def open_settings_dialog(self): # open a dialog with settings dialog = SettingsDialog(self, self.profilecon) dialog.exec() # update settings self.configure_plot()
def settingsDialog(self): dlg = SettingsDialog(self.theme, self.palette().highlight().color().name(), parent=self) dlg.exec() if dlg.theme != self.theme or dlg.hilite_color != self.palette().highlight().color().name(): settings = QSettings(QSettings.IniFormat, QSettings.UserScope, QCoreApplication.organizationName(), QCoreApplication.applicationName()) settings.setValue("theme", dlg.theme) settings.setValue("hiliteColor", dlg.hilite_color) msgBox = QMessageBox() msgBox.setText("Please restart the app to change the theme!") msgBox.exec()
def titleContextMenu(self, pos): menu = QMenu() menu.setStyleSheet('background: '+self.sets.get('window.menubgcolor','#222')+'; color: '+self.sets.get('window.menucolor','#fff')+'; padding: 6px;') settingsAction = menu.addAction("Настройка") settingsAction.setIcon(QIcon(':/set.png')) menu.addSeparator() addgroupAction = menu.addAction('Добавить группу') addgroupAction.setIcon(QIcon(':/addgroup.png')) menu.addSeparator() quitAction = menu.addAction("Quit") quitAction.setIcon(QIcon(':/quit.png')) action = menu.exec_(self.sender().mapToGlobal(pos)) if action == quitAction: self.onCloseSignal.emit(self) self.close() elif action == settingsAction: dialog = SettingsDialog(self.sets, self) dialog.loadfromsets() if dialog.exec() == 1: dialog.savetosets() self.sets.save() self.applysets() elif action == addgroupAction: shladd, title, withtext = groupedit.groupAdd(self.sets.get('panel.withtext',False)) if shladd: self.glist.addList(title, (0,0),withtext)