def __init__(self, parent=None): super().__init__(parent) self.setupUi(self) self.setWindowIcon(QIcon('img/cloverball.png')) editDir = QDir.homePath() editDir += '/documents/KONAMI/Pro Evolution Soccer 2016/save' if (os.path.isdir(editDir)): self._directory = editDir else: self._directory = QDir.currentPath() self._editFile = EditFile() self._editData = None # Handle open/save buttons if (EditFile.crypterAvailable()): self.actionOpen_Edit_File.setEnabled(True) else: self.actionOpen_Edit_File.setEnabled(False) self.actionSave_As_Edit_File.setEnabled(False) self.actionOpen_Edit_data.setEnabled(True) self.actionSave_As_Edit_data.setEnabled(False) self.actionOpen_Edit_File.triggered.connect(lambda: self.openEdit(False)) self.actionSave_As_Edit_File.triggered.connect(lambda: self.saveEdit(False)) self.actionOpen_Edit_data.triggered.connect(lambda: self.openEdit(True)) self.actionSave_As_Edit_data.triggered.connect(lambda: self.saveEdit(True)) self.actionExit.triggered.connect(self.close)
from modules.mainwindow import MainWindow # import after compilation app = QApplication(sys.argv) mainWindow = MainWindow() mainWindow.setWindowTitle(name + ' v' + version) # Prepare status bar versionString = '<a href=\'' + repository + '\'>' + 'v' + version + '</a>' versionLabel = QLabel(versionString) versionLabel.setOpenExternalLinks(True) mainWindow.statusbar.insertPermanentWidget(0, versionLabel) websiteLabel = QLabel('<a href=\'' + wiki + '\'>' + wiki + '</a>') websiteLabel.setOpenExternalLinks(True) mainWindow.statusbar.insertPermanentWidget(0, websiteLabel) decrypterText = '<a href="https://github.com/tunabrain4cc/pes16decrypter">' decrypterText += 'pes16decrypter</a> status: ' if (EditFile.crypterAvailable()): decrypterText += 'found' else: decrypterText += 'missing' pes16decrypterLabel = QLabel(decrypterText) mainWindow.statusbar.insertPermanentWidget(0, pes16decrypterLabel) mainWindow.statusbar.showMessage(welcomeText) # Add tabs and show main window #TODO: do this by searching the directory? from modules.players import PlayersWidget playersTab = PlayersWidget(mainWindow) mainWindow.mainTabs.addTab(playersTab, playersTab.windowTitle()) from modules.batchplayerediting4cc import BatchPlayerEditing4ccWidget batchTab = BatchPlayerEditing4ccWidget(mainWindow) mainWindow.mainTabs.addTab(batchTab, batchTab.windowTitle()) mainWindow.show()