|
|
@ -50,10 +50,13 @@ class Submenu(QtWidgets.QDialog): |
|
|
|
|
|
|
|
#self.setFocus(); #self.grabKeyboard(); #redundant for a proper modal dialog. Leave here for documentation reasons. |
|
|
|
|
|
|
|
if hasOkCancelButtons: |
|
|
|
if hasOkCancelButtons == 1: #or true |
|
|
|
self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel) |
|
|
|
self.buttonBox.accepted.connect(self.process) |
|
|
|
self.buttonBox.rejected.connect(self.reject) |
|
|
|
elif hasOkCancelButtons == 2: #only cancel. #TODO: unpythonic. |
|
|
|
self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel) |
|
|
|
self.buttonBox.rejected.connect(self.reject) |
|
|
|
else: |
|
|
|
self.buttonBox = None |
|
|
|
|
|
|
|