622 Public method to check the dirty status and open a message window. |
622 Public method to check the dirty status and open a message window. |
623 |
623 |
624 @return flag indicating whether this operation was successful (boolean) |
624 @return flag indicating whether this operation was successful (boolean) |
625 """ |
625 """ |
626 if self.isDirty(): |
626 if self.isDirty(): |
627 res = E5MessageBox.warning(self.parent(), |
627 res = E5MessageBox.okToClearData(self.parent(), |
628 self.trUtf8("Close Multiproject"), |
628 self.trUtf8("Close Multiproject"), |
629 self.trUtf8("The current multiproject has unsaved changes."), |
629 self.trUtf8("The current multiproject has unsaved changes."), |
630 QMessageBox.StandardButtons(\ |
630 self.saveMultiProject) |
631 QMessageBox.Abort | \ |
631 if res: |
632 QMessageBox.Discard | \ |
|
633 QMessageBox.Save), |
|
634 QMessageBox.Save) |
|
635 if res == QMessageBox.Save: |
|
636 return self.saveMultiProject() |
|
637 elif res == QMessageBox.Discard: |
|
638 self.setDirty(False) |
632 self.setDirty(False) |
639 return True |
633 return res |
640 elif res == QMessageBox.Abort: |
|
641 return False |
|
642 |
634 |
643 return True |
635 return True |
644 |
636 |
645 def closeMultiProject(self): |
637 def closeMultiProject(self): |
646 """ |
638 """ |