예제 #1
0
    def on_actionClose_triggered(self):
        edit = self.edit_tab.currentWidget()
        if edit:
	    if(edit.isModified()):
		saveBox = SaveDialog("Do you want to save this Script?")
		prompt = saveBox.exec_()
		if(prompt == QMessageBox.Save):
		    self.save(True)
		elif(prompt == QMessageBox.Cancel):
		    return
		elif(prompt == QMessageBox.Discard):
		    pass
            i = self.edit_tab.indexOf(edit)
            self.edit_tab.removeTab(i)
            self.editors.remove(edit)
예제 #2
0
    def on_actionExit_triggered(self):
	while(self.editors.__len__()):
	    edit = self.edit_tab.currentWidget()
            if edit:
	        if(edit.isModified()):
		    saveBox = SaveDialog("You have unsaved script. Save it now?")
		    prompt = saveBox.exec_()
		    if(prompt == QMessageBox.Save):
		        self.save(True)
		    elif(prompt == QMessageBox.Cancel):
		        return
		    elif(prompt == QMessageBox.Discard):
		        pass
		i = self.edit_tab.indexOf(edit)
                self.edit_tab.removeTab(i)
                self.editors.remove(edit)
	self.close()
예제 #3
0
    def closeEvent(self, event):
	while(self.editors.__len__()):
	    edit = self.edit_tab.currentWidget()
            if edit:
	        if(edit.isModified()):
		    saveBox = SaveDialog("You have unsaved script. Save it now?")
		    prompt = saveBox.exec_()
		    if(prompt == QMessageBox.Save):
			event.ignore()
		        self.save(True)
		    elif(prompt == QMessageBox.Cancel):
		        event.ignore()
			return
		    elif(prompt == QMessageBox.Discard):
		        event.accept()
                i = self.edit_tab.indexOf(edit)
                self.edit_tab.removeTab(i)
                self.editors.remove(edit)
	event.accept()