def update(self, old_name, new_name, new_settings): if old_name and old_name != new_name: settings.remove('project/' + old_name) with settings.open_group('project/' + new_name): for k, v in new_settings.items(): settings.set_value(k, v) if not old_name: self.load_data() self.set_active(new_name) elif old_name != new_name: self.load_data() if old_name == self.active: self.set_active(new_name) elif old_name == self.active: self.active_project_changed.emit()
def closeEvent(self, event): settings.set_value('window/geometry', self.saveGeometry()) settings.set_value('window/state', self.saveState()) super(PugdebugMainWindow, self).closeEvent(event)
def save_state(self): """Save current expressions to settings""" settings.set_value('expressions_viewer/expressions', self.get_expressions())
def set_active(self, project_name): if project_name != self.active and self.exists(project_name): self.active = project_name settings.set_value('active_project', project_name) self.emit_data_changed() self.active_project_changed.emit()