Ejemplo n.º 1
0
class MainWindowUI:
    def setup_ui(self, win: QMainWindow) -> None:
        # ui widgets
        self.toolbar = QToolBar("main", parent=win)
        self.port_combobox1 = PortCombobox("")
        self.port_combobox2 = PortCombobox("")
        self.baudrate_combobox = QComboBox()
        self.monitor1 = QPlainTextEdit("")
        self.monitor2 = QPlainTextEdit("")
        self.btn_clear_monitor1 = QPushButton("Clear")
        self.btn_clear_monitor2 = QPushButton("Clear")
        self.group_monitor1 = QGroupBox("Monitor 1")
        self.group_monitor2 = QGroupBox("Monitor 2")

        # setup widgets
        self.monitor1.setReadOnly(True)
        self.monitor1.setLineWrapMode(QPlainTextEdit.NoWrap)
        self.monitor1.setUndoRedoEnabled(False)
        self.monitor2.setReadOnly(True)
        self.monitor2.setLineWrapMode(QPlainTextEdit.NoWrap)
        self.monitor2.setUndoRedoEnabled(False)
        self.baudrate_combobox.addItems([
            "300",
            "1200",
            "2400",
            "4800",
            "9600",
            "19200",
            "38400",
            "57600",
            "74880",
            "115200",
            "230400",
            "250000",
            "500000",
            "1000000",
            "2000000",
        ])
        self.baudrate_combobox.setCurrentText("9600")

        # setup layout
        win.addToolBar(self.toolbar)

        v_layout = QVBoxLayout()  # type:ignore
        v_layout.addWidget(self.monitor1)
        v_layout.addWidget(self.btn_clear_monitor1)
        self.group_monitor1.setLayout(v_layout)

        v_layout = QVBoxLayout()  # type:ignore
        v_layout.addWidget(self.monitor2)
        v_layout.addWidget(self.btn_clear_monitor2)
        self.group_monitor2.setLayout(v_layout)

        h_layout = QHBoxLayout()  # type:ignore
        h_layout.addWidget(self.group_monitor1)
        h_layout.addWidget(self.group_monitor2)
        central_widget = QWidget()
        central_widget.setLayout(h_layout)
        win.setCentralWidget(central_widget)
Ejemplo n.º 2
0
class QTextEditLogger(logging.Handler):
    def __init__(self, parent):
        super().__init__()
        self.widget = QPlainTextEdit(parent)
        self.widget.setReadOnly(True)

    def emit(self, record):
        msg = self.format(record)
        self.widget.appendPlainText(msg)
Ejemplo n.º 3
0
class MainWindow(QWidget):
    def __init__(self):
        super(MainWindow, self).__init__()
        hBoxLayout = QHBoxLayout(self)
        self.plainTextEdit = QPlainTextEdit()
        self.plainTextEdit.setMinimumWidth(400)
        self.plainTextEdit.setReadOnly(True)
        hBoxLayout.addWidget(self.plainTextEdit)
        self.renderWindow = RenderWindow(QSurfaceFormat())
        container = QWidget.createWindowContainer(self.renderWindow)
        container.setMinimumSize(QSize(400, 400))
        hBoxLayout.addWidget(container)

    def updateDescription(self):
        text = "{}\n\nPython {}\n\n{}".format(QLibraryInfo.build(),
                                              sys.version,
                                              self.renderWindow.glInfo())
        self.plainTextEdit.setPlainText(text)
Ejemplo n.º 4
0
class MainWindowUI:
    def setup_ui(self, win: QMainWindow, settings: Settings) -> None:
        self.statusbar = CustomStatusBar(win)
        self.toolbar = AToolBar(win)
        self.tab = QTabWidget()
        self.tab_main = TabMain()
        self.tab_lcr = TabLCR()
        self.tab_stage_step = TabStageStep()
        self.tab_stage_cycle = TabStageCycle()
        self.console = QPlainTextEdit()
        self.group_measurements_data = QGroupBox("Measurements Data")

        self.tab.addTab(self.tab_main, "Test")
        self.tab.addTab(self.tab_lcr, "LCR Meter")
        self.tab.addTab(self.tab_stage_step, "Stage Controller")
        self.tab.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.console.setReadOnly(True)
        self.console.setLineWrapMode(QPlainTextEdit.NoWrap)
        # self.console.setUndoRedoEnabled(False)

        # setup settings
        self.console.setMaximumBlockCount(
            settings.console.maximum_number_of_line)
        self.tab_main.spinbox_interval.setValue(settings.main.measure_interval)
        self.tab_stage_step.int_slider.update_current_value(
            settings.stage_controller.maximum_speed)
        self.tab_stage_cycle.int_slider.update_current_value(
            settings.stage_controller.maximum_speed)

        # setup layout
        v_layout = AVBoxLayout()
        v_layout.addWidget(self.console)
        self.group_measurements_data.setLayout(v_layout)

        h_layout = AHBoxLayout()
        h_layout.addWidget(self.tab)
        h_layout.addWidget(self.group_measurements_data)
        central_widget = QWidget()
        central_widget.setLayout(h_layout)
        win.setCentralWidget(central_widget)
Ejemplo n.º 5
0
 def __init__(self, parent, history):
     super().__init__(parent=parent)
     self.setWindowTitle("History")
     layout = QVBoxLayout()
     text = QPlainTextEdit()
     font = QFont()
     font.setFamily("monospace")
     font.setStyleHint(QFont.Monospace)
     text.setFont(font)
     highlighter = PythonHighlighter(text.document())  # noqa: F841
     text.setReadOnly(True)
     text.setPlainText(history)
     layout.addWidget(text)
     buttonbox = QDialogButtonBox(QDialogButtonBox.Ok)
     clipboardbutton = QPushButton("Copy to clipboard")
     buttonbox.addButton(clipboardbutton, QDialogButtonBox.ActionRole)
     clipboard = QGuiApplication.clipboard()
     clipboardbutton.clicked.connect(
         lambda: clipboard.setText(history + "\n"))
     layout.addWidget(buttonbox)
     self.setLayout(layout)
     buttonbox.accepted.connect(self.accept)
     self.resize(700, 500)
Ejemplo n.º 6
0
class UIBuilder(object):
    """Constructs the UI for a main application window"""
    def setup(self, main_window: QMainWindow) -> None:
        """
        Initialize the UI.

        :param main_window: An instance of the `QMainWindow` class.
        :type main_window: :class:`QMainWindow`
        """
        main_window.setObjectName("main_window")
        main_window.setWindowTitle("TeaseAI")
        main_window.resize(1137, 751)
        main_window.setSizePolicy(*EXP_EXP)
        main_window.setTabShape(QTabWidget.Rounded)

        self.menubar = QMenuBar(main_window)
        self.menubar.setObjectName("menubar")
        self.menubar.setGeometry(0, 0, 1137, 23)
        self.file_menu = QMenu("File", self.menubar)
        self.file_menu.setObjectName("file_men")
        self.server_menu = QMenu("Server", self.menubar)
        self.server_menu.setObjectName("server_men")
        self.options_menu = QMenu("Options", self.menubar)
        self.options_menu.setObjectName("options_men")
        self.media_menu = QMenu("Media", self.menubar)
        self.media_menu.setObjectName("media_men")
        main_window.setMenuBar(self.menubar)

        self.exit = QAction("Exit", main_window)
        self.exit.setObjectName("exit")
        self.start_server = QAction("Start Server", main_window)
        self.start_server.setObjectName("start_server")
        self.connect_server = QAction("Connect to Server", main_window)
        self.connect_server.setObjectName("connect_server")
        self.kill_server = QAction("Kill Server", main_window)
        self.kill_server.setObjectName("kill_server")
        self.options = QAction("Options", main_window)
        self.options.setObjectName("options")
        self.start_webcam = QAction("Start Webcam", main_window)
        self.start_webcam.setObjectName("start_webcam")
        self.start_webcam.setCheckable(False)
        self.centralwidget = QWidget(main_window)
        self.centralwidget.setObjectName("centralwidget")
        self.centralwidget.setContentsMargins(QMargins(0, 0, 0, 0))
        self.centralwidget.setSizePolicy(*EXP_EXP)
        self.grid_layout = QGridLayout(self.centralwidget)

        self.media = QFrame(self.centralwidget)
        self.media.setObjectName("media")
        self.media.setSizePolicy(*EXP_EXP)
        self.media.setMinimumSize(200, 200)
        self.media.setStyleSheet("background: #000;")
        self.grid_layout.addWidget(self.media, 0, 0, 5, 1)

        self.users_label = QLabel(" Online users:", self.centralwidget)
        self.users_label.setObjectName("users_label")
        self.users_label.setMinimumSize(300, 15)
        self.users_label.setMaximumSize(300, 15)
        self.grid_layout.addWidget(self.users_label, 0, 1, 1, 2)

        self.online = QPlainTextEdit("", self.centralwidget)
        self.online.setObjectName("online")
        self.online.setSizePolicy(*FIX_FIX)
        self.online.setMinimumSize(300, 50)
        self.online.setMaximumSize(300, 50)
        self.online.setStyleSheet("margin-left: 3px;" + SUNKEN)
        self.online.setLineWidth(2)
        self.online.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.online.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.online.setSizeAdjustPolicy(QAbstractScrollArea.AdjustIgnored)
        self.online.setReadOnly(True)
        self.grid_layout.addWidget(self.online, 1, 1, 1, 2)

        self.chat = QPlainTextEdit("", self.centralwidget)
        self.chat.setObjectName("chat")
        self.chat.setSizePolicy(*FIX_EXP)
        self.chat.setMinimumSize(300, 0)
        self.chat.setMaximumSize(300, INFINITE)
        self.chat.setStyleSheet("margin-bottom: 3px; margin-top: 8px;" +
                                SUNKEN)
        self.chat.setLineWidth(2)
        self.chat.setReadOnly(True)
        self.chat.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.grid_layout.addWidget(self.chat, 2, 1, 1, 2)

        self.input = QLineEdit(self.centralwidget)
        self.input.setObjectName("input")
        self.input.setSizePolicy(*FIX_FIX)
        self.input.setMinimumSize(224, 30)
        self.input.setMaximumSize(224, 30)
        self.input.setStyleSheet(SUNKEN)
        self.input.setEchoMode(QLineEdit.Normal)
        self.input.setClearButtonEnabled(True)
        self.grid_layout.addWidget(self.input, 3, 1, 1, 1)

        self.submit = QPushButton("Submit", self.centralwidget)
        self.submit.setObjectName("submit")
        self.submit.setSizePolicy(*FIX_FIX)
        self.submit.setMinimumSize(70, 30)
        self.submit.setMaximumSize(70, 30)
        self.grid_layout.addWidget(self.submit, 3, 2, 1, 1)

        self.tabs = QTabWidget(self.centralwidget)
        self.tabs.setObjectName("tabs")
        self.tabs.setSizePolicy(*FIX_FIX)
        self.tabs.setMinimumSize(300, 150)
        self.tabs.setMaximumSize(300, 150)
        self.tab = QWidget()
        self.tab.setObjectName("tab")
        self.tabs.addTab(self.tab, "Actions")
        self.tab2 = QWidget()
        self.tab2.setObjectName("tab2")
        self.tabs.addTab(self.tab2, "My Media")
        self.tab3 = QWidget()
        self.tab3.setObjectName("tab3")
        self.tab3.setSizePolicy(*FIX_FIX)
        self.grid_layout2 = QGridLayout(self.tab3)
        self.grid_layout2.setHorizontalSpacing(0)
        self.grid_layout2.setVerticalSpacing(3)
        self.grid_layout2.setContentsMargins(3, -1, 3, -1)
        self.server_folder = QLineEdit(self.tab3)
        self.server_folder.setObjectName("server_folder")

        self.grid_layout2.addWidget(self.server_folder, 0, 0, 1, 3)
        self.srv_browse = QPushButton("BROWSE", self.tab3)
        self.srv_browse.setObjectName("srv_browse")
        self.srv_browse.setStyleSheet("background: transparent;\n"
                                      "	color: #4d4940;\n"
                                      "    font-size: 8pt;\n"
                                      "	font-weight: 450;\n"
                                      "    padding: 6px;\n")

        self.grid_layout2.addWidget(self.srv_browse, 0, 3, 1, 1)

        self.back_button = QPushButton("", self.tab3)
        self.back_button.setObjectName("back_button")
        self.back_button.setSizePolicy(*FIX_FIX)
        self.back_button.setMaximumSize(SEVENTY_FIVE)
        self.back_button.setCursor(QCursor(Qt.PointingHandCursor))
        self.back_button.setStyleSheet("border: 0;\n"
                                       "background: transparent;")
        icon = QIcon()
        icon.addFile(":/newPrefix/back_button.png", SIXTY_FOUR, QIcon.Normal,
                     QIcon.Off)
        self.back_button.setIcon(icon)
        self.back_button.setIconSize(SIXTY_FOUR)

        self.grid_layout2.addWidget(self.back_button, 1, 0, 1, 1)

        self.play_button = QPushButton("", self.tab3)
        self.play_button.setObjectName("play_button")
        self.play_button.setSizePolicy(*FIX_FIX)
        self.play_button.setMaximumSize(SEVENTY_FIVE)
        self.play_button.setCursor(QCursor(Qt.PointingHandCursor))
        self.play_button.setStyleSheet("border: 0;\n"
                                       "background: transparent;")
        icon1 = QIcon()
        icon1.addFile(":/newPrefix/play_button.png", SIXTY_FOUR, QIcon.Normal,
                      QIcon.Off)
        self.play_button.setIcon(icon1)
        self.play_button.setIconSize(SIXTY_FOUR)

        self.grid_layout2.addWidget(self.play_button, 1, 1, 1, 1)

        self.stop_button = QPushButton("", self.tab3)
        self.stop_button.setObjectName("stop_button")
        self.stop_button.setSizePolicy(*FIX_FIX)
        self.stop_button.setMaximumSize(SEVENTY_FIVE)
        self.stop_button.setCursor(QCursor(Qt.PointingHandCursor))
        self.stop_button.setStyleSheet("border: 0;\n"
                                       "background: transparent;")
        icon2 = QIcon()
        icon2.addFile(":/newPrefix/stop_button.png", SIXTY_FOUR, QIcon.Normal,
                      QIcon.Off)
        self.stop_button.setIcon(icon2)
        self.stop_button.setIconSize(SIXTY_FOUR)

        self.grid_layout2.addWidget(self.stop_button, 1, 2, 1, 1)

        self.fast_forward = QPushButton("", self.tab3)
        self.fast_forward.setObjectName("fast_forward")
        self.fast_forward.setSizePolicy(*FIX_FIX)
        self.fast_forward.setMaximumSize(SEVENTY_FIVE)
        self.fast_forward.setCursor(QCursor(Qt.PointingHandCursor))
        self.fast_forward.setStyleSheet("border: 0;\n"
                                        "background: transparent;")
        icon3 = QIcon()
        icon3.addFile(":/newPrefix/fast_forward.png", SIXTY_FOUR, QIcon.Normal,
                      QIcon.Off)
        self.fast_forward.setIcon(icon3)
        self.fast_forward.setIconSize(SIXTY_FOUR)

        self.grid_layout2.addWidget(self.fast_forward, 1, 3, 1, 1)

        self.tabs.addTab(self.tab3, "Server Media")
        self.grid_layout.addWidget(self.tabs, 4, 1, 1, 2)
        main_window.setCentralWidget(self.centralwidget)

        self.statusbar = QStatusBar(main_window)
        self.statusbar.setObjectName("statusbar")
        self.statusbar.setEnabled(True)
        self.statusbar.setStyleSheet("margin-bottom: 5px;")
        self.statusbar.setSizePolicy(*EXP_FIX)
        self.statusbar.setMinimumSize(INFINITE, 30)
        self.statusbar.setMaximumSize(INFINITE, 30)
        self.statusbar.setSizeGripEnabled(False)
        main_window.setStatusBar(self.statusbar)

        self.menubar.addAction(self.file_menu.menuAction())
        self.menubar.addAction(self.server_menu.menuAction())
        self.menubar.addAction(self.options_menu.menuAction())
        self.menubar.addAction(self.media_menu.menuAction())
        self.file_menu.addAction(self.exit)
        self.server_menu.addAction(self.start_server)
        self.server_menu.addAction(self.connect_server)
        self.server_menu.addAction(self.kill_server)
        self.options_menu.addAction(self.options)
        self.media_menu.addAction(self.start_webcam)
        self.exit.triggered.connect(main_window.close)
        self.tabs.setCurrentIndex(0)
        QMetaObject.connectSlotsByName(main_window)
        self.exit.setStatusTip("Exit the program.")
        self.start_server.setStatusTip("Initialize a local server instance.")
        self.connect_server.setStatusTip("Connect to a remote server.")
        self.kill_server.setStatusTip("Shut down a running local server.")
        self.options.setStatusTip("Open the options menu.")
        self.start_webcam.setStatusTip("Start webcam feed.")
        self.tooltip = QLabel("", self.statusbar)
        tooltip_policy = QSizePolicy(*EXP_FIX)
        tooltip_policy.setHorizontalStretch(100)
        self.tooltip.setSizePolicy(tooltip_policy)
        self.tooltip.setMinimumSize(INFINITE, 26)
        self.tooltip.setMaximumSize(INFINITE, 26)
        self.server_status = QLabel("Server status:", self.statusbar)
        self.server_status.setSizePolicy(*FIX_FIX)
        self.server_status.setMinimumSize(300, 26)
        self.server_status.setMaximumSize(300, 26)
        self.client_status = QLabel("Client status:", self.statusbar)
        self.client_status.setSizePolicy(*FIX_FIX)
        self.client_status.setMinimumSize(302, 26)
        self.client_status.setMaximumSize(302, 26)
        self.statusbar.addPermanentWidget(self.tooltip)
        self.statusbar.addPermanentWidget(self.server_status)
        self.statusbar.addPermanentWidget(self.client_status)
        self.tooltip.setStyleSheet(SUNKEN + "margin-left: 4px;\
            margin-right: 0px;")
        self.client_status.setStyleSheet(SUNKEN + "margin-right: 7px;")
        self.server_status.setStyleSheet(SUNKEN + "margin-right: 2px;\
            margin-left: 2px;")
        self.statusbar.messageChanged.connect(main_window.status_tip)
Ejemplo n.º 7
0
class Ui_MainWindow(object):
    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)
    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Contour ShuttleXpress", None))
        self.action_Quit.setText(QCoreApplication.translate("MainWindow", u"&Quit", None))
#if QT_CONFIG(tooltip)
        self.log_button.setToolTip("")
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(statustip)
        self.log_button.setStatusTip(QCoreApplication.translate("MainWindow", u"Log", None))
#endif // QT_CONFIG(statustip)
        self.log_button.setText(QCoreApplication.translate("MainWindow", u"//", None))
#if QT_CONFIG(statustip)
        self.button_1.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 1", None))
#endif // QT_CONFIG(statustip)
        self.button_1.setText("")
#if QT_CONFIG(tooltip)
        self.usb_status.setToolTip("")
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(statustip)
        self.usb_status.setStatusTip(QCoreApplication.translate("MainWindow", u"USB connection status", None))
#endif // QT_CONFIG(statustip)
#if QT_CONFIG(whatsthis)
        self.usb_status.setWhatsThis(QCoreApplication.translate("MainWindow", u"USB Status", None))
#endif // QT_CONFIG(whatsthis)
#if QT_CONFIG(statustip)
        self.button_5.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 5", None))
#endif // QT_CONFIG(statustip)
        self.button_5.setText("")
#if QT_CONFIG(statustip)
        self.wheel_pos4.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 4", None))
#endif // QT_CONFIG(statustip)
        self.wheel_pos4.setText("")
#if QT_CONFIG(statustip)
        self.wheel_cent0.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: center", None))
#endif // QT_CONFIG(statustip)
        self.wheel_cent0.setText("")
#if QT_CONFIG(statustip)
        self.wheel_pos1.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 1", None))
#endif // QT_CONFIG(statustip)
        self.wheel_pos1.setText("")
#if QT_CONFIG(statustip)
        self.wheel_pos2.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 2", None))
#endif // QT_CONFIG(statustip)
        self.wheel_pos2.setText("")
#if QT_CONFIG(statustip)
        self.dial.setStatusTip(QCoreApplication.translate("MainWindow", u"Dial", None))
#endif // QT_CONFIG(statustip)
#if QT_CONFIG(statustip)
        self.wheel_neg6.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 6", None))
#endif // QT_CONFIG(statustip)
        self.wheel_neg6.setText("")
#if QT_CONFIG(statustip)
        self.wheel_pos5.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 5", None))
#endif // QT_CONFIG(statustip)
        self.wheel_pos5.setText("")
#if QT_CONFIG(statustip)
        self.button_2.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 2", None))
#endif // QT_CONFIG(statustip)
        self.button_2.setText("")
#if QT_CONFIG(statustip)
        self.wheel_neg5.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 5", None))
#endif // QT_CONFIG(statustip)
        self.wheel_neg5.setText("")
#if QT_CONFIG(statustip)
        self.wheel_pos6.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 6", None))
#endif // QT_CONFIG(statustip)
        self.wheel_pos6.setText("")
#if QT_CONFIG(statustip)
        self.wheel_neg1.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 1", None))
#endif // QT_CONFIG(statustip)
        self.wheel_neg1.setText("")
#if QT_CONFIG(statustip)
        self.button_4.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 4", None))
#endif // QT_CONFIG(statustip)
        self.button_4.setText("")
#if QT_CONFIG(statustip)
        self.wheel_pos7.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 7", None))
#endif // QT_CONFIG(statustip)
        self.wheel_pos7.setText("")
#if QT_CONFIG(statustip)
        self.button_3.setStatusTip(QCoreApplication.translate("MainWindow", u"Button 3", None))
#endif // QT_CONFIG(statustip)
        self.button_3.setText("")
#if QT_CONFIG(statustip)
        self.wheel_neg2.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 2", None))
#endif // QT_CONFIG(statustip)
        self.wheel_neg2.setText("")
#if QT_CONFIG(statustip)
        self.wheel_pos3.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: right 3", None))
#endif // QT_CONFIG(statustip)
        self.wheel_pos3.setText("")
#if QT_CONFIG(statustip)
        self.wheel_neg3.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 3", None))
#endif // QT_CONFIG(statustip)
        self.wheel_neg3.setText("")
#if QT_CONFIG(statustip)
        self.wheel_neg4.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 4", None))
#endif // QT_CONFIG(statustip)
        self.wheel_neg4.setText(QCoreApplication.translate("MainWindow", u"-", None))
#if QT_CONFIG(statustip)
        self.wheel_neg7.setStatusTip(QCoreApplication.translate("MainWindow", u"Wheel position: left 7", None))
#endif // QT_CONFIG(statustip)
        self.wheel_neg7.setText("")
#if QT_CONFIG(tooltip)
        self.about_button.setToolTip("")
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(statustip)
        self.about_button.setStatusTip(QCoreApplication.translate("MainWindow", u"About", None))
#endif // QT_CONFIG(statustip)
        self.about_button.setText(QCoreApplication.translate("MainWindow", u"?", None))
#if QT_CONFIG(tooltip)
        self.plug_button.setToolTip("")
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(statustip)
        self.plug_button.setStatusTip(QCoreApplication.translate("MainWindow", u"Configuration", None))
#endif // QT_CONFIG(statustip)
        self.plug_button.setText(QCoreApplication.translate("MainWindow", u"#", None))
#if QT_CONFIG(tooltip)
        self.conf_button.setToolTip("")
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(statustip)
        self.conf_button.setStatusTip(QCoreApplication.translate("MainWindow", u"Configuration", None))
#endif // QT_CONFIG(statustip)
        self.conf_button.setText(QCoreApplication.translate("MainWindow", u"=", None))
        self.about_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"About", None))
        self.about_text.setDocumentTitle("")
        self.log_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"Log", None))
        self.log_clear_button.setText(QCoreApplication.translate("MainWindow", u"Clear", None))
        self.config_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"Configuration", None))
        self.plugins_widget.setWindowTitle(QCoreApplication.translate("MainWindow", u"Plugins", None))
Ejemplo n.º 8
0
class PredictionWindow(QWidget):
    """Subwindow dedicated to random forest prediction functions."""

    # Private Instance Attributes:
    # - _predict_btn: Button that signals for a prediction to be made.
    # - _predict_btn: Button that signals for the selected model to be deleted.
    # - _model: The RandomForest model currently loaded.
    # - _model_info: QPlainTextEdit widget displaying information about the selected model.
    # - _target_date: Calendar widget for the user to select a target prediction date.
    # -_plot_window: Window for displaying historical information with a prediction.
    _predict_btn: QDialogButtonBox
    _delete_btn: QDialogButtonBox
    _model: QComboBox
    _model_info: QPlainTextEdit
    _target_date: QCalendarWidget
    _plot_window: QMainWindow

    def __init__(self) -> None:
        super().__init__()

        main_layout = QGridLayout()
        button_box = self._create_button_box()
        main_layout.addWidget(self._create_options_group_box(), 0, 0)
        main_layout.addWidget(button_box, 1, 0)

        main_layout.setSizeConstraint(QLayout.SetMinimumSize)

        self.setLayout(main_layout)

        self._refresh_model_info()
        self.setWindowTitle('Predict')
        self._plot_window = QMainWindow()

    def show(self) -> None:
        """Override of QWidget's show() function.

        Refreshes window and then shows the window.
        """
        self._refresh_lists()
        return super().show()

    @property
    def _selected_model(self) -> Union[RandomForest, None]:
        """Gets the currently selected model."""
        model_name = self._model.currentText()
        if model_name != '':
            try:
                return load_model(model_name)
            except pickle.UnpicklingError:
                self._error_event(f'{model_name} is an invalid model.')
                return None
        else:
            return None

    def _create_button_box(self) -> QDialogButtonBox:
        """Creates the lower control buttons at the bottom of the window."""
        button_box = QDialogButtonBox()

        self._predict_btn = button_box.addButton('Predict',
                                                 QDialogButtonBox.ActionRole)
        self._delete_btn = button_box.addButton('Delete Model',
                                                QDialogButtonBox.ActionRole)
        refresh_btn = button_box.addButton('Refresh &Options',
                                           QDialogButtonBox.ActionRole)

        self._predict_btn.clicked.connect(self._predict)
        refresh_btn.clicked.connect(self._refresh_lists)
        self._delete_btn.clicked.connect(self._delete)

        return button_box

    def _create_options_group_box(self) -> QGroupBox:
        """Returns the group of prediction options."""
        options_group_box = QGroupBox("Options")

        options_layout = QGridLayout()
        left_options = QGridLayout()
        right_options = QGridLayout()

        date_label = QLabel("Target Date:")
        self._target_date = QCalendarWidget()

        left_options.addWidget(date_label, 0, 0)
        left_options.addWidget(self._target_date, 1, 0, 1, 3)

        left_options.setColumnStretch(0, 1)

        self._model = QComboBox()
        self._model_info = QPlainTextEdit()
        self._model_info.setReadOnly(True)

        self._model.currentTextChanged.connect(self._refresh_model_info)

        self._refresh_lists()

        models_label = QLabel("Models:")
        info_label = QLabel("Model Information:")

        right_options.addWidget(models_label, 0, 0)
        right_options.addWidget(self._model, 1, 0)

        right_options.addWidget(info_label, 2, 0)
        right_options.addWidget(self._model_info, 3, 0)

        options_layout.addLayout(left_options, 0, 0)
        options_layout.addLayout(right_options, 0, 1)

        options_group_box.setLayout(options_layout)

        return options_group_box

    def _delete(self) -> None:
        """Deletes the currently selected dataset."""
        self.setEnabled(False)
        name = self._model.currentText()

        warning = f'Are you sure you want to delete {name}?'

        response = QMessageBox.warning(self, self.tr("Delete Model"), warning,
                                       QMessageBox.Yes, QMessageBox.No)

        if response == QMessageBox.Yes:
            data_ingest.delete_data(name, file_type='model')
            self._refresh_lists()

        self.setEnabled(True)

    def _refresh_lists(self) -> None:
        """Refreshes avaliable datasets for training."""
        self._model.clear()

        data_list = data_ingest.get_avaliable_data(search_type='model')

        self._model.addItems(data_list)

    def _refresh_model_info(self) -> None:
        """Refreshes avaliable features for the selected target."""
        self._predict_btn.setEnabled(False)
        self._target_date.setEnabled(False)
        self._model_info.clear()

        model_name = self._model.currentText()

        model = self._selected_model
        if model is None:
            self._delete_btn.setEnabled(False)
            return None

        self._delete_btn.setEnabled(True)

        self._display_model_info(model)

        req_features = model.window.req_features

        avaliable_sym = data_ingest.get_avaliable_sym()

        if len(req_features - avaliable_sym) != 0:
            self._error_event(
                f'Missing required data for {model_name}: {req_features - avaliable_sym}'
            )
            return None

        dfs = load_corresponding_dataframes(model)
        grouped_dataframe = data_ingest.create_grouped_dataframe(dfs)

        date_offset = pd.DateOffset(days=model.window.target_shift)

        self._target_date.setMaximumDate(grouped_dataframe.index.max() +
                                         date_offset)
        self._target_date.setMinimumDate(grouped_dataframe.index.min() +
                                         date_offset)

        self._target_date.setEnabled(True)
        self._predict_btn.setEnabled(True)

        return None

    def _display_model_info(self, model: RandomForest) -> None:
        """Updates model info box to display current model's information."""
        self._model_info.appendPlainText(
            f'Target Feature Name: \n{model.window.target_lbl}')
        self._model_info.appendPlainText('Window Information:')
        self._model_info.appendPlainText(
            f'\t- Window Size: {model.window.window_size}')
        self._model_info.appendPlainText(
            f'\t- Target Shift: {model.window.target_shift}')
        self._model_info.appendPlainText(
            f'\t- Required Features: {model.window.req_features}')
        self._model_info.appendPlainText('Forest Information:')
        self._model_info.appendPlainText(
            f'\t- Number of Trees: {model.forest.n_trees}')
        self._model_info.appendPlainText(
            f'\t- Tree Max Depth: {model.forest.max_depth}')
        self._model_info.appendPlainText(f'\t- Seed: {model.forest.seed}')

    def _predict(self) -> None:
        """Creates a model prediction using the selected target date and model."""
        self.setEnabled(False)
        self._predict_btn.setEnabled(False)
        model = self._selected_model
        if model is None:
            self.setEnabled(True)
            return None

        target_date = self._target_date.selectedDate().toPython()

        try:
            dfs = load_corresponding_dataframes(model)
            prediction_input = data_ingest.create_input(
                model.window.window_size, model.window.target_shift,
                target_date, dfs)
        except ce.MissingData:
            self._error_event(
                'Missing required data. Could be that loaded datasets have holes.'
            )
            self.setEnabled(True)
            return None

        prediction = model.predict(prediction_input)

        historical_dfs = load_corresponding_dataframes(model, 'target')
        if len(historical_dfs) == 0:
            self._prediction_historical_error(prediction)
        else:
            self._plot_prediction(historical_dfs, model, prediction,
                                  target_date)

        self._predict_btn.setEnabled(True)
        self.setEnabled(True)
        return None

    def _plot_prediction(self, historical_dfs: list[pd.DataFrame],
                         model: RandomForest, prediction: ndarray,
                         target_date: datetime.date) -> None:
        """Opens a window with a plot of the historical target data as well as the prediction
        the model made."""
        hdf = historical_dfs[0]
        for frame in historical_dfs[1:]:
            hdf = hdf.combine_first(frame)
        window_end = target_date - \
            pd.DateOffset(days=model.window.target_shift)
        window_start = window_end - pd.DateOffset(days=30 - 1)
        hdf = pd.Series(
            hdf.loc[window_end:window_start][model.window.target_lbl])

        hdf_data = hdf.to_list()
        hdf_dates = hdf.index

        hdf_dates = [ts.to_pydatetime().timestamp() for ts in hdf_dates]

        b_axis = pg.DateAxisItem(orientation='bottom')
        b_axis.setLabel('Date')
        plot = PlotWidget(axisItems={'bottom': b_axis})

        target_time = datetime.combine(target_date, datetime.min.time())

        plot.addLegend()
        plot.plot(x=hdf_dates,
                  y=hdf_data,
                  name=f'Historical {model.window.target_lbl}')
        plot.plot(x=[target_time.timestamp()],
                  y=prediction,
                  pen=None,
                  symbol='o',
                  name=f'Predicted Value: {prediction[0]}')
        model_name = self._model.currentText()
        self._plot_window.setWindowTitle(f'{model_name} Prediction')
        self._plot_window.setCentralWidget(plot)
        self._plot_window.show()

    def _prediction_historical_error(self, prediction: list) -> None:
        """Displays a message for when historical target is unavalable such that
        a graph can't be made."""
        QMessageBox.information(
            self, self.tr("Information"), f'Prediction was: {prediction}. \n '
            'Unable to display graph due to missing historical data.',
            QtWidgets.QMessageBox.Ok)

    def _error_event(
        self,
        error: str,
        choice: bool = False,
        btn: QMessageBox = QMessageBox.Abort
    ) -> Union[QMessageBox.Ignore, QMessageBox.Abort, None]:
        """Displays an error message with the given error."""
        if choice:
            response = QMessageBox.critical(self, self.tr("Error"), error, btn,
                                            QMessageBox.Ignore)
            return response
        else:
            QMessageBox.critical(self, self.tr("Error"), error, QMessageBox.Ok)
            return None
Ejemplo n.º 9
0
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        if not MainWindow.objectName():
            MainWindow.setObjectName(u"MainWindow")
        MainWindow.resize(1024, 768)
        self.actionOpen_ObjectBlueprints_xml = QAction(MainWindow)
        self.actionOpen_ObjectBlueprints_xml.setObjectName(
            u"actionOpen_ObjectBlueprints_xml")
        self.actionExit = QAction(MainWindow)
        self.actionExit.setObjectName(u"actionExit")
        self.actionWiki_template = QAction(MainWindow)
        self.actionWiki_template.setObjectName(u"actionWiki_template")
        self.actionWiki_template.setCheckable(True)
        self.actionWiki_template.setChecked(True)
        self.actionAttributes = QAction(MainWindow)
        self.actionAttributes.setObjectName(u"actionAttributes")
        self.actionAttributes.setCheckable(True)
        self.actionAll_attributes = QAction(MainWindow)
        self.actionAll_attributes.setObjectName(u"actionAll_attributes")
        self.actionAll_attributes.setCheckable(True)
        self.actionScan_wiki = QAction(MainWindow)
        self.actionScan_wiki.setObjectName(u"actionScan_wiki")
        self.actionUpload_templates = QAction(MainWindow)
        self.actionUpload_templates.setObjectName(u"actionUpload_templates")
        self.actionUpload_tiles = QAction(MainWindow)
        self.actionUpload_tiles.setObjectName(u"actionUpload_tiles")
        self.actionXML_source = QAction(MainWindow)
        self.actionXML_source.setObjectName(u"actionXML_source")
        self.actionXML_source.setCheckable(True)
        self.actionShow_help = QAction(MainWindow)
        self.actionShow_help.setObjectName(u"actionShow_help")
        self.actionUpload_extra_image_s_for_selected_objects = QAction(
            MainWindow)
        self.actionUpload_extra_image_s_for_selected_objects.setObjectName(
            u"actionUpload_extra_image_s_for_selected_objects")
        self.actionDiff_template_against_wiki = QAction(MainWindow)
        self.actionDiff_template_against_wiki.setObjectName(
            u"actionDiff_template_against_wiki")
        self.actionDark_mode = QAction(MainWindow)
        self.actionDark_mode.setObjectName(u"actionDark_mode")
        self.actionSuppress_image_comparison_popups = QAction(MainWindow)
        self.actionSuppress_image_comparison_popups.setObjectName(
            u"actionSuppress_image_comparison_popups")
        self.actionSuppress_image_comparison_popups.setCheckable(True)
        self.actionSuppress_image_comparison_popups.setChecked(False)
        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName(u"centralwidget")
        self.gridLayout = QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName(u"gridLayout")
        self.verticalLayout = QVBoxLayout()
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.plainTextEdit = QPlainTextEdit(self.centralwidget)
        self.plainTextEdit.setObjectName(u"plainTextEdit")
        font = QFont()
        font.setFamilies([u"Consolas"])
        font.setPointSize(10)
        self.plainTextEdit.setFont(font)
        self.plainTextEdit.setUndoRedoEnabled(False)
        self.plainTextEdit.setReadOnly(True)

        self.horizontalLayout.addWidget(self.plainTextEdit)

        self.verticalLayout_4 = QVBoxLayout()
        self.verticalLayout_4.setObjectName(u"verticalLayout_4")
        self.tile_label = QLabel(self.centralwidget)
        self.tile_label.setObjectName(u"tile_label")
        self.tile_label.setMinimumSize(QSize(160, 240))
        font1 = QFont()
        font1.setFamilies([u"Segoe UI"])
        self.tile_label.setFont(font1)
        self.tile_label.setStyleSheet(u"background-color: rgb(15, 59, 58);")

        self.verticalLayout_4.addWidget(self.tile_label)

        self.save_tile_button = QPushButton(self.centralwidget)
        self.save_tile_button.setObjectName(u"save_tile_button")
        font2 = QFont()
        font2.setFamilies([u"Segoe UI"])
        font2.setPointSize(10)
        self.save_tile_button.setFont(font2)

        self.verticalLayout_4.addWidget(self.save_tile_button)

        self.swap_tile_button = QPushButton(self.centralwidget)
        self.swap_tile_button.setObjectName(u"swap_tile_button")
        self.swap_tile_button.setEnabled(True)
        self.swap_tile_button.setFont(font2)

        self.verticalLayout_4.addWidget(self.swap_tile_button)

        self.horizontalLayout.addLayout(self.verticalLayout_4)

        self.verticalLayout.addLayout(self.horizontalLayout)

        self.verticalLayout_3 = QVBoxLayout()
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.search_label = QLabel(self.centralwidget)
        self.search_label.setObjectName(u"search_label")
        self.search_label.setMinimumSize(QSize(0, 0))
        self.search_label.setFont(font2)

        self.horizontalLayout_2.addWidget(self.search_label)

        self.search_line_edit = QLineEdit(self.centralwidget)
        self.search_line_edit.setObjectName(u"search_line_edit")
        self.search_line_edit.setFont(font2)

        self.horizontalLayout_2.addWidget(self.search_line_edit)

        self.expand_all_button = QPushButton(self.centralwidget)
        self.expand_all_button.setObjectName(u"expand_all_button")
        self.expand_all_button.setMinimumSize(QSize(90, 0))
        self.expand_all_button.setFont(font2)

        self.horizontalLayout_2.addWidget(self.expand_all_button)

        self.collapse_all_button = QPushButton(self.centralwidget)
        self.collapse_all_button.setObjectName(u"collapse_all_button")
        self.collapse_all_button.setMinimumSize(QSize(90, 0))
        self.collapse_all_button.setFont(font2)

        self.horizontalLayout_2.addWidget(self.collapse_all_button)

        self.restore_all_button = QPushButton(self.centralwidget)
        self.restore_all_button.setObjectName(u"restore_all_button")
        self.restore_all_button.setMinimumSize(QSize(130, 0))
        self.restore_all_button.setFont(font2)

        self.horizontalLayout_2.addWidget(self.restore_all_button)

        self.verticalLayout_3.addLayout(self.horizontalLayout_2)

        self.tree_target_widget = QWidget(self.centralwidget)
        self.tree_target_widget.setObjectName(u"tree_target_widget")
        self.tree_target_widget.setFont(font1)

        self.verticalLayout_3.addWidget(self.tree_target_widget, 0,
                                        Qt.AlignBottom)

        self.verticalLayout.addLayout(self.verticalLayout_3)

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

        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QMenuBar(MainWindow)
        self.menubar.setObjectName(u"menubar")
        self.menubar.setGeometry(QRect(0, 0, 1024, 21))
        self.menuFile = QMenu(self.menubar)
        self.menuFile.setObjectName(u"menuFile")
        self.menuView = QMenu(self.menubar)
        self.menuView.setObjectName(u"menuView")
        self.menuWiki = QMenu(self.menubar)
        self.menuWiki.setObjectName(u"menuWiki")
        self.menuHelp = QMenu(self.menubar)
        self.menuHelp.setObjectName(u"menuHelp")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QStatusBar(MainWindow)
        self.statusbar.setObjectName(u"statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuView.menuAction())
        self.menubar.addAction(self.menuWiki.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())
        self.menuFile.addAction(self.actionOpen_ObjectBlueprints_xml)
        self.menuFile.addAction(self.actionExit)
        self.menuView.addAction(self.actionWiki_template)
        self.menuView.addAction(self.actionAttributes)
        self.menuView.addAction(self.actionAll_attributes)
        self.menuView.addAction(self.actionXML_source)
        self.menuView.addSeparator()
        self.menuView.addAction(self.actionDark_mode)
        self.menuWiki.addAction(self.actionScan_wiki)
        self.menuWiki.addAction(self.actionDiff_template_against_wiki)
        self.menuWiki.addAction(self.actionUpload_templates)
        self.menuWiki.addAction(self.actionUpload_tiles)
        self.menuWiki.addAction(
            self.actionUpload_extra_image_s_for_selected_objects)
        self.menuWiki.addAction(self.actionSuppress_image_comparison_popups)
        self.menuHelp.addAction(self.actionShow_help)

        self.retranslateUi(MainWindow)

        QMetaObject.connectSlotsByName(MainWindow)

    # setupUi

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(
            QCoreApplication.translate("MainWindow", u"Qud Blueprint Explorer",
                                       None))
        self.actionOpen_ObjectBlueprints_xml.setText(
            QCoreApplication.translate("MainWindow",
                                       u"Open ObjectBlueprints.xml...", None))
        self.actionExit.setText(
            QCoreApplication.translate("MainWindow", u"Exit", None))
        self.actionWiki_template.setText(
            QCoreApplication.translate("MainWindow", u"Wiki template", None))
        self.actionAttributes.setText(
            QCoreApplication.translate("MainWindow", u"Attributes", None))
        self.actionAll_attributes.setText(
            QCoreApplication.translate("MainWindow", u"All attributes", None))
        self.actionScan_wiki.setText(
            QCoreApplication.translate("MainWindow",
                                       u"Scan wiki for selected objects",
                                       None))
        self.actionUpload_templates.setText(
            QCoreApplication.translate(
                "MainWindow", u"Upload templates for selected objects", None))
        self.actionUpload_tiles.setText(
            QCoreApplication.translate("MainWindow",
                                       u"Upload tiles for selected objects",
                                       None))
        self.actionXML_source.setText(
            QCoreApplication.translate("MainWindow", u"XML source", None))
        self.actionShow_help.setText(
            QCoreApplication.translate("MainWindow", u"Show help", None))
        self.actionUpload_extra_image_s_for_selected_objects.setText(
            QCoreApplication.translate(
                "MainWindow", u"Upload extra image(s) for selected objects",
                None))
        self.actionDiff_template_against_wiki.setText(
            QCoreApplication.translate("MainWindow",
                                       u"Diff template against wiki", None))
        self.actionDark_mode.setText(
            QCoreApplication.translate("MainWindow", u"Toggle dark mode",
                                       None))
        self.actionSuppress_image_comparison_popups.setText(
            QCoreApplication.translate("MainWindow",
                                       u"Suppress image comparison pop-ups",
                                       None))
        self.tile_label.setText("")
        self.save_tile_button.setText(
            QCoreApplication.translate("MainWindow", u"Save tile...", None))
        self.swap_tile_button.setText(
            QCoreApplication.translate("MainWindow", u"Toggle .png/.gif",
                                       None))
        self.search_label.setText(
            QCoreApplication.translate("MainWindow", u"Search:", None))
        self.expand_all_button.setText(
            QCoreApplication.translate("MainWindow", u"Expand all", None))
        self.collapse_all_button.setText(
            QCoreApplication.translate("MainWindow", u"Collapse all", None))
        self.restore_all_button.setText(
            QCoreApplication.translate("MainWindow", u"Default expansion",
                                       None))
        self.menuFile.setTitle(
            QCoreApplication.translate("MainWindow", u"File", None))
        self.menuView.setTitle(
            QCoreApplication.translate("MainWindow", u"View type", None))
        self.menuWiki.setTitle(
            QCoreApplication.translate("MainWindow", u"Wiki", None))
        self.menuHelp.setTitle(
            QCoreApplication.translate("MainWindow", u"Help", None))
Ejemplo n.º 10
0
Archivo: pro.py Proyecto: clpi/isutils
class Ui_ProjectSettings_UI(object):
    def setupUi(self, ProjectSettings_UI):
        if not ProjectSettings_UI.objectName():
            ProjectSettings_UI.setObjectName(u"ProjectSettings_UI")
        ProjectSettings_UI.resize(575, 685)
        self.gridLayout_3 = QGridLayout(ProjectSettings_UI)
        self.gridLayout_3.setObjectName(u"gridLayout_3")
        self.buttonBox = QDialogButtonBox(ProjectSettings_UI)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                          | QDialogButtonBox.Ok)

        self.gridLayout_3.addWidget(self.buttonBox, 2, 0, 1, 1)

        self.tabWidget = QTabWidget(ProjectSettings_UI)
        self.tabWidget.setObjectName(u"tabWidget")
        self.tabWidget.setDocumentMode(True)
        self.tab = QWidget()
        self.tab.setObjectName(u"tab")
        self.gridLayout = QGridLayout(self.tab)
        self.gridLayout.setObjectName(u"gridLayout")
        self.previewparams = QPlainTextEdit(self.tab)
        self.previewparams.setObjectName(u"previewparams")
        sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.previewparams.sizePolicy().hasHeightForWidth())
        self.previewparams.setSizePolicy(sizePolicy)
        self.previewparams.setReadOnly(True)

        self.gridLayout.addWidget(self.previewparams, 7, 0, 1, 4)

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

        self.gridLayout.addWidget(self.label_2, 5, 0, 1, 1)

        self.audio_thumbs = QCheckBox(self.tab)
        self.audio_thumbs.setObjectName(u"audio_thumbs")

        self.gridLayout.addWidget(self.audio_thumbs, 5, 2, 1, 1)

        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.label_7 = QLabel(self.tab)
        self.label_7.setObjectName(u"label_7")

        self.horizontalLayout_2.addWidget(self.label_7)

        self.video_tracks = QSpinBox(self.tab)
        self.video_tracks.setObjectName(u"video_tracks")

        self.horizontalLayout_2.addWidget(self.video_tracks)

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

        self.horizontalLayout_2.addWidget(self.label_8)

        self.audio_tracks = QSpinBox(self.tab)
        self.audio_tracks.setObjectName(u"audio_tracks")

        self.horizontalLayout_2.addWidget(self.audio_tracks)

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

        self.horizontalLayout_2.addWidget(self.label)

        self.audio_channels = QComboBox(self.tab)
        self.audio_channels.addItem("")
        self.audio_channels.addItem("")
        self.audio_channels.addItem("")
        self.audio_channels.setObjectName(u"audio_channels")
        sizePolicy1 = QSizePolicy(QSizePolicy.MinimumExpanding,
                                  QSizePolicy.Fixed)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.audio_channels.sizePolicy().hasHeightForWidth())
        self.audio_channels.setSizePolicy(sizePolicy1)

        self.horizontalLayout_2.addWidget(self.audio_channels)

        self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 4)

        self.horizontalSpacer = QSpacerItem(229, 20, QSizePolicy.Expanding,
                                            QSizePolicy.Minimum)

        self.gridLayout.addItem(self.horizontalSpacer, 5, 3, 1, 1)

        self.profile_box = QGroupBox(self.tab)
        self.profile_box.setObjectName(u"profile_box")
        sizePolicy2 = QSizePolicy(QSizePolicy.Preferred,
                                  QSizePolicy.MinimumExpanding)
        sizePolicy2.setHorizontalStretch(0)
        sizePolicy2.setVerticalStretch(0)
        sizePolicy2.setHeightForWidth(
            self.profile_box.sizePolicy().hasHeightForWidth())
        self.profile_box.setSizePolicy(sizePolicy2)
        self.profile_box.setFlat(True)

        self.gridLayout.addWidget(self.profile_box, 3, 0, 1, 4)

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

        self.gridLayout.addWidget(self.label_4, 0, 0, 1, 4)

        self.video_thumbs = QCheckBox(self.tab)
        self.video_thumbs.setObjectName(u"video_thumbs")

        self.gridLayout.addWidget(self.video_thumbs, 5, 1, 1, 1)

        self.horizontalLayout_4 = QHBoxLayout()
        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
        self.label_25 = QLabel(self.tab)
        self.label_25.setObjectName(u"label_25")
        sizePolicy3 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred)
        sizePolicy3.setHorizontalStretch(0)
        sizePolicy3.setVerticalStretch(0)
        sizePolicy3.setHeightForWidth(
            self.label_25.sizePolicy().hasHeightForWidth())
        self.label_25.setSizePolicy(sizePolicy3)

        self.horizontalLayout_4.addWidget(self.label_25)

        self.preview_profile = KComboBox(self.tab)
        self.preview_profile.setObjectName(u"preview_profile")
        sizePolicy1.setHeightForWidth(
            self.preview_profile.sizePolicy().hasHeightForWidth())
        self.preview_profile.setSizePolicy(sizePolicy1)

        self.horizontalLayout_4.addWidget(self.preview_profile)

        self.preview_showprofileinfo = QToolButton(self.tab)
        self.preview_showprofileinfo.setObjectName(u"preview_showprofileinfo")
        self.preview_showprofileinfo.setCheckable(True)

        self.horizontalLayout_4.addWidget(self.preview_showprofileinfo)

        self.preview_manageprofile = QToolButton(self.tab)
        self.preview_manageprofile.setObjectName(u"preview_manageprofile")

        self.horizontalLayout_4.addWidget(self.preview_manageprofile)

        self.gridLayout.addLayout(self.horizontalLayout_4, 6, 0, 1, 4)

        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.custom_folder = QCheckBox(self.tab)
        self.custom_folder.setObjectName(u"custom_folder")

        self.horizontalLayout.addWidget(self.custom_folder)

        self.project_folder = KUrlRequester(self.tab)
        self.project_folder.setObjectName(u"project_folder")
        self.project_folder.setEnabled(False)

        self.horizontalLayout.addWidget(self.project_folder)

        self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 4)

        self.same_folder = QCheckBox(self.tab)
        self.same_folder.setObjectName(u"same_folder")

        self.gridLayout.addWidget(self.same_folder, 2, 0, 1, 4)

        self.tabWidget.addTab(self.tab, "")
        self.label_4.raise_()
        self.profile_box.raise_()
        self.label_2.raise_()
        self.video_thumbs.raise_()
        self.audio_thumbs.raise_()
        self.previewparams.raise_()
        self.same_folder.raise_()
        self.tab_4 = QWidget()
        self.tab_4.setObjectName(u"tab_4")
        self.verticalLayout = QVBoxLayout(self.tab_4)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.enable_proxy = QCheckBox(self.tab_4)
        self.enable_proxy.setObjectName(u"enable_proxy")

        self.verticalLayout.addWidget(self.enable_proxy)

        self.proxy_box = QGroupBox(self.tab_4)
        self.proxy_box.setObjectName(u"proxy_box")
        self.proxy_box.setEnabled(False)
        self.proxy_box.setFlat(True)
        self.proxy_box.setCheckable(False)
        self.proxy_box.setChecked(False)
        self.gridLayout_2 = QGridLayout(self.proxy_box)
        self.gridLayout_2.setObjectName(u"gridLayout_2")
        self.gridLayout_2.setHorizontalSpacing(6)
        self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
        self.l_relPathProxyToOrig = QLabel(self.proxy_box)
        self.l_relPathProxyToOrig.setObjectName(u"l_relPathProxyToOrig")

        self.gridLayout_2.addWidget(self.l_relPathProxyToOrig, 10, 1, 1, 1)

        self.generate_imageproxy = QCheckBox(self.proxy_box)
        self.generate_imageproxy.setObjectName(u"generate_imageproxy")

        self.gridLayout_2.addWidget(self.generate_imageproxy, 3, 0, 1, 2)

        self.l_prefix_proxy = QLabel(self.proxy_box)
        self.l_prefix_proxy.setObjectName(u"l_prefix_proxy")

        self.gridLayout_2.addWidget(self.l_prefix_proxy, 11, 1, 1, 1)

        self.proxy_imagesize = QSpinBox(self.proxy_box)
        self.proxy_imagesize.setObjectName(u"proxy_imagesize")
        self.proxy_imagesize.setEnabled(False)
        self.proxy_imagesize.setMinimum(200)
        self.proxy_imagesize.setMaximum(100000)
        self.proxy_imagesize.setValue(800)

        self.gridLayout_2.addWidget(self.proxy_imagesize, 4, 2, 1, 4)

        self.label_24 = QLabel(self.proxy_box)
        self.label_24.setObjectName(u"label_24")
        sizePolicy3.setHeightForWidth(
            self.label_24.sizePolicy().hasHeightForWidth())
        self.label_24.setSizePolicy(sizePolicy3)

        self.gridLayout_2.addWidget(self.label_24, 1, 0, 1, 1)

        self.proxy_minsize = QSpinBox(self.proxy_box)
        self.proxy_minsize.setObjectName(u"proxy_minsize")
        self.proxy_minsize.setMaximum(10000)
        self.proxy_minsize.setValue(1000)

        self.gridLayout_2.addWidget(self.proxy_minsize, 0, 2, 1, 4)

        self.l_prefix_clip = QLabel(self.proxy_box)
        self.l_prefix_clip.setObjectName(u"l_prefix_clip")

        self.gridLayout_2.addWidget(self.l_prefix_clip, 8, 1, 1, 1)

        self.proxy_profile = KComboBox(self.proxy_box)
        self.proxy_profile.setObjectName(u"proxy_profile")
        sizePolicy1.setHeightForWidth(
            self.proxy_profile.sizePolicy().hasHeightForWidth())
        self.proxy_profile.setSizePolicy(sizePolicy1)

        self.gridLayout_2.addWidget(self.proxy_profile, 1, 1, 1, 2)

        self.proxy_showprofileinfo = QToolButton(self.proxy_box)
        self.proxy_showprofileinfo.setObjectName(u"proxy_showprofileinfo")
        self.proxy_showprofileinfo.setCheckable(True)

        self.gridLayout_2.addWidget(self.proxy_showprofileinfo, 1, 4, 1, 1)

        self.generate_proxy = QCheckBox(self.proxy_box)
        self.generate_proxy.setObjectName(u"generate_proxy")

        self.gridLayout_2.addWidget(self.generate_proxy, 0, 0, 1, 2)

        self.proxyparams = QPlainTextEdit(self.proxy_box)
        self.proxyparams.setObjectName(u"proxyparams")
        sizePolicy.setHeightForWidth(
            self.proxyparams.sizePolicy().hasHeightForWidth())
        self.proxyparams.setSizePolicy(sizePolicy)
        self.proxyparams.setReadOnly(True)

        self.gridLayout_2.addWidget(self.proxyparams, 2, 0, 1, 6)

        self.image_label = QLabel(self.proxy_box)
        self.image_label.setObjectName(u"image_label")
        self.image_label.setEnabled(False)

        self.gridLayout_2.addWidget(self.image_label, 4, 0, 1, 2)

        self.le_relPathProxyToOrig = QLineEdit(self.proxy_box)
        self.le_relPathProxyToOrig.setObjectName(u"le_relPathProxyToOrig")
        self.le_relPathProxyToOrig.setEnabled(False)

        self.gridLayout_2.addWidget(self.le_relPathProxyToOrig, 10, 3, 1, 1)

        self.le_prefix_proxy = QLineEdit(self.proxy_box)
        self.le_prefix_proxy.setObjectName(u"le_prefix_proxy")
        self.le_prefix_proxy.setEnabled(False)

        self.gridLayout_2.addWidget(self.le_prefix_proxy, 11, 3, 1, 1)

        self.l_suffix_proxy = QLabel(self.proxy_box)
        self.l_suffix_proxy.setObjectName(u"l_suffix_proxy")

        self.gridLayout_2.addWidget(self.l_suffix_proxy, 12, 1, 1, 1)

        self.le_prefix_clip = QLineEdit(self.proxy_box)
        self.le_prefix_clip.setObjectName(u"le_prefix_clip")
        self.le_prefix_clip.setEnabled(False)

        self.gridLayout_2.addWidget(self.le_prefix_clip, 8, 3, 1, 1)

        self.le_suffix_proxy = QLineEdit(self.proxy_box)
        self.le_suffix_proxy.setObjectName(u"le_suffix_proxy")
        self.le_suffix_proxy.setEnabled(False)

        self.gridLayout_2.addWidget(self.le_suffix_proxy, 12, 3, 1, 1)

        self.proxy_imageminsize = QSpinBox(self.proxy_box)
        self.proxy_imageminsize.setObjectName(u"proxy_imageminsize")
        self.proxy_imageminsize.setMinimum(500)
        self.proxy_imageminsize.setMaximum(100000)
        self.proxy_imageminsize.setValue(2000)

        self.gridLayout_2.addWidget(self.proxy_imageminsize, 3, 2, 1, 4)

        self.l_suffix_clip = QLabel(self.proxy_box)
        self.l_suffix_clip.setObjectName(u"l_suffix_clip")

        self.gridLayout_2.addWidget(self.l_suffix_clip, 9, 1, 1, 1)

        self.l_relPathOrigToProxy = QLabel(self.proxy_box)
        self.l_relPathOrigToProxy.setObjectName(u"l_relPathOrigToProxy")

        self.gridLayout_2.addWidget(self.l_relPathOrigToProxy, 7, 1, 1, 1)

        self.le_relPathOrigToProxy = QLineEdit(self.proxy_box)
        self.le_relPathOrigToProxy.setObjectName(u"le_relPathOrigToProxy")
        self.le_relPathOrigToProxy.setEnabled(False)

        self.gridLayout_2.addWidget(self.le_relPathOrigToProxy, 7, 3, 1, 1)

        self.external_proxy_profile = QComboBox(self.proxy_box)
        self.external_proxy_profile.setObjectName(u"external_proxy_profile")

        self.gridLayout_2.addWidget(self.external_proxy_profile, 6, 1, 1, 5)

        self.proxy_resize = QSpinBox(self.proxy_box)
        self.proxy_resize.setObjectName(u"proxy_resize")
        self.proxy_resize.setMinimum(200)
        self.proxy_resize.setMaximum(100000)

        self.gridLayout_2.addWidget(self.proxy_resize, 5, 2, 1, 4)

        self.le_suffix_clip = QLineEdit(self.proxy_box)
        self.le_suffix_clip.setObjectName(u"le_suffix_clip")
        self.le_suffix_clip.setEnabled(False)

        self.gridLayout_2.addWidget(self.le_suffix_clip, 9, 3, 1, 1)

        self.external_proxy = QCheckBox(self.proxy_box)
        self.external_proxy.setObjectName(u"external_proxy")

        self.gridLayout_2.addWidget(self.external_proxy, 6, 0, 1, 1)

        self.checkProxy = QToolButton(self.proxy_box)
        self.checkProxy.setObjectName(u"checkProxy")

        self.gridLayout_2.addWidget(self.checkProxy, 1, 3, 1, 1)

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

        self.gridLayout_2.addWidget(self.label_3, 5, 0, 1, 1)

        self.proxy_manageprofile = QToolButton(self.proxy_box)
        self.proxy_manageprofile.setObjectName(u"proxy_manageprofile")

        self.gridLayout_2.addWidget(self.proxy_manageprofile, 1, 5, 1, 1)

        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum,
                                          QSizePolicy.Expanding)

        self.gridLayout_2.addItem(self.verticalSpacer, 13, 1, 1, 1)

        self.verticalLayout.addWidget(self.proxy_box)

        self.tabWidget.addTab(self.tab_4, "")
        self.tab_3 = QWidget()
        self.tab_3.setObjectName(u"tab_3")
        self.gridLayout_6 = QGridLayout(self.tab_3)
        self.gridLayout_6.setObjectName(u"gridLayout_6")
        self.metadata_list = QTreeWidget(self.tab_3)
        self.metadata_list.setObjectName(u"metadata_list")
        self.metadata_list.setAlternatingRowColors(True)
        self.metadata_list.setRootIsDecorated(False)
        self.metadata_list.setAllColumnsShowFocus(True)
        self.metadata_list.setColumnCount(2)
        self.metadata_list.header().setVisible(False)

        self.gridLayout_6.addWidget(self.metadata_list, 0, 0, 1, 1)

        self.horizontalLayout_3 = QHBoxLayout()
        self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
        self.add_metadata = QToolButton(self.tab_3)
        self.add_metadata.setObjectName(u"add_metadata")

        self.horizontalLayout_3.addWidget(self.add_metadata)

        self.delete_metadata = QToolButton(self.tab_3)
        self.delete_metadata.setObjectName(u"delete_metadata")

        self.horizontalLayout_3.addWidget(self.delete_metadata)

        self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                              QSizePolicy.Minimum)

        self.horizontalLayout_3.addItem(self.horizontalSpacer_3)

        self.gridLayout_6.addLayout(self.horizontalLayout_3, 1, 0, 1, 1)

        self.tabWidget.addTab(self.tab_3, "")
        self.tab_2 = QWidget()
        self.tab_2.setObjectName(u"tab_2")
        self.gridLayout_4 = QGridLayout(self.tab_2)
        self.gridLayout_4.setObjectName(u"gridLayout_4")
        self.fonts_list = QListWidget(self.tab_2)
        self.fonts_list.setObjectName(u"fonts_list")
        self.fonts_list.setAlternatingRowColors(True)

        self.gridLayout_4.addWidget(self.fonts_list, 5, 0, 1, 5)

        self.files_list = QTreeWidget(self.tab_2)
        __qtreewidgetitem = QTreeWidgetItem()
        __qtreewidgetitem.setText(0, u"1")
        self.files_list.setHeaderItem(__qtreewidgetitem)
        self.files_list.setObjectName(u"files_list")
        self.files_list.setAlternatingRowColors(True)
        self.files_list.setRootIsDecorated(False)
        self.files_list.setItemsExpandable(False)
        self.files_list.setHeaderHidden(True)
        self.files_list.setExpandsOnDoubleClick(False)

        self.gridLayout_4.addWidget(self.files_list, 3, 0, 1, 5)

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

        self.gridLayout_4.addWidget(self.label_12, 0, 0, 1, 2)

        self.used_count = QLabel(self.tab_2)
        self.used_count.setObjectName(u"used_count")

        self.gridLayout_4.addWidget(self.used_count, 0, 2, 1, 1)

        self.used_size = QLabel(self.tab_2)
        self.used_size.setObjectName(u"used_size")

        self.gridLayout_4.addWidget(self.used_size, 0, 3, 1, 1)

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

        self.gridLayout_4.addWidget(self.label_6, 1, 0, 1, 1)

        self.unused_count = QLabel(self.tab_2)
        self.unused_count.setObjectName(u"unused_count")

        self.gridLayout_4.addWidget(self.unused_count, 1, 2, 1, 1)

        self.unused_size = QLabel(self.tab_2)
        self.unused_size.setObjectName(u"unused_size")

        self.gridLayout_4.addWidget(self.unused_size, 1, 3, 1, 1)

        self.delete_unused = QPushButton(self.tab_2)
        self.delete_unused.setObjectName(u"delete_unused")

        self.gridLayout_4.addWidget(self.delete_unused, 1, 4, 1, 1)

        self.list_search = KTreeWidgetSearchLine(self.tab_2)
        self.list_search.setObjectName(u"list_search")

        self.gridLayout_4.addWidget(self.list_search, 2, 3, 1, 2)

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

        self.gridLayout_4.addWidget(self.label_13, 2, 0, 1, 1)

        self.label_fonts = QLabel(self.tab_2)
        self.label_fonts.setObjectName(u"label_fonts")

        self.gridLayout_4.addWidget(self.label_fonts, 4, 0, 1, 1)

        self.button_export = QPushButton(self.tab_2)
        self.button_export.setObjectName(u"button_export")

        self.gridLayout_4.addWidget(self.button_export, 6, 0, 1, 2)

        self.files_count = QLabel(self.tab_2)
        self.files_count.setObjectName(u"files_count")

        self.gridLayout_4.addWidget(self.files_count, 2, 2, 1, 1)

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

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

        self.retranslateUi(ProjectSettings_UI)
        self.buttonBox.accepted.connect(ProjectSettings_UI.accept)
        self.buttonBox.rejected.connect(ProjectSettings_UI.reject)
        self.custom_folder.toggled.connect(self.project_folder.setEnabled)
        self.enable_proxy.toggled.connect(self.proxy_box.setEnabled)
        self.external_proxy.toggled.connect(
            self.external_proxy_profile.setEnabled)

        self.tabWidget.setCurrentIndex(0)

        QMetaObject.connectSlotsByName(ProjectSettings_UI)

    # setupUi

    def retranslateUi(self, ProjectSettings_UI):
        ProjectSettings_UI.setWindowTitle(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Project Settings", None))
        self.label_2.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Thumbnails:",
                                       None))
        self.audio_thumbs.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Audio", None))
        self.label_7.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Video tracks:",
                                       None))
        self.label_8.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Audio tracks:",
                                       None))
        self.label.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Audio channels:", None))
        self.audio_channels.setItemText(
            0,
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"2 Channels (Stereo)", None))
        self.audio_channels.setItemText(
            1,
            QCoreApplication.translate("ProjectSettings_UI", u"4 Channels",
                                       None))
        self.audio_channels.setItemText(
            2,
            QCoreApplication.translate("ProjectSettings_UI", u"6 Channels",
                                       None))

        self.label_4.setText(
            QCoreApplication.translate(
                "ProjectSettings_UI",
                u"Project folder to store proxy clips, thumbnails, previews",
                None))
        self.video_thumbs.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Video", None))
        self.label_25.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Preview profile:", None))
        self.preview_showprofileinfo.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"...", None))
        self.preview_manageprofile.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"...", None))
        self.custom_folder.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Custom project folder:", None))
        self.same_folder.setText(
            QCoreApplication.translate(
                "ProjectSettings_UI",
                u"Use parent folder of the project file as project folder",
                None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab),
            QCoreApplication.translate("ProjectSettings_UI", u"Settings",
                                       None))
        self.enable_proxy.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Enable proxy clips", None))
        self.l_relPathProxyToOrig.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Relative path from proxy to clip:",
                                       None))
        self.generate_imageproxy.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Generate for images larger than",
                                       None))
        self.l_prefix_proxy.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Prefix of proxy:", None))
        self.proxy_imagesize.setSuffix(
            QCoreApplication.translate("ProjectSettings_UI", u"pixels", None))
        self.label_24.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Encoding profile:", None))
        self.proxy_minsize.setSuffix(
            QCoreApplication.translate("ProjectSettings_UI", u"pixels", None))
        self.l_prefix_clip.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Prefix of clip:", None))
        self.proxy_showprofileinfo.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"...", None))
        self.generate_proxy.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Generate for videos larger than",
                                       None))
        self.image_label.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Proxy image size", None))
        self.l_suffix_proxy.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Suffix of proxy:", None))
        self.proxy_imageminsize.setSuffix(
            QCoreApplication.translate("ProjectSettings_UI", u"pixels", None))
        self.l_suffix_clip.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Suffix of clip:", None))
        self.l_relPathOrigToProxy.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Relative path from clip to proxy:",
                                       None))
        self.proxy_resize.setSuffix(
            QCoreApplication.translate("ProjectSettings_UI", u"pixels", None))
        self.external_proxy.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Use external proxy clips", None))
        self.checkProxy.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"...", None))
        self.label_3.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Proxy video resize (width)", None))
        self.proxy_manageprofile.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"...", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_4),
            QCoreApplication.translate("ProjectSettings_UI", u"Proxy", None))
        ___qtreewidgetitem = self.metadata_list.headerItem()
        ___qtreewidgetitem.setText(
            1, QCoreApplication.translate("ProjectSettings_UI", u"2", None))
        ___qtreewidgetitem.setText(
            0, QCoreApplication.translate("ProjectSettings_UI", u"1", None))
        self.add_metadata.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"...", None))
        self.delete_metadata.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"...", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_3),
            QCoreApplication.translate("ProjectSettings_UI", u"Metadata",
                                       None))
        self.label_12.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Clips used in project:", None))
        self.used_count.setText("")
        self.used_size.setText("")
        self.label_6.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Unused clips:",
                                       None))
        self.unused_count.setText("")
        self.unused_size.setText("")
        self.delete_unused.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Delete files",
                                       None))
        self.label_13.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Project files:",
                                       None))
        self.label_fonts.setText(
            QCoreApplication.translate("ProjectSettings_UI", u"Fonts", None))
        self.button_export.setText(
            QCoreApplication.translate("ProjectSettings_UI",
                                       u"Plain Text Export...", None))
        self.files_count.setText("")
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_2),
            QCoreApplication.translate("ProjectSettings_UI", u"Project Files",
                                       None))
Ejemplo n.º 11
0
class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.setWindowTitle("Hooty Light Client")
        self.program_started = False
        self.log_text_box = QPlainTextEdit(self)
        self.log_text_box.setReadOnly(True)
        self.url = self.get_url_config()
        self.edit_url = QLineEdit(self.url)
        self.run_button = QPushButton("Run Hooty!")

        widgy = QWidget()
        layout = QVBoxLayout()
        widgy.setLayout(layout)
        layout.addWidget(self.log_text_box)
        layout.addWidget(self.edit_url)
        layout.addWidget(self.run_button)
        self.setLayout(layout)
        self.setCentralWidget(widgy)
        self.thread_pool = QThreadPool()

        # Create a runner
        self.runner = runner.JobRunner(self.edit_url.text())
        self.thread_pool.start(self.runner)

        self.runner.logHandler.log.signal.connect(self.write_log)

        # Run some actions when we press the hooty button!
        self.run_button.pressed.connect(
            lambda: self.runner.set_url(self.edit_url.text()))
        self.run_button.pressed.connect(
            lambda: self.write_url_config(self.edit_url.text()))
        self.run_button.pressed.connect(self.runner.clicked)
        self.run_button.pressed.connect(self.hooty_button_text)

        self.show()

    # Get the url from the config file if it is there
    def get_url_config(self):
        config = configparser.ConfigParser()
        if path.exists("hooty.ini"):
            try:
                config.read("hooty.ini")
                return config['DEFAULT']['url']
            except:
                return "url.example"
        else:
            return "url.example"

    # Write your url to the file!
    # TODO: Maybe I should only write if the url is a valid working one..
    def write_url_config(self, url):
        config = configparser.ConfigParser()
        config['DEFAULT'] = {'url': url}
        with open('hooty.ini', 'w') as configfile:
            config.write(configfile)

    # Change some text!
    # TODO: Something something variables
    def hooty_button_text(self):
        if self.run_button.text() == "Run Hooty!":
            self.run_button.setText("Hooty is running!")
        else:
            self.run_button.setText("Run Hooty!")

    # First time we run our actual worker thread
    # No reason to run it immediately
    def run_thread(self):
        # Thread runner
        if self.program_started is False:
            self.thread_pool.start(self.runner)

    # Make sure we actually kill the worker
    def closeEvent(self, event):
        self.runner.exit()

    # writing to our log & scroll to the bottom
    @Slot(str)
    def write_log(self, log_text):
        self.log_text_box.appendPlainText(log_text)
        self.log_text_box.centerCursor()
Ejemplo n.º 12
0
class XDFChunksDialog(QDialog):
    def __init__(self, parent, chunks, fname):
        super().__init__(parent)
        self.setWindowTitle(f"XDF Chunks ({fname})")

        self.chunks = chunks

        TAGS = {
            1: "FileHeader",
            2: "StreamHeader",
            3: "Samples",
            4: "ClockOffset",
            5: "Boundary",
            6: "StreamFooter"
        }

        self.model = QStandardItemModel()
        self.model.setHorizontalHeaderLabels(
            ["#", "Bytes", "Tag", "Stream ID"])

        for i, chunk in enumerate(chunks, start=1):
            row = []
            row.append(_add_item(i))
            row.append(_add_item(chunk["nbytes"]))
            row.append(_add_item(f"{chunk['tag']} ({TAGS[chunk['tag']]})"))
            row.append(_add_item(chunk.get("stream_id", "")))
            self.model.appendRow(row)

        self.view = QTableView()
        self.view.setModel(self.model)
        self.view.verticalHeader().setVisible(False)
        self.view.horizontalHeader().setStretchLastSection(True)
        self.view.setShowGrid(False)
        self.view.setSelectionMode(QAbstractItemView.SingleSelection)
        self.view.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.view.setSortingEnabled(True)
        self.view.sortByColumn(0, Qt.AscendingOrder)
        self.view.setEditTriggers(QTableView.NoEditTriggers)
        self.view.setFixedWidth(450)

        self.details = QPlainTextEdit("")
        self.details.setFixedWidth(450)
        self.details.setReadOnly(True)
        self.details.setTabStopDistance(30)
        font = QFont()
        font.setFamily("monospace")
        font.setStyleHint(QFont.Monospace)
        self.details.setFont(font)
        self.details.setLineWrapMode(QPlainTextEdit.NoWrap)

        hbox = QHBoxLayout()
        hbox.addWidget(self.view)
        hbox.addWidget(self.details)

        vbox = QVBoxLayout(self)
        vbox.addLayout(hbox)
        self.buttonbox = QDialogButtonBox(QDialogButtonBox.Ok)
        vbox.addWidget(self.buttonbox)
        self.buttonbox.accepted.connect(self.accept)

        self.view.clicked.connect(self._update_details)

        self.setFixedSize(980, 650)
        self.view.setColumnWidth(0, 70)
        self.view.setColumnWidth(1, 80)
        self.view.setColumnWidth(2, 150)
        self.view.setColumnWidth(3, 70)

    @Slot()
    def _update_details(self):
        selection = self.view.selectionModel()
        if selection.hasSelection():
            n = int(selection.selectedIndexes()[0].data())
            self.details.setPlainText(self.chunks[n - 1].get("content", ""))