Improve itemEditor test, and refactor actions
This commit is contained in:
+1
-1
@@ -133,7 +133,7 @@ class GuiDocMerge(QDialog):
|
||||
|
||||
theDoc.openDocument(nHandle, False)
|
||||
theDoc.saveDocument(theText)
|
||||
self.theParent.treeView.revealTreeItem(nHandle)
|
||||
self.theParent.treeView.revealNewTreeItem(nHandle)
|
||||
self.theParent.openDocument(nHandle, doScroll=True)
|
||||
|
||||
self._doClose()
|
||||
|
||||
+2
-2
@@ -178,7 +178,7 @@ class GuiDocSplit(QDialog):
|
||||
fHandle = self.theProject.newFolder(
|
||||
srcItem.itemName, srcItem.itemClass, srcItem.parHandle
|
||||
)
|
||||
self.theParent.treeView.revealTreeItem(fHandle)
|
||||
self.theParent.treeView.revealNewTreeItem(fHandle)
|
||||
logger.verbose("Creating folder %s" % fHandle)
|
||||
|
||||
# Loop through, and create the files
|
||||
@@ -213,7 +213,7 @@ class GuiDocSplit(QDialog):
|
||||
theDoc.openDocument(nHandle, False)
|
||||
theDoc.saveDocument(theText)
|
||||
theDoc.clearDocument()
|
||||
self.theParent.treeView.revealTreeItem(nHandle)
|
||||
self.theParent.treeView.revealNewTreeItem(nHandle)
|
||||
|
||||
self._doClose()
|
||||
|
||||
|
||||
+2
-2
@@ -240,12 +240,12 @@ class GuiProjectTree(QTreeWidget):
|
||||
|
||||
# Add the new item to the tree
|
||||
if tHandle is not None:
|
||||
self.revealTreeItem(tHandle, nHandle)
|
||||
self.revealNewTreeItem(tHandle, nHandle)
|
||||
self.theParent.editItem(tHandle)
|
||||
|
||||
return True
|
||||
|
||||
def revealTreeItem(self, tHandle, nHandle=None):
|
||||
def revealNewTreeItem(self, tHandle, nHandle=None):
|
||||
"""Reveal a newly added project item in the project tree.
|
||||
"""
|
||||
nwItem = self.theProject.projTree[tHandle]
|
||||
|
||||
+7
-8
@@ -659,14 +659,13 @@ class GuiMain(QMainWindow):
|
||||
return
|
||||
|
||||
logger.verbose("Requesting change to item %s" % tHandle)
|
||||
if self.mainConf.showGUI:
|
||||
dlgProj = GuiItemEditor(self, self.theProject, tHandle)
|
||||
dlgProj.exec_()
|
||||
if dlgProj.result() == QDialog.Accepted:
|
||||
self.treeView.setTreeItemValues(tHandle)
|
||||
self.treeMeta.updateViewBox(tHandle)
|
||||
self.docEditor.updateDocInfo(tHandle)
|
||||
self.docViewer.updateDocInfo(tHandle)
|
||||
dlgProj = GuiItemEditor(self, self.theProject, tHandle)
|
||||
dlgProj.exec_()
|
||||
if dlgProj.result() == QDialog.Accepted:
|
||||
self.treeView.setTreeItemValues(tHandle)
|
||||
self.treeMeta.updateViewBox(tHandle)
|
||||
self.docEditor.updateDocInfo(tHandle)
|
||||
self.docViewer.updateDocInfo(tHandle)
|
||||
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user