CHange the order of preference for the view document action
This commit is contained in:
+20
-10
@@ -518,20 +518,30 @@ class GuiMain(QMainWindow):
|
|||||||
"""Load a document for viewing in the view panel.
|
"""Load a document for viewing in the view panel.
|
||||||
"""
|
"""
|
||||||
if tHandle is None:
|
if tHandle is None:
|
||||||
tHandle = self.treeView.getSelectedHandle()
|
logger.debug("Viewing document, but no handle provided")
|
||||||
if tHandle is None:
|
|
||||||
logger.debug("No document selected, trying editor document")
|
if self.docEditor.hasFocus():
|
||||||
tHandle = self.docEditor.theHandle
|
logger.verbose("Trying editor document")
|
||||||
if tHandle is None:
|
tHandle = self.docEditor.theHandle
|
||||||
logger.debug("No document selected, trying last viewed")
|
|
||||||
tHandle = self.theProject.lastViewed
|
if tHandle is not None:
|
||||||
if tHandle is None:
|
self.saveDocument()
|
||||||
logger.debug("No document selected, giving up")
|
else:
|
||||||
return False
|
logger.verbose("Trying selected document")
|
||||||
|
tHandle = self.treeView.getSelectedHandle()
|
||||||
|
|
||||||
|
if tHandle is None:
|
||||||
|
logger.verbose("Trying last viewed document")
|
||||||
|
tHandle = self.theProject.lastViewed
|
||||||
|
|
||||||
|
if tHandle is None:
|
||||||
|
logger.verbose("No document to view, giving up")
|
||||||
|
return False
|
||||||
|
|
||||||
# Make sure main tab is in Editor view
|
# Make sure main tab is in Editor view
|
||||||
self.tabWidget.setCurrentWidget(self.splitDocs)
|
self.tabWidget.setCurrentWidget(self.splitDocs)
|
||||||
|
|
||||||
|
logger.debug("Viewing document with handle %s" % tHandle)
|
||||||
if self.docViewer.loadText(tHandle):
|
if self.docViewer.loadText(tHandle):
|
||||||
if not self.splitView.isVisible():
|
if not self.splitView.isVisible():
|
||||||
bPos = self.splitMain.sizes()
|
bPos = self.splitMain.sizes()
|
||||||
|
|||||||
Reference in New Issue
Block a user