Exemple #1
0
        def __init__(self, parent=None):
            super(DataDownloadGui, self).__init__(parent)
            self.setWindowTitle("RedVox Cloud Data Downloader")
            self.setMinimumWidth(1600)
            self.setMinimumHeight(900)

            redvox_config: Optional[RedVoxConfig] = RedVoxConfig.find()

            self.authentication_widget: AuthenticationWidget = AuthenticationWidget(
                redvox_config)
            self.server_selection_widget: ServerSelectionWidget = ServerSelectionWidget(
                redvox_config)
            self.window_selection_widget: WindowSelectionWidget = (
                WindowSelectionWidget())
            self.station_ids_widget: QTextEdit = QTextEdit()
            self.api_selection_widget: ApiSelectionWidget = ApiSelectionWidget(
            )
            self.output_directory_widget: OutputDirectoryWidget = (
                OutputDirectoryWidget())
            self.download_data_btn: QPushButton = QPushButton("Download Data")
            # noinspection PyUnresolvedReferences
            self.download_data_btn.clicked.connect(self.download_data)

            self.log: QTextEdit = QTextEdit()
            self.log.setReadOnly(True)
            self.info = lambda msg: self.log.append(
                f"{datetime.datetime.utcnow()}: {msg}")

            layout: QVBoxLayout = QVBoxLayout()

            layout.addWidget(QLabel("RedVox Authentication"))
            layout.addWidget(self.authentication_widget)

            layout.addWidget(QLabel("Server Selection"))
            layout.addWidget(self.server_selection_widget)

            layout.addWidget(QLabel("Data Window Selection"))
            layout.addWidget(self.window_selection_widget)

            layout.addWidget(QLabel("Station IDs (one per line)"))
            layout.addWidget(self.station_ids_widget)

            layout.addWidget(QLabel("API Selection"))
            layout.addWidget(self.api_selection_widget)

            layout.addWidget(QLabel("Output Directory"))
            layout.addWidget(self.output_directory_widget)

            layout.addWidget(self.download_data_btn)

            layout.addWidget(QLabel("Log"))
            layout.addWidget(self.log)

            self.setLayout(layout)
    def __init__(self, parent=None):
        super(AddDialogWidget, self).__init__(parent)

        nameLabel = QLabel("Name")
        addressLabel = QLabel("Address")
        buttonBox = QDialogButtonBox(QDialogButtonBox.Ok
                                     | QDialogButtonBox.Cancel)

        self.nameText = QLineEdit()
        self.addressText = QTextEdit()

        grid = QGridLayout()
        grid.setColumnStretch(1, 2)
        grid.addWidget(nameLabel, 0, 0)
        grid.addWidget(self.nameText, 0, 1)
        grid.addWidget(addressLabel, 1, 0, Qt.AlignLeft | Qt.AlignTop)
        grid.addWidget(self.addressText, 1, 1, Qt.AlignLeft)

        layout = QVBoxLayout()
        layout.addLayout(grid)
        layout.addWidget(buttonBox)

        self.setLayout(layout)

        self.setWindowTitle("Add a Contact")

        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)
Exemple #3
0
    def initUI(self):
        title = QLabel('标题')
        author = QLabel('提交人')
        review = QLabel('申告内容')

        titleEdit = QLineEdit()
        authorEdit = QLineEdit()
        reviewEdit = QTextEdit()

        grid = QGridLayout()
        grid.setSpacing(10)

        grid.addWidget(title, 1, 0)
        grid.addWidget(titleEdit, 1, 1)

        grid.addWidget(author, 2, 0)
        grid.addWidget(authorEdit, 2, 1)

        grid.addWidget(review, 3, 0)
        grid.addWidget(reviewEdit, 3, 1, 5, 1)

        self.setLayout(grid)

        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle('故障申告')
Exemple #4
0
    def __init__(self, parent=None):
        super().__init__(parent=parent)

        layout = QtWidgets.QVBoxLayout(self)
        label1 = QLabel('입력', self)
        label1.setAlignment(Qt.AlignVCenter)
        label1.move(200, 30)

        label2 = QLabel('결과', self)
        label2.setAlignment(Qt.AlignVCenter)
        label2.move(710, 30)

        self.text_box1 = QTextEdit(self)
        self.text_box1.resize(350, 350)
        self.text_box1.move(50, 60)

        self.text_box2 = QTextBrowser(self)
        self.text_box2.append('')
        self.text_box2.setGeometry(550, 60, 350, 350) 

        self.ok_base64 = QPushButton("OK", self)	
        self.ok_base64.setGeometry(50, 420, 850, 45) 
        self.ok_base64.clicked.connect(self.base64_conversion)

        self.back = QPushButton(self)
        self.back.setStyleSheet(
            '''
            QPushButton{image:url(./img/back_img.png); border:0px;}
            QPushButton:hover{image:url(./img/back_img_ev_1.png); border:0px;}
            ''') 
        self.back.setGeometry(0, 0, 50, 50) 
        self.back.clicked.connect(self.change_stack1)
    def __init__(self):
        self.db = ClientesDB()
        QWidget.__init__(self)
        font = QFont()
        font.setBold(True)  # Labels em Negrito

        # Labels:
        self.label_title = QLabel("Novo Cliente")
        self.label_title.setFont(font)
        self.label_nome = QLabel("Nome Completo:")
        self.label_nome.setFont(font)
        self.label_endereco = QLabel("Endereço:")
        self.label_endereco.setFont(font)
        self.label_numero = QLabel("Número:")
        self.label_numero.setFont(font)
        self.label_cpf = QLabel("CPF:")
        self.label_cpf.setFont(font)

        # Entries:
        self.entry_nome = QLineEdit()
        self.entry_endereco = QTextEdit()
        self.entry_numero = QLineEdit()
        self.entry_cpf = QLineEdit()

        # Botões;
        self.button_salvar = QPushButton("&Salvar")
        self.button_salvar.clicked.connect(self.salvar_cliente)
        self.button_salvar.setShortcut("Ctrl+S")
        self.button_cancelar = QPushButton("Cancelar")
        self.button_cancelar.clicked.connect(self.limpar)
        self.button_cancelar.setShortcut("ESC")

        # Linha
        self.line = QFrame()
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)
        self.line.setLineWidth(0)
        self.line.setMidLineWidth(1)

        # Leiaute:
        self.layout = QVBoxLayout()
        self.layout_buttons = QHBoxLayout()
        self.layout.addWidget(self.label_title)
        self.layout.addWidget(self.line)
        self.layout.addWidget(self.label_nome)
        self.layout.addWidget(self.entry_nome)
        self.layout.addWidget(self.label_numero)
        self.layout.addWidget(self.entry_numero)
        self.layout.addWidget(self.label_cpf)
        self.layout.addWidget(self.entry_cpf)
        self.layout.addWidget(self.label_endereco)
        self.layout.addWidget(self.entry_endereco)
        self.layout_buttons.addWidget(self.button_salvar)
        self.layout_buttons.addWidget(self.button_cancelar)
        self.layout.addStretch(2)
        self.layout.addLayout(self.layout_buttons)
        self.setLayout(self.layout)
Exemple #6
0
    def __init__(self, parent=None):
        super(Window, self).__init__(parent)

        self.iconGroupBox = QGroupBox()
        self.iconLabel = QLabel()
        self.iconComboBox = QComboBox()
        self.showIconCheckBox = QCheckBox()

        self.messageGroupBox = QGroupBox()
        self.typeLabel = QLabel()
        self.durationLabel = QLabel()
        self.durationWarningLabel = QLabel()
        self.titleLabel = QLabel()
        self.bodyLabel = QLabel()

        self.typeComboBox = QComboBox()
        self.durationSpinBox = QSpinBox()
        self.titleEdit = QLineEdit()
        self.bodyEdit = QTextEdit()
        self.showMessageButton = QPushButton()

        self.minimizeAction = QAction()
        self.maximizeAction = QAction()
        self.restoreAction = QAction()
        self.quitAction = QAction()

        self.trayIcon = QSystemTrayIcon()
        self.trayIconMenu = QMenu()

        self.createIconGroupBox()
        self.createMessageGroupBox()

        self.iconLabel.setMinimumWidth(self.durationLabel.sizeHint().width())

        self.createActions()
        self.createTrayIcon()

        self.showMessageButton.clicked.connect(self.showMessage)
        self.showIconCheckBox.toggled.connect(self.trayIcon.setVisible)
        self.iconComboBox.currentIndexChanged.connect(self.setIcon)
        self.trayIcon.messageClicked.connect(self.messageClicked)
        self.trayIcon.activated.connect(self.iconActivated)

        self.mainLayout = QVBoxLayout()
        self.mainLayout.addWidget(self.iconGroupBox)
        self.mainLayout.addWidget(self.messageGroupBox)
        self.setLayout(self.mainLayout)

        self.iconComboBox.setCurrentIndex(1)
        self.trayIcon.show()

        self.setWindowTitle("Systray")
        self.resize(400, 300)
Exemple #7
0
    def __init__(self, window_width=None, window_height=None):
        super(MainWindow, self).__init__()
        if window_width != None and window_height != None:
            self.window_width = window_width
            self.window_height = window_height
            self.resize(window_width, window_height)

        self.stack_of_widget = QStackedWidget()
        self.central_widget = QWidget()
        self.main_layout = QVBoxLayout()

        self.username = ""

        # ui widgets
        self.message_visable_field = QTextEdit()
        self.message_input_field = QTextEdit()
        self.send_message = QPushButton("Send my message!")

        self.login_screen = LoginScreen()
        self.login_screen.auth_button.clicked.connect(self.login_button_click)

        # show all widgets
        self.build_ui()
Exemple #8
0
    def __init__(self):
        super().__init__()

        self.textEdit = QTextEdit()
        self.textEdit.setTabStopDistance(20)
        self.textEdit.setLineWrapMode(QTextEdit.LineWrapMode.NoWrap)
        self.textEdit.textChanged.connect(self.codeChanged.emit)

        self.textEdit.setAcceptRichText(False)

        layout = QHBoxLayout()
        self.setLayout(layout)
        layout.addWidget(self.textEdit)

        self._highlighter = PythonSyntaxHighlighter(self.textEdit.document())
    def __init__(self):
        super(MainWindow, self).__init__()

        self.textEdit = QTextEdit()
        self.setCentralWidget(self.textEdit)

        self.createActions()
        self.createMenus()
        self.createToolBars()
        self.createStatusBar()
        self.createDockWindows()

        self.setWindowTitle("Dock Widgets")

        self.newLetter()
    def setupWidgets(self):
        """
        Set up the widgets and layouts for interface.
        """
        dir_label = QLabel("Choose Directory:")
        self.dir_line_edit = QLineEdit()

        dir_button = QPushButton('...')
        dir_button.setToolTip("Select file directory.")
        dir_button.clicked.connect(self.setDirectory)

        self.change_name_edit = QLineEdit()
        self.change_name_edit.setToolTip(
            "Files will be appended with numerical values.For example: filename <b> 01 </b >.jpg")
        self.change_name_edit.setPlaceholderText("Change file names to...")

        rename_button = QPushButton("Rename Files")
        rename_button.setToolTip("Begin renaming files in directory.")
        rename_button.clicked.connect(self.renameFiles)

        file_exts = [".jpg", ".jpeg", ".png", ".gif", ".txt"]

        # Create combo box for selecting file extensions.
        ext_cb = QComboBox()
        self.cb_value = file_exts[0]
        ext_cb.setToolTip("Only files with this extension will be changed.")
        ext_cb.addItems(file_exts)
        ext_cb.currentTextChanged.connect(self.updateCbValue)

        # Text edit is for displaying the file names as they are updated.
        self.display_files_edit = QTextEdit()
        self.display_files_edit.setReadOnly(True)
        self.progress_bar = QProgressBar()
        self.progress_bar.setValue(0)

        # Set layout and widgets.
        grid = QGridLayout()
        grid.addWidget(dir_label, 0, 0)
        grid.addWidget(self.dir_line_edit, 1, 0, 1, 2)
        grid.addWidget(dir_button, 1, 2)
        grid.addWidget(self.change_name_edit, 2, 0)
        grid.addWidget(ext_cb, 2, 1)
        grid.addWidget(rename_button, 2, 2)
        grid.addWidget(self.display_files_edit, 3, 0, 1, 3)
        grid.addWidget(self.progress_bar, 4, 0, 1, 3)
        self.setLayout(grid)
Exemple #11
0
    def init_ui(self):
        self.textEdit = QTextEdit()
        self.setCentralWidget(self.textEdit)

        self.statusBar()

        openFile = QAction(QIcon('open.svg'), 'Open', self)
        openFile.setShortcut("Ctrl+O")
        openFile.setStatusTip("Open new File")
        openFile.triggered.connect(self.show_dialog)

        menubar = self.menuBar()
        fileMenu = menubar.addMenu('&File')
        fileMenu.addAction(openFile)

        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle('File dialog')
Exemple #12
0
    def initUI(self):
        textEdit = QTextEdit()
        self.setCentralWidget(textEdit)

        exitAction = QAction("Exit", self)
        exitAction.setShortcut("Ctrl+Q")
        exitAction.setStatusTip("Exit application")
        exitAction.triggered.connect(self.close)

        self.statusBar()
        menuBar = self.menuBar()
        fileMenu = menuBar.addMenu("&File")
        fileMenu.addAction(exitAction)

        toolbar = self.addToolBar("Exit")
        toolbar.addAction(exitAction)

        self.setGeometry(300, 300, 250, 250)
        self.setWindowTitle("Main Window")
Exemple #13
0
 def createCodeEditPage(self):
     self.codeEditPage = QWidget()
     self.codeEditLayout = QVBoxLayout()
     self.codeEditNameBox = QHBoxLayout()
     self.codeEditNameBoxNameLabel = QLabel("Name:")
     self.codeEditNameBoxNameInput = QLineEdit()
     self.codeEditNameBoxSaveButton = QPushButton("Save")
     self.codeEditNameBoxCancelButton = QPushButton("Cancel")
     self.codeEditNameBox.addWidget(self.codeEditNameBoxNameLabel)
     self.codeEditNameBox.addWidget(self.codeEditNameBoxNameInput)
     self.codeEditNameBox.addWidget(self.codeEditNameBoxSaveButton)
     self.codeEditNameBox.addWidget(self.codeEditNameBoxCancelButton)
     self.codeEdit = QTextEdit()
     self.codeEditLayout.addLayout(self.codeEditNameBox)
     self.codeEditLayout.addWidget(self.codeEdit)
     self.codeEditPage.setLayout(self.codeEditLayout)
     self.codeEditLastCode = ''
     self.codeEditNameBoxSaveButton.clicked.connect(self.saveEditProgram)
     self.codeEditNameBoxCancelButton.clicked.connect(self.cancelEditProgram)
Exemple #14
0
    def __init__(self, text):
        super().__init__()
        # finding windows_size
        self.setMinimumSize(QSize(363, 300))
        self.setWindowIcon(
            QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))
        self.setWindowTitle('Persepolis Download Manager')

        verticalLayout = QVBoxLayout(self)
        horizontalLayout = QHBoxLayout()
        horizontalLayout.addStretch(1)

        self.text_edit = QTextEdit(self)
        self.text_edit.setReadOnly(True)
        self.text_edit.insertPlainText(text)

        verticalLayout.addWidget(self.text_edit)

        self.label2 = QLabel(self)
        self.label2.setText(
            'Reseting persepolis may solving problem.\nDo not panic!If you add your download links again,\npersepolis will resume your downloads\nPlease copy this error message and press "Report Issue" button\nand open a new issue in Github for it.\nWe answer you as soon as possible. \nreporting this issue help us to improve persepolis.\nThank you!'
        )
        verticalLayout.addWidget(self.label2)

        self.report_pushButton = QPushButton(self)
        self.report_pushButton.setText("Report Issue")
        horizontalLayout.addWidget(self.report_pushButton)

        self.reset_persepolis_pushButton = QPushButton(self)
        self.reset_persepolis_pushButton.clicked.connect(
            self.resetPushButtonPressed)
        self.reset_persepolis_pushButton.setText('Reset Persepolis')
        horizontalLayout.addWidget(self.reset_persepolis_pushButton)

        self.close_pushButton = QPushButton(self)
        self.close_pushButton.setText('close')
        horizontalLayout.addWidget(self.close_pushButton)

        verticalLayout.addLayout(horizontalLayout)

        self.report_pushButton.clicked.connect(self.reportPushButtonPressed)
        self.close_pushButton.clicked.connect(self.closePushButtonPressed)
Exemple #15
0
	def __init__(self, parent, name, data):
		if not type(data) == binaryninja.binaryview.BinaryView:
			raise Exception('expected widget data to be a BinaryView')

		self.bv = data

		QWidget.__init__(self, parent)
		DockContextHandler.__init__(self, self, name)
		self.actionHandler = UIActionHandler()
		self.actionHandler.setupActionHandler(self)

		layout = QVBoxLayout()
		self.consoleText = QTextEdit(self)
		self.consoleText.setReadOnly(True)
		self.consoleText.setFont(getMonospaceFont(self))
		layout.addWidget(self.consoleText, 1)

		inputLayout = QHBoxLayout()
		inputLayout.setContentsMargins(4, 4, 4, 4)

		promptLayout = QVBoxLayout()
		promptLayout.setContentsMargins(0, 5, 0, 5)

		inputLayout.addLayout(promptLayout)

		self.consoleEntry = QLineEdit(self)
		inputLayout.addWidget(self.consoleEntry, 1)

		self.entryLabel = QLabel("dbg>>> ", self)
		self.entryLabel.setFont(getMonospaceFont(self))
		promptLayout.addWidget(self.entryLabel)
		promptLayout.addStretch(1)

		self.consoleEntry.returnPressed.connect(lambda: self.sendLine())

		layout.addLayout(inputLayout)
		layout.setContentsMargins(0, 0, 0, 0)
		layout.setSpacing(0)
		self.setLayout(layout)
 def __init__(self, parent=None):
     super().__init__(parent)
     self.thread = QThread()
     self.worker = None
     grid_layout = QGridLayout(self)
     login_group_box = self.create_login_group()
     data_group_box = self.create_data_group()
     self.enable_editables.connect(login_group_box.setEnabled)
     self.enable_editables.connect(data_group_box.setEnabled)
     self.import_button = QPushButton('Importar', self)
     self.import_button.setEnabled(False)
     self.enable_editables.connect(self.import_button.setEnabled)
     self.import_button.clicked.connect(self.enable_editables)
     self.import_button.clicked.connect(self.load_data)
     self.bgg_user_line_edit.textChanged.connect(self.enable_import)
     self.ludo_mail_line_edit.textChanged.connect(self.enable_import)
     self.ludo_pass_line_edit.textChanged.connect(self.enable_import)
     grid_layout.addWidget(login_group_box, 1, 1, 1, 2)
     grid_layout.addWidget(data_group_box, 2, 1, 1, 2)
     grid_layout.addWidget(self.import_button, 8, 2)
     self.log_widget = QTextEdit(self)
     self.log_widget.setReadOnly(True)
     grid_layout.addWidget(self.log_widget, 9, 1, 30, 2)
Exemple #17
0
    def _init_UI(self):
        self.setGeometry(300, 300, 250, 150)
        self.setWindowTitle('Example 7')


        self.label_name = QLabel("form name", self)
        self.text = QTextEdit("kek", self)

        # self.kek_btn = QLabel("kek", self)
        self.kek_btn = QPushButton("kek", self)
        self.form_name = QLineEdit(self.windowTitle(), self)


        self.layout = QFormLayout(self)
        self.layout.addRow(self.label_name, self.form_name)
        self.layout.addRow(self.kek_btn, self.text)

        self.form_name.textChanged.connect(self.set_title)
        self.kek_btn.clicked.connect(self.set_text)
        # self.layout.addWidget(self.kek_btn, 0, 0)
        # self.layout.addWidget(self.text, 0, 1)

        self.setLayout(self.layout)
        self.show()
Exemple #18
0
    def __init__(self, parent=None) -> None:
        super().__init__(parent)

        self.verticalLayout = QVBoxLayout(self)

        self.compileButton = QPushButton('Compile', self)
        self.compileButton.setMinimumSize(QSize(200, 50))
        self.verticalLayout.addWidget(self.compileButton, 0, Qt.AlignHCenter)

        self.tidyButton = QPushButton('Tidy', self)
        self.verticalLayout.addWidget(self.tidyButton, 0, Qt.AlignHCenter)

        self.splitter = QSplitter(self)
        self.splitter.setOrientation(Qt.Vertical)

        self.widget = QWidget(self.splitter)
        self.widget.setObjectName(u"widget")
        self.verticalLayout2 = QVBoxLayout(self.widget)
        self.stdoutLabel = QLabel(self.widget)
        self.stdoutLabel.setText('stdout:')

        self.verticalLayout2.addWidget(self.stdoutLabel)

        self.stdoutText = QTextEdit(self.widget)
        self.stdoutText.setEnabled(False)
        self.stdoutText.setReadOnly(True)
        self.stdoutText.setPlainText("Output will appear here")

        self.verticalLayout2.addWidget(self.stdoutText)

        self.splitter.addWidget(self.widget)

        self.widget1 = QWidget(self.splitter)

        self.verticalLayout3 = QVBoxLayout(self.widget1)
        self.stderrLabel = QLabel(self.widget1)
        self.stderrLabel.setText('stderr:')

        self.verticalLayout3.addWidget(self.stderrLabel)

        self.stderrText = QTextEdit(self.widget1)
        self.stderrText.setEnabled(False)
        self.stderrText.setReadOnly(True)
        self.stderrText.setPlainText('Errors will appear here')

        self.verticalLayout3.addWidget(self.stderrText)

        self.splitter.addWidget(self.widget1)

        self.verticalLayout.addWidget(self.splitter)

        # Logic

        # Use QProcess to start a program and get its outputs https://stackoverflow.com/a/22110924
        self.process = QProcess(self)

        self.process.readyReadStandardOutput.connect(self.readStdout)
        self.process.readyReadStandardError.connect(self.readStderr)
        self.process.started.connect(self.processStarted)
        self.process.finished.connect(self.processFinished)
        self.process.errorOccurred.connect(self.errorOccurred)
        self.compileButton.clicked.connect(self.doCompile)
        self.tidyButton.clicked.connect(self.doTidy)
Exemple #19
0
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(671, 496)
        self.help = QAction(MainWindow)
        self.help.setObjectName(u"help")
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.log_text = QTextEdit(self.centralwidget)
        self.log_text.setObjectName(u"log_text")
        self.log_text.setGeometry(QRect(0, 190, 671, 291))
        self.labe = QLabel(self.centralwidget)
        self.labe.setObjectName(u"labe")
        self.labe.setGeometry(QRect(30, 20, 54, 12))
        self.ssid = QLineEdit(self.centralwidget)
        self.ssid.setObjectName(u"ssid")
        self.ssid.setGeometry(QRect(70, 20, 131, 20))
        self.time = QLineEdit(self.centralwidget)
        self.time.setObjectName(u"time")
        self.time.setGeometry(QRect(540, 20, 91, 20))
        self.label_2 = QLabel(self.centralwidget)
        self.label_2.setObjectName(u"label_2")
        self.label_2.setGeometry(QRect(470, 20, 54, 12))
        self.password = QLineEdit(self.centralwidget)
        self.password.setObjectName(u"password")
        self.password.setGeometry(QRect(310, 20, 131, 20))
        self.label_3 = QLabel(self.centralwidget)
        self.label_3.setObjectName(u"label_3")
        self.label_3.setGeometry(QRect(240, 20, 54, 12))
        self.connect = QPushButton(self.centralwidget)
        self.connect.setObjectName(u"connect")
        self.connect.setGeometry(QRect(140, 60, 75, 23))
        self.disconnect = QPushButton(self.centralwidget)
        self.disconnect.setObjectName(u"disconnect")
        self.disconnect.setGeometry(QRect(250, 60, 75, 23))
        self.labe_2 = QLabel(self.centralwidget)
        self.labe_2.setObjectName(u"labe_2")
        self.labe_2.setGeometry(QRect(30, 120, 91, 16))
        self.cur_ssid = QTextEdit(self.centralwidget)
        self.cur_ssid.setObjectName(u"cur_ssid")
        self.cur_ssid.setGeometry(QRect(140, 110, 241, 31))
        self.label = QLabel(self.centralwidget)
        self.label.setObjectName(u"label")
        self.label.setGeometry(QRect(30, 160, 101, 16))
        self.interface_name = QTextEdit(self.centralwidget)
        self.interface_name.setObjectName(u"interface_name")
        self.interface_name.setGeometry(QRect(140, 150, 241, 31))
        self.label_4 = QLabel(self.centralwidget)
        self.label_4.setObjectName(u"label_4")
        self.label_4.setGeometry(QRect(450, 70, 54, 12))
        self.frequency = QLineEdit(self.centralwidget)
        self.frequency.setObjectName(u"frequency")
        self.frequency.setGeometry(QRect(540, 70, 91, 20))
        self.test = QPushButton(self.centralwidget)
        self.test.setObjectName(u"test")
        self.test.setGeometry(QRect(550, 110, 75, 23))
        self.label_5 = QLabel(self.centralwidget)
        self.label_5.setObjectName(u"label_5")
        self.label_5.setGeometry(QRect(470, 70, 61, 16))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QMenuBar(MainWindow)
        self.menubar.setObjectName(u"menubar")
        self.menubar.setGeometry(QRect(0, 0, 671, 22))
        self.menuFile = QMenu(self.menubar)
        self.menuFile.setObjectName(u"menuFile")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QStatusBar(MainWindow)
        self.statusbar.setObjectName(u"statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.menubar.addAction(self.menuFile.menuAction())
        self.menuFile.addAction(self.help)
        self.menuFile.addSeparator()

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)
Exemple #20
0
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(400, 300)
        MainWindow.setWindowTitle(u"\u0421\u0442\u0435\u0433\u0430\u043d\u043e\u0433\u0440\u0430\u0444\u0438\u044f")
        MainWindow.setStyleSheet(u
                                "QMainWindow {\n"
                                "background-color: #f8f9fa;\n"
                                "}\n"
                                "QPushButton:hover {\n"
                                "color: rgb(70, 126, 163);\n"
                                "font: bold 11pt;\n"
                                "}\n"
                                "QPushButton {\n"
                                "color: white;\n"
                                "border:1px solid rgb(82, 108, 125);\n"
                                "border-radius: 6px;\n"
                                "background-color: rgb(82, 108, 125)\n";
                                "}")

        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.verticalLayout = QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.load_button = QPushButton(self.centralwidget)
        self.load_button.setObjectName(u"load_button")
        font = QFont()
        font.setPointSize(9)
        self.load_button.setFont(font)
        self.load_button.setStyleSheet(u"")
        self.load_button.setText(u"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435")

        self.horizontalLayout.addWidget(self.load_button)

        self.save_button = QPushButton(self.centralwidget)
        self.save_button.setObjectName(u"save_button")
        self.save_button.setFont(font)
        self.save_button.setStyleSheet(u"")
        self.save_button.setText(u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435")

        self.horizontalLayout.addWidget(self.save_button)


        self.verticalLayout.addLayout(self.horizontalLayout)

        self.message_frame = QTextEdit(self.centralwidget)
        self.message_frame.setObjectName(u"message_frame")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.message_frame.sizePolicy().hasHeightForWidth())
        self.message_frame.setSizePolicy(sizePolicy)
        font.setPointSize(10)
        self.message_frame.setFont(font)
        font.setPointSize(9)        
        self.message_frame.setStyleSheet(u"")
        self.message_frame.setFrameShape(QFrame.StyledPanel)
        self.message_frame.setMarkdown(u"")
        self.message_frame.setHtml(u"")
        self.message_frame.setPlaceholderText(u"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435")

        self.verticalLayout.addWidget(self.message_frame)

        self.output_label = QLabel(self.centralwidget)
        self.output_label.setObjectName(u"output_label")
        sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy1.setHorizontalStretch(1)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(self.output_label.sizePolicy().hasHeightForWidth())
        self.output_label.setSizePolicy(sizePolicy1)
        font1 = QFont()
        self.output_label.setFont(font1)
        self.output_label.setText(u"")
        self.output_label.setScaledContents(False)
        self.output_label.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
        self.output_label.setWordWrap(True)

        self.verticalLayout.addWidget(self.output_label)

        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.decode_button = QPushButton(self.centralwidget)
        self.decode_button.setObjectName(u"decode_button")
        palette = QPalette()
        brush = QBrush(QColor(255, 255, 255, 255))
        brush.setStyle(Qt.SolidPattern)
        palette.setBrush(QPalette.Active, QPalette.WindowText, brush)
        brush1 = QBrush(QColor(13, 110, 253, 255))
        brush1.setStyle(Qt.SolidPattern)
        palette.setBrush(QPalette.Active, QPalette.Button, brush1)
        palette.setBrush(QPalette.Active, QPalette.Text, brush)
        palette.setBrush(QPalette.Active, QPalette.ButtonText, brush)
        palette.setBrush(QPalette.Active, QPalette.Base, brush1)
        palette.setBrush(QPalette.Active, QPalette.Window, brush1)
        palette.setBrush(QPalette.Active, QPalette.PlaceholderText, brush)
        palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush)
        palette.setBrush(QPalette.Inactive, QPalette.Button, brush1)
        palette.setBrush(QPalette.Inactive, QPalette.Text, brush)
        palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush)
        palette.setBrush(QPalette.Inactive, QPalette.Base, brush1)
        palette.setBrush(QPalette.Inactive, QPalette.Window, brush1)
        palette.setBrush(QPalette.Inactive, QPalette.PlaceholderText, brush)
        palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush)
        palette.setBrush(QPalette.Disabled, QPalette.Button, brush1)
        palette.setBrush(QPalette.Disabled, QPalette.Text, brush)
        palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush)
        palette.setBrush(QPalette.Disabled, QPalette.Base, brush1)
        palette.setBrush(QPalette.Disabled, QPalette.Window, brush1)
        palette.setBrush(QPalette.Disabled, QPalette.PlaceholderText, brush)
        self.decode_button.setPalette(palette)
        self.decode_button.setFont(font)
        self.decode_button.setStyleSheet(u"")
        self.decode_button.setText(u"\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442")

        self.horizontalLayout_2.addWidget(self.decode_button)

        self.encode_button = QPushButton(self.centralwidget)
        self.encode_button.setObjectName(u"encode_button")
        self.encode_button.setFont(font)
        self.encode_button.setStyleSheet(u"")
        self.encode_button.setText(u"\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442")

        self.horizontalLayout_2.addWidget(self.encode_button)


        self.verticalLayout.addLayout(self.horizontalLayout_2)

        MainWindow.setCentralWidget(self.centralwidget)
        QWidget.setTabOrder(self.load_button, self.save_button)
        QWidget.setTabOrder(self.save_button, self.encode_button)
        QWidget.setTabOrder(self.encode_button, self.decode_button)

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)
Exemple #21
0
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.setWindowModality(Qt.ApplicationModal)
        MainWindow.resize(1492, 1852)
        sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        MainWindow.setMinimumSize(QSize(700, 700))
        MainWindow.setMaximumSize(QSize(16777215, 16777215))
        MainWindow.setBaseSize(QSize(600, 600))
        font = QFont()
        font.setPointSize(12)
        font.setKerning(True)
        MainWindow.setFont(font)
        MainWindow.setAutoFillBackground(False)
        MainWindow.setStyleSheet(u"")
        MainWindow.setDocumentMode(False)
        MainWindow.setTabShape(QTabWidget.Rounded)
        MainWindow.setDockOptions(QMainWindow.AllowTabbedDocks|QMainWindow.AnimatedDocks)
        MainWindow.setUnifiedTitleAndToolBarOnMac(False)
        self.action_Quit = QAction(MainWindow)
        self.action_Quit.setObjectName(u"action_Quit")
        self.main_widget = QWidget(MainWindow)
        self.main_widget.setObjectName(u"main_widget")
        self.main_widget.setEnabled(True)
        self.main_widget.setMinimumSize(QSize(650, 650))
        self.main_widget.setContextMenuPolicy(Qt.DefaultContextMenu)
        self.main_widget.setAutoFillBackground(False)
        self.main_widget.setStyleSheet(u"")
        self.main_layout = QGridLayout(self.main_widget)
        self.main_layout.setObjectName(u"main_layout")
        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.log_button = QPushButton(self.main_widget)
        self.log_button.setObjectName(u"log_button")
        sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(self.log_button.sizePolicy().hasHeightForWidth())
        self.log_button.setSizePolicy(sizePolicy1)
        self.log_button.setMinimumSize(QSize(24, 24))
        font1 = QFont()
        font1.setPointSize(9)
        font1.setBold(True)
        font1.setKerning(True)
        self.log_button.setFont(font1)
        self.log_button.setCursor(QCursor(Qt.PointingHandCursor))
        self.log_button.setCheckable(False)
        self.log_button.setFlat(True)

        self.horizontalLayout_2.addWidget(self.log_button)


        self.main_layout.addLayout(self.horizontalLayout_2, 5, 2, 1, 1)

        self.shuttle_widget = QWidget(self.main_widget)
        self.shuttle_widget.setObjectName(u"shuttle_widget")
        self.shuttle_widget.setMinimumSize(QSize(600, 600))
        self.shuttle_widget.setMaximumSize(QSize(600, 600))
        self.shuttle_widget.setAutoFillBackground(False)
        self.shuttle_widget.setStyleSheet(u"QWidget#shuttle_widget {background: url(images/ShuttleXpress_Black.png);\n"
"        background-repeat:no-repeat;}\n"
"       ")
        self.button_1 = QCheckBox(self.shuttle_widget)
        self.button_1.setObjectName(u"button_1")
        self.button_1.setGeometry(QRect(80, 266, 24, 24))
        sizePolicy1.setHeightForWidth(self.button_1.sizePolicy().hasHeightForWidth())
        self.button_1.setSizePolicy(sizePolicy1)
        self.button_1.setMinimumSize(QSize(24, 24))
        self.button_1.setFont(font)
        self.button_1.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.usb_status = QPushButton(self.shuttle_widget)
        self.usb_status.setObjectName(u"usb_status")
        self.usb_status.setEnabled(False)
        self.usb_status.setGeometry(QRect(288, 10, 24, 24))
        sizePolicy1.setHeightForWidth(self.usb_status.sizePolicy().hasHeightForWidth())
        self.usb_status.setSizePolicy(sizePolicy1)
        self.usb_status.setMinimumSize(QSize(24, 24))
        self.usb_status.setFont(font1)
        self.usb_status.setCursor(QCursor(Qt.ArrowCursor))
        self.usb_status.setAutoFillBackground(False)
        self.usb_status.setText(u"")
        icon = QIcon()
        icon.addFile(u"images/usb_black_24.png", QSize(), QIcon.Disabled, QIcon.Off)
        icon.addFile(u"images/usb_white_24.png", QSize(), QIcon.Disabled, QIcon.On)
        self.usb_status.setIcon(icon)
        self.usb_status.setIconSize(QSize(24, 24))
        self.usb_status.setCheckable(True)
        self.usb_status.setChecked(False)
        self.usb_status.setFlat(True)
        self.button_5 = QCheckBox(self.shuttle_widget)
        self.button_5.setObjectName(u"button_5")
        self.button_5.setGeometry(QRect(498, 266, 24, 24))
        sizePolicy1.setHeightForWidth(self.button_5.sizePolicy().hasHeightForWidth())
        self.button_5.setSizePolicy(sizePolicy1)
        self.button_5.setMinimumSize(QSize(24, 24))
        self.button_5.setFont(font)
        self.button_5.setLayoutDirection(Qt.RightToLeft)
        self.button_5.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_pos4 = QRadioButton(self.shuttle_widget)
        self.wheel_pos4.setObjectName(u"wheel_pos4")
        self.wheel_pos4.setGeometry(QRect(382, 164, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_pos4.sizePolicy().hasHeightForWidth())
        self.wheel_pos4.setSizePolicy(sizePolicy1)
        self.wheel_pos4.setMinimumSize(QSize(24, 24))
        self.wheel_pos4.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_cent0 = QRadioButton(self.shuttle_widget)
        self.wheel_cent0.setObjectName(u"wheel_cent0")
        self.wheel_cent0.setGeometry(QRect(289, 130, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_cent0.sizePolicy().hasHeightForWidth())
        self.wheel_cent0.setSizePolicy(sizePolicy1)
        self.wheel_cent0.setMinimumSize(QSize(24, 24))
        self.wheel_cent0.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_cent0.setChecked(True)
        self.wheel_pos1 = QRadioButton(self.shuttle_widget)
        self.wheel_pos1.setObjectName(u"wheel_pos1")
        self.wheel_pos1.setGeometry(QRect(314, 133, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_pos1.sizePolicy().hasHeightForWidth())
        self.wheel_pos1.setSizePolicy(sizePolicy1)
        self.wheel_pos1.setMinimumSize(QSize(24, 24))
        self.wheel_pos1.setStyleSheet(u"color: white;")
        self.wheel_pos2 = QRadioButton(self.shuttle_widget)
        self.wheel_pos2.setObjectName(u"wheel_pos2")
        self.wheel_pos2.setGeometry(QRect(338, 139, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_pos2.sizePolicy().hasHeightForWidth())
        self.wheel_pos2.setSizePolicy(sizePolicy1)
        self.wheel_pos2.setMinimumSize(QSize(24, 24))
        self.wheel_pos2.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.dial = QDial(self.shuttle_widget)
        self.dial.setObjectName(u"dial")
        self.dial.setGeometry(QRect(197, 178, 216, 216))
        sizePolicy2 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(self.dial.sizePolicy().hasHeightForWidth())
        self.dial.setSizePolicy(sizePolicy2)
        self.dial.setMinimumSize(QSize(24, 24))
        self.dial.setAutoFillBackground(False)
        self.dial.setStyleSheet(u"background-color: black;")
        self.dial.setMinimum(0)
        self.dial.setMaximum(10)
        self.dial.setPageStep(1)
        self.dial.setValue(5)
        self.dial.setSliderPosition(5)
        self.dial.setInvertedAppearance(False)
        self.dial.setInvertedControls(False)
        self.dial.setWrapping(True)
        self.dial.setNotchTarget(3.700000000000000)
        self.dial.setNotchesVisible(False)
        self.wheel_neg6 = QRadioButton(self.shuttle_widget)
        self.wheel_neg6.setObjectName(u"wheel_neg6")
        self.wheel_neg6.setGeometry(QRect(162, 204, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_neg6.sizePolicy().hasHeightForWidth())
        self.wheel_neg6.setSizePolicy(sizePolicy1)
        self.wheel_neg6.setMinimumSize(QSize(24, 24))
        self.wheel_neg6.setStyleSheet(u"color: white;")
        self.wheel_pos5 = QRadioButton(self.shuttle_widget)
        self.wheel_pos5.setObjectName(u"wheel_pos5")
        self.wheel_pos5.setGeometry(QRect(400, 182, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_pos5.sizePolicy().hasHeightForWidth())
        self.wheel_pos5.setSizePolicy(sizePolicy1)
        self.wheel_pos5.setMinimumSize(QSize(24, 24))
        self.wheel_pos5.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.button_2 = QCheckBox(self.shuttle_widget)
        self.button_2.setObjectName(u"button_2")
        self.button_2.setGeometry(QRect(156, 122, 24, 24))
        sizePolicy1.setHeightForWidth(self.button_2.sizePolicy().hasHeightForWidth())
        self.button_2.setSizePolicy(sizePolicy1)
        self.button_2.setMinimumSize(QSize(24, 24))
        self.button_2.setFont(font)
        self.button_2.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_neg5 = QRadioButton(self.shuttle_widget)
        self.wheel_neg5.setObjectName(u"wheel_neg5")
        self.wheel_neg5.setGeometry(QRect(178, 182, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_neg5.sizePolicy().hasHeightForWidth())
        self.wheel_neg5.setSizePolicy(sizePolicy1)
        self.wheel_neg5.setMinimumSize(QSize(24, 24))
        self.wheel_neg5.setStyleSheet(u"color: white;")
        self.wheel_pos6 = QRadioButton(self.shuttle_widget)
        self.wheel_pos6.setObjectName(u"wheel_pos6")
        self.wheel_pos6.setGeometry(QRect(416, 204, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_pos6.sizePolicy().hasHeightForWidth())
        self.wheel_pos6.setSizePolicy(sizePolicy1)
        self.wheel_pos6.setMinimumSize(QSize(24, 24))
        self.wheel_pos6.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_neg1 = QRadioButton(self.shuttle_widget)
        self.wheel_neg1.setObjectName(u"wheel_neg1")
        self.wheel_neg1.setGeometry(QRect(264, 133, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_neg1.sizePolicy().hasHeightForWidth())
        self.wheel_neg1.setSizePolicy(sizePolicy1)
        self.wheel_neg1.setMinimumSize(QSize(24, 24))
        self.wheel_neg1.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.button_4 = QCheckBox(self.shuttle_widget)
        self.button_4.setObjectName(u"button_4")
        self.button_4.setGeometry(QRect(430, 122, 24, 24))
        sizePolicy1.setHeightForWidth(self.button_4.sizePolicy().hasHeightForWidth())
        self.button_4.setSizePolicy(sizePolicy1)
        self.button_4.setMinimumSize(QSize(24, 24))
        self.button_4.setFont(font)
        self.button_4.setLayoutDirection(Qt.RightToLeft)
        self.button_4.setAutoFillBackground(False)
        self.button_4.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_pos7 = QRadioButton(self.shuttle_widget)
        self.wheel_pos7.setObjectName(u"wheel_pos7")
        self.wheel_pos7.setGeometry(QRect(427, 229, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_pos7.sizePolicy().hasHeightForWidth())
        self.wheel_pos7.setSizePolicy(sizePolicy1)
        self.wheel_pos7.setMinimumSize(QSize(24, 24))
        self.wheel_pos7.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.button_3 = QCheckBox(self.shuttle_widget)
        self.button_3.setObjectName(u"button_3")
        self.button_3.setGeometry(QRect(290, 72, 24, 24))
        sizePolicy1.setHeightForWidth(self.button_3.sizePolicy().hasHeightForWidth())
        self.button_3.setSizePolicy(sizePolicy1)
        self.button_3.setMinimumSize(QSize(24, 24))
        self.button_3.setFont(font)
        self.button_3.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.button_3.setTristate(False)
        self.wheel_neg2 = QRadioButton(self.shuttle_widget)
        self.wheel_neg2.setObjectName(u"wheel_neg2")
        self.wheel_neg2.setGeometry(QRect(240, 139, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_neg2.sizePolicy().hasHeightForWidth())
        self.wheel_neg2.setSizePolicy(sizePolicy1)
        self.wheel_neg2.setMinimumSize(QSize(24, 24))
        self.wheel_neg2.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_pos3 = QRadioButton(self.shuttle_widget)
        self.wheel_pos3.setObjectName(u"wheel_pos3")
        self.wheel_pos3.setGeometry(QRect(361, 149, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_pos3.sizePolicy().hasHeightForWidth())
        self.wheel_pos3.setSizePolicy(sizePolicy1)
        self.wheel_pos3.setMinimumSize(QSize(24, 24))
        self.wheel_pos3.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_neg3 = QRadioButton(self.shuttle_widget)
        self.wheel_neg3.setObjectName(u"wheel_neg3")
        self.wheel_neg3.setGeometry(QRect(217, 149, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_neg3.sizePolicy().hasHeightForWidth())
        self.wheel_neg3.setSizePolicy(sizePolicy1)
        self.wheel_neg3.setMinimumSize(QSize(24, 24))
        self.wheel_neg3.setStyleSheet(u"color: white;")
        self.wheel_neg4 = QRadioButton(self.shuttle_widget)
        self.wheel_neg4.setObjectName(u"wheel_neg4")
        self.wheel_neg4.setGeometry(QRect(196, 164, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_neg4.sizePolicy().hasHeightForWidth())
        self.wheel_neg4.setSizePolicy(sizePolicy1)
        self.wheel_neg4.setMinimumSize(QSize(24, 24))
        self.wheel_neg4.setStyleSheet(u"background: #000000ff;\n"
"         color: white;\n"
"        ")
        self.wheel_neg7 = QRadioButton(self.shuttle_widget)
        self.wheel_neg7.setObjectName(u"wheel_neg7")
        self.wheel_neg7.setGeometry(QRect(151, 229, 24, 24))
        sizePolicy1.setHeightForWidth(self.wheel_neg7.sizePolicy().hasHeightForWidth())
        self.wheel_neg7.setSizePolicy(sizePolicy1)
        self.wheel_neg7.setMinimumSize(QSize(24, 24))
        self.wheel_neg7.setStyleSheet(u"color: white;")
        self.dial.raise_()
        self.button_1.raise_()
        self.usb_status.raise_()
        self.button_5.raise_()
        self.wheel_pos4.raise_()
        self.wheel_cent0.raise_()
        self.wheel_pos1.raise_()
        self.wheel_pos2.raise_()
        self.wheel_neg6.raise_()
        self.wheel_pos5.raise_()
        self.button_2.raise_()
        self.wheel_neg5.raise_()
        self.wheel_pos6.raise_()
        self.wheel_neg1.raise_()
        self.button_4.raise_()
        self.wheel_pos7.raise_()
        self.button_3.raise_()
        self.wheel_neg2.raise_()
        self.wheel_pos3.raise_()
        self.wheel_neg3.raise_()
        self.wheel_neg4.raise_()
        self.wheel_neg7.raise_()

        self.main_layout.addWidget(self.shuttle_widget, 3, 2, 1, 1)

        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.about_button = QPushButton(self.main_widget)
        self.about_button.setObjectName(u"about_button")
        sizePolicy1.setHeightForWidth(self.about_button.sizePolicy().hasHeightForWidth())
        self.about_button.setSizePolicy(sizePolicy1)
        self.about_button.setMinimumSize(QSize(24, 24))
        self.about_button.setFont(font1)
        self.about_button.setCursor(QCursor(Qt.WhatsThisCursor))
        self.about_button.setCheckable(False)
        self.about_button.setFlat(True)

        self.horizontalLayout.addWidget(self.about_button)


        self.main_layout.addLayout(self.horizontalLayout, 1, 2, 1, 1)

        self.horizontalLayout_3 = QHBoxLayout()
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.plug_button = QPushButton(self.main_widget)
        self.plug_button.setObjectName(u"plug_button")
        sizePolicy1.setHeightForWidth(self.plug_button.sizePolicy().hasHeightForWidth())
        self.plug_button.setSizePolicy(sizePolicy1)
        self.plug_button.setMinimumSize(QSize(24, 24))
        self.plug_button.setFont(font1)
        self.plug_button.setCursor(QCursor(Qt.PointingHandCursor))
        self.plug_button.setCheckable(False)
        self.plug_button.setFlat(True)

        self.horizontalLayout_3.addWidget(self.plug_button)


        self.main_layout.addLayout(self.horizontalLayout_3, 3, 1, 1, 1)

        self.verticalLayout = QVBoxLayout()
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.conf_button = QPushButton(self.main_widget)
        self.conf_button.setObjectName(u"conf_button")
        sizePolicy1.setHeightForWidth(self.conf_button.sizePolicy().hasHeightForWidth())
        self.conf_button.setSizePolicy(sizePolicy1)
        self.conf_button.setMinimumSize(QSize(24, 24))
        self.conf_button.setFont(font1)
        self.conf_button.setCursor(QCursor(Qt.PointingHandCursor))
        self.conf_button.setCheckable(False)
        self.conf_button.setFlat(True)

        self.verticalLayout.addWidget(self.conf_button)


        self.main_layout.addLayout(self.verticalLayout, 3, 4, 1, 1)

        MainWindow.setCentralWidget(self.main_widget)
        self.statusbar = QStatusBar(MainWindow)
        self.statusbar.setObjectName(u"statusbar")
        self.statusbar.setMinimumSize(QSize(600, 0))
        MainWindow.setStatusBar(self.statusbar)
        self.about_widget = QDockWidget(MainWindow)
        self.about_widget.setObjectName(u"about_widget")
        self.about_widget.setEnabled(True)
        sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy3.setHorizontalStretch(0)
        sizePolicy3.setVerticalStretch(0)
        sizePolicy3.setHeightForWidth(self.about_widget.sizePolicy().hasHeightForWidth())
        self.about_widget.setSizePolicy(sizePolicy3)
        self.about_widget.setMinimumSize(QSize(600, 600))
        self.about_widget.setVisible(True)
        self.about_widget.setFloating(False)
        self.about_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetMovable)
        self.about_widget.setAllowedAreas(Qt.TopDockWidgetArea)
        self.about_layout = QWidget()
        self.about_layout.setObjectName(u"about_layout")
        sizePolicy3.setHeightForWidth(self.about_layout.sizePolicy().hasHeightForWidth())
        self.about_layout.setSizePolicy(sizePolicy3)
        self.about_layout.setAutoFillBackground(False)
        self.gridLayout_3 = QGridLayout(self.about_layout)
        self.gridLayout_3.setObjectName(u"gridLayout_3")
        self.about_text = QTextEdit(self.about_layout)
        self.about_text.setObjectName(u"about_text")
        self.about_text.setFocusPolicy(Qt.WheelFocus)
        self.about_text.setAcceptDrops(False)
        self.about_text.setStyleSheet(u"color: white;")
        self.about_text.setFrameShape(QFrame.StyledPanel)
        self.about_text.setFrameShadow(QFrame.Sunken)
        self.about_text.setUndoRedoEnabled(False)
        self.about_text.setReadOnly(True)
        self.about_text.setAcceptRichText(True)

        self.gridLayout_3.addWidget(self.about_text, 0, 0, 1, 1)

        self.about_widget.setWidget(self.about_layout)
        MainWindow.addDockWidget(Qt.TopDockWidgetArea, self.about_widget)
        self.log_widget = QDockWidget(MainWindow)
        self.log_widget.setObjectName(u"log_widget")
        self.log_widget.setEnabled(True)
        self.log_widget.setMinimumSize(QSize(550, 158))
        self.log_widget.setFont(font)
        self.log_widget.setVisible(True)
        self.log_widget.setFloating(False)
        self.log_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetMovable)
        self.log_widget.setAllowedAreas(Qt.BottomDockWidgetArea)
        self.log_layout = QWidget()
        self.log_layout.setObjectName(u"log_layout")
        sizePolicy4 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        sizePolicy4.setHorizontalStretch(0)
        sizePolicy4.setVerticalStretch(0)
        sizePolicy4.setHeightForWidth(self.log_layout.sizePolicy().hasHeightForWidth())
        self.log_layout.setSizePolicy(sizePolicy4)
        self.gridLayout_2 = QGridLayout(self.log_layout)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.log_content_layout = QVBoxLayout()
        self.log_content_layout.setObjectName(u"log_content_layout")
        self.log_content_layout.setSizeConstraint(QLayout.SetDefaultConstraint)
        self.log_text = QPlainTextEdit(self.log_layout)
        self.log_text.setObjectName(u"log_text")
        sizePolicy4.setHeightForWidth(self.log_text.sizePolicy().hasHeightForWidth())
        self.log_text.setSizePolicy(sizePolicy4)
        self.log_text.setMinimumSize(QSize(0, 0))
        self.log_text.setAcceptDrops(False)
        self.log_text.setFrameShape(QFrame.StyledPanel)
        self.log_text.setFrameShadow(QFrame.Sunken)
        self.log_text.setUndoRedoEnabled(False)
        self.log_text.setReadOnly(True)

        self.log_content_layout.addWidget(self.log_text)

        self.buttons_layout = QHBoxLayout()
        self.buttons_layout.setObjectName(u"buttons_layout")
        self.buttons_layout.setSizeConstraint(QLayout.SetDefaultConstraint)
        self.log_clear_button = QToolButton(self.log_layout)
        self.log_clear_button.setObjectName(u"log_clear_button")
        icon1 = QIcon()
        icon1.addFile(u"images/delete-sweep_24.png", QSize(), QIcon.Normal, QIcon.Off)
        self.log_clear_button.setIcon(icon1)
        self.log_clear_button.setIconSize(QSize(24, 24))

        self.buttons_layout.addWidget(self.log_clear_button)


        self.log_content_layout.addLayout(self.buttons_layout)


        self.gridLayout_2.addLayout(self.log_content_layout, 0, 0, 1, 1)

        self.log_widget.setWidget(self.log_layout)
        MainWindow.addDockWidget(Qt.BottomDockWidgetArea, self.log_widget)
        self.config_widget = QDockWidget(MainWindow)
        self.config_widget.setObjectName(u"config_widget")
        self.config_widget.setEnabled(True)
        self.config_widget.setMinimumSize(QSize(250, 600))
        self.config_widget.setFloating(False)
        self.config_widget.setFeatures(QDockWidget.DockWidgetClosable|QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetMovable)
        self.config_widget.setAllowedAreas(Qt.RightDockWidgetArea)
        self.config_layout = QWidget()
        self.config_layout.setObjectName(u"config_layout")
        self.gridLayout = QGridLayout(self.config_layout)
        self.gridLayout.setObjectName(u"gridLayout")
        self.config_content_layout = QFormLayout()
        self.config_content_layout.setObjectName(u"config_content_layout")

        self.gridLayout.addLayout(self.config_content_layout, 0, 0, 1, 1)

        self.config_widget.setWidget(self.config_layout)
        MainWindow.addDockWidget(Qt.RightDockWidgetArea, self.config_widget)
        self.plugins_widget = QDockWidget(MainWindow)
        self.plugins_widget.setObjectName(u"plugins_widget")
        self.plugins_widget.setMinimumSize(QSize(250, 600))
        self.plugins_widget.setAllowedAreas(Qt.LeftDockWidgetArea)
        self.dockWidgetContents = QWidget()
        self.dockWidgetContents.setObjectName(u"dockWidgetContents")
        self.plugins_widget.setWidget(self.dockWidgetContents)
        MainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.plugins_widget)
        self.about_widget.raise_()
        self.log_widget.raise_()

        self.retranslateUi(MainWindow)

        self.usb_status.setDefault(False)


        QMetaObject.connectSlotsByName(MainWindow)
Exemple #22
0
    def createLayout(self):
        self.box0 = QGroupBox("Timeframe")
        self.box4 = QGroupBox("Test Data")
        self.box6 = QGroupBox("Output Directory")
        self.box5 = QGroupBox("")
        self.box7 = QGroupBox("Demographic Settings")
        self.box8 = QGroupBox("Resume Layout")

        #Demographic Settings

        self.wPercent = QTextEdit("0.25")
        self.bPercent = QTextEdit("0.25")
        self.aPercent = QTextEdit("0.25")
        self.hPercent = QTextEdit("0.25")
        self.gPercent = QTextEdit("0.5")
        self.wLabel = QLabel("White %")
        self.bLabel = QLabel("Black %")
        self.aLabel = QLabel("Asian %")
        self.hLabel = QLabel("Hispanic %")
        self.gLabel = QLabel("       Gender Ratio")

        self.wPercent.setFixedSize(100, 30)
        self.bPercent.setFixedSize(100, 30)
        self.aPercent.setFixedSize(100, 30)
        self.hPercent.setFixedSize(100, 30)
        self.gPercent.setFixedSize(100, 30)

        #Resume Layout Settings

        self.testSectionLabel1 = QLabel("Test Location")
        self.testSectionLabel2 = QLabel("Section")
        self.testSectionLabel3 = QLabel("Location of Content")
        self.sectionSelect = QComboBox()
        self.sectionSelect.addItems(
            ["Address", "Education", "Work History", "Skills"])
        self.sectionSelect.setFixedSize(300, 30)

        self.modeSelect = QComboBox()
        self.modeSelect.addItems(["Before", "After", "Replace"])
        self.modeSelect.setFixedSize(300, 30)

        #Academic Year

        #First Semester
        self.monthBegin = QComboBox()
        self.monthBegin.addItems([
            "January", "February", "March", "April", "May", "June", "July",
            "August", "September", "November", "December"
        ])
        self.monthBegin.setFixedSize(100, 30)

        self.yearBeginLabel = QLabel("First Semester")
        self.yearBegin = QComboBox()
        self.yearBegin.setFixedSize(100, 30)

        for year in range(1970, 2050):
            self.yearBegin.addItem(str(year))

        #Last Semester
        self.monthEnd = QComboBox()
        self.monthEnd.addItems([
            "January", "February", "March", "April", "May", "June", "July",
            "August", "September", "November", "December"
        ])
        self.monthEnd.setFixedSize(100, 30)

        self.yearEnd = QComboBox()
        self.yearEndLabel = QLabel("Semester of Graduation")
        for year in range(1970, 2050):
            self.yearEnd.addItem(str(year))
        self.yearEnd.setFixedSize(100, 30)

        #Earliest relevant employment
        self.monthWorkBegin = QComboBox()
        self.monthWorkBegin.addItems([
            "January", "February", "March", "April", "May", "June", "July",
            "August", "September", "November", "December"
        ])
        self.monthBegin.setFixedSize(100, 30)

        self.yearWorkBeginLabel = QLabel(
            "Earliest Possible Date of Employment")
        self.yearWorkBegin = QComboBox()
        self.yearWorkBegin.setFixedSize(100, 30)

        for year in range(1970, 2050):
            self.yearWorkBegin.addItem(str(year))

        #Latest relevant employment
        self.monthWorkEnd = QComboBox()
        self.monthWorkEnd.addItems([
            "January", "February", "March", "April", "May", "June", "July",
            "August", "September", "November", "December"
        ])
        self.monthWorkEnd.setFixedSize(100, 30)

        self.yearWorkEnd = QComboBox()
        self.yearWorkEndLabel = QLabel("Latest Possible Date of Employment")
        for year in range(1970, 2050):
            self.yearWorkEnd.addItem(str(year))
        self.yearWorkEnd.setFixedSize(100, 30)

        currentYear = date.today().year
        index = currentYear - 1970
        self.yearEnd.setCurrentIndex(index)
        self.yearBegin.setCurrentIndex(index)
        self.yearWorkBegin.setCurrentIndex(index)
        self.yearWorkEnd.setCurrentIndex(index)

        #Output Directory
        self.dirLabel = QLabel("Output Directory")
        self.currentDir = QTextEdit()
        self.currentDir.setText("Not Selected")
        self.currentDir.layout()
        self.currentDir.setFixedSize(300, 30)
        self.currentDir.setReadOnly(True)
        self.outputName = QTextEdit()

        self.outputLabel = QLabel("Output Folder Name")
        self.outputName.setText("None written")
        self.outputName.setToolTip(
            "Type in the name of the new Folder you would like to make for your Resume batch. \n Otherwise, this will use the current timestamp."
        )
        self.outputName.setFixedSize(300, 30)
        #Select ouput folder button

        self.outputButton = QPushButton('Select Output Directory')
        self.outputButton.setToolTip(
            "Click here to tell the generator where to put this batch of Resumes when it is finished."
        )
        self.outputButton.clicked.connect(
            lambda: self.openDir(self.currentDir))
        self.currentTest = QTextEdit()
        self.currentTest.setText("SportsCollegeList.csv")

        #Output Directory
        self.workLabel = QLabel("Output Directory")
        self.currentWork = QTextEdit()
        self.currentWork.setText("SportsCollegeList.csv")
        self.currentWork.layout()
        self.currentWork.setFixedSize(300, 30)
        self.currentWork.setReadOnly(True)

        #Select work datafolder button
        self.workButton = QPushButton('Select Work Data (.CSV)')
        self.workButton.setToolTip(
            "Click here to select a source file for the employment information in this Resume Batch."
        )
        self.workButton.clicked.connect(lambda: self.openDir(self.currentWork))

        #Select School Data

        self.workLabel = QLabel("Output Directory")
        self.currentSchool = QTextEdit()
        self.currentSchool.setText("Not Selected")
        self.currentSchool.layout()
        self.currentSchool.setFixedSize(300, 30)
        self.currentSchool.setReadOnly(True)

        #Select work datafolder button
        self.schoolButton = QPushButton('Select Work Data (.CSV)')
        self.schoolButton.clicked.connect(
            lambda: self.openDir(self.currentWork))

        #Select test data

        self.testLabel = QLabel("Output Directory")
        self.currentTest = QTextEdit()
        self.currentTest.setText("SportsCollegeList.csv")
        self.currentTest.layout()
        self.currentTest.setFixedSize(300, 30)
        self.currentTest.setReadOnly(True)
        self.testButton = QPushButton('Select Test Data (.CSV)')
        self.testButton.clicked.connect(lambda: self.openDir(self.currentTest))

        #Generate Resumes button
        self.begin = QPushButton('Generate Resumes')
        self.begin.clicked.connect(
            lambda: self.beginTask(self.currentTest.toPlainText()))

        layout = QGridLayout()
        self.box0.setLayout(layout)
        layout.addWidget(self.yearBeginLabel, 0, 0, 1, 2)
        layout.addWidget(self.monthBegin, 1, 0, 1, 1)
        layout.addWidget(self.yearBegin, 1, 1, 1, 1)
        layout.addWidget(self.yearEndLabel, 2, 0, 1, 2)
        layout.addWidget(self.monthEnd, 3, 0, 1, 1)
        layout.addWidget(self.yearEnd, 3, 1, 1, 1)

        layout.addWidget(self.yearWorkBeginLabel, 4, 0, 1, 2)
        layout.addWidget(self.monthWorkBegin, 5, 0, 1, 1)
        layout.addWidget(self.yearWorkBegin, 5, 1, 1, 1)
        layout.addWidget(self.yearWorkEndLabel, 6, 0, 1, 2)
        layout.addWidget(self.monthWorkEnd, 7, 0, 1, 1)
        layout.addWidget(self.yearWorkEnd, 7, 1, 1, 1)

        layout1 = QGridLayout()
        self.box8.setLayout(layout1)
        layout1.addWidget(self.testSectionLabel1, 0, 0, 1, 1)
        layout1.addWidget(self.testSectionLabel3, 1, 0, 1, 1)
        layout1.addWidget(self.sectionSelect, 0, 1, 1, 1)
        layout1.addWidget(self.modeSelect, 1, 1, 1, 1)

        layout2 = QGridLayout()
        self.box7.setLayout(layout2)
        layout2.addWidget(self.wLabel, 0, 0, 1, 1)
        layout2.addWidget(self.bLabel, 1, 0, 1, 1)
        layout2.addWidget(self.hLabel, 0, 2, 1, 1)
        layout2.addWidget(self.aLabel, 2, 0, 1, 1)
        layout2.addWidget(self.wPercent, 0, 1, 1, 1)
        layout2.addWidget(self.bPercent, 1, 1, 1, 1)
        layout2.addWidget(self.hPercent, 0, 3, 1, 1)
        layout2.addWidget(self.aPercent, 2, 1, 1, 1)
        layout2.addWidget(self.gLabel, 3, 1, 1, 1)
        layout2.addWidget(self.gPercent, 3, 2, 1, 2)

        layout = QGridLayout()
        self.box5.setLayout(layout)
        layout.addWidget(self.begin, 0, 0, 1, 2)

        layout3 = QGridLayout()
        layout3.addWidget(self.testButton, 0, 0, 1, 2)
        layout3.addWidget(self.currentTest, 1, 0, 1, 2)
        self.box4.setLayout(layout3)

        layout4 = QGridLayout()

        layout4.addWidget(self.outputButton, 0, 0, 1, 2)
        layout4.addWidget(self.currentDir, 1, 0, 1, 2)
        layout4.addWidget(self.outputLabel, 2, 0, 1, 2)
        layout4.addWidget(self.outputName, 3, 0, 1, 2)
        self.box6.setLayout(layout4)
    def __init__(self, parent: QWidget, model: Model) -> None:
        super().__init__(parent)

        logger.add(self.log)

        settings = QSettings()
        self.mainlayout = QVBoxLayout()
        self.mainlayout.setContentsMargins(5, 5, 5, 5)
        self.setLayout(self.mainlayout)

        # summary

        summarylayout = FlowLayout()
        summarylayout.setContentsMargins(0, 0, 0, 0)
        self.summary = QWidget()
        self.summary.setLayout(summarylayout)
        self.mainlayout.addWidget(self.summary)
        self.summary.setVisible(
            settings.value('showSummary', 'True') == 'True')

        detailslayout = QHBoxLayout()
        detailslayout.setContentsMargins(1, 0, 0, 0)
        detailslayout.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
        detailslayout.setSpacing(15)
        details = QWidget()
        details.setLayout(detailslayout)
        summarylayout.addWidget(details)

        self.modstotal = QLabel()
        detailslayout.addWidget(self.modstotal)
        self.modsenabled = QLabel()
        detailslayout.addWidget(self.modsenabled)
        self.overridden = QLabel()
        detailslayout.addWidget(self.overridden)
        self.conflicts = QLabel()
        detailslayout.addWidget(self.conflicts)

        buttonslayout = QHBoxLayout()
        buttonslayout.setContentsMargins(0, 0, 0, 0)
        buttonslayout.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
        buttons = QWidget()
        buttons.setLayout(buttonslayout)
        summarylayout.addWidget(buttons)

        self.startscriptmerger = QPushButton('Start Script Merger')
        self.startscriptmerger.setContentsMargins(0, 0, 0, 0)
        self.startscriptmerger.setMinimumWidth(140)
        self.startscriptmerger.setIcon(
            QIcon(str(getRuntimePath('resources/icons/script.ico'))))
        self.startscriptmerger.clicked.connect(lambda: [
            openExecutable(Path(str(settings.value('scriptMergerPath'))), True)
        ])
        self.startscriptmerger.setEnabled(
            verifyScriptMergerPath(
                Path(str(settings.value('scriptMergerPath')))) is not None)
        buttonslayout.addWidget(self.startscriptmerger)

        self.startgame = QPushButton('Start Game')
        self.startgame.setContentsMargins(0, 0, 0, 0)
        self.startgame.setMinimumWidth(100)
        self.startgame.setIcon(
            QIcon(str(getRuntimePath('resources/icons/w3b.ico'))))
        buttonslayout.addWidget(self.startgame)

        # splitter

        self.splitter = QSplitter(Qt.Vertical)

        self.stack = QStackedWidget()
        self.splitter.addWidget(self.stack)

        # mod list widget

        self.modlistwidget = QWidget()
        self.modlistlayout = QVBoxLayout()
        self.modlistlayout.setContentsMargins(0, 0, 0, 0)
        self.modlistwidget.setLayout(self.modlistlayout)
        self.stack.addWidget(self.modlistwidget)

        # search bar

        self.searchbar = QLineEdit()
        self.searchbar.setPlaceholderText('Search...')
        self.modlistlayout.addWidget(self.searchbar)

        # mod list

        self.modlist = ModList(self, model)
        self.modlistlayout.addWidget(self.modlist)

        self.searchbar.textChanged.connect(lambda e: self.modlist.setFilter(e))

        # welcome message

        welcomelayout = QVBoxLayout()
        welcomelayout.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        welcomewidget = QWidget()
        welcomewidget.setLayout(welcomelayout)
        welcomewidget.dragEnterEvent = self.modlist.dragEnterEvent  # type: ignore
        welcomewidget.dragMoveEvent = self.modlist.dragMoveEvent  # type: ignore
        welcomewidget.dragLeaveEvent = self.modlist.dragLeaveEvent  # type: ignore
        welcomewidget.dropEvent = self.modlist.dropEvent  # type: ignore
        welcomewidget.setAcceptDrops(True)

        icon = QIcon(str(getRuntimePath('resources/icons/open-folder.ico')))
        iconpixmap = icon.pixmap(32, 32)
        icon = QLabel()
        icon.setPixmap(iconpixmap)
        icon.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        icon.setContentsMargins(4, 4, 4, 4)
        welcomelayout.addWidget(icon)

        welcome = QLabel('''<p><font>
            No mod installed yet.
            Drag a mod into this area to get started!
            </font></p>''')
        welcome.setAttribute(Qt.WA_TransparentForMouseEvents)
        welcome.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        welcomelayout.addWidget(welcome)

        self.stack.addWidget(welcomewidget)

        # output log

        self.output = QTextEdit(self)
        self.output.setTextInteractionFlags(Qt.NoTextInteraction)
        self.output.setReadOnly(True)
        self.output.setContextMenuPolicy(Qt.NoContextMenu)
        self.output.setPlaceholderText('Program output...')
        self.splitter.addWidget(self.output)

        # TODO: enhancement: show indicator if scripts have to be merged

        self.splitter.setStretchFactor(0, 1)
        self.splitter.setStretchFactor(1, 0)
        self.mainlayout.addWidget(self.splitter)

        # TODO: incomplete: make start game button functional

        if len(model):
            self.stack.setCurrentIndex(0)
            self.splitter.setSizes([self.splitter.size().height(), 50])
        else:
            self.stack.setCurrentIndex(1)
            self.splitter.setSizes([self.splitter.size().height(), 0])
        model.updateCallbacks.append(self.modelUpdateEvent)

        asyncio.create_task(model.loadInstalled())
Exemple #24
0
    def setupUi(self, EditRenderPreset_UI):
        if not EditRenderPreset_UI.objectName():
            EditRenderPreset_UI.setObjectName(u"EditRenderPreset_UI")
        EditRenderPreset_UI.resize(463, 630)
        self.verticalLayout_2 = QVBoxLayout(EditRenderPreset_UI)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.mainBox = QHBoxLayout()
        self.mainBox.setObjectName(u"mainBox")
        self.formLayout_6 = QFormLayout()
        self.formLayout_6.setObjectName(u"formLayout_6")
        self.formLayout_6.setContentsMargins(-1, 20, 10, -1)
        self.groupLabel = QLabel(EditRenderPreset_UI)
        self.groupLabel.setObjectName(u"groupLabel")

        self.formLayout_6.setWidget(0, QFormLayout.LabelRole, self.groupLabel)

        self.presetNameLabel = QLabel(EditRenderPreset_UI)
        self.presetNameLabel.setObjectName(u"presetNameLabel")

        self.formLayout_6.setWidget(1, QFormLayout.LabelRole,
                                    self.presetNameLabel)

        self.preset_name = QLineEdit(EditRenderPreset_UI)
        self.preset_name.setObjectName(u"preset_name")

        self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.preset_name)

        self.label_2 = QLabel(EditRenderPreset_UI)
        self.label_2.setObjectName(u"label_2")

        self.formLayout_6.setWidget(2, QFormLayout.LabelRole, self.label_2)

        self.formatCombo = QComboBox(EditRenderPreset_UI)
        self.formatCombo.setObjectName(u"formatCombo")

        self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.formatCombo)

        self.tabWidget = QTabWidget(EditRenderPreset_UI)
        self.tabWidget.setObjectName(u"tabWidget")
        self.video_tab = QWidget()
        self.video_tab.setObjectName(u"video_tab")
        self.verticalLayout_3 = QVBoxLayout(self.video_tab)
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.scrollArea = QScrollArea(self.video_tab)
        self.scrollArea.setObjectName(u"scrollArea")
        sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding,
                                 QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.scrollArea.sizePolicy().hasHeightForWidth())
        self.scrollArea.setSizePolicy(sizePolicy)
        self.scrollArea.setFrameShape(QFrame.NoFrame)
        self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.scrollAreaWidgetContents = QWidget()
        self.scrollAreaWidgetContents.setObjectName(
            u"scrollAreaWidgetContents")
        self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 428, 650))
        self.formLayout_3 = QFormLayout(self.scrollAreaWidgetContents)
        self.formLayout_3.setObjectName(u"formLayout_3")
        self.formLayout_3.setContentsMargins(-1, -1, 40, -1)
        self.label_4 = QLabel(self.scrollAreaWidgetContents)
        self.label_4.setObjectName(u"label_4")

        self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4)

        self.horizontalLayout_3 = QHBoxLayout()
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.resWidth = QSpinBox(self.scrollAreaWidgetContents)
        self.resWidth.setObjectName(u"resWidth")
        self.resWidth.setMinimum(1)
        self.resWidth.setMaximum(8192)
        self.resWidth.setSingleStep(2)
        self.resWidth.setValue(1)

        self.horizontalLayout_3.addWidget(self.resWidth)

        self.label_9 = QLabel(self.scrollAreaWidgetContents)
        self.label_9.setObjectName(u"label_9")
        self.label_9.setMinimumSize(QSize(10, 0))
        self.label_9.setText(u"x")
        self.label_9.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_3.addWidget(self.label_9)

        self.resHeight = QSpinBox(self.scrollAreaWidgetContents)
        self.resHeight.setObjectName(u"resHeight")
        self.resHeight.setMinimum(1)
        self.resHeight.setMaximum(8192)
        self.resHeight.setSingleStep(2)

        self.horizontalLayout_3.addWidget(self.resHeight)

        self.linkResoultion = QToolButton(self.scrollAreaWidgetContents)
        self.linkResoultion.setObjectName(u"linkResoultion")
        icon = QIcon()
        iconThemeName = u"link"
        if QIcon.hasThemeIcon(iconThemeName):
            icon = QIcon.fromTheme(iconThemeName)
        else:
            icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off)

        self.linkResoultion.setIcon(icon)
        self.linkResoultion.setCheckable(True)
        self.linkResoultion.setAutoRaise(True)

        self.horizontalLayout_3.addWidget(self.linkResoultion)

        self.formLayout_3.setLayout(0, QFormLayout.FieldRole,
                                    self.horizontalLayout_3)

        self.label_6 = QLabel(self.scrollAreaWidgetContents)
        self.label_6.setObjectName(u"label_6")

        self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_6)

        self.parCombo = QComboBox(self.scrollAreaWidgetContents)
        self.parCombo.setObjectName(u"parCombo")
        self.parCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents)

        self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.parCombo)

        self.label_16 = QLabel(self.scrollAreaWidgetContents)
        self.label_16.setObjectName(u"label_16")

        self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_16)

        self.horizontalLayout_4 = QHBoxLayout()
        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
        self.displayAspectNum = QSpinBox(self.scrollAreaWidgetContents)
        self.displayAspectNum.setObjectName(u"displayAspectNum")
        self.displayAspectNum.setMinimum(1)
        self.displayAspectNum.setMaximum(8192)

        self.horizontalLayout_4.addWidget(self.displayAspectNum)

        self.label_17 = QLabel(self.scrollAreaWidgetContents)
        self.label_17.setObjectName(u"label_17")
        self.label_17.setMinimumSize(QSize(10, 0))
        self.label_17.setText(u":")
        self.label_17.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_4.addWidget(self.label_17)

        self.displayAspectDen = QSpinBox(self.scrollAreaWidgetContents)
        self.displayAspectDen.setObjectName(u"displayAspectDen")
        self.displayAspectDen.setMinimum(1)
        self.displayAspectDen.setMaximum(8192)

        self.horizontalLayout_4.addWidget(self.displayAspectDen)

        self.formLayout_3.setLayout(2, QFormLayout.FieldRole,
                                    self.horizontalLayout_4)

        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.framerateNum = QSpinBox(self.scrollAreaWidgetContents)
        self.framerateNum.setObjectName(u"framerateNum")
        self.framerateNum.setMinimum(1)
        self.framerateNum.setMaximum(1000000)

        self.horizontalLayout.addWidget(self.framerateNum)

        self.label_8 = QLabel(self.scrollAreaWidgetContents)
        self.label_8.setObjectName(u"label_8")
        sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.label_8.sizePolicy().hasHeightForWidth())
        self.label_8.setSizePolicy(sizePolicy1)
        self.label_8.setMinimumSize(QSize(10, 0))
        self.label_8.setText(u"/")
        self.label_8.setAlignment(Qt.AlignCenter)

        self.horizontalLayout.addWidget(self.label_8)

        self.framerateDen = QSpinBox(self.scrollAreaWidgetContents)
        self.framerateDen.setObjectName(u"framerateDen")
        self.framerateDen.setMinimum(1)
        self.framerateDen.setMaximum(9999)

        self.horizontalLayout.addWidget(self.framerateDen)

        self.formLayout_3.setLayout(3, QFormLayout.FieldRole,
                                    self.horizontalLayout)

        self.label_3 = QLabel(self.scrollAreaWidgetContents)
        self.label_3.setObjectName(u"label_3")

        self.formLayout_3.setWidget(3, QFormLayout.LabelRole, self.label_3)

        self.label_22 = QLabel(self.scrollAreaWidgetContents)
        self.label_22.setObjectName(u"label_22")

        self.formLayout_3.setWidget(4, QFormLayout.LabelRole, self.label_22)

        self.frameRateDisplay = QLabel(self.scrollAreaWidgetContents)
        self.frameRateDisplay.setObjectName(u"frameRateDisplay")
        self.frameRateDisplay.setEnabled(True)

        self.formLayout_3.setWidget(4, QFormLayout.FieldRole,
                                    self.frameRateDisplay)

        self.label_7 = QLabel(self.scrollAreaWidgetContents)
        self.label_7.setObjectName(u"label_7")

        self.formLayout_3.setWidget(5, QFormLayout.LabelRole, self.label_7)

        self.scanningCombo = QComboBox(self.scrollAreaWidgetContents)
        self.scanningCombo.addItem("")
        self.scanningCombo.addItem("")
        self.scanningCombo.setObjectName(u"scanningCombo")

        self.formLayout_3.setWidget(5, QFormLayout.FieldRole,
                                    self.scanningCombo)

        self.fieldOrderLabel = QLabel(self.scrollAreaWidgetContents)
        self.fieldOrderLabel.setObjectName(u"fieldOrderLabel")

        self.formLayout_3.setWidget(6, QFormLayout.LabelRole,
                                    self.fieldOrderLabel)

        self.fieldOrderCombo = QComboBox(self.scrollAreaWidgetContents)
        self.fieldOrderCombo.addItem("")
        self.fieldOrderCombo.addItem("")
        self.fieldOrderCombo.setObjectName(u"fieldOrderCombo")
        self.fieldOrderCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents)

        self.formLayout_3.setWidget(6, QFormLayout.FieldRole,
                                    self.fieldOrderCombo)

        self.colorspaceLabel = QLabel(self.scrollAreaWidgetContents)
        self.colorspaceLabel.setObjectName(u"colorspaceLabel")
        self.colorspaceLabel.setEnabled(False)

        self.formLayout_3.setWidget(7, QFormLayout.LabelRole,
                                    self.colorspaceLabel)

        self.colorspaceCombo = QComboBox(self.scrollAreaWidgetContents)
        self.colorspaceCombo.setObjectName(u"colorspaceCombo")
        self.colorspaceCombo.setEnabled(False)

        self.formLayout_3.setWidget(7, QFormLayout.FieldRole,
                                    self.colorspaceCombo)

        self.vCodecCombo = QComboBox(self.scrollAreaWidgetContents)
        self.vCodecCombo.setObjectName(u"vCodecCombo")
        sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding,
                                  QSizePolicy.Fixed)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(
            self.vCodecCombo.sizePolicy().hasHeightForWidth())
        self.vCodecCombo.setSizePolicy(sizePolicy2)

        self.formLayout_3.setWidget(8, QFormLayout.FieldRole, self.vCodecCombo)

        self.vRateControlCombo = QComboBox(self.scrollAreaWidgetContents)
        self.vRateControlCombo.setObjectName(u"vRateControlCombo")
        sizePolicy2.setHeightForWidth(
            self.vRateControlCombo.sizePolicy().hasHeightForWidth())
        self.vRateControlCombo.setSizePolicy(sizePolicy2)

        self.formLayout_3.setWidget(9, QFormLayout.FieldRole,
                                    self.vRateControlCombo)

        self.label_24 = QLabel(self.scrollAreaWidgetContents)
        self.label_24.setObjectName(u"label_24")

        self.formLayout_3.setWidget(8, QFormLayout.LabelRole, self.label_24)

        self.label_12 = QLabel(self.scrollAreaWidgetContents)
        self.label_12.setObjectName(u"label_12")

        self.formLayout_3.setWidget(9, QFormLayout.LabelRole, self.label_12)

        self.default_vbitrate_label = QLabel(self.scrollAreaWidgetContents)
        self.default_vbitrate_label.setObjectName(u"default_vbitrate_label")

        self.formLayout_3.setWidget(10, QFormLayout.LabelRole,
                                    self.default_vbitrate_label)

        self.default_vbitrate = QSpinBox(self.scrollAreaWidgetContents)
        self.default_vbitrate.setObjectName(u"default_vbitrate")
        self.default_vbitrate.setMaximum(500000)

        self.formLayout_3.setWidget(10, QFormLayout.FieldRole,
                                    self.default_vbitrate)

        self.vBuffer_label = QLabel(self.scrollAreaWidgetContents)
        self.vBuffer_label.setObjectName(u"vBuffer_label")

        self.formLayout_3.setWidget(11, QFormLayout.LabelRole,
                                    self.vBuffer_label)

        self.vBuffer = QSpinBox(self.scrollAreaWidgetContents)
        self.vBuffer.setObjectName(u"vBuffer")
        self.vBuffer.setMaximum(9999)

        self.formLayout_3.setWidget(11, QFormLayout.FieldRole, self.vBuffer)

        self.vquality_label = QLabel(self.scrollAreaWidgetContents)
        self.vquality_label.setObjectName(u"vquality_label")

        self.formLayout_3.setWidget(12, QFormLayout.LabelRole,
                                    self.vquality_label)

        self.default_vquality = QSpinBox(self.scrollAreaWidgetContents)
        self.default_vquality.setObjectName(u"default_vquality")
        self.default_vquality.setMaximum(500000)

        self.formLayout_3.setWidget(12, QFormLayout.FieldRole,
                                    self.default_vquality)

        self.label_26 = QLabel(self.scrollAreaWidgetContents)
        self.label_26.setObjectName(u"label_26")

        self.formLayout_3.setWidget(13, QFormLayout.LabelRole, self.label_26)

        self.gopSpinner = QSpinBox(self.scrollAreaWidgetContents)
        self.gopSpinner.setObjectName(u"gopSpinner")
        self.gopSpinner.setMaximum(999)
        self.gopSpinner.setSingleStep(1)

        self.formLayout_3.setWidget(13, QFormLayout.FieldRole, self.gopSpinner)

        self.fixedGop = QCheckBox(self.scrollAreaWidgetContents)
        self.fixedGop.setObjectName(u"fixedGop")
        self.fixedGop.setEnabled(False)

        self.formLayout_3.setWidget(14, QFormLayout.FieldRole, self.fixedGop)

        self.bFramesSpinner = QSpinBox(self.scrollAreaWidgetContents)
        self.bFramesSpinner.setObjectName(u"bFramesSpinner")
        self.bFramesSpinner.setEnabled(False)
        self.bFramesSpinner.setMinimum(-1)
        self.bFramesSpinner.setMaximum(8)
        self.bFramesSpinner.setValue(-1)

        self.formLayout_3.setWidget(15, QFormLayout.FieldRole,
                                    self.bFramesSpinner)

        self.bFramesLabel = QLabel(self.scrollAreaWidgetContents)
        self.bFramesLabel.setObjectName(u"bFramesLabel")

        self.formLayout_3.setWidget(15, QFormLayout.LabelRole,
                                    self.bFramesLabel)

        self.scrollArea.setWidget(self.scrollAreaWidgetContents)

        self.verticalLayout_3.addWidget(self.scrollArea)

        self.tabWidget.addTab(self.video_tab, "")
        self.audio_tab = QWidget()
        self.audio_tab.setObjectName(u"audio_tab")
        self.formLayout_2 = QFormLayout(self.audio_tab)
        self.formLayout_2.setObjectName(u"formLayout_2")
        self.label_15 = QLabel(self.audio_tab)
        self.label_15.setObjectName(u"label_15")

        self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label_15)

        self.audioChannels = QComboBox(self.audio_tab)
        self.audioChannels.setObjectName(u"audioChannels")

        self.formLayout_2.setWidget(0, QFormLayout.FieldRole,
                                    self.audioChannels)

        self.label_13 = QLabel(self.audio_tab)
        self.label_13.setObjectName(u"label_13")

        self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_13)

        self.aCodecCombo = QComboBox(self.audio_tab)
        self.aCodecCombo.setObjectName(u"aCodecCombo")

        self.formLayout_2.setWidget(1, QFormLayout.FieldRole, self.aCodecCombo)

        self.label_11 = QLabel(self.audio_tab)
        self.label_11.setObjectName(u"label_11")

        self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_11)

        self.horizontalLayout_5 = QHBoxLayout()
        self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
        self.audioSampleRate = QComboBox(self.audio_tab)
        self.audioSampleRate.addItem("")
        self.audioSampleRate.addItem("")
        self.audioSampleRate.addItem("")
        self.audioSampleRate.addItem("")
        self.audioSampleRate.addItem("")
        self.audioSampleRate.addItem("")
        self.audioSampleRate.addItem("")
        self.audioSampleRate.addItem("")
        self.audioSampleRate.setObjectName(u"audioSampleRate")
        self.audioSampleRate.setEditable(True)

        self.horizontalLayout_5.addWidget(self.audioSampleRate)

        self.label_20 = QLabel(self.audio_tab)
        self.label_20.setObjectName(u"label_20")

        self.horizontalLayout_5.addWidget(self.label_20)

        self.formLayout_2.setLayout(2, QFormLayout.FieldRole,
                                    self.horizontalLayout_5)

        self.label_14 = QLabel(self.audio_tab)
        self.label_14.setObjectName(u"label_14")

        self.formLayout_2.setWidget(3, QFormLayout.LabelRole, self.label_14)

        self.aRateControlCombo = QComboBox(self.audio_tab)
        self.aRateControlCombo.setObjectName(u"aRateControlCombo")

        self.formLayout_2.setWidget(3, QFormLayout.FieldRole,
                                    self.aRateControlCombo)

        self.label_18 = QLabel(self.audio_tab)
        self.label_18.setObjectName(u"label_18")

        self.formLayout_2.setWidget(4, QFormLayout.LabelRole, self.label_18)

        self.aBitrate = QSpinBox(self.audio_tab)
        self.aBitrate.setObjectName(u"aBitrate")
        self.aBitrate.setMaximum(500000)

        self.formLayout_2.setWidget(4, QFormLayout.FieldRole, self.aBitrate)

        self.label_19 = QLabel(self.audio_tab)
        self.label_19.setObjectName(u"label_19")

        self.formLayout_2.setWidget(5, QFormLayout.LabelRole, self.label_19)

        self.aQuality = QSpinBox(self.audio_tab)
        self.aQuality.setObjectName(u"aQuality")
        self.aQuality.setMaximum(500000)

        self.formLayout_2.setWidget(5, QFormLayout.FieldRole, self.aQuality)

        self.tabWidget.addTab(self.audio_tab, "")
        self.tab = QWidget()
        self.tab.setObjectName(u"tab")
        self.verticalLayout = QVBoxLayout(self.tab)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.speedsLabel = QLabel(self.tab)
        self.speedsLabel.setObjectName(u"speedsLabel")

        self.verticalLayout.addWidget(self.speedsLabel)

        self.speeds_list = QTextEdit(self.tab)
        self.speeds_list.setObjectName(u"speeds_list")
        self.speeds_list.setAcceptRichText(False)

        self.verticalLayout.addWidget(self.speeds_list)

        self.label = QLabel(self.tab)
        self.label.setObjectName(u"label")

        self.verticalLayout.addWidget(self.label)

        self.overrideParamsWarning = KMessageWidget(self.tab)
        self.overrideParamsWarning.setObjectName(u"overrideParamsWarning")
        self.overrideParamsWarning.setProperty("wordWrap", True)
        self.overrideParamsWarning.setProperty("closeButtonVisible", False)

        self.verticalLayout.addWidget(self.overrideParamsWarning)

        self.additionalParams = QPlainTextEdit(self.tab)
        self.additionalParams.setObjectName(u"additionalParams")

        self.verticalLayout.addWidget(self.additionalParams)

        self.parametersLabel = QLabel(self.tab)
        self.parametersLabel.setObjectName(u"parametersLabel")
        self.parametersLabel.setTextFormat(Qt.RichText)
        self.parametersLabel.setWordWrap(True)
        self.parametersLabel.setOpenExternalLinks(True)

        self.verticalLayout.addWidget(self.parametersLabel)

        self.tabWidget.addTab(self.tab, "")

        self.formLayout_6.setWidget(4, QFormLayout.SpanningRole,
                                    self.tabWidget)

        self.parameters = QTextEdit(EditRenderPreset_UI)
        self.parameters.setObjectName(u"parameters")
        self.parameters.setReadOnly(True)
        self.parameters.setAcceptRichText(False)

        self.formLayout_6.setWidget(5, QFormLayout.SpanningRole,
                                    self.parameters)

        self.groupName = QComboBox(EditRenderPreset_UI)
        self.groupName.setObjectName(u"groupName")
        sizePolicy2.setHeightForWidth(
            self.groupName.sizePolicy().hasHeightForWidth())
        self.groupName.setSizePolicy(sizePolicy2)
        self.groupName.setEditable(True)
        self.groupName.setSizeAdjustPolicy(QComboBox.AdjustToContents)

        self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.groupName)

        self.mainBox.addLayout(self.formLayout_6)

        self.verticalLayout_2.addLayout(self.mainBox)

        self.buttonBox = QDialogButtonBox(EditRenderPreset_UI)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                          | QDialogButtonBox.Ok)

        self.verticalLayout_2.addWidget(self.buttonBox)

        self.retranslateUi(EditRenderPreset_UI)
        self.buttonBox.rejected.connect(EditRenderPreset_UI.reject)

        self.tabWidget.setCurrentIndex(0)

        QMetaObject.connectSlotsByName(EditRenderPreset_UI)
Exemple #25
0
    def __init__(self, persepolis_setting):
        super().__init__()

        self.persepolis_setting = persepolis_setting

        # add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        # set ui direction
        ui_direction = self.persepolis_setting.value('ui_direction')

        if ui_direction == 'rtl':
            self.setLayoutDirection(Qt.RightToLeft)

        elif ui_direction in 'ltr':
            self.setLayoutDirection(Qt.LeftToRight)

        icons = ':/' + \
            str(self.persepolis_setting.value('settings/icons')) + '/'

        # finding windows_size
        self.setMinimumSize(QtCore.QSize(620, 300))
        self.setWindowIcon(
            QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))

        verticalLayout = QVBoxLayout(self)
        horizontalLayout = QHBoxLayout()
        horizontalLayout.addStretch(1)

        # text_edit
        self.text_edit = QTextEdit(self)
        self.text_edit.setReadOnly(True)

        verticalLayout.addWidget(self.text_edit)

        # clear_log_pushButton
        self.clear_log_pushButton = QPushButton(self)
        horizontalLayout.addWidget(self.clear_log_pushButton)

        # refresh_log_pushButton
        self.refresh_log_pushButton = QPushButton(self)
        self.refresh_log_pushButton.setIcon(QIcon(icons + 'refresh'))
        horizontalLayout.addWidget(self.refresh_log_pushButton)

        # report_pushButton
        self.report_pushButton = QPushButton(self)
        self.report_pushButton.setIcon(QIcon(icons + 'about'))
        horizontalLayout.addWidget(self.report_pushButton)

        self.copy_log_pushButton = QPushButton(self)

        # copy_log_pushButton
        self.copy_log_pushButton.setIcon(QIcon(icons + 'clipboard'))
        horizontalLayout.addWidget(self.copy_log_pushButton)

        # close_pushButton
        self.close_pushButton = QPushButton(self)
        self.close_pushButton.setIcon(QIcon(icons + 'remove'))
        horizontalLayout.addWidget(self.close_pushButton)

        verticalLayout.addLayout(horizontalLayout)

        # set labels

        self.setWindowTitle(
            QCoreApplication.translate("log_window_ui_tr", 'Persepolis Log'))
        self.close_pushButton.setText(
            QCoreApplication.translate("log_window_ui_tr", 'Close'))
        self.copy_log_pushButton.setText(
            QCoreApplication.translate("log_window_ui_tr",
                                       'Copy Selected to Clipboard'))
        self.report_pushButton.setText(
            QCoreApplication.translate("log_window_ui_tr", "Report Issue"))
        self.refresh_log_pushButton.setText(
            QCoreApplication.translate("log_window_ui_tr",
                                       'Refresh Log Messages'))
        self.clear_log_pushButton.setText(
            QCoreApplication.translate("log_window_ui_tr",
                                       'Clear Log Messages'))
Exemple #26
0
    def setupUi(self, Dialog):
        if not Dialog.objectName():
            Dialog.setObjectName(u"Dialog")
        Dialog.resize(1136, 733)
        self.formLayout = QFormLayout(Dialog)
        self.formLayout.setObjectName(u"formLayout")
        self.tableWidget = QTableWidget(Dialog)
        if (self.tableWidget.columnCount() < 4):
            self.tableWidget.setColumnCount(4)
        __qtablewidgetitem = QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(0, __qtablewidgetitem)
        __qtablewidgetitem1 = QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(1, __qtablewidgetitem1)
        __qtablewidgetitem2 = QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(2, __qtablewidgetitem2)
        __qtablewidgetitem3 = QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(3, __qtablewidgetitem3)
        self.tableWidget.setObjectName(u"tableWidget")
        self.tableWidget.setMinimumSize(QSize(0, 450))
        self.tableWidget.verticalHeader().setVisible(False)

        self.formLayout.setWidget(1, QFormLayout.SpanningRole, self.tableWidget)

        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.textEdit = QTextEdit(Dialog)
        self.textEdit.setObjectName(u"textEdit")
        self.textEdit.setReadOnly(True)

        self.horizontalLayout.addWidget(self.textEdit)

        self.verticalLayout = QVBoxLayout()
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.pushButton = QPushButton(Dialog)
        self.pushButton.setObjectName(u"pushButton")
        sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())
        self.pushButton.setSizePolicy(sizePolicy)
        self.pushButton.setCursor(QCursor(Qt.PointingHandCursor))

        self.verticalLayout.addWidget(self.pushButton)

        self.pushButton_2 = QPushButton(Dialog)
        self.pushButton_2.setObjectName(u"pushButton_2")
        sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth())
        self.pushButton_2.setSizePolicy(sizePolicy)
        self.pushButton_2.setCursor(QCursor(Qt.PointingHandCursor))

        self.verticalLayout.addWidget(self.pushButton_2)


        self.horizontalLayout.addLayout(self.verticalLayout)


        self.formLayout.setLayout(0, QFormLayout.SpanningRole, self.horizontalLayout)

        self.buttonBox = QDialogButtonBox(Dialog)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Ok)

        self.formLayout.setWidget(2, QFormLayout.FieldRole, self.buttonBox)


        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)

        QMetaObject.connectSlotsByName(Dialog)
Exemple #27
0
    def __init__(self, persepolis_setting):
        super().__init__()

        self.persepolis_setting = persepolis_setting

        # add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        # set ui direction
        ui_direction = self.persepolis_setting.value('ui_direction')

        if ui_direction == 'rtl':
            self.setLayoutDirection(Qt.RightToLeft)

        elif ui_direction in 'ltr':
            self.setLayoutDirection(Qt.LeftToRight)

        icons = ':/' + \
            str(self.persepolis_setting.value('settings/icons')) + '/'

        self.setMinimumSize(QSize(545, 375))
        self.setWindowIcon(QIcon.fromTheme('persepolis', QIcon(':/persepolis.svg')))

        verticalLayout = QVBoxLayout(self)

        self.about_tabWidget = QTabWidget(self)

        # about tab
        self.about_tab = QWidget(self)

        about_tab_horizontalLayout = QHBoxLayout(self.about_tab)

        about_tab_verticalLayout = QVBoxLayout()

        # persepolis icon
        if qtsvg_available:
            persepolis_icon_verticalLayout = QVBoxLayout()
            self.persepolis_icon = QtSvgWidget.QSvgWidget(':/persepolis.svg')
            self.persepolis_icon.setFixedSize(QSize(64, 64))

            persepolis_icon_verticalLayout.addWidget(self.persepolis_icon)
            persepolis_icon_verticalLayout.addStretch(1)

            about_tab_horizontalLayout.addLayout(persepolis_icon_verticalLayout)

        self.title_label = QLabel(self.about_tab)
        font = QFont()
        font.setBold(True)
        font.setWeight(QFont.Weight.Bold)
        self.title_label.setFont(font)
        self.title_label.setAlignment(Qt.AlignCenter)
        about_tab_verticalLayout.addWidget(self.title_label)

        self.version_label = QLabel(self.about_tab)
        self.version_label.setAlignment(Qt.AlignCenter)

        about_tab_verticalLayout.addWidget(self.version_label)

        self.site2_label = QLabel(self.about_tab)
        self.site2_label.setTextFormat(Qt.RichText)
        self.site2_label.setAlignment(Qt.AlignCenter)
        self.site2_label.setOpenExternalLinks(True)
        self.site2_label.setTextInteractionFlags(
            Qt.TextBrowserInteraction)
        about_tab_verticalLayout.addWidget(self.site2_label)

        self.telegram_label = QLabel(self.about_tab)
        self.telegram_label.setTextFormat(Qt.RichText)
        self.telegram_label.setAlignment(Qt.AlignCenter)
        self.telegram_label.setOpenExternalLinks(True)
        self.telegram_label.setTextInteractionFlags(
            Qt.TextBrowserInteraction)
        about_tab_verticalLayout.addWidget(self.telegram_label)

        self.twitter_label = QLabel(self.about_tab)
        self.twitter_label.setTextFormat(Qt.RichText)
        self.twitter_label.setAlignment(Qt.AlignCenter)
        self.twitter_label.setOpenExternalLinks(True)
        self.twitter_label.setTextInteractionFlags(
            Qt.TextBrowserInteraction)
        about_tab_verticalLayout.addWidget(self.twitter_label)

        about_tab_verticalLayout.addStretch(1)

        about_tab_horizontalLayout.addLayout(about_tab_verticalLayout)

        # developers_tab
        # developers
        self.developers_tab = QWidget(self)
        developers_verticalLayout = QVBoxLayout(self.developers_tab)

        self.developers_title_label = QLabel(self.developers_tab)
        font.setBold(True)
        font.setWeight(QFont.Weight.Bold)
        self.developers_title_label.setFont(font)
        self.developers_title_label.setAlignment(Qt.AlignCenter)
        developers_verticalLayout.addWidget(self.developers_title_label)

        self.name_label = QLabel(self.developers_tab)
        self.name_label.setAlignment(Qt.AlignCenter)

        developers_verticalLayout.addWidget(self.name_label)

        # contributors
        self.contributors_thank_label = QLabel(self.developers_tab)
        self.contributors_thank_label.setFont(font)
        self.contributors_thank_label.setAlignment(Qt.AlignCenter)

        developers_verticalLayout.addWidget(self.contributors_thank_label)

        self.contributors_link_label = QLabel(self.developers_tab)
        self.contributors_link_label.setTextFormat(Qt.RichText)
        self.contributors_link_label.setAlignment(Qt.AlignCenter)
        self.contributors_link_label.setOpenExternalLinks(True)
        self.contributors_link_label.setTextInteractionFlags(
            Qt.TextBrowserInteraction)
        developers_verticalLayout.addWidget(self.contributors_link_label)

        developers_verticalLayout.addStretch(1)

        # translators tab
        self.translators_tab = QWidget(self)
        translators_tab_verticalLayout = QVBoxLayout(self.translators_tab)

        # translators
        self.translators_textEdit = QTextEdit(self.translators_tab)
        self.translators_textEdit.setReadOnly(True)
        translators_tab_verticalLayout.addWidget(self.translators_textEdit)

        # License tab
        self.license_tab = QWidget(self)
        license_tab_verticalLayout = QVBoxLayout(self.license_tab)

        self.license_text = QTextEdit(self.license_tab)
        self.license_text.setReadOnly(True)

        license_tab_verticalLayout.addWidget(self.license_text)

        verticalLayout.addWidget(self.about_tabWidget)

        # buttons
        button_horizontalLayout = QHBoxLayout()
        button_horizontalLayout.addStretch(1)

        self.pushButton = QPushButton(self)
        self.pushButton.setIcon(QIcon(icons + 'ok'))
        self.pushButton.clicked.connect(self.close)

        button_horizontalLayout.addWidget(self.pushButton)

        verticalLayout.addLayout(button_horizontalLayout)

        self.setWindowTitle(QCoreApplication.translate("about_ui_tr", "About Persepolis"))

        # about_tab
        self.title_label.setText(QCoreApplication.translate("about_ui_tr", "Persepolis Download Manager"))
        self.version_label.setText(QCoreApplication.translate("about_ui_tr", "Version 3.2.0"))
        self.site2_label.setText(QCoreApplication.translate("about_ui_tr",
                                                            "<a href=https://persepolisdm.github.io>https://persepolisdm.github.io</a>",
                                                            "TRANSLATORS NOTE: YOU REALLY DON'T NEED TO TRANSLATE THIS PART!"))

        self.telegram_label.setText(QCoreApplication.translate("about_ui_tr",
                                                               "<a href=https://telegram.me/persepolisdm>https://telegram.me/persepolisdm</a>",
                                                               "TRANSLATORS NOTE: YOU REALLY DON'T NEED TO TRANSLATE THIS PART!"))

        self.twitter_label.setText(QCoreApplication.translate("about_ui_tr",
                                                              "<a href=https://twitter.com/persepolisdm>https://twitter.com/persepolisdm</a>",
                                                              "TRANSLATORS NOTE: YOU REALLY DON'T NEED TO TRANSLATE THIS PART!"))

        # developers_tab
        self.developers_title_label.setText(QCoreApplication.translate('about_ui_tr', 'Developers:'))

        self.name_label.setText(QCoreApplication.translate("about_ui_tr",
                                                           "\nAliReza AmirSamimi\nMohammadreza Abdollahzadeh\nSadegh Alirezaie\nMostafa Asadi\nMohammadAmin Vahedinia\nJafar Akhondali\nH.Rostami\nEhsan Titish",
                                                           "TRANSLATORS NOTE: YOU REALLY DON'T NEED TO TRANSLATE THIS PART!"))

        self.contributors_thank_label.setText(QCoreApplication.translate('about_ui_tr', 'Special thanks to:'))
        self.contributors_link_label.setText(
            "<a href=https://github.com/persepolisdm/persepolis/graphs/contributors>our contributors</a>")

        # License
        self.license_text.setPlainText("""
            This program is free software: you can redistribute it and/or modify
            it under the terms of the GNU General Public License as published by
            the Free Software Foundation, either version 3 of the License, or
            (at your option) any later version.

            This program is distributed in the hope that it will be useful,
            but WITHOUT ANY WARRANTY; without even the implied warranty of
            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
            GNU General Public License for more details.

            You should have received a copy of the GNU General Public License
            along with this program.  If not, see http://www.gnu.org/licenses/.
            """)

        # tabs
        self.about_tabWidget.addTab(self.about_tab, QCoreApplication.translate("about_ui_tr", "About Persepolis"))
        self.about_tabWidget.addTab(self.developers_tab, QCoreApplication.translate("about_ui_tr", "Developers"))
        self.about_tabWidget.addTab(self.translators_tab, QCoreApplication.translate("about_ui_tr", "Translators"))
        self.about_tabWidget.addTab(self.license_tab, QCoreApplication.translate("about_ui_tr", "License"))

        # button
        self.pushButton.setText(QCoreApplication.translate("about_ui_tr", "OK"))
    def __init__(self, parent, receiver_slot, settings, video_dict={}):
        super().__init__(parent, receiver_slot, settings, video_dict)
        self.setWindowTitle(
            QCoreApplication.translate("ytaddlink_src_ui_tr", 'Video Finder'))
        self.size_label.hide()

        # empty lists for no_audio and no_video and video_audio files
        self.no_audio_list = []
        self.no_video_list = []
        self.video_audio_list = []

        self.media_title = ''

        # add support for other languages
        locale = str(self.persepolis_setting.value('settings/locale'))
        QLocale.setDefault(QLocale(locale))
        self.translator = QTranslator()
        if self.translator.load(':/translations/locales/ui_' + locale, 'ts'):
            QCoreApplication.installTranslator(self.translator)

        # extension_label
        self.extension_label = QLabel(self.link_frame)
        self.change_name_horizontalLayout.addWidget(self.extension_label)

        # Fetch Button
        self.url_submit_pushButtontton = QPushButton(self.link_frame)
        self.link_horizontalLayout.addWidget(self.url_submit_pushButtontton)

        # Status Box
        self.status_box_textEdit = QTextEdit(self.link_frame)
        self.status_box_textEdit.setMaximumHeight(150)
        self.link_verticalLayout.addWidget(self.status_box_textEdit)

        # Select format horizontal layout
        select_format_horizontalLayout = QHBoxLayout()

        # Selection Label
        self.select_format_label = QLabel(self.link_frame)
        select_format_horizontalLayout.addWidget(self.select_format_label)

        # Selection combobox
        self.media_comboBox = QComboBox(self.link_frame)
        self.media_comboBox.setMinimumWidth(200)
        select_format_horizontalLayout.addWidget(self.media_comboBox)

        # Duration label
        self.duration_label = QLabel(self.link_frame)
        select_format_horizontalLayout.addWidget(self.duration_label)

        self.format_selection_frame = QFrame(self)
        self.format_selection_frame.setLayout(select_format_horizontalLayout)
        self.link_verticalLayout.addWidget(self.format_selection_frame)

        # advanced_format_selection_checkBox
        self.advanced_format_selection_checkBox = QCheckBox(self)
        self.link_verticalLayout.addWidget(
            self.advanced_format_selection_checkBox)

        # advanced_format_selection_frame
        self.advanced_format_selection_frame = QFrame(self)
        self.link_verticalLayout.addWidget(
            self.advanced_format_selection_frame)

        advanced_format_selection_horizontalLayout = QHBoxLayout(
            self.advanced_format_selection_frame)

        # video_format_selection
        self.video_format_selection_label = QLabel(
            self.advanced_format_selection_frame)
        self.video_format_selection_comboBox = QComboBox(
            self.advanced_format_selection_frame)

        # audio_format_selection
        self.audio_format_selection_label = QLabel(
            self.advanced_format_selection_frame)
        self.audio_format_selection_comboBox = QComboBox(
            self.advanced_format_selection_frame)

        for widget in [
                self.video_format_selection_label,
                self.video_format_selection_comboBox,
                self.audio_format_selection_label,
                self.audio_format_selection_comboBox
        ]:
            advanced_format_selection_horizontalLayout.addWidget(widget)

        # Set Texts
        self.url_submit_pushButtontton.setText(
            QCoreApplication.translate("ytaddlink_src_ui_tr",
                                       'Fetch Media List'))
        self.select_format_label.setText(
            QCoreApplication.translate("ytaddlink_src_ui_tr",
                                       'Select a format'))

        self.video_format_selection_label.setText(
            QCoreApplication.translate("ytaddlink_src_ui_tr", 'Video format:'))
        self.audio_format_selection_label.setText(
            QCoreApplication.translate("ytaddlink_src_ui_tr", 'Audio format:'))

        self.advanced_format_selection_checkBox.setText(
            QCoreApplication.translate("ytaddlink_src_ui_tr",
                                       'Advanced options'))

        # Add Slot Connections
        self.url_submit_pushButtontton.setEnabled(False)
        self.change_name_lineEdit.setEnabled(False)
        self.ok_pushButton.setEnabled(False)
        self.download_later_pushButton.setEnabled(False)

        self.format_selection_frame.setEnabled(True)
        self.advanced_format_selection_frame.setEnabled(False)
        self.advanced_format_selection_checkBox.toggled.connect(
            self.advancedFormatFrame)

        self.url_submit_pushButtontton.clicked.connect(self.submitClicked)

        self.media_comboBox.activated.connect(
            partial(self.mediaSelectionChanged, 'video_audio'))

        self.video_format_selection_comboBox.activated.connect(
            partial(self.mediaSelectionChanged, 'video'))

        self.audio_format_selection_comboBox.activated.connect(
            partial(self.mediaSelectionChanged, 'audio'))

        self.link_lineEdit.textChanged.disconnect(
            super().linkLineChanged)  # Should be disconnected.
        self.link_lineEdit.textChanged.connect(self.linkLineChangedHere)

        self.setMinimumSize(650, 480)

        self.status_box_textEdit.hide()
        self.format_selection_frame.hide()
        self.advanced_format_selection_frame.hide()
        self.advanced_format_selection_checkBox.hide()

        if 'link' in video_dict.keys() and video_dict['link']:
            self.link_lineEdit.setText(video_dict['link'])
            self.url_submit_pushButtontton.setEnabled(True)
        else:
            # check clipboard
            clipboard = QApplication.clipboard()
            text = clipboard.text()
            if (("tp:/" in text[2:6]) or ("tps:/" in text[2:7])):
                self.link_lineEdit.setText(str(text))

            self.url_submit_pushButtontton.setEnabled(True)
    def create_GUI(self) -> None:
        self.commands_display = QTextEdit(self)
        font = self.commands_display.font()
        font.setPointSize(10)
        self.commands_display.setFont(font)

        self.commands_display.setReadOnly(True)
        place_holder: str = "1. Choose Action | 2. Pick a Key to be Bound | 3. Select a Gun/Equipment"
        self.commands_display.setPlaceholderText(place_holder)

        self.f1 = QPushButton(self.centralWidget)
        self.f2 = QPushButton(self.centralWidget)
        self.f3 = QPushButton(self.centralWidget)
        self.f4 = QPushButton(self.centralWidget)
        self.f5 = QPushButton(self.centralWidget)
        self.f6 = QPushButton(self.centralWidget)
        self.f7 = QPushButton(self.centralWidget)
        self.f8 = QPushButton(self.centralWidget)
        self.f9 = QPushButton(self.centralWidget)
        self.f10 = QPushButton(self.centralWidget)
        self.f11 = QPushButton(self.centralWidget)
        self.f12 = QPushButton(self.centralWidget)

        self.acute = QPushButton(self.centralWidget)
        self.one = QPushButton(self.centralWidget)
        self.two = QPushButton(self.centralWidget)
        self.three = QPushButton(self.centralWidget)
        self.four = QPushButton(self.centralWidget)
        self.five = QPushButton(self.centralWidget)
        self.six = QPushButton(self.centralWidget)
        self.seven = QPushButton(self.centralWidget)
        self.eight = QPushButton(self.centralWidget)
        self.nine = QPushButton(self.centralWidget)
        self.zero = QPushButton(self.centralWidget)
        self.minus = QPushButton(self.centralWidget)
        self.equal = QPushButton(self.centralWidget)
        self.backspace = QPushButton(self.centralWidget)

        self.tab = QPushButton(self.centralWidget)
        self.q = QPushButton(self.centralWidget)
        self.w = QPushButton(self.centralWidget)
        self.e = QPushButton(self.centralWidget)
        self.r = QPushButton(self.centralWidget)
        self.t = QPushButton(self.centralWidget)
        self.y = QPushButton(self.centralWidget)
        self.u = QPushButton(self.centralWidget)
        self.i = QPushButton(self.centralWidget)
        self.o = QPushButton(self.centralWidget)
        self.p = QPushButton(self.centralWidget)
        self.open_bracket = QPushButton(self.centralWidget)
        self.closed_bracket = QPushButton(self.centralWidget)
        self.backslash = QPushButton(self.centralWidget)

        self.capslock = QPushButton(self.centralWidget)
        self.a = QPushButton(self.centralWidget)
        self.s = QPushButton(self.centralWidget)
        self.d = QPushButton(self.centralWidget)
        self.f = QPushButton(self.centralWidget)
        self.g = QPushButton(self.centralWidget)
        self.h = QPushButton(self.centralWidget)
        self.j = QPushButton(self.centralWidget)
        self.k = QPushButton(self.centralWidget)
        self.l = QPushButton(self.centralWidget)
        self.semicolon = QPushButton(self.centralWidget)
        self.apostrophe = QPushButton(self.centralWidget)
        self.enter = QPushButton(self.centralWidget)

        self.left_shift = QPushButton(self.centralWidget)
        self.z = QPushButton(self.centralWidget)
        self.x = QPushButton(self.centralWidget)
        self.c = QPushButton(self.centralWidget)
        self.v = QPushButton(self.centralWidget)
        self.b = QPushButton(self.centralWidget)
        self.n = QPushButton(self.centralWidget)
        self.m = QPushButton(self.centralWidget)
        self.comma = QPushButton(self.centralWidget)
        self.dot = QPushButton(self.centralWidget)
        self.slash = QPushButton(self.centralWidget)
        self.right_shift = QPushButton(self.centralWidget)

        self.left_ctrl = QPushButton(self.centralWidget)
        self.right_alt = QPushButton(self.centralWidget)
        self.space = QPushButton(self.centralWidget)
        self.left_alt = QPushButton(self.centralWidget)
        self.right_ctrl = QPushButton(self.centralWidget)

        self.insert = QPushButton(self.centralWidget)
        self.home = QPushButton(self.centralWidget)
        self.pgup = QPushButton(self.centralWidget)
        self.delete = QPushButton(self.centralWidget)
        self.end = QPushButton(self.centralWidget)
        self.pgdn = QPushButton(self.centralWidget)
        self.uparrow = QPushButton(self.centralWidget)
        self.leftarrow = QPushButton(self.centralWidget)
        self.downarrow = QPushButton(self.centralWidget)
        self.rightarrow = QPushButton(self.centralWidget)

        self.numlock = QPushButton(self.centralWidget)
        self.kp_slash = QPushButton(self.centralWidget)
        self.kp_multiply = QPushButton(self.centralWidget)
        self.kp_minus = QPushButton(self.centralWidget)
        self.kp_home = QPushButton(self.centralWidget)
        self.kp_uparrow = QPushButton(self.centralWidget)
        self.kp_pgup = QPushButton(self.centralWidget)
        self.kp_plus = QPushButton(self.centralWidget)
        self.kp_plus.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
        self.kp_leftarrow = QPushButton(self.centralWidget)
        self.kp_five = QPushButton(self.centralWidget)
        self.kp_rightarrow = QPushButton(self.centralWidget)
        self.kp_end = QPushButton(self.centralWidget)
        self.kp_downarrow = QPushButton(self.centralWidget)
        self.kp_pgdn = QPushButton(self.centralWidget)
        self.kp_enter = QPushButton(self.centralWidget)
        self.kp_enter.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
        self.kp_insert = QPushButton(self.centralWidget)
        self.kp_delete = QPushButton(self.centralWidget)

        self.buy = QPushButton(self.centralWidget)
        self.buy.setStyleSheet("QPushButton" "{" "font-size: 17px;" "}")
        self.buy.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.hand_switch = QPushButton(self.centralWidget)
        self.clear_decals = QPushButton(self.centralWidget)
        self.bind_grenade = QPushButton(self.centralWidget)
        self.voice_mute = QPushButton(self.centralWidget)
        self.bomb_drop = QPushButton(self.centralWidget)
        self.copy = QPushButton(self.centralWidget)
        self.reset = QPushButton(self.centralWidget)

        self.ak47 = QPushButton(self.centralWidget)
        self.ak47.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.m4s = QPushButton(self.centralWidget)
        self.m4s.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.aug = QPushButton(self.centralWidget)
        self.sg = QPushButton(self.centralWidget)
        self.awp = QPushButton(self.centralWidget)
        self.ssg = QPushButton(self.centralWidget)
        self.famas = QPushButton(self.centralWidget)
        self.galil = QPushButton(self.centralWidget)

        self.mac10 = QPushButton(self.centralWidget)
        self.mp9 = QPushButton(self.centralWidget)
        self.mp7 = QPushButton(self.centralWidget)
        self.ump = QPushButton(self.centralWidget)
        self.bizon = QPushButton(self.centralWidget)
        self.p90 = QPushButton(self.centralWidget)
        self.mp5 = QPushButton(self.centralWidget)

        self.xm = QPushButton(self.centralWidget)
        self.sawedoff = QPushButton(self.centralWidget)
        self.mag7 = QPushButton(self.centralWidget)

        self.p250 = QPushButton(self.centralWidget)
        self.cz75 = QPushButton(self.centralWidget)
        self.tec9 = QPushButton(self.centralWidget)
        self.fiveseven = QPushButton(self.centralWidget)
        self.deagle = QPushButton(self.centralWidget)
        self.revolver = QPushButton(self.centralWidget)

        self.nade = QPushButton(self.centralWidget)
        self.flash = QPushButton(self.centralWidget)
        self.double_flash = QPushButton(self.centralWidget)
        self.smoke = QPushButton(self.centralWidget)
        self.molotov = QPushButton(self.centralWidget)
        self.inc_grenade = QPushButton(self.centralWidget)

        self.vest = QPushButton(self.centralWidget)
        self.vest.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.vest_helmet = QPushButton(self.centralWidget)
        self.vest_helmet.setSizePolicy(QSizePolicy.Expanding,
                                       QSizePolicy.Expanding)
        self.defuse_kit = QPushButton(self.centralWidget)

        self.mouse3 = QPushButton(self.centralWidget)
        self.mouse3.setStyleSheet("margin-top: 25px;" "margin-bottom: 10px;")
        self.mouse4 = QPushButton(self.centralWidget)
        self.mouse4.setStyleSheet("margin-top: 25px;" "margin-bottom: 10px;")
        self.mouse5 = QPushButton(self.centralWidget)
        self.mouse5.setStyleSheet("margin-top: 25px;" "margin-bottom: 10px;")

        self.f1.setText("F1")
        self.f2.setText("F2")
        self.f3.setText("F3")
        self.f4.setText("F4")
        self.f5.setText("F5")
        self.f6.setText("F6")
        self.f7.setText("F7")
        self.f8.setText("F8")
        self.f9.setText("F9")
        self.f10.setText("F10")
        self.f11.setText("F11")
        self.f12.setText("F12")
        self.acute.setText("`")
        self.one.setText("1")
        self.two.setText("2")
        self.three.setText("3")
        self.four.setText("4")
        self.five.setText("5")
        self.six.setText("6")
        self.seven.setText("7")
        self.eight.setText("8")
        self.nine.setText("9")
        self.zero.setText("0")
        self.minus.setText("-")
        self.equal.setText("=")
        self.backspace.setText("Backspace")
        self.tab.setText("TAB")
        self.q.setText("Q")
        self.w.setText("W")
        self.e.setText("E")
        self.r.setText("R")
        self.t.setText("T")
        self.y.setText("Y")
        self.u.setText("U")
        self.i.setText("I")
        self.o.setText("O")
        self.p.setText("P")
        self.open_bracket.setText("[")
        self.closed_bracket.setText("]")
        self.backslash.setText("\\")
        self.capslock.setText("Caps Lock")
        self.a.setText("A")
        self.s.setText("S")
        self.d.setText("D")
        self.f.setText("F")
        self.g.setText("G")
        self.h.setText("H")
        self.j.setText("J")
        self.k.setText("K")
        self.l.setText("L")
        self.semicolon.setText(";")
        self.apostrophe.setText("'")
        self.enter.setText("Enter")
        self.left_shift.setText("Shift")
        self.z.setText("Z")
        self.x.setText("X")
        self.c.setText("C")
        self.v.setText("V")
        self.b.setText("B")
        self.n.setText("N")
        self.m.setText("M")
        self.comma.setText(",")
        self.dot.setText(".")
        self.slash.setText("/")
        self.right_shift.setText("Shift")
        self.left_ctrl.setText("Ctrl")
        self.left_alt.setText("Alt")
        self.space.setText("Space")
        self.right_alt.setText("Alt")
        self.right_ctrl.setText("Ctrl")
        self.insert.setText("Insert")
        self.home.setText("Home")
        self.pgup.setText("PgUp")
        self.delete.setText("Del")
        self.end.setText("End")
        self.pgdn.setText("PgDn")
        self.uparrow.setText("↑")
        self.leftarrow.setText("←")
        self.downarrow.setText("↓")
        self.rightarrow.setText("→")
        self.numlock.setText("Num Lock")
        self.kp_slash.setText("/")
        self.kp_multiply.setText("*")
        self.kp_minus.setText("-")
        self.kp_home.setText("7")
        self.kp_uparrow.setText("8")
        self.kp_pgup.setText("9")
        self.kp_plus.setText("+")
        self.kp_leftarrow.setText("4")
        self.kp_five.setText("5")
        self.kp_rightarrow.setText("6")
        self.kp_end.setText("1")
        self.kp_downarrow.setText("2")
        self.kp_pgdn.setText("3")
        self.kp_enter.setText("Enter")
        self.kp_insert.setText("0")
        self.kp_delete.setText(".")

        self.buy.setText("BUY")
        self.bind_grenade.setText("Bind Grenades")
        self.voice_mute.setText("Mute Voice Chat")
        self.bomb_drop.setText("Bomb Drop")
        self.reset.setText("RESET")
        self.clear_decals.setText("Clear Decals")
        self.hand_switch.setText("Switch Hands")
        self.copy.setText("Copy to Clipboard")
        self.mouse3.setText("Mouse 3")
        self.mouse4.setText("Mouse 4")
        self.mouse5.setText("Mouse 5")

        self.ak47.setText("AK-47")
        self.m4s.setText("M4A4/1-S")
        self.aug.setText("AUG")
        self.sg.setText("SG 553")
        self.awp.setText("AWP")
        self.galil.setText("Galil AR")
        self.famas.setText("FAMAS")
        self.ssg.setText("SSG 08")

        self.mac10.setText("MAC-10")
        self.mp9.setText("MP9")
        self.mp7.setText("MP7")
        self.bizon.setText("PP-Bizon")
        self.p90.setText("P90")
        self.ump.setText("UMP-45")
        self.mp5.setText("MP5-SD")

        self.mag7.setText("MAG-7")
        self.sawedoff.setText("Sawed-Off")
        self.xm.setText("XM1014")

        self.p250.setText("P250")
        self.cz75.setText("CZ75-Auto")
        self.fiveseven.setText("Five-SeveN")
        self.tec9.setText("Tec-9")
        self.deagle.setText("Desert Eagle")
        self.revolver.setText("R8 Revolver")

        self.vest.setText("Kevlar Vest")
        self.vest_helmet.setText(f"Kevlar\n +\nHelmet")
        self.defuse_kit.setText("Defuse Kit")

        self.flash.setText("Flash")
        self.double_flash.setText("2x Flash")
        self.nade.setText("Grenade")
        self.smoke.setText("Smoke")
        self.inc_grenade.setText("INC-Grenade")
        self.molotov.setText("Molotov")

        self.layout.addWidget(self.commands_display, 0, 5, 5, 7)

        self.layout.addWidget(self.bind_grenade, 0, 0, 1, 2)
        self.layout.addWidget(self.bomb_drop, 1, 0, 1, 2)
        self.layout.addWidget(self.voice_mute, 2, 0, 1, 2)
        self.layout.addWidget(self.hand_switch, 3, 0, 1, 2)
        self.layout.addWidget(self.clear_decals, 4, 0, 1, 2)

        self.layout.addWidget(self.buy, 0, 3, 2, 2)
        self.layout.addWidget(self.reset, 3, 3, 1, 2)
        self.layout.addWidget(self.copy, 4, 3, 1, 2)

        self.layout.addWidget(self.ak47, 0, 12, 2, 1)
        self.layout.addWidget(self.m4s, 0, 13, 2, 1)
        self.layout.addWidget(self.vest, 2, 12, 2, 1)
        self.layout.addWidget(self.vest_helmet, 2, 13, 2, 1)
        self.layout.addWidget(self.defuse_kit, 4, 12)
        self.layout.addWidget(self.double_flash, 4, 13)

        self.layout.addWidget(self.flash, 0, 14)
        self.layout.addWidget(self.smoke, 1, 14)
        self.layout.addWidget(self.nade, 2, 14)
        self.layout.addWidget(self.inc_grenade, 3, 14)
        self.layout.addWidget(self.molotov, 4, 14)

        self.layout.addWidget(self.awp, 0, 15)
        self.layout.addWidget(self.deagle, 1, 15)

        self.layout.addWidget(self.aug, 0, 16)
        self.layout.addWidget(self.sg, 1, 16)
        self.layout.addWidget(self.famas, 3, 16)
        self.layout.addWidget(self.galil, 2, 16)
        self.layout.addWidget(self.ssg, 4, 16)

        self.layout.addWidget(self.fiveseven, 0, 17)
        self.layout.addWidget(self.tec9, 1, 17)
        self.layout.addWidget(self.cz75, 3, 17)
        self.layout.addWidget(self.p250, 2, 17)
        self.layout.addWidget(self.revolver, 4, 17)

        self.layout.addWidget(self.mac10, 0, 18)
        self.layout.addWidget(self.mp9, 1, 18)
        self.layout.addWidget(self.mp7, 2, 18)
        self.layout.addWidget(self.ump, 3, 18)
        self.layout.addWidget(self.p90, 4, 18)

        self.layout.addWidget(self.mp5, 0, 19)
        self.layout.addWidget(self.bizon, 1, 19)
        self.layout.addWidget(self.mag7, 2, 19)
        self.layout.addWidget(self.sawedoff, 3, 19)
        self.layout.addWidget(self.xm, 4, 19)

        self.layout.addWidget(self.mouse3, 5, 7)
        self.layout.addWidget(self.mouse4, 5, 8)
        self.layout.addWidget(self.mouse5, 5, 9)

        self.layout.addWidget(self.f1, 6, 0)
        self.layout.addWidget(self.f2, 6, 1)
        self.layout.addWidget(self.f3, 6, 2)
        self.layout.addWidget(self.f4, 6, 3)
        self.layout.addWidget(self.f5, 6, 4)
        self.layout.addWidget(self.f6, 6, 5)
        self.layout.addWidget(self.f7, 6, 6)
        self.layout.addWidget(self.f8, 6, 7)
        self.layout.addWidget(self.f9, 6, 8)
        self.layout.addWidget(self.f10, 6, 9)
        self.layout.addWidget(self.f11, 6, 10)
        self.layout.addWidget(self.f12, 6, 11)

        self.layout.addWidget(self.acute, 7, 0)
        self.layout.addWidget(self.one, 7, 1)
        self.layout.addWidget(self.two, 7, 2)
        self.layout.addWidget(self.three, 7, 3)
        self.layout.addWidget(self.four, 7, 4)
        self.layout.addWidget(self.five, 7, 5)
        self.layout.addWidget(self.six, 7, 6)
        self.layout.addWidget(self.seven, 7, 7)
        self.layout.addWidget(self.eight, 7, 8)
        self.layout.addWidget(self.nine, 7, 9)
        self.layout.addWidget(self.zero, 7, 10)
        self.layout.addWidget(self.minus, 7, 11)
        self.layout.addWidget(self.equal, 7, 12)
        self.layout.addWidget(self.backspace, 7, 13)
        self.layout.addWidget(self.insert, 7, 14)
        self.layout.addWidget(self.home, 7, 15)
        self.layout.addWidget(self.pgup, 7, 16)
        self.layout.addWidget(self.numlock, 7, 17)
        self.layout.addWidget(self.kp_slash, 7, 18)
        self.layout.addWidget(self.kp_multiply, 7, 19)
        self.layout.addWidget(self.kp_minus, 7, 20)

        self.layout.addWidget(self.tab, 8, 0)
        self.layout.addWidget(self.q, 8, 1)
        self.layout.addWidget(self.w, 8, 2)
        self.layout.addWidget(self.e, 8, 3)
        self.layout.addWidget(self.r, 8, 4)
        self.layout.addWidget(self.t, 8, 5)
        self.layout.addWidget(self.y, 8, 6)
        self.layout.addWidget(self.u, 8, 7)
        self.layout.addWidget(self.i, 8, 8)
        self.layout.addWidget(self.o, 8, 9)
        self.layout.addWidget(self.p, 8, 10)
        self.layout.addWidget(self.open_bracket, 8, 11)
        self.layout.addWidget(self.closed_bracket, 8, 12)
        self.layout.addWidget(self.backslash, 8, 13)
        self.layout.addWidget(self.delete, 8, 14)
        self.layout.addWidget(self.end, 8, 15)
        self.layout.addWidget(self.pgdn, 8, 16)
        self.layout.addWidget(self.kp_home, 8, 17)
        self.layout.addWidget(self.kp_uparrow, 8, 18)
        self.layout.addWidget(self.kp_pgup, 8, 19)
        self.layout.addWidget(self.kp_plus, 8, 20, 2, 1)

        self.layout.addWidget(self.capslock, 9, 0)
        self.layout.addWidget(self.a, 9, 1)
        self.layout.addWidget(self.s, 9, 2)
        self.layout.addWidget(self.d, 9, 3)
        self.layout.addWidget(self.f, 9, 4)
        self.layout.addWidget(self.g, 9, 5)
        self.layout.addWidget(self.h, 9, 6)
        self.layout.addWidget(self.j, 9, 7)
        self.layout.addWidget(self.k, 9, 8)
        self.layout.addWidget(self.l, 9, 9)
        self.layout.addWidget(self.semicolon, 9, 10)
        self.layout.addWidget(self.apostrophe, 9, 11)
        self.layout.addWidget(self.enter, 9, 12, 1, 2)
        self.layout.addWidget(self.kp_leftarrow, 9, 17)
        self.layout.addWidget(self.kp_five, 9, 18)
        self.layout.addWidget(self.kp_rightarrow, 9, 19)

        self.layout.addWidget(self.left_shift, 10, 0, 1, 2)
        self.layout.addWidget(self.z, 10, 2)
        self.layout.addWidget(self.x, 10, 3)
        self.layout.addWidget(self.c, 10, 4)
        self.layout.addWidget(self.v, 10, 5)
        self.layout.addWidget(self.b, 10, 6)
        self.layout.addWidget(self.n, 10, 7)
        self.layout.addWidget(self.m, 10, 8)
        self.layout.addWidget(self.comma, 10, 9)
        self.layout.addWidget(self.dot, 10, 10)
        self.layout.addWidget(self.slash, 10, 11)
        self.layout.addWidget(self.right_shift, 10, 12, 1, 2)
        self.layout.addWidget(self.uparrow, 10, 15)
        self.layout.addWidget(self.kp_end, 10, 17)
        self.layout.addWidget(self.kp_downarrow, 10, 18)
        self.layout.addWidget(self.kp_pgdn, 10, 19)
        self.layout.addWidget(self.kp_enter, 10, 20, 2, 1)

        self.layout.addWidget(self.left_ctrl, 11, 0)
        self.layout.addWidget(self.left_alt, 11, 2)
        self.layout.addWidget(self.space, 11, 3, 1, 7)
        self.layout.addWidget(self.right_alt, 11, 10)
        self.layout.addWidget(self.right_ctrl, 11, 13)
        self.layout.addWidget(self.leftarrow, 11, 14)
        self.layout.addWidget(self.downarrow, 11, 15)
        self.layout.addWidget(self.rightarrow, 11, 16)
        self.layout.addWidget(self.kp_insert, 11, 17, 1, 2)
        self.layout.addWidget(self.kp_delete, 11, 19)

        self.f1.clicked.connect(lambda: self.key_clicked('"f1"'))
        self.f2.clicked.connect(lambda: self.key_clicked('"f2"'))
        self.f3.clicked.connect(lambda: self.key_clicked('"f3"'))
        self.f4.clicked.connect(lambda: self.key_clicked('"f4"'))
        self.f5.clicked.connect(lambda: self.key_clicked('"f5"'))
        self.f6.clicked.connect(lambda: self.key_clicked('"f6"'))
        self.f7.clicked.connect(lambda: self.key_clicked('"f7"'))
        self.f8.clicked.connect(lambda: self.key_clicked('"f8"'))
        self.f9.clicked.connect(lambda: self.key_clicked('"f9"'))
        self.f10.clicked.connect(lambda: self.key_clicked('"f10"'))
        self.f11.clicked.connect(lambda: self.key_clicked('"f11"'))
        self.f12.clicked.connect(lambda: self.key_clicked('"f12"'))

        self.acute.clicked.connect(lambda: self.key_clicked('"`"'))
        self.one.clicked.connect(lambda: self.key_clicked('"1"'))
        self.two.clicked.connect(lambda: self.key_clicked('"2"'))
        self.three.clicked.connect(lambda: self.key_clicked('"3"'))
        self.four.clicked.connect(lambda: self.key_clicked('"4"'))
        self.five.clicked.connect(lambda: self.key_clicked('"5"'))
        self.six.clicked.connect(lambda: self.key_clicked('"6"'))
        self.seven.clicked.connect(lambda: self.key_clicked('"7"'))
        self.eight.clicked.connect(lambda: self.key_clicked('"8"'))
        self.nine.clicked.connect(lambda: self.key_clicked('"9"'))
        self.zero.clicked.connect(lambda: self.key_clicked('"0"'))
        self.minus.clicked.connect(lambda: self.key_clicked('"-"'))
        self.equal.clicked.connect(lambda: self.key_clicked('"="'))
        self.backspace.clicked.connect(lambda: self.key_clicked('"backspace"'))
        self.insert.clicked.connect(lambda: self.key_clicked('"ins"'))
        self.home.clicked.connect(lambda: self.key_clicked('"home"'))
        self.pgup.clicked.connect(lambda: self.key_clicked('"pgup"'))
        self.numlock.clicked.connect(lambda: self.key_clicked('"numlock"'))
        self.kp_slash.clicked.connect(lambda: self.key_clicked('"kp_slash"'))
        self.kp_multiply.clicked.connect(
            lambda: self.key_clicked('"kp_multiply"'))
        self.kp_minus.clicked.connect(lambda: self.key_clicked('"kp_minus"'))

        self.tab.clicked.connect(lambda: self.key_clicked('"tab"'))
        self.q.clicked.connect(lambda: self.key_clicked('"q"'))
        self.w.clicked.connect(lambda: self.key_clicked('"w"'))
        self.e.clicked.connect(lambda: self.key_clicked('"e"'))
        self.r.clicked.connect(lambda: self.key_clicked('"r"'))
        self.t.clicked.connect(lambda: self.key_clicked('"t"'))
        self.y.clicked.connect(lambda: self.key_clicked('"y"'))
        self.u.clicked.connect(lambda: self.key_clicked('"u"'))
        self.i.clicked.connect(lambda: self.key_clicked('"i"'))
        self.o.clicked.connect(lambda: self.key_clicked('"o"'))
        self.p.clicked.connect(lambda: self.key_clicked('"p"'))
        self.open_bracket.clicked.connect(lambda: self.key_clicked('"["'))
        self.closed_bracket.clicked.connect(lambda: self.key_clicked('"]"'))
        self.backspace.clicked.connect(lambda: self.key_clicked('"\\"'))
        self.delete.clicked.connect(lambda: self.key_clicked('"del"'))
        self.end.clicked.connect(lambda: self.key_clicked('"End"'))
        self.pgdn.clicked.connect(lambda: self.key_clicked('"pgdn"'))
        self.kp_home.clicked.connect(lambda: self.key_clicked('"kp_home"'))
        self.kp_uparrow.clicked.connect(
            lambda: self.key_clicked('"kp_uparrow"'))
        self.kp_pgup.clicked.connect(lambda: self.key_clicked('"kp_pgup"'))
        self.kp_plus.clicked.connect(lambda: self.key_clicked('"kp_plus"'))

        self.capslock.clicked.connect(lambda: self.key_clicked('"capslock"'))
        self.a.clicked.connect(lambda: self.key_clicked('"a"'))
        self.s.clicked.connect(lambda: self.key_clicked('"s"'))
        self.d.clicked.connect(lambda: self.key_clicked('"d"'))
        self.f.clicked.connect(lambda: self.key_clicked('"f"'))
        self.g.clicked.connect(lambda: self.key_clicked('"g"'))
        self.h.clicked.connect(lambda: self.key_clicked('"h"'))
        self.j.clicked.connect(lambda: self.key_clicked('"j"'))
        self.k.clicked.connect(lambda: self.key_clicked('"k"'))
        self.l.clicked.connect(lambda: self.key_clicked('"l"'))
        self.semicolon.clicked.connect(lambda: self.key_clicked('"semicolon"'))
        self.apostrophe.clicked.connect(lambda: self.key_clicked('"' '"'))
        self.enter.clicked.connect(lambda: self.key_clicked('"enter"'))
        self.kp_leftarrow.clicked.connect(
            lambda: self.key_clicked('"kp_leftarrow"'))
        self.kp_five.clicked.connect(lambda: self.key_clicked('"kp_5"'))
        self.kp_rightarrow.clicked.connect(
            lambda: self.key_clicked('"kp_rightarrow"'))

        self.left_shift.clicked.connect(lambda: self.key_clicked('"shift"'))
        self.z.clicked.connect(lambda: self.key_clicked('"z"'))
        self.x.clicked.connect(lambda: self.key_clicked('"x"'))
        self.c.clicked.connect(lambda: self.key_clicked('"c"'))
        self.v.clicked.connect(lambda: self.key_clicked('"v"'))
        self.b.clicked.connect(lambda: self.key_clicked('"b"'))
        self.n.clicked.connect(lambda: self.key_clicked('"n"'))
        self.m.clicked.connect(lambda: self.key_clicked('"m"'))
        self.comma.clicked.connect(lambda: self.key_clicked('","'))
        self.dot.clicked.connect(lambda: self.key_clicked('"."'))
        self.slash.clicked.connect(lambda: self.key_clicked('"/"'))
        self.right_shift.clicked.connect(lambda: self.key_clicked('"shift"'))
        self.uparrow.clicked.connect(lambda: self.key_clicked('"uparrow"'))
        self.kp_end.clicked.connect(lambda: self.key_clicked('"kp_end"'))
        self.kp_downarrow.clicked.connect(
            lambda: self.key_clicked('"kp_downarrow"'))
        self.kp_pgdn.clicked.connect(lambda: self.key_clicked('"kp_pgdn"'))
        self.kp_enter.clicked.connect(lambda: self.key_clicked('"kp_enter"'))

        self.left_ctrl.clicked.connect(lambda: self.key_clicked('"ctrl"'))
        self.left_alt.clicked.connect(lambda: self.key_clicked('"alt"'))
        self.space.clicked.connect(lambda: self.key_clicked('"space"'))
        self.right_alt.clicked.connect(lambda: self.key_clicked('"alt"'))
        self.right_ctrl.clicked.connect(lambda: self.key_clicked('"ctrl"'))
        self.leftarrow.clicked.connect(lambda: self.key_clicked('"leftarrow"'))
        self.downarrow.clicked.connect(lambda: self.key_clicked('"downarrow"'))
        self.rightarrow.clicked.connect(
            lambda: self.key_clicked('"rightarrow"'))
        self.kp_insert.clicked.connect(lambda: self.key_clicked('"kp_ins"'))
        self.kp_delete.clicked.connect(lambda: self.key_clicked('"kp_del"'))

        self.mouse3.clicked.connect(lambda: self.key_clicked('"mouse3"'))
        self.mouse4.clicked.connect(lambda: self.key_clicked('"mouse4"'))
        self.mouse5.clicked.connect(lambda: self.key_clicked('"mouse5"'))

        self.buy.clicked.connect(self.buy_clicked)
        self.reset.clicked.connect(self.reset_clicked)
        self.bomb_drop.clicked.connect(self.bomb_drop_clicked)
        self.clear_decals.clicked.connect(self.clear_decals_clicked)
        self.bind_grenade.clicked.connect(self.bind_grenade_clicked)
        self.voice_mute.clicked.connect(self.voice_mute_clicked)
        self.hand_switch.clicked.connect(self.hand_switch_clicked)
        self.copy.clicked.connect(self.copy_clicked)

        self.ak47.clicked.connect(
            lambda: self.gear_clicked('"buy ak47; buy m4a1";'))
        self.m4s.clicked.connect(
            lambda: self.gear_clicked('"buy m4a1; buy ak47";'))
        self.vest.clicked.connect(lambda: self.gear_clicked('"buy vest";'))
        self.vest_helmet.clicked.connect(
            lambda: self.gear_clicked('"buy vesthelm";'))
        self.defuse_kit.clicked.connect(
            lambda: self.gear_clicked('"buy defuser";'))
        self.double_flash.clicked.connect(
            lambda: self.gear_clicked('"buy flashbang; buy flashbang";'))

        self.flash.clicked.connect(
            lambda: self.gear_clicked('"buy flashbang";'))
        self.smoke.clicked.connect(
            lambda: self.gear_clicked('"buy smokegrenade";'))
        self.nade.clicked.connect(
            lambda: self.gear_clicked('"buy hegrenade";'))
        self.inc_grenade.clicked.connect(
            lambda: self.gear_clicked('"buy incgrenade; buy molotov";'))
        self.molotov.clicked.connect(
            lambda: self.gear_clicked('"buy molotov; buy incgrenade";'))

        self.awp.clicked.connect(lambda: self.gear_clicked('"buy awp";'))
        self.deagle.clicked.connect(
            lambda: self.gear_clicked('"buy deagle; buy revolver";'))

        self.aug.clicked.connect(
            lambda: self.gear_clicked('"buy aug; buy sg556";'))
        self.sg.clicked.connect(
            lambda: self.gear_clicked('"buy sg556; buy aug";'))
        self.galil.clicked.connect(
            lambda: self.gear_clicked('"buy galilar; buy famas";'))
        self.famas.clicked.connect(
            lambda: self.gear_clicked('"buy famas; buy galilar";'))
        self.ssg.clicked.connect(lambda: self.gear_clicked('"buy ssg08";'))

        self.fiveseven.clicked.connect(
            lambda: self.gear_clicked('"buy fiveseven; buy tec9";'))
        self.tec9.clicked.connect(
            lambda: self.gear_clicked('"buy tec9; buy fiveseven";'))
        self.p250.clicked.connect(lambda: self.gear_clicked('"buy p250";'))
        self.cz75.clicked.connect(
            lambda: self.gear_clicked('"buy fiveseven; buy tec9";'))
        self.revolver.clicked.connect(
            lambda: self.gear_clicked('"buy revolver; buy deagle";'))

        self.mac10.clicked.connect(
            lambda: self.gear_clicked('"buy mac10; buy mp9";'))
        self.mp9.clicked.connect(
            lambda: self.gear_clicked('"buy mp9; buy mac10";'))
        self.mp7.clicked.connect(lambda: self.gear_clicked('"buy mp7";'))
        self.ump.clicked.connect(lambda: self.gear_clicked('"buy ump";'))
        self.p90.clicked.connect(lambda: self.gear_clicked('"buy p90";'))

        self.mp5.clicked.connect(lambda: self.gear_clicked('"buy mp7";'))
        self.bizon.clicked.connect(lambda: self.gear_clicked('"buy bizon";'))
        self.mag7.clicked.connect(
            lambda: self.gear_clicked('"buy mag7; buy sawedoff";'))
        self.sawedoff.clicked.connect(
            lambda: self.gear_clicked('"buy sawedoff; buy mag7";'))
        self.xm.clicked.connect(lambda: self.gear_clicked('"buy xm1014"`'))

        #------------------------------------------------------------------------------------------
        #------------------------------------------------------------------------------------------
        #------------------------------------------------------------------------------------------

        self.command: str = ""
        self.bind: Union[NoneType, bool] = None
        self.action: Union[NoneType, str] = None
        self.grenade_keys: tuple = (self.flash, self.smoke, self.nade,
                                    self.inc_grenade, self.molotov)
Exemple #30
0
    def createMessageGroupBox(self):
        self.messageGroupBox = QGroupBox("Balloon Message")

        self.typeLabel = QLabel("Type:")

        self.typeComboBox = QComboBox()
        self.typeComboBox.addItem("None", QSystemTrayIcon.NoIcon)
        self.typeComboBox.addItem(
            self.style().standardIcon(QStyle.SP_MessageBoxInformation),
            "Information",
            QSystemTrayIcon.Information,
        )
        self.typeComboBox.addItem(
            self.style().standardIcon(QStyle.SP_MessageBoxWarning),
            "Warning",
            QSystemTrayIcon.Warning,
        )
        self.typeComboBox.addItem(
            self.style().standardIcon(QStyle.SP_MessageBoxCritical),
            "Critical",
            QSystemTrayIcon.Critical,
        )
        self.typeComboBox.addItem(QIcon(), "Custom icon", -1)
        self.typeComboBox.setCurrentIndex(1)

        self.durationLabel = QLabel("Duration:")

        self.durationSpinBox = QSpinBox()
        self.durationSpinBox.setRange(5, 60)
        self.durationSpinBox.setSuffix(" s")
        self.durationSpinBox.setValue(15)

        self.durationWarningLabel = QLabel(
            "(some systems might ignore this hint)")
        self.durationWarningLabel.setIndent(10)

        self.titleLabel = QLabel("Title:")
        self.titleEdit = QLineEdit("Cannot connect to network")
        self.bodyLabel = QLabel("Body:")

        self.bodyEdit = QTextEdit()
        self.bodyEdit.setPlainText(
            "Don't believe me. Honestly, I don't have a clue."
            "\nClick this balloon for details.")

        self.showMessageButton = QPushButton("Show Message")
        self.showMessageButton.setDefault(True)

        messageLayout = QGridLayout()
        messageLayout.addWidget(self.typeLabel, 0, 0)
        messageLayout.addWidget(self.typeComboBox, 0, 1, 1, 2)
        messageLayout.addWidget(self.durationLabel, 1, 0)
        messageLayout.addWidget(self.durationSpinBox, 1, 1)
        messageLayout.addWidget(self.durationWarningLabel, 1, 2, 1, 3)
        messageLayout.addWidget(self.titleLabel, 2, 0)
        messageLayout.addWidget(self.titleEdit, 2, 1, 1, 4)
        messageLayout.addWidget(self.bodyLabel, 3, 0)
        messageLayout.addWidget(self.bodyEdit, 3, 1, 2, 4)
        messageLayout.addWidget(self.showMessageButton, 5, 4)
        messageLayout.setColumnStretch(3, 1)
        messageLayout.setRowStretch(4, 1)
        self.messageGroupBox.setLayout(messageLayout)