diff options
-rw-r--r-- | src/main/python/utils/dialogs.py | 14 | ||||
-rw-r--r-- | src/main/python/utils/fileWindow.py | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/main/python/utils/dialogs.py b/src/main/python/utils/dialogs.py index 83a5f90..d5522cc 100644 --- a/src/main/python/utils/dialogs.py +++ b/src/main/python/utils/dialogs.py @@ -57,7 +57,19 @@ class paperDims(QDialog): def exec_(self): #overload exec_ to add return values and delete itself(currently being tested) super(paperDims, self).exec_() - return self._canvasSize, self._ppi if self.result==1 else None + self.deleteLater() + return (self._canvasSize, self._ppi) if self.result() else None + + def accept(self): + self.setResult(1) + self.accepted.emit() + return super(paperDims, self).accept() + + def reject(self): + self.setResult(0) + self.rejected.emit() + return super(paperDims, self).reject() + def saveEvent(parent = None): #utility function to generate a Qt alert window requesting the user to save the file, returns user intention on window close diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py index bab9004..d5ad19f 100644 --- a/src/main/python/utils/fileWindow.py +++ b/src/main/python/utils/fileWindow.py @@ -76,7 +76,7 @@ class fileWindow(QMdiSubWindow): #helper function to the context menu dialog box currentTab = self.tabber.currentWidget() result = dialogs.paperDims(self, currentTab._canvasSize, currentTab._ppi, currentTab.objectName()).exec_() - if result: + if result is not None: currentTab.canvasSize, currentTab.ppi = result return self.resizeHandler() else: |