1474 Private method to ask the user to save the file, if it was modified. |
1474 Private method to ask the user to save the file, if it was modified. |
1475 |
1475 |
1476 @return flag indicating, if it is ok to continue (boolean) |
1476 @return flag indicating, if it is ok to continue (boolean) |
1477 """ |
1477 """ |
1478 if self.__textEdit.isModified(): |
1478 if self.__textEdit.isModified(): |
1479 ret = E5MessageBox.warning(self, |
1479 ret = E5MessageBox.okToClearData(self, |
1480 self.trUtf8("eric5 Mini Editor"), |
1480 self.trUtf8("eric5 Mini Editor"), |
1481 self.trUtf8("The document has been unsaved changes."), |
1481 self.trUtf8("The document has been unsaved changes."), |
1482 QMessageBox.StandardButtons(\ |
1482 self.__save) |
1483 QMessageBox.Abort | \ |
1483 return ret |
1484 QMessageBox.Discard | \ |
|
1485 QMessageBox.Save), |
|
1486 QMessageBox.Save) |
|
1487 if ret == QMessageBox.Save: |
|
1488 return self.__save() |
|
1489 elif ret == QMessageBox.Abort: |
|
1490 return False |
|
1491 return True |
1484 return True |
1492 |
1485 |
1493 def __loadFile(self, fileName, filetype = None): |
1486 def __loadFile(self, fileName, filetype = None): |
1494 """ |
1487 """ |
1495 Private method to load the given file. |
1488 Private method to load the given file. |