def on_actionRemoveData_triggered(self): items = self.selected_items() if not items: return if QMessageBox.question( self, 'ufit', 'OK to remove %d item(s)?' % len(items), QMessageBox.Yes | QMessageBox.No) == QMessageBox.No: return session.remove_items(items) self.re_expand_tree()
def check_save(self): if not self.isWindowModified(): # nothing there to be saved return True resp = QMessageBox.question( self, 'ufit', 'Save current session?\n%s' % session.filename, QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel) if resp == QMessageBox.Yes: return self.save_session() elif resp == QMessageBox.No: return True return False