Exemplo n.º 1
0
 def closeEvent(self, event : QtGui.QCloseEvent): # override
     if self.closed: return 
     
     self.__Log("closeEvent: started")
     
     # close DRI session
     if self.dri: 
         self.dri.Close()
         self.dri = None
     
     msg = None
     if self.ipsiusUnexpClosed:
         msg = "ProjIpsius was unexpectedly closed from outside or crashed."
         self.__LogAndPrint(msg)
         
     # ask save config changes
     if (self.devListWrapper and not self.devListWrapper.TryClose(msg)):
         self.ipsiusUnexpClosed = False
         self.__Log("closeEvent: aborted - need save changes")
         event.ignore()
         return
     
     self.closed = True
     
     self.__SaveConfigOnClose()
     self.__Log("closeEvent: completed.")
     self.__LogAndPrint("ProjIpsius closed.")
     event.accept()   
Exemplo n.º 2
0
def test_close_event(mocker, dialog_builder, close):
    dialog = dialog_builder.build(5)
    warning = mocker.patch("PyQt4.QtGui.QMessageBox.warning")
    warning.return_value = QMessageBox.Yes if close else QMessageBox.No
    evt = QCloseEvent()

    dialog.closeEvent(evt)
    assert evt.isAccepted() is close
Exemplo n.º 3
0
 def closeEvent(self, event: QtGui.QCloseEvent):
     if not self.pageIds()[-1] > self.currentId() > 0:
         if self.parent_window is not None:
             self.parent_window.show()
         event.accept()
     elif (QtGui.QMessageBox.question(
             self, "هل انت متأكد؟",
             "انت علي وشك ان تغلق النافذة، كل الإجابات سوف تنسي.",
             QtGui.QMessageBox.Yes
             | QtGui.QMessageBox.No)) == QtGui.QMessageBox.Yes:
         if self.parent_window is not None:
             self.parent_window.show()
         event.accept()
     else:
         event.ignore()
Exemplo n.º 4
0
 def close_busy_dlg(*args):
     QApplication.postEvent(busy_dlg, QCloseEvent())
Exemplo n.º 5
0
	def onClose(self):
		abstractGuiModuleClass.onClose(self)
		
		event = QCloseEvent()
		event.accept()
		abstractGuiModuleClass.closeEvent(self, event)