def mod_settings(self): # allow user to change settings values, update setting attributes settingsdlg = SettingsDlg(root, self.settings) if settingsdlg.result: self.settings = settingsdlg.result self.write_settings()
def __init__(self): super(MainWindow, self).__init__() self.setFont(QFont("Monospace", 10)) self.dlgSettings = SettingsDlg(self) self.dlgSettings.setModal(True) self.dlgSettings.load() self.main = MainArea(self) self.setCentralWidget(self.main) self.createToolBar() self.createStatusBar() self.setWindowTitle('Svn Tool') self.setWindowIcon(QIcon('image/logo.png')) self.setStyleSheet(STYLE_SHEET)
def onSettings(self): dlg = SettingsDlg(self.settings) dlg.exec_()
class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.setFont(QFont("Monospace", 10)) self.dlgSettings = SettingsDlg(self) self.dlgSettings.setModal(True) self.dlgSettings.load() self.main = MainArea(self) self.setCentralWidget(self.main) self.createToolBar() self.createStatusBar() self.setWindowTitle('Svn Tool') self.setWindowIcon(QIcon('image/logo.png')) self.setStyleSheet(STYLE_SHEET) def createStatusBar(self): self.lbLoadingText = QLabel() self.lbLoadingGif = QLabel() self.lbLoadingGif.hide() movie = QMovie("image/loading.gif") movie.start() self.lbLoadingGif.setMovie(movie) self.statusBar() self.statusBar().addWidget(self.lbLoadingText) self.statusBar().addWidget(self.lbLoadingGif) def createToolBar(self): self.myTb = self.addToolBar("Svn Tool") self.myTb.addAction( QAction( QIcon('image/computer.png'), "Open Settings Dialog", self, #statusTip="Open Settings Dialog", triggered=self.openSettingsTab) ) self.myTb.addAction( QAction( QIcon('image/stop.png'), "Stop Current Running Task", self, #statusTip="Stop Current Running Task", triggered=self.stopCurrentTask) ) def stopCurrentTask(self): TaskWorker().stop_task() def openSettingsTab(self): self.dlgSettings.show() def center(self): self.move( QApplication.desktop().screen().rect().center() - self.rect().center() ) def closeEvent(self, event): #self.dlgSettings.saveConfig() self.main.close() event.accept() def showLoading(self, msg, loading=True): self.lbLoadingText.setText(msg) #self.statusBar().showMessage(msg) self.lbLoadingGif.setVisible(loading) def notifyConfigChanged(self): self.main.updateAppList()