Merge branch 'master' into word_counts

This commit is contained in:
Veronica K. Berglyd Olsen
2020-06-22 19:26:55 +02:00
committed by GitHub
4 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ class GuiDocMerge(QDialog):
self.theParent.treeView.revealTreeItem(nHandle)
theDoc.openDocument(nHandle, False)
theDoc.saveDocument(theText)
self.theParent.openDocument(nHandle)
self.theParent.openDocument(nHandle, doScroll=True)
self.close()
+1 -1
View File
@@ -196,7 +196,7 @@ class GuiOutline(QTreeWidget):
except:
tLine = 1
logger.verbose("User selected entry with handle %s on line %s" % (tHandle, tLine))
self.theParent.openDocument(tHandle, tLine - 1)
self.theParent.openDocument(tHandle, tLine=tLine-1, doScroll=True)
return
def _itemSelected(self):
+1 -1
View File
@@ -933,7 +933,7 @@ class GuiProjectTreeMenu(QMenu):
"""Forward the open document call to the main GUI window.
"""
if self.theItem is not None:
self.theTree.theParent.openDocument(self.theItem.itemHandle)
self.theTree.theParent.openDocument(self.theItem.itemHandle, doScroll=False)
return
def _doViewItem(self):
+8 -8
View File
@@ -417,7 +417,7 @@ class GuiMain(QMainWindow):
# Restore previously open documents, if any
if self.theProject.lastEdited is not None:
self.openDocument(self.theProject.lastEdited)
self.openDocument(self.theProject.lastEdited, doScroll=True)
if self.theProject.lastViewed is not None:
self.viewDocument(self.theProject.lastViewed)
@@ -461,7 +461,7 @@ class GuiMain(QMainWindow):
self.docEditor.clearEditor()
return True
def openDocument(self, tHandle, tLine=None, changeFocus=True):
def openDocument(self, tHandle, tLine=None, changeFocus=True, doScroll=False):
"""Open a specific document, optionally at a given line.
"""
if self.hasProject:
@@ -471,7 +471,7 @@ class GuiMain(QMainWindow):
if changeFocus:
self.docEditor.setFocus()
self.theProject.setLastEdited(tHandle)
self.treeView.setSelectedHandle(tHandle)
self.treeView.setSelectedHandle(tHandle, doScroll=doScroll)
else:
return False
return True
@@ -499,10 +499,10 @@ class GuiMain(QMainWindow):
break
if nHandle is not None:
self.openDocument(nHandle, tLine=0)
self.openDocument(nHandle, tLine=0, doScroll=True)
return True
elif wrapAround:
self.openDocument(fHandle, tLine=0)
self.openDocument(fHandle, tLine=0, doScroll=True)
return False
return False
@@ -656,7 +656,7 @@ class GuiMain(QMainWindow):
nwItem = self.theProject.projTree[tHandle]
if nwItem.itemType == nwItemType.FILE:
logger.verbose("Requested item %s is a file" % tHandle)
self.openDocument(tHandle)
self.openDocument(tHandle, doScroll=False)
else:
logger.verbose("Requested item %s is not a file" % tHandle)
@@ -1101,7 +1101,7 @@ class GuiMain(QMainWindow):
if nwItem is not None:
if nwItem.itemType == nwItemType.FILE:
logger.verbose("Requested item %s is a file" % tHandle)
self.openDocument(tHandle, changeFocus=False)
self.openDocument(tHandle, changeFocus=False, doScroll=False)
else:
logger.verbose("Requested item %s is a folder" % tHandle)
return
@@ -1117,7 +1117,7 @@ class GuiMain(QMainWindow):
if nwItem is not None:
if nwItem.itemType == nwItemType.FILE:
logger.verbose("Requested item %s is a file" % tHandle)
self.openDocument(tHandle, changeFocus=False)
self.openDocument(tHandle, changeFocus=False, doScroll=False)
else:
logger.verbose("Requested item %s is a folder" % tHandle)
return