Changeset 3357
- Timestamp:
- 05/14/08 22:58:29 (2 months ago)
- Location:
- trunk/opus_gui
- Files:
-
- 2 modified
-
config/xmlmodelview/opusdatamodel.py (modified) (1 diff)
-
main/opusgui.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/opus_gui/config/xmlmodelview/opusdatamodel.py
r3351 r3357 273 273 self.parentObj.setWindowTitle(wintitle) 274 274 self.dirty = True 275 276 def markAsClean(self): 277 if self.dirty == True: 278 wintitle = self.parentObj.windowTitle().replace("*", "") 279 self.parentObj.setWindowTitle(wintitle) 280 self.dirty = False 275 281 276 282 def isDirty(self): 283 return self.dirty 284 277 285 def setData(self,index,value,role): 278 286 if not index.isValid(): -
trunk/opus_gui/main/opusgui.py
r3351 r3357 216 216 opusXMLTree.update(str(domDocument.toString(indentSize))) 217 217 opusXMLTree.save() 218 self.toolboxStuff.runManagerTree.model.dirty = False 219 self.setWindowTitle(self.windowTitle().replace("*", "")) 220 self.toolboxStuff.dataManagerTree.model.dirty = False 221 self.setWindowTitle(self.windowTitle().replace("*", "")) 222 self.toolboxStuff.dataManagerDBSTree.model.dirty = False 223 self.setWindowTitle(self.windowTitle().replace("*", "")) 224 self.toolboxStuff.modelManagerTree.model.dirty = False 225 self.setWindowTitle(self.windowTitle().replace("*", "")) 226 self.toolboxStuff.resultsManagerTree.model.dirty = False 227 self.setWindowTitle(self.windowTitle().replace("*", "")) 218 self.toolboxStuff.runManagerTree.model.markAsClean() 219 self.toolboxStuff.dataManagerTree.model.markAsClean() 220 self.toolboxStuff.dataManagerDBSTree.model.markAsClean() 221 self.toolboxStuff.modelManagerTree.model.markAsClean() 222 self.toolboxStuff.resultsManagerTree.model.markAsClean() 228 223 except: 229 224 print "Unexpected error:", sys.exc_info()[0] … … 248 243 opusXMLTree.update(str(domDocument.toString(indentSize))) 249 244 opusXMLTree.save_as(str(fileName)) 250 self.toolboxStuff.runManagerTree.model.dirty = False 251 self.setWindowTitle(self.windowTitle().replace("*", "")) 252 self.toolboxStuff.dataManagerTree.model.dirty = False 253 self.setWindowTitle(self.windowTitle().replace("*", "")) 254 self.toolboxStuff.dataManagerDBSTree.model.dirty = False 255 self.setWindowTitle(self.windowTitle().replace("*", "")) 256 self.toolboxStuff.modelManagerTree.model.dirty = False 257 self.setWindowTitle(self.windowTitle().replace("*", "")) 258 self.toolboxStuff.resultsManagerTree.model.dirty = False 259 self.setWindowTitle(self.windowTitle().replace("*", "")) 245 self.toolboxStuff.runManagerTree.model.markAsClean() 246 self.toolboxStuff.dataManagerTree.model.markAsClean() 247 self.toolboxStuff.dataManagerDBSTree.model.markAsClean() 248 self.toolboxStuff.modelManagerTree.model.markAsClean() 249 self.toolboxStuff.resultsManagerTree.model.markAsClean() 260 250 except: 261 251 print "Unexpected error:", sys.exc_info()[0] … … 267 257 """ 268 258 saveBeforeOpen = QMessageBox.Discard 269 if self.toolboxStuff.resultsManagerTree and self.toolboxStuff.resultsManagerTree.model. dirty:259 if self.toolboxStuff.resultsManagerTree and self.toolboxStuff.resultsManagerTree.model.isDirty(): 270 260 saveBeforeOpen = QMessageBox.question(self,"Warning", 271 261 "Current project contains changes... \nShould we save or discard those changes?", 272 262 QMessageBox.Discard,QMessageBox.Save) 273 elif self.toolboxStuff.modelManagerTree and self.toolboxStuff.modelManagerTree.model. dirty:263 elif self.toolboxStuff.modelManagerTree and self.toolboxStuff.modelManagerTree.model.isDirty(): 274 264 saveBeforeOpen = QMessageBox.question(self,"Warning", 275 265 "Current project contains changes... \nShould we save or discard those changes?", 276 266 QMessageBox.Discard,QMessageBox.Save) 277 elif self.toolboxStuff.runManagerTree and self.toolboxStuff.runManagerTree.model. dirty:267 elif self.toolboxStuff.runManagerTree and self.toolboxStuff.runManagerTree.model.isDirty(): 278 268 saveBeforeOpen = QMessageBox.question(self,"Warning", 279 269 "Current project contains changes... \nShould we save or discard those changes?", 280 270 QMessageBox.Discard,QMessageBox.Save) 281 elif self.toolboxStuff.dataManagerTree and self.toolboxStuff.dataManagerTree.model. dirty:271 elif self.toolboxStuff.dataManagerTree and self.toolboxStuff.dataManagerTree.model.isDirty(): 282 272 saveBeforeOpen = QMessageBox.question(self,"Warning", 283 273 "Current project contains changes... \nShould we save or discard those changes?", … … 289 279 #if we have an existing tree we need to remove the dirty bit since we are discarding 290 280 if self.toolboxStuff.runManagerTree: 291 self.toolboxStuff.runManagerTree.model. dirty = False281 self.toolboxStuff.runManagerTree.model.markAsClean() 292 282 if self.toolboxStuff.dataManagerTree: 293 self.toolboxStuff.dataManagerTree.model. dirty = False283 self.toolboxStuff.dataManagerTree.model.markAsClean() 294 284 if self.toolboxStuff.modelManagerTree: 295 self.toolboxStuff.modelManagerTree.model. dirty = False285 self.toolboxStuff.modelManagerTree.model.markAsClean() 296 286 if self.toolboxStuff.resultsManagerTree: 297 self.toolboxStuff.resultsManagerTree.model. dirty = False287 self.toolboxStuff.resultsManagerTree.model.markAsClean() 298 288 299 289 def closeConfig(self):
