def reloadConfig(self): Util.reloadConfig() self.showWindowTitle = Util.getConfigValue('showTitle') self.showWindowIcon = Util.getConfigValue('showWindowIcon') self.defaultStyle = Util.getConfigValue('style') self.closeConfirm = Util.getConfigValue('closeConfirm') self.closeToTray = Util.getConfigValue('closeToTray') Util.loadTheme()
def on_btn_apply_clicked(self): #default default = self.getDefaultSetting() printer = self.getPrinterSetting() if not Util.saveConfig('Default', default): QMessageBox.critical(self, 'Message', Util.lang('save_config_error', 'Save config.ini file failure.'), QMessageBox.Ok, QMessageBox.Ok) return if not Util.saveConfig('Printer', printer): QMessageBox.critical(self, 'Message', Util.lang('save_config_error', 'Save config.ini file failure.'), QMessageBox.Ok, QMessageBox.Ok) return if self.mainWindow: self.mainWindow.on_settingOK() else: Util.reloadConfig() Util.loadTheme()
e.__str__(), QMessageBox.Ok, QMessageBox.Ok) sys.exit() #print(Util.timestamp() - startupTime) #splash splash = None if Util.getConfigValue('showSplash') and os.path.exists(splashPath): splash = QSplashScreen(QPixmap(splashPath)) splash.setWindowFlags(Qt.SplashScreen | Qt.FramelessWindowHint | Qt.Tool) splash.showMessage("Loading... 0%", Qt.AlignHCenter | Qt.AlignBottom, Qt.white) splash.show() qApp.processEvents() Util.loadTheme() #main Window.Margins = 5 if Util.getConfigValue('resizable') else 0 Window.StayOnTop = Util.getConfigValue('windowStayOnTop') mainWnd = MainWindow() mainWnd.setWidget(WebWindow(mainWnd)) mainWnd.loadData(splash) #ui mainWnd.setWindowTitle( Util.getWindowTitle(Util.lang('loading', 'Loading...'))) mainWnd.setWindowIcon(Icon.getLogoIcon()) if not Util.getConfigValue('showTitleBar'): mainWnd.titleBar.hide()