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.setStatusTip("Close Current Document")
|
||||
menuItem.setShortcut("Ctrl+W")
|
||||
menuItem.triggered.connect(self.theParent.closeDocument)
|
||||
menuItem.triggered.connect(self.theParent.closeDocEditor)
|
||||
self.docuMenu.addAction(menuItem)
|
||||
|
||||
# Document > Separator
|
||||
|
||||
+10
-3
@@ -258,8 +258,11 @@ class GuiMain(QMainWindow):
|
||||
if not self.closeProject():
|
||||
return False
|
||||
|
||||
# Do the stuff
|
||||
self.theProject.openProject(projFile)
|
||||
# Try to open the project
|
||||
if not self.theProject.openProject(projFile):
|
||||
return False
|
||||
|
||||
# Update GUI
|
||||
self._setWindowTitle(self.theProject.projName)
|
||||
self.rebuildTree()
|
||||
self.docEditor.setPwl(path.join(self.theProject.projMeta, nwFiles.PROJ_DICT))
|
||||
@@ -301,7 +304,6 @@ class GuiMain(QMainWindow):
|
||||
self.saveDocument()
|
||||
self.theDocument.clearDocument()
|
||||
self.docEditor.clearEditor()
|
||||
self.theProject.setLastEdited(None)
|
||||
return True
|
||||
|
||||
def openDocument(self, tHandle):
|
||||
@@ -478,6 +480,11 @@ class GuiMain(QMainWindow):
|
||||
self.docViewer.setFocus()
|
||||
return
|
||||
|
||||
def closeDocEditor(self):
|
||||
self.closeDocument()
|
||||
self.theProject.setLastEdited(None)
|
||||
return
|
||||
|
||||
def closeDocViewer(self):
|
||||
self.docViewer.clearViewer()
|
||||
self.theProject.setLastViewed(None)
|
||||
|
||||
Reference in New Issue
Block a user