def load_settings(self): self.settings = QSettings() db_path = self.settings.value('db_base_path') db_name = self.settings.value('db_name') if db_path is not None and db_name is not None: db_file = os.path.join(db_path, db_name) Lumberjack.debug('__init__ - db_file = {}'.format(db_file)) if os.path.exists(db_file): return Lumberjack.warning('(load_settings) - database not found') settings_dialog = SettingsDialog() settings_dialog.exec_() int_value = self.settings.value('db_type', type=int) print(Fore.MAGENTA + "load choosen database setting: %s" % repr(int_value))
def change_settings(self): dlg = SettingsDialog(self.gui) result = dlg.exec_() if result: self.gui.add_status_message("Saved new settings") self.gui.update_floor_grid()
def doSettings(self): libPath = getSettingStr("Paths/Library", "") backupPaths = getSettingStr("Paths/Backup", "") fileExt = getSettingStr("FileExtensions", "jpg, CR2") fileExtOther = getSettingStr("FileExtensionsOther", "mov, avi") dialog = SettingsDialog(self, libPath, backupPaths, fileExt, fileExtOther) if dialog.exec_(): saveSetting("Paths/Library", dialog.libPathEdit.text()) saveSetting("Paths/Backup", dialog.backupPathsEdit.text()) saveSetting("FileExtensions", dialog.fileExtensionEdit.text()) saveSetting("FileExtensionsOther", dialog.fileExtensionOtherEdit.text()) self.status.showMessage("Settings updated", 5000)
def show_settings(self): Lumberjack.info('< MainApp > - -> (show_settings)') settings_dialog = SettingsDialog() settings_dialog.exec_()
def do(self): """ Executes the action. """ dialog = SettingsDialog(self.parent) dialog.exec_()
app.setApplicationDisplayName("HiChess") app.setOrganizationName("Zneigras") app.setOrganizationDomain("https://github.com/H-a-y-k/Hichess") breeze = QFile(":qbreeze/dark.qss") main = QFile(":/style/styles.css") # stylesheet as string breezeQss = "" mainQss = "" if breeze.open(QFile.ReadOnly): textstream = QTextStream(breeze) breezeQss = textstream.readAll() if main.open(QFile.ReadOnly): textstream = QTextStream(main) mainQss = textstream.readAll() app.setStyleSheet(f"{breezeQss}{mainQss}") settingsDialog = SettingsDialog() status = settingsDialog.exec_() if status == SettingsDialog.Accepted: window = HichessGui(username=settingsDialog.newUsername, enginePath=settingsDialog.newEnginePath) window.setMinimumSize(800, 800) window.showMaximized() sys.exit(app.exec_())