Changeset 59b925c1 in sasview for src/sas/qtgui
- Timestamp:
- Dec 17, 2018 9:05:09 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
- Children:
- 04a884a, 44a698c
- Parents:
- b96d2e1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Utilities/TabbedModelEditor.py
rb96d2e1 r59b925c1 3 3 import os 4 4 import datetime 5 import numpy as np6 5 import logging 7 6 import traceback … … 87 86 self.plugin_widget.setEnabled(is_active) 88 87 88 def saveClose(self): 89 """ 90 Check if file needs saving before closing or model reloading 91 """ 92 saveCancelled = False 93 ret = self.onModifiedExit() 94 if ret == QtWidgets.QMessageBox.Cancel: 95 saveCancelled = True 96 elif ret == QtWidgets.QMessageBox.Save: 97 self.updateFromEditor() 98 return saveCancelled 99 89 100 def closeEvent(self, event): 90 101 """ … … 92 103 """ 93 104 if self.is_modified: 94 ret = self.onModifiedExit()95 if ret == QtWidgets.QMessageBox.Cancel:105 saveCancelled = self.saveClose() 106 if saveCancelled: 96 107 return 97 elif ret == QtWidgets.QMessageBox.Save:98 self.updateFromEditor()99 108 event.accept() 100 109 … … 103 112 Loads a model plugin file 104 113 """ 114 if self.is_modified: 115 saveCancelled = self.saveClose() 116 if saveCancelled: 117 return 118 self.is_modified = False 119 self.buttonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(False) 120 105 121 plugin_location = models.find_plugins_dir() 106 122 filename = QtWidgets.QFileDialog.getOpenFileName( … … 164 180 """ 165 181 if self.is_modified: 166 ret = self.onModifiedExit()167 if ret == QtWidgets.QMessageBox.Cancel:182 saveCancelled = self.saveClose() 183 if saveCancelled: 168 184 return 169 elif ret == QtWidgets.QMessageBox.Save:170 self.updateFromEditor()171 185 self.reject() 172 186
Note: See TracChangeset
for help on using the changeset viewer.