Added closing of document feature
This commit is contained in:
+1
-1
@@ -257,7 +257,7 @@ class GuiMainMenu(QMenuBar):
|
|||||||
menuItem = QAction(QIcon.fromTheme("document-revert"), "Close Document", self)
|
menuItem = QAction(QIcon.fromTheme("document-revert"), "Close Document", self)
|
||||||
menuItem.setStatusTip("Close Current Document")
|
menuItem.setStatusTip("Close Current Document")
|
||||||
menuItem.setShortcut("Ctrl+W")
|
menuItem.setShortcut("Ctrl+W")
|
||||||
menuItem.triggered.connect(self.theParent.closeDocument)
|
menuItem.triggered.connect(self.theParent.closeDocEditor)
|
||||||
self.docuMenu.addAction(menuItem)
|
self.docuMenu.addAction(menuItem)
|
||||||
|
|
||||||
# Document > Separator
|
# Document > Separator
|
||||||
|
|||||||
+10
-3
@@ -258,8 +258,11 @@ class GuiMain(QMainWindow):
|
|||||||
if not self.closeProject():
|
if not self.closeProject():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Do the stuff
|
# Try to open the project
|
||||||
self.theProject.openProject(projFile)
|
if not self.theProject.openProject(projFile):
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Update GUI
|
||||||
self._setWindowTitle(self.theProject.projName)
|
self._setWindowTitle(self.theProject.projName)
|
||||||
self.rebuildTree()
|
self.rebuildTree()
|
||||||
self.docEditor.setPwl(path.join(self.theProject.projMeta, nwFiles.PROJ_DICT))
|
self.docEditor.setPwl(path.join(self.theProject.projMeta, nwFiles.PROJ_DICT))
|
||||||
@@ -301,7 +304,6 @@ class GuiMain(QMainWindow):
|
|||||||
self.saveDocument()
|
self.saveDocument()
|
||||||
self.theDocument.clearDocument()
|
self.theDocument.clearDocument()
|
||||||
self.docEditor.clearEditor()
|
self.docEditor.clearEditor()
|
||||||
self.theProject.setLastEdited(None)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def openDocument(self, tHandle):
|
def openDocument(self, tHandle):
|
||||||
@@ -478,6 +480,11 @@ class GuiMain(QMainWindow):
|
|||||||
self.docViewer.setFocus()
|
self.docViewer.setFocus()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def closeDocEditor(self):
|
||||||
|
self.closeDocument()
|
||||||
|
self.theProject.setLastEdited(None)
|
||||||
|
return
|
||||||
|
|
||||||
def closeDocViewer(self):
|
def closeDocViewer(self):
|
||||||
self.docViewer.clearViewer()
|
self.docViewer.clearViewer()
|
||||||
self.theProject.setLastViewed(None)
|
self.theProject.setLastViewed(None)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Some text here would look good as well, and maybe some "dialogue"?
|
|||||||
|
|
||||||
So, this is some __text__ that we’ve been adding to this document. It is utterly meaningless text, _but_ since this is just dummy text, that doesn’t really matter. The text is perfectly happy to live in this document regardless.
|
So, this is some __text__ that we’ve been adding to this document. It is utterly meaningless text, _but_ since this is just dummy text, that doesn’t really matter. The text is perfectly happy to live in this document regardless.
|
||||||
|
|
||||||
This paragraph is also meaningless. At least a bit. It’s also very short. But we could make it less meaningless if we wanted to … but we won’t.
|
This paragraph is also meaningless. At least a bit. It’s also very short. But we could make it less meaningless if we wanted to … but we won’t, will we.
|
||||||
|
|
||||||
This one is a bit longer. “It also has some dialogue in it” she said, before she moved on to check if the spellchecker worked. It did. “Cool,” she concluded.
|
This one is a bit longer. “It also has some dialogue in it” she said, before she moved on to check if the spellchecker worked. It did. “Cool,” she concluded.
|
||||||
|
|
||||||
|
|||||||
@@ -8,3 +8,8 @@ Start: 2019-05-26 14:50:18 End: 2019-05-26 14:50:21 Words: 0
|
|||||||
Start: 2019-05-26 14:50:29 End: 2019-05-26 14:50:47 Words: 3
|
Start: 2019-05-26 14:50:29 End: 2019-05-26 14:50:47 Words: 3
|
||||||
Start: 2019-05-26 15:10:52 End: 2019-05-26 15:11:09 Words: 0
|
Start: 2019-05-26 15:10:52 End: 2019-05-26 15:11:09 Words: 0
|
||||||
Start: 2019-05-26 15:28:56 End: 2019-05-26 15:29:08 Words: 0
|
Start: 2019-05-26 15:28:56 End: 2019-05-26 15:29:08 Words: 0
|
||||||
|
Start: 2019-05-26 15:37:34 End: 2019-05-26 15:37:43 Words: -538
|
||||||
|
Start: 2019-05-26 15:37:47 End: 2019-05-26 15:38:07 Words: 538
|
||||||
|
Start: 2019-05-26 15:38:11 End: 2019-05-26 15:43:07 Words: 2
|
||||||
|
Start: 2019-05-26 15:49:18 End: 2019-05-26 15:49:47 Words: 0
|
||||||
|
Start: 2019-05-26 15:52:39 End: 2019-05-26 15:52:56 Words: 0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<novelWriterXML appVersion="0.1.4" fileVersion="1.0" timeStamp="2019-05-26 15:29:08">
|
<novelWriterXML appVersion="0.1.4" fileVersion="1.0" timeStamp="2019-05-26 15:52:53">
|
||||||
<project>
|
<project>
|
||||||
<name>Sample Project</name>
|
<name>Sample Project</name>
|
||||||
<title>Sample Project</title>
|
<title>Sample Project</title>
|
||||||
@@ -8,9 +8,9 @@
|
|||||||
</project>
|
</project>
|
||||||
<settings>
|
<settings>
|
||||||
<spellCheck>True</spellCheck>
|
<spellCheck>True</spellCheck>
|
||||||
<lastEdited>None</lastEdited>
|
<lastEdited>636b6aa9b697b</lastEdited>
|
||||||
<lastViewed>None</lastViewed>
|
<lastViewed>None</lastViewed>
|
||||||
<lastWordCount>538</lastWordCount>
|
<lastWordCount>540</lastWordCount>
|
||||||
<status>
|
<status>
|
||||||
<entry blue="100" green="100" red="100">New</entry>
|
<entry blue="100" green="100" red="100">New</entry>
|
||||||
<entry blue="0" green="50" red="200">Notes</entry>
|
<entry blue="0" green="50" red="200">Notes</entry>
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
<status>Notes</status>
|
<status>Notes</status>
|
||||||
<expanded>False</expanded>
|
<expanded>False</expanded>
|
||||||
<layout>SCENE</layout>
|
<layout>SCENE</layout>
|
||||||
<charCount>647</charCount>
|
<charCount>656</charCount>
|
||||||
<wordCount>119</wordCount>
|
<wordCount>121</wordCount>
|
||||||
<paraCount>5</paraCount>
|
<paraCount>5</paraCount>
|
||||||
<cursorPos>565</cursorPos>
|
<cursorPos>573</cursorPos>
|
||||||
</item>
|
</item>
|
||||||
<item handle="bc0cbd2a407f3" order="2" parent="e7ded148d6e4a">
|
<item handle="bc0cbd2a407f3" order="2" parent="e7ded148d6e4a">
|
||||||
<name>New File</name>
|
<name>New File</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user