Exemple #1
0
class PickChannelsDialog(QDialog):
    def __init__(self, parent, channels, selected=None, title="Pick channels"):
        super().__init__(parent)
        self.setWindowTitle(title)
        if selected is None:
            selected = []
        self.initial_selection = selected
        vbox = QVBoxLayout(self)
        self.channels = QListWidget()
        self.channels.insertItems(0, channels)
        self.channels.setSelectionMode(QListWidget.ExtendedSelection)
        for i in range(self.channels.count()):
            if self.channels.item(i).data(0) in selected:
                self.channels.item(i).setSelected(True)
        vbox.addWidget(self.channels)
        self.buttonbox = QDialogButtonBox(QDialogButtonBox.Ok
                                          | QDialogButtonBox.Cancel)
        vbox.addWidget(self.buttonbox)
        self.buttonbox.accepted.connect(self.accept)
        self.buttonbox.rejected.connect(self.reject)
        self.channels.itemSelectionChanged.connect(self.toggle_buttons)
        self.toggle_buttons()  # initialize OK button state

    @Slot()
    def toggle_buttons(self):
        """Toggle OK button.
        """
        selected = [item.data(0) for item in self.channels.selectedItems()]
        if selected != self.initial_selection:
            self.buttonbox.button(QDialogButtonBox.Ok).setEnabled(True)
        else:
            self.buttonbox.button(QDialogButtonBox.Ok).setEnabled(False)
Exemple #2
0
class MontageDialog(QDialog):
    def __init__(self, parent, montages, selected=None):
        super().__init__(parent)
        self.setWindowTitle("Set montage")
        vbox = QVBoxLayout(self)
        self.montages = QListWidget()
        self.montages.insertItems(0, montages)
        self.montages.setSelectionMode(QListWidget.SingleSelection)
        if selected is not None:
            for i in range(self.montages.count()):
                if self.montages.item(i).data(0) == selected:
                    self.montages.item(i).setSelected(True)
        vbox.addWidget(self.montages)
        hbox = QHBoxLayout()
        self.view_button = QPushButton("View")
        self.view_button.clicked.connect(self.view_montage)
        hbox.addWidget(self.view_button)
        hbox.addStretch()
        self.buttonbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        hbox.addWidget(self.buttonbox)
        vbox.addLayout(hbox)
        self.buttonbox.accepted.connect(self.accept)
        self.buttonbox.rejected.connect(self.reject)
        self.montages.itemSelectionChanged.connect(self.toggle_buttons)
        self.toggle_buttons()  # initialize OK and View buttons state

    @Slot()
    def toggle_buttons(self):
        """Toggle OK and View buttons.
        """
        if self.montages.selectedItems():
            self.buttonbox.button(QDialogButtonBox.Ok).setEnabled(True)
            self.view_button.setEnabled(True)
        else:
            self.buttonbox.button(QDialogButtonBox.Ok).setEnabled(False)
            self.view_button.setEnabled(False)

    def view_montage(self):
        name = self.montages.selectedItems()[0].data(0)
        montage = make_standard_montage(name)
        fig = montage.plot(show_names=True, show=False)
        win = fig.canvas.manager.window
        win.setWindowModality(Qt.WindowModal)
        win.setWindowTitle("Montage")
        win.statusBar().hide()  # not necessary since matplotlib 3.3
        fig.show()
Exemple #3
0
class AppendDialog(QDialog):
    def __init__(self, parent, compatibles, title="Append data"):
        super().__init__(parent)
        self.setWindowTitle(title)

        vbox = QVBoxLayout(self)
        grid = QGridLayout()

        grid.addWidget(QLabel("Source"), 0, 0, Qt.AlignCenter)
        grid.addWidget(QLabel("Destination"), 0, 2, Qt.AlignCenter)

        self.source = QListWidget(self)
        self.source.setAcceptDrops(True)
        self.source.setDragEnabled(True)
        self.source.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.source.setDefaultDropAction(Qt.DropAction.MoveAction)
        self.source.insertItems(0, [d["name"] for d in compatibles])
        grid.addWidget(self.source, 1, 0)

        self.move_button = QPushButton("→")
        self.move_button.setEnabled(False)
        grid.addWidget(self.move_button, 1, 1, Qt.AlignHCenter)

        self.destination = QListWidget(self)
        self.destination.setAcceptDrops(True)
        self.destination.setDragEnabled(True)
        self.destination.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.destination.setDefaultDropAction(Qt.DropAction.MoveAction)
        grid.addWidget(self.destination, 1, 2)
        vbox.addLayout(grid)

        self.buttonbox = QDialogButtonBox(QDialogButtonBox.Ok
                                          | QDialogButtonBox.Cancel)
        self.buttonbox.accepted.connect(self.accept)
        self.buttonbox.rejected.connect(self.reject)

        vbox.addWidget(self.buttonbox)
        vbox.setSizeConstraint(QVBoxLayout.SetFixedSize)
        self.destination.model().rowsInserted.connect(self.toggle_ok_button)
        self.destination.model().rowsRemoved.connect(self.toggle_ok_button)
        self.source.itemSelectionChanged.connect(self.toggle_move_source)
        self.destination.itemSelectionChanged.connect(
            self.toggle_move_destination)
        self.move_button.clicked.connect(self.move)
        self.toggle_ok_button()
        self.toggle_move_source()
        self.toggle_move_destination()

    @property
    def names(self):
        names = []
        for it in range(self.destination.count()):
            names.append(self.destination.item(it).text())
        return names

    @Slot()
    def toggle_ok_button(self):
        """Toggle OK button."""
        if self.destination.count() > 0:
            self.buttonbox.button(QDialogButtonBox.Ok).setEnabled(True)
        else:
            self.buttonbox.button(QDialogButtonBox.Ok).setEnabled(False)

    @Slot()
    def toggle_move_source(self):
        if self.source.selectedItems():
            self.move_button.setEnabled(True)
            self.move_button.setText("→")
            self.destination.clearSelection()
        elif not self.destination.selectedItems():
            self.move_button.setEnabled(False)

    @Slot()
    def toggle_move_destination(self):
        if self.destination.selectedItems():
            self.move_button.setEnabled(True)
            self.move_button.setText("←")
            self.source.clearSelection()
        elif not self.source.selectedItems():
            self.move_button.setEnabled(False)

    @Slot()
    def move(self):
        if self.source.selectedItems():
            for item in self.source.selectedItems():
                self.destination.addItem(item.text())
                self.source.takeItem(self.source.row(item))
        elif self.destination.selectedItems():
            for item in self.destination.selectedItems():
                self.source.addItem(item.text())
                self.destination.takeItem(self.destination.row(item))
Exemple #4
0
class Ui_Form(object):
    def setupUi(self, sectionOp):
        if not sectionOp.objectName():
            sectionOp.setObjectName(u"sectionOp")
        self.formLayout_6 = QFormLayout(sectionOp)
        self.formLayout_6.setObjectName(u"formLayout_6")
        self.sectionRulesListWidget = QListWidget(sectionOp)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        self.sectionRulesListWidget.setObjectName(u"sectionRulesListWidget")
        self.sectionRulesListWidget.setMaximumSize(QSize(16777215, 100))

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

        self.label_10 = QLabel(sectionOp)
        self.label_10.setObjectName(u"label_10")
        self.label_10.setMaximumSize(QSize(16777215, 20))

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

        self.sectionCoverageLabel = QLabel(sectionOp)
        self.sectionCoverageLabel.setObjectName(u"sectionCoverageLabel")
        self.sectionCoverageLabel.setMaximumSize(QSize(16777215, 20))

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

        self.label_11 = QLabel(sectionOp)
        self.label_11.setObjectName(u"label_11")
        self.label_11.setMaximumSize(QSize(16777215, 20))

        self.formLayout_6.setWidget(3, QFormLayout.FieldRole, self.label_11)

        self.retranslateUi(sectionOp)

        QMetaObject.connectSlotsByName(sectionOp)

    # setupUi

    def retranslateUi(self, sectionOp):

        __sortingEnabled = self.sectionRulesListWidget.isSortingEnabled()
        self.sectionRulesListWidget.setSortingEnabled(False)
        ___qlistwidgetitem = self.sectionRulesListWidget.item(0)
        ___qlistwidgetitem.setText(
            QCoreApplication.translate("Form",
                                       u"Step has TP, next step without TP",
                                       None))
        ___qlistwidgetitem1 = self.sectionRulesListWidget.item(1)
        ___qlistwidgetitem1.setText(
            QCoreApplication.translate("Form",
                                       u"Step has TP, next step with TP",
                                       None))
        ___qlistwidgetitem2 = self.sectionRulesListWidget.item(2)
        ___qlistwidgetitem2.setText(
            QCoreApplication.translate(
                "Form", u"Step has TP, previous step without TP", None))
        ___qlistwidgetitem3 = self.sectionRulesListWidget.item(3)
        ___qlistwidgetitem3.setText(
            QCoreApplication.translate("Form",
                                       u"Step has TP, previous step with TP",
                                       None))
        ___qlistwidgetitem4 = self.sectionRulesListWidget.item(4)
        ___qlistwidgetitem4.setText(
            QCoreApplication.translate("Form", u"Step has fade-in", None))
        ___qlistwidgetitem5 = self.sectionRulesListWidget.item(5)
        ___qlistwidgetitem5.setText(
            QCoreApplication.translate("Form", u"Step has jump box", None))
        ___qlistwidgetitem6 = self.sectionRulesListWidget.item(6)
        ___qlistwidgetitem6.setText(
            QCoreApplication.translate("Form",
                                       u"Step TP contains text pattern...",
                                       None))
        self.sectionRulesListWidget.setSortingEnabled(__sortingEnabled)

        self.label_10.setText(
            QCoreApplication.translate("Form", u"Insert new section on...",
                                       None))
        self.sectionCoverageLabel.setText(
            QCoreApplication.translate(
                "Form", u"Covers 0 steps in selected sections/steps", None))
        self.label_11.setText(
            QCoreApplication.translate(
                "Form",
                u"May not match number of audio soundbites (audio not imported)",
                None))
        pass
Exemple #5
0
class ProgramList(QWidget):
    onProgramEditRequest = Signal(Program)

    def __init__(self, parent):
        super().__init__(parent)
        self._programsLabel = QLabel("Programs")
        self._programsList = QListWidget()
        self._programsList.itemClicked.connect(self.SelectProgram)
        self._programsList.itemDoubleClicked.connect(self.EditProgram)

        AppGlobals.Instance().onChipModified.connect(self.SyncInstances)

        self._instances: Dict[Program, ProgramInstance] = {}

        self._newButton = QPushButton("Create New Program")
        self._newButton.clicked.connect(self.NewProgram)

        layout = QVBoxLayout()
        layout.addWidget(self._programsLabel)
        layout.addWidget(self._programsList)
        layout.addWidget(self._newButton)

        self.setLayout(layout)

        AppGlobals.Instance().onChipOpened.connect(self.SyncInstances)

    def EditProgram(self, selectedProgram: 'ProgramListItem'):
        self.onProgramEditRequest.emit(selectedProgram.program)

    def SelectProgram(self, selectedProgram: 'ProgramListItem'):
        contextDisplay = ProgramContextDisplay(self.topLevelWidget(),
                                               selectedProgram.instance,
                                               self._programsList)
        contextDisplay.onDelete.connect(self.DeleteProgram)
        contextDisplay.onEdit.connect(self.onProgramEditRequest)

    def SyncInstances(self):
        for program in AppGlobals.Chip().programs:
            if program not in self._instances:
                self._instances[program] = ProgramInstance(program)
        for program in self._instances.copy():
            if program not in AppGlobals.Chip().programs:
                del self._instances[program]
            else:
                self._instances[program].SyncParameters()
        self.RefreshList()

    def NewProgram(self):
        newProgram = Program()
        AppGlobals.Chip().programs.append(newProgram)
        AppGlobals.Instance().onChipModified.emit()
        for item in [
                self._programsList.item(row)
                for row in range(self._programsList.count())
        ]:
            if item.program is newProgram:
                self._programsList.setCurrentItem(item)
                self.onProgramEditRequest.emit(newProgram)
                return

    def ProgramItem(self, program: Program):
        matches = [
            item for item in [
                self._programsList.item(row)
                for row in range(self._programsList.count())
            ] if item.program is program
        ]
        if matches:
            return matches[0]

    def RefreshList(self):
        self._programsList.blockSignals(True)

        self._programsList.clear()
        for program in AppGlobals.Chip().programs:
            self._programsList.addItem(
                ProgramListItem(program, self._instances[program]))

        self._programsList.blockSignals(False)

    def DeleteProgram(self, program: Program):
        if QMessageBox.question(
                self, "Confirm Deletion", "Are you sure you want to delete " +
                program.name + "?") is QMessageBox.Yes:
            AppGlobals.Chip().programs.remove(program)
            AppGlobals.Instance().onChipModified.emit()

    def keyPressEvent(self, event) -> None:
        if event.key() == Qt.Key.Key_Delete:
            if self._programsList.currentItem():
                self.DeleteProgram(self._programsList.currentItem().program)
class TableClothGenerator(QMainWindow):
    def __init__(self, parent=None):

        super().__init__(parent)

        # Main UI settings
        self.setWindowTitle('Tablecloth Generator')
        self.setWindowIcon(QIcon('icon.ico'))
        self.centralWidget = QWidget()

        self.setCentralWidget(self.centralWidget)
        self.resize(350, 350)
        self.center()

        self._createMenuBar()

        self.MainUI()

    def MainUI(self):

        # Obtain the configs
        fp_config = open(THISDIR + "\\config\\config.json", "r",
                            encoding="utf-8")
        self.config = json.loads(fp_config.read())
        fp_config.close()

        # Obtain and List the teams
        fp_teams = open(THISDIR + "\\config\\teams.json", "r",
                            encoding="utf-8")
        conf_teams = json.loads(fp_teams.read())
        fp_teams.close()
        self.teams = conf_teams["teams"]
        self.players = conf_teams["players"]

        # Obtain all images needed to create the tablecloth
        self.background = Image.open(THISDIR + "\\images\\mat.png")
        self.table_border = Image.open(THISDIR + "\\images\\table_border.png")
        self.tech_lines = Image.open(THISDIR + "\\images\\technical_lines.png")

        # Check if there's no configuration set up
        # and prompt to create/import one
        if self.config["total_teams"] == 0:
            self.no_config = QMessageBox.question(self, "No configuration",
            "No configuration has been found. Do you wish to set up a new one?",
            QMessageBox.Yes | QMessageBox.No)

            if self.no_config == QMessageBox.Yes:
                self.CreateTeamsWindow()

        self.bg_image = self.config["image_route"]
        self.players_combobox = QComboBox()
        self.UpdatePlayersList()
        self.players_combobox.setEditable(True)
        self.players_combobox.completer()\
                             .setCompletionMode(QCompleter.PopupCompletion)
        self.players_combobox.setInsertPolicy(QComboBox.NoInsert)

        # Set up the GUI
        self.statusBar().showMessage("Remember: Rig responsibly.")
        # Bottom (EAST)
        self.label_east = QLabel(self)
        self.label_east.setText("<h1>East Seat</h1>")
        self.label_east.setAlignment(QtCore.Qt.AlignCenter)
        self.image_east = QLabel(self)
        self.image_east.setPixmap(QPixmap("images/logos/team1.png")\
                                  .scaled(100,100))
        self.image_east.setAlignment(QtCore.Qt.AlignCenter)
        self.search_east = QLineEdit()
        self.search_east.setAlignment(QtCore.Qt.AlignCenter)
        self.search_east.editingFinished.connect(
            lambda: self.searchPlayer(self.search_east.text(),
                                      self.cloth_east))
        self.cloth_east = QComboBox()
        self.cloth_east.setModel(self.players_combobox.model())
        self.cloth_east.currentIndexChanged.connect(
            lambda: self.SwitchImage(self.cloth_east, self.image_east))
        # Right (SOUTH)
        self.label_south = QLabel(self)
        self.label_south.setText("<h1>South Seat</h1>")
        self.label_south.setAlignment(QtCore.Qt.AlignCenter)
        self.image_south = QLabel(self)
        self.image_south.setPixmap(QPixmap("images/logos/team1.png")\
                                   .scaled(100,100))
        self.image_south.setAlignment(QtCore.Qt.AlignCenter)
        self.image_south.show()
        self.search_south = QLineEdit()
        self.search_south.setAlignment(QtCore.Qt.AlignCenter)
        self.search_south.editingFinished.connect(
            lambda: self.searchPlayer(self.search_south.text(),
                                      self.cloth_south))
        self.cloth_south = QComboBox()
        self.cloth_south.setModel(self.players_combobox.model())
        self.cloth_south.currentIndexChanged.connect(
            lambda: self.SwitchImage(self.cloth_south, self.image_south))
        # Top (WEST)
        self.label_west = QLabel(self)
        self.label_west.setText("<h1>West Seat</h1>")
        self.label_west.setAlignment(QtCore.Qt.AlignCenter)
        self.image_west = QLabel(self)
        self.image_west.setPixmap(QPixmap("images/logos/team1.png")\
                                  .scaled(100,100))
        self.image_west.setAlignment(QtCore.Qt.AlignCenter)
        self.image_west.show()
        self.cloth_west = QComboBox()
        self.search_west = QLineEdit()
        self.search_west.setAlignment(QtCore.Qt.AlignCenter)
        self.search_west.editingFinished.connect(
            lambda: self.searchPlayer(self.search_west.text(),
                                      self.cloth_west))
        self.cloth_west.setModel(self.players_combobox.model())
        self.cloth_west.currentIndexChanged.connect(
            lambda: self.SwitchImage(self.cloth_west, self.image_west))
        # Left (NORTH)
        self.label_north = QLabel(self)
        self.label_north.setText("<h1>North Seat</h1>")
        self.label_north.setAlignment(QtCore.Qt.AlignCenter)
        self.image_north = QLabel(self)
        self.image_north.setPixmap(QPixmap("images/logos/team1.png")\
                                   .scaled(100,100))
        self.image_north.setAlignment(QtCore.Qt.AlignCenter)
        self.image_north.show()
        self.cloth_north = QComboBox()
        self.search_north = QLineEdit()
        self.search_north.setAlignment(QtCore.Qt.AlignCenter)
        self.search_north.editingFinished.connect(
            lambda: self.searchPlayer(self.search_north.text(),
                                      self.cloth_north))
        self.cloth_north.setModel(self.players_combobox.model())
        self.cloth_north.currentIndexChanged.connect(
            lambda: self.SwitchImage(self.cloth_north, self.image_north))
        # Technical lines
        self.technical_lines = QCheckBox("Show Technical lines", self)
        # Generate button
        self.generate = QPushButton(self)
        self.generate.setText("Generate Tablecloth")
        self.generate.clicked.connect(self.GeneratePreview)
        # Add custom mat
        self.custom_mat = QPushButton(self)
        self.custom_mat.setText("Add Mat")
        self.custom_mat.clicked.connect(self.MatDialog)

        # Create the layout
        grid_layout = QGridLayout()
        grid_layout.setAlignment(QtCore.Qt.AlignCenter)
        grid_layout.setAlignment(QtCore.Qt.AlignTop)
        # Labels East, West
        grid_layout.addWidget(self.label_east, 1, 1)
        grid_layout.addWidget(self.label_west, 1, 2)
        # Image preview East, West
        grid_layout.addWidget(self.image_east, 2, 1)
        grid_layout.addWidget(self.image_west, 2, 2)
        # Search player East, West
        grid_layout.addWidget(self.search_east, 3, 1)
        grid_layout.addWidget(self.search_west, 3, 2)
        # Player combobox East, West
        grid_layout.addWidget(self.cloth_east, 4, 1)
        grid_layout.addWidget(self.cloth_west, 4, 2)
        # Labes South, North
        grid_layout.addWidget(self.label_south, 5, 1)
        grid_layout.addWidget(self.label_north, 5, 2)
        # Image preview South, North
        grid_layout.addWidget(self.image_south, 6, 1)
        grid_layout.addWidget(self.image_north, 6, 2)
        # Search player South, North
        grid_layout.addWidget(self.search_south, 7, 1)
        grid_layout.addWidget(self.search_north, 7, 2)
        # Player combobox South, North
        grid_layout.addWidget(self.cloth_south, 8, 1)
        grid_layout.addWidget(self.cloth_north, 8, 2)
        # Technical lines
        grid_layout.addWidget(self.technical_lines, 9, 1)
        # Custom mat/bg
        grid_layout.addWidget(self.custom_mat, 10, 1)
        # Generate
        grid_layout.addWidget(self.generate, 10, 2)

        self.centralWidget.setLayout(grid_layout)

        # Create the window
        self.show()

    def _createMenuBar(self):

        # Settings and stuff for the toolbar
        menubar = QMenuBar(self)

        file_menu = QMenu("&File", self)
        file_menu.addAction("Create Team(s)", self.CreateTeamsWindow)
        file_menu.addAction("Edit Team(s)", self.EditTeamsWindow)
        file_menu.addAction("Exit", self.close)
        settings_menu = QMenu("&Settings", self)
        settings_menu.addAction("Version", self.SeeVersion)
        settings_menu.addAction("Help", self.GetHelp)

        menubar.addMenu(file_menu)
        menubar.addMenu(settings_menu)

        self.setMenuBar(menubar)

    def _createProgressBar(self):

        self.progress_bar = QProgressBar()
        self.progress_bar.minimum = 0
        self.progress_bar.maximum = 100
        self.progress_bar.setValue(0)
        self.progress_bar.setTextVisible(False)
        self.progress_bar.setGeometry(50, 50, 10, 10)
        self.progress_bar.setAlignment(QtCore.Qt.AlignRight)
        self.progress_bar.adjustSize()
        self.statusBar().addPermanentWidget(self.progress_bar)
        self.ChangeAppStatus(False)

    def SwitchImage(self, cloth, image):
        # It shows you the team logo. No way you can miss those, right?
        team_id = self.SearchTeamID(cloth, True)
        image.setPixmap(QPixmap(
            "images/logos/team%d.png" % team_id).scaled(100,100))

    def searchPlayer(self, text, combobox):
        # It even searches the player for you. What more could you want?
        search_index = combobox.findText(text, QtCore.Qt.MatchContains)
        if search_index == -1:
            QMessageBox.warning(self, "Error", "No player found")
        else:
            combobox.setCurrentIndex(search_index)

    def CreateTeamsWindow(self):

        self.teamcreation_wid = EditionWidget()
        self.teamcreation_wid.resize(400, 200)
        self.teamcreation_wid.setWindowTitle("Teams configuration")

        self.new_config = {}

        id_label = QLabel(self)
        id_label.setText("Team ID: ")
        self.num_id = QLabel(self)
        current_id = str(self.config["total_teams"] + 1)
        self.num_id.setText(current_id)
        name_label = QLabel(self)
        name_label.setText("Team Name:")
        name_label.setFocus()
        self.name_input = QLineEdit(self)
        members_label = QLabel(self)
        members_label.setText("Members (write and press enter):")
        members_input = QLineEdit(self)
        members_input.editingFinished.connect(
            lambda: self.AddMember(members_input))
        self.members_list = QListWidget(self)

        import_image = QPushButton(self)
        import_image.setText("Import Team Image")
        import_image.clicked.connect(self.ImportTeamImage)

        add_team = QPushButton(self)
        add_team.setText("Add Team")
        add_team.clicked.connect(
            lambda: self.addTeamFunction(self.name_input.text(),
                self.members_list))
        import_config = QPushButton(self)
        import_config.setText("Import configuration")
        import_config.clicked.connect(self.importTeamFunction)

        config_lay = QGridLayout()
        config_lay.addWidget(id_label, 1, 0)
        config_lay.addWidget(self.num_id, 1, 1)
        config_lay.addWidget(name_label, 2, 0)
        config_lay.addWidget(self.name_input, 2, 1)
        config_lay.addWidget(members_label, 3, 0)
        config_lay.addWidget(members_input, 3, 1)
        config_lay.addWidget(self.members_list, 4, 0, 2, 2)
        config_lay.addWidget(add_team, 6, 0)
        config_lay.addWidget(import_image, 6, 1)
        config_lay.addWidget(import_config, 7, 0, 1, 2)
        self.teamcreation_wid.setLayout(config_lay)

        self.teamcreation_wid.setWindowModality(QtCore.Qt.ApplicationModal)
        self.teamcreation_wid.activateWindow()
        self.teamcreation_wid.raise_()
        self.teamcreation_wid.show()

    def addTeamFunction(self, name, members):
        fp_teams = open(THISDIR + "\\config\\teams.json", "r",
                            encoding="utf-8")
        current_teams = json.loads(fp_teams.read())
        fp_teams.close()
        team = {}
        current_teams["teams"].append(name)
        current_teams["players"][name] = [str(self.members_list.item(i).text())\
                                    for i in range(self.members_list.count())]
        new_team = open(THISDIR + "\\config\\teams.json", "w+",
                            encoding="utf-8")
        add_config = open(THISDIR + "\\config\\config.json", "w+",
                            encoding="utf-8")
        self.teams = current_teams["teams"]
        self.players = current_teams["players"]
        self.config["total_teams"] += 1
        new_id = self.config["total_teams"] + 1
        self.num_id.setText(str(new_id))
        add_config.write(json.dumps(self.config, indent=4))
        new_team.write(json.dumps(current_teams, indent=4))
        new_team.close()

        self.name_input.clear()

        self.members_list.clear()

        self.UpdatePlayersList()

    def ImportTeamImage(self):

        image_dialog = QFileDialog(self)
        image_dialog = QFileDialog.getOpenFileName(filter="Images (*.png)",
            selectedFilter="Images (*.png)")

        if image_dialog[0] != "":
            new_team_logo = Image.open(image_dialog[0]).convert("RGBA")
            if new_team_logo.size != (250, 250):
                new_team_logo.resize((250, 250))
            new_team_logo.save(THISDIR+"\\images\\logos\\team%s.png"\
                % self.num_id.text())

            QMessageBox.information(self, "Team Image", "Team image added.")

    def importTeamFunction(self):
        file_dialog = QFileDialog(self)
        file_dialog = QFileDialog.getOpenFileName(
                                    filter="Team Files (*.json *.zip)",
                                    selectedFilter="Team Files (*.json *.zip)")

        if file_dialog[0] != "":
            if is_zipfile(file_dialog[0]):
                with ZipFile(file_dialog[0]) as zip_import:
                    list_of_files = zip_import.namelist()
                    for fimp in list_of_files:
                        if fimp.startswith('logos'):
                            zip_import.extract(fimp, path=THISDIR+'\\images\\')
                    imported_teams = zip_import.read('teams.json')
                    imported_teams = imported_teams.decode('utf-8')
            else:
                imported_teams = open(file_dialog[0], "r",
                                encoding="utf-8").read()
            json_teams = json.loads(imported_teams)
            self.teams = json_teams["teams"]
            self.players = json_teams["players"]

            new_teams = open(THISDIR + "\\config\\teams.json", "w+",
                            encoding="utf-8")
            new_teams.write(json.dumps(json_teams, indent=4))
            new_teams.close()

            old_config = open(THISDIR + "\\config\\config.json", "r",
                                encoding="utf-8").read()
            old_config = json.loads(old_config)
            old_config["total_teams"] = len(json_teams["teams"])
            self.config = old_config
            new_config = open(THISDIR + "\\config\\config.json", "w+",
                                encoding="utf-8")
            new_config.write(json.dumps(self.config, indent=4))
            new_config.close()

            self.UpdatePlayersList()

            self.image_east.setPixmap(QPixmap("images/logos/team1.png")\
                                       .scaled(100,100))
            self.cloth_east.setModel(self.players_combobox.model())
            self.image_south.setPixmap(QPixmap("images/logos/team1.png")\
                                       .scaled(100,100))
            self.cloth_south.setModel(self.players_combobox.model())
            self.image_west.setPixmap(QPixmap("images/logos/team1.png")\
                                       .scaled(100,100))
            self.cloth_west.setModel(self.players_combobox.model())
            self.image_north.setPixmap(QPixmap("images/logos/team1.png")\
                                       .scaled(100,100))
            self.cloth_north.setModel(self.players_combobox.model())
            self.statusBar().showMessage("Teams imported successfully.")
            self.teamcreation_wid.close()


    def AddMember(self, member):
        self.members_list.addItem(member.text())
        member.clear()

    def EditTeamsWindow(self):

        self.teamedit_wid = EditionWidget()
        self.teamedit_wid.resize(400, 320)
        self.teamedit_wid.setWindowTitle("Edit Teams")

        self.teams_list = QComboBox(self)
        self.teams_list.addItem("--- Select a team ---")
        for team in self.teams:
            self.teams_list.addItem(team)
        self.teams_list.currentIndexChanged.connect(self.UpdateTeamInfo)

        team_id_label = QLabel(self)
        team_id_label.setText("Team ID: ")
        self.config_team_id = QLabel(self)
        team_name_label = QLabel(self)
        team_name_label.setText("Team name: ")
        self.config_team_name = QLabel(self)
        team_members_label = QLabel(self)
        team_members_label.setText("Team members: ")
        self.config_team_members = QListWidget(self)
        add_member_label = QLabel(self)
        add_member_label.setText("Add new member: ")
        add_member_input = QLineEdit(self)
        add_member_input.editingFinished.connect(self.AddNewMember)

        delete_member = QPushButton(self)
        delete_member.setText("Delete member")
        delete_member.clicked.connect(self.DeleteMember)
        delete_team = QPushButton(self)
        delete_team.setText("Delete Team")
        delete_team.clicked.connect(self.DeleteTeam)
        save_changes = QPushButton(self)
        save_changes.setText("Save changes")
        save_changes.clicked.connect(self.SaveEdits)
        export_config = QPushButton(self)
        export_config.setText("Export Configuration")
        export_config.clicked.connect(self.ExportTeams)

        config_lay = QGridLayout()
        config_lay.addWidget(self.teams_list, 1, 0)
        config_lay.addWidget(team_id_label, 2, 0)
        config_lay.addWidget(self.config_team_id, 2, 1)
        config_lay.addWidget(team_name_label, 3, 0)
        config_lay.addWidget(self.config_team_name, 3, 1, 1, 2)
        config_lay.addWidget(team_members_label, 4, 0)
        config_lay.addWidget(self.config_team_members, 5, 0)
        config_lay.addWidget(add_member_label, 6, 0)
        config_lay.addWidget(add_member_input, 6, 1, 1, 2)
        config_lay.addWidget(delete_member, 7, 0)
        config_lay.addWidget(delete_team, 7, 1)
        config_lay.addWidget(save_changes, 8, 0)
        config_lay.addWidget(export_config, 8, 1)

        self.teamedit_wid.setLayout(config_lay)
        self.teamedit_wid.setWindowModality(QtCore.Qt.ApplicationModal)
        self.teamedit_wid.activateWindow()
        self.teamedit_wid.raise_()
        self.teamedit_wid.show()

    def UpdateTeamInfo(self):

        sender = self.sender()
        if sender.currentIndex() > 0:
            team_id = sender.currentIndex()
            self.config_team_id.setText(str(team_id))
            self.config_team_name.setText(sender.currentText())
            if self.config_team_members.count() > 0:
                self.config_team_members.clear()
            self.config_team_members.addItems(
                self.players[sender.currentText()])

    def AddNewMember(self):

        sender = self.sender()
        self.config_team_members.addItem(sender.text())
        sender.clear()

    def DeleteMember(self):

        list_members = self.config_team_members.selectedItems()
        if len(list_members) == 0:
            QMessageBox.warning(self, "Error", "No player selected")
        else:
            for member in list_members:
                self.config_team_members.takeItem(
                                           self.config_team_members.row(member))

    def DeleteTeam(self):
        team_id = int(self.config_team_id.text())
        is_last_item = self.teams[self.teams.index(
            self.config_team_name.text())] == (self.teams[len(self.teams)-1])
        self.teams.pop(self.teams.index(self.config_team_name.text()))
        self.players.pop(self.config_team_name.text())
        new_teamlist = {}
        new_teamlist["teams"] = self.teams
        new_teamlist["players"] = self.players
        current_teams = open(THISDIR + "\\config\\teams.json", "w+",
                        encoding="utf-8")
        current_teams.write(json.dumps(new_teamlist, indent=4))
        current_teams.close()

        if is_last_item == True:
            self.teams_list.setCurrentIndex(1)
        else:
            self.teams_list.setCurrentIndex(team_id+1)
        self.teams_list.removeItem(team_id)
        self.UpdatePlayersList()
        self.cloth_east.setModel(self.players_combobox.model())
        self.cloth_south.setModel(self.players_combobox.model())
        self.cloth_west.setModel(self.players_combobox.model())
        self.cloth_north.setModel(self.players_combobox.model())

    def ExportTeams(self):

        export_dir = self.config["save_route"] if self.config["save_route"] \
                                                    is not None else THISDIR
        exported_file = QFileDialog.getSaveFileName(self, "Save File",
            export_dir, "Save files (*.zip)")

        if exported_file[0] != "":
            export_filename = exported_file[0]
            if export_filename.endswith(".zip") is False:
                export_filename += ".zip"
            files_to_export = []
            files_to_export.append("config\\teams.json")

            for root, directories, files in os.walk(THISDIR+"\\images\\logos"):
                for filename in files:
                    filepath = os.path.join(root, filename)
                    files_to_export.append(filepath)

            with ZipFile(export_filename, "w") as export_zip:
                for exp_file in files_to_export:
                    export_name = exp_file
                    if exp_file.endswith(".json"):
                        split_name = exp_file.split("\\")
                        export_name = split_name[-1]
                    if exp_file.endswith(".png"):
                        split_name = exp_file.split("\\")
                        export_name = "\\logos\\" + split_name[-1]
                    export_zip.write(exp_file, arcname=export_name)
                export_zip.close()

            if os.path.exists(export_filename):
                QMessageBox.information(self, "Export",
                    "The export was successful")

    def SaveEdits(self):

        list_members = [str(self.config_team_members.item(i).text()) for i in \
                                        range(self.config_team_members.count())]
        self.players[self.config_team_name.text()] = list_members
        new_teamlist = {}
        new_teamlist["teams"] = self.teams
        new_teamlist["players"] = self.players
        current_teams = open(THISDIR + "\\config\\teams.json", "w+",
                        encoding="utf-8")
        current_teams.write(json.dumps(new_teamlist, indent=4))
        current_teams.close()
        self.teamedit_wid.close()
        self.statusBar().showMessage("Settings saved.")

    def MatDialog(self):

        mat_dialog = QFileDialog(self)
        mat_dialog = QFileDialog.getOpenFileName(filter="Images (*.png *.jpg)",
            selectedFilter="Images (*.png *.jpg)")

        if mat_dialog[0] != "":
            self.GenerateMat(mat_dialog[0])

    def GenerateMat(self, image):

        self.background = image
        background = Image.open(self.background).resize((2048,2048))\
                                                .convert("RGBA")

        self.mat_thread = QThread()
        east_id = self.SearchTeamID(self.cloth_east, True)
        south_id = self.SearchTeamID(self.cloth_south, True)
        west_id = self.SearchTeamID(self.cloth_west, True)
        north_id = self.SearchTeamID(self.cloth_north, True)

        if self.config["save_route"] is None:
            save_to_route = THISDIR
        else:
            save_to_route = self.config["save_route"]
        self._createProgressBar()

        self.mat_worker = GenerateImageThread(background, self.table_border,
            east_id, south_id, west_id, north_id,
            self.technical_lines.isChecked(), save_to_route,
            self.bg_image, True)
        self.mat_worker.moveToThread(self.mat_thread)
        self.mat_thread.started.connect(self.mat_worker.run)
        self.mat_worker.update_progress.connect(self.UpdateStatus)
        self.mat_worker.finished.connect(self.mat_thread.quit)
        self.mat_worker.finished.connect(self.mat_worker.deleteLater)
        self.mat_thread.finished.connect(self.mat_thread.deleteLater)
        self.mat_thread.finished.connect(self.MatPreviewWindow)
        self.mat_thread.start()


    def MatPreviewWindow(self):

        self.statusBar().showMessage('Mat preview generated.')
        self.statusBar().removeWidget(self.progress_bar)
        # Now you can go back to rigging
        self.ChangeAppStatus(True)

        self.mat_wid = QWidget()
        self.mat_wid.resize(600, 600)
        self.mat_wid.setWindowTitle("Background preview")

        mat_preview_title = QLabel(self)
        mat_preview_title.setText("Selected image (1/4 scale)")
        mat_preview = QLabel(self)
        mat_preview.setPixmap(QPixmap(tempfile.gettempdir()+"\\Table_Dif.jpg")\
                                .scaled(512,512))
        confirm = QPushButton(self)
        confirm.setText("Confirm")
        confirm.clicked.connect(
            lambda: self.ChangeMatImage(self.background))

        vbox = QVBoxLayout()
        vbox.setAlignment(QtCore.Qt.AlignCenter)
        vbox.addWidget(mat_preview_title)
        vbox.addWidget(mat_preview)
        vbox.addWidget(confirm)
        self.mat_wid.setLayout(vbox)

        self.mat_wid.setWindowModality(QtCore.Qt.ApplicationModal)
        self.mat_wid.activateWindow()
        self.mat_wid.raise_()
        self.mat_wid.show()

    def ChangeMatImage(self, image):

        new_bg = Image.open(image)

        if new_bg.size != (2048, 2048):
            new_bg = new_bg.resize((2048, 2048))
        if new_bg.mode != "RGBA":
            new_bg = new_bg.convert("RGBA")

        if self.config["save_route"] is not None:
            new_bg.save(self.config["save_route"]+"\\images\\mat.png")
            self.bg_image = self.config["save_route"]+"\\images\\mat.png"
        else:
            new_bg.save(THISDIR+"\\images\\mat.png")
            self.bg_image = THISDIR+"\\images\\mat.png"

        self.background = new_bg
        self.config["image_route"] = self.bg_image

        new_file = open(THISDIR + "\\config\\config.json", "w+",
                                        encoding="utf-8")
        new_file.write(json.dumps(self.config, indent=4))
        new_file.close()

        self.statusBar().showMessage('New background added.')
        self.statusBar().removeWidget(self.progress_bar)
        self.ChangeAppStatus(True)

        self.mat_wid.close()

    def GeneratePreview(self):

        self.preview_thread = QThread()
        east_id = self.SearchTeamID(self.cloth_east, True)
        south_id = self.SearchTeamID(self.cloth_south, True)
        west_id = self.SearchTeamID(self.cloth_west, True)
        north_id = self.SearchTeamID(self.cloth_north, True)

        if self.config["save_route"] is None:
            save_to_route = THISDIR
        else:
            save_to_route = self.config["save_route"]
        self._createProgressBar()

        self.preview_worker = GenerateImageThread(self.background,
            self.table_border, east_id, south_id, west_id, north_id,
            self.technical_lines.isChecked(), save_to_route,
            self.bg_image, True)
        self.preview_worker.moveToThread(self.preview_thread)
        self.preview_thread.started.connect(self.preview_worker.run)
        self.preview_worker.update_progress.connect(self.UpdateStatus)
        self.preview_worker.finished.connect(self.preview_thread.quit)
        self.preview_worker.finished.connect(self.preview_worker.deleteLater)
        self.preview_thread.finished.connect(self.preview_thread.deleteLater)
        self.preview_thread.finished.connect(self.PreviewWindow)
        self.preview_thread.start()

    def PreviewWindow(self):

        self.statusBar().showMessage('Tablecloth preview generated.')
        self.statusBar().removeWidget(self.progress_bar)
        # Now you can go back to rigging
        self.ChangeAppStatus(True)

        self.preview_wid = QWidget()
        self.preview_wid.resize(600, 600)
        self.preview_wid.setWindowTitle("Tablecloth preview")

        tablecloth = QPixmap(tempfile.gettempdir()+"\\Table_Dif.jpg")

        tablecloth_preview_title = QLabel(self)
        tablecloth_preview_title.setText("Tablecloth preview (1/4 scale)")
        tablecloth_preview = QLabel(self)
        tablecloth_preview.setPixmap(tablecloth.scaled(512,512))
        confirm = QPushButton(self)
        confirm.setText("Confirm")
        confirm.clicked.connect(self.GenerateImage)
        confirm.clicked.connect(self.preview_wid.close)

        vbox = QVBoxLayout()
        vbox.setAlignment(QtCore.Qt.AlignCenter)
        vbox.addWidget(tablecloth_preview_title)
        vbox.addWidget(tablecloth_preview)
        vbox.addWidget(confirm)
        self.preview_wid.setLayout(vbox)

        self.preview_wid.setWindowModality(QtCore.Qt.ApplicationModal)
        self.preview_wid.activateWindow()
        self.preview_wid.raise_()
        self.preview_wid.show()

    def GeneratedDialog(self):

        self.statusBar().showMessage('Tablecloth generated. Happy rigging!')
        self.statusBar().removeWidget(self.progress_bar)
        # Now you can go back to rigging
        self.ChangeAppStatus(True)

        mbox = QMessageBox()

        mbox.setWindowTitle("Tablecloth Generator")
        mbox.setText("Tablecloth Generated!")
        mbox.setStandardButtons(QMessageBox.Ok)

        mbox.exec()

    def UpdateStatus(self, status):
        self.progress_bar.setValue(status)

    def GenerateImage(self):

        self.statusBar().showMessage('Generating image...')
        self._createProgressBar()

        if self.config["save_route"] is None:
            self.config["save_route"] = THISDIR

        save_to_route = QFileDialog.getExistingDirectory(self,
            "Where to save the image", self.config["save_route"],
            QFileDialog.ShowDirsOnly | QFileDialog.DontResolveSymlinks)

        if self.config["save_route"] != save_to_route:
            temp_file = open(THISDIR + "\\config\\config.json", "r",
                                            encoding="utf-8")
            fp_teams = json.loads(temp_file.read())
            fp_teams["save_route"] = save_to_route
            fp_teams["image_route"] = self.bg_image
            new_file = open(THISDIR + "\\config\\config.json", "w+",
                                            encoding="utf-8")
            new_file.write(json.dumps(fp_teams, indent=4))
            new_file.close()

        self.background = Image.open(THISDIR + "\\images\\mat.png")
        self.table_border = Image.open(THISDIR + "\\images\\table_border.png")
        self.tech_lines = Image.open(THISDIR + "\\images\\technical_lines.png")

        self.thread = QThread()
        east_id = self.SearchTeamID(self.cloth_east, True)
        south_id = self.SearchTeamID(self.cloth_south, True)
        west_id = self.SearchTeamID(self.cloth_west, True)
        north_id = self.SearchTeamID(self.cloth_north, True)
        self.worker = GenerateImageThread(self.background, self.table_border,
            east_id, south_id, west_id, north_id,
            self.technical_lines.isChecked(), save_to_route, self.bg_image)
        self.worker.moveToThread(self.thread)
        self.thread.started.connect(self.worker.run)
        self.worker.update_progress.connect(self.UpdateStatus)
        self.worker.finished.connect(self.thread.quit)
        self.worker.finished.connect(self.worker.deleteLater)
        self.thread.finished.connect(self.thread.deleteLater)
        self.thread.finished.connect(self.GeneratedDialog)
        self.thread.start()

    def ChangeAppStatus(self, status):
        # True for enable, False for disable.
        self.cloth_east.setEnabled(status)
        self.search_east.setEnabled(status)
        self.cloth_south.setEnabled(status)
        self.search_south.setEnabled(status)
        self.cloth_west.setEnabled(status)
        self.search_west.setEnabled(status)
        self.cloth_north.setEnabled(status)
        self.search_north.setEnabled(status)
        self.generate.setEnabled(status)

    def SearchTeamID(self, cloth, plus_one=False):
        team_id = self.teams.index(cloth.itemData(cloth.currentIndex()))
        if plus_one:
            team_id += 1
        return team_id

    def UpdatePlayersList(self):
        for team, members in self.players.items():
            for member in members:
                self.players_combobox.addItem(member, team)

    def center(self):
        qr = self.frameGeometry()
        cp = QScreen().availableGeometry().center()
        qr.moveCenter(cp)

    def SeeVersion(self):

        git_url = "https://raw.githubusercontent.com/vg-mjg/tablecloth-"
        git_url += "generator/main/version.txt"
        with urllib.request.urlopen(git_url) as response:
            url_version = response.read().decode("utf-8")

        version = "Your version is up to date!"
        if url_version != VERSION:
            version = "Your version is outdated."
            version += "Please check the <a href='https://github.com/vg-mjg/"
            version += "tablecloth-generator/releases'>Github page</a>"
            version +=" for updates."
        version_message = QMessageBox(self)
        version_message.setWindowTitle("Checking version")
        version_message.setText("""<h1>Tablecloth generator</h1>
            <br>
            <b>Current Version:</b> %s<br>
            <b>Your Version:</b> %s<br>
            <i>%s</i>
            """ % (url_version, VERSION, version))

        version_message.exec()

    def GetHelp(self):
        webbrowser.open("https://github.com/vg-mjg/tablecloth-generator/wiki")
Exemple #7
0
class Ui_opsWidget(object):
    def setupUi(self, opsWidget):
        if not opsWidget.objectName():
            opsWidget.setObjectName(u"opsWidget")
        opsWidget.resize(484, 788)
        self.opLayout = QVBoxLayout(opsWidget)
        self.opLayout.setObjectName(u"opLayout")
        self.operationSelect = QGroupBox(opsWidget)
        self.operationSelect.setObjectName(u"operationSelect")
        self.operationSelect.setEnabled(True)
        self.operationSelect.setFlat(True)
        self.verticalLayout_3 = QVBoxLayout(self.operationSelect)
        self.verticalLayout_3.setSpacing(10)
        self.verticalLayout_3.setObjectName(u"verticalLayout_3")
        self.verticalLayout_3.setContentsMargins(4, 4, 4, 4)
        self.formLayout = QFormLayout()
        self.formLayout.setObjectName(u"formLayout")
        self.formLayout.setVerticalSpacing(10)
        self.formLayout.setContentsMargins(5, 20, 5, 20)
        self.applyOpLabel = QLabel(self.operationSelect)
        self.applyOpLabel.setObjectName(u"applyOpLabel")

        self.formLayout.setWidget(1, QFormLayout.LabelRole, self.applyOpLabel)

        self.opCombo = QComboBox(self.operationSelect)
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.addItem("")
        self.opCombo.setObjectName(u"opCombo")
        self.opCombo.setEnabled(True)

        self.formLayout.setWidget(1, QFormLayout.FieldRole, self.opCombo)

        self.applyToLabel = QLabel(self.operationSelect)
        self.applyToLabel.setObjectName(u"applyToLabel")

        self.formLayout.setWidget(2, QFormLayout.LabelRole, self.applyToLabel)

        self.horizontalLayout = QHBoxLayout()
        self.horizontalLayout.setObjectName(u"horizontalLayout")
        self.verticalLayout_18 = QVBoxLayout()
        self.verticalLayout_18.setObjectName(u"verticalLayout_18")
        self.horizontalLayout_2 = QHBoxLayout()
        self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
        self.allDemoCheck = QCheckBox(self.operationSelect)
        self.allDemoCheck.setObjectName(u"allDemoCheck")
        self.allDemoCheck.setMaximumSize(QSize(10000, 16777215))

        self.horizontalLayout_2.addWidget(self.allDemoCheck)

        self.allStepsCheck = QCheckBox(self.operationSelect)
        self.allStepsCheck.setObjectName(u"allStepsCheck")
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.allStepsCheck.sizePolicy().hasHeightForWidth())
        self.allStepsCheck.setSizePolicy(sizePolicy)
        self.allStepsCheck.setMinimumSize(QSize(180, 0))
        self.allStepsCheck.setLayoutDirection(Qt.LeftToRight)

        self.horizontalLayout_2.addWidget(self.allStepsCheck)

        self.verticalLayout_18.addLayout(self.horizontalLayout_2)

        self.matchSubstringCheck = QCheckBox(self.operationSelect)
        self.matchSubstringCheck.setObjectName(u"matchSubstringCheck")

        self.verticalLayout_18.addWidget(self.matchSubstringCheck)

        self.horizontalLayout_13 = QHBoxLayout()
        self.horizontalLayout_13.setObjectName(u"horizontalLayout_13")
        self.label_16 = QLabel(self.operationSelect)
        self.label_16.setObjectName(u"label_16")
        self.label_16.setEnabled(False)

        self.horizontalLayout_13.addWidget(self.label_16)

        self.matchSubstringText = QLineEdit(self.operationSelect)
        self.matchSubstringText.setObjectName(u"matchSubstringText")
        self.matchSubstringText.setEnabled(False)

        self.horizontalLayout_13.addWidget(self.matchSubstringText)

        self.verticalLayout_18.addLayout(self.horizontalLayout_13)

        self.horizontalLayout.addLayout(self.verticalLayout_18)

        self.formLayout.setLayout(2, QFormLayout.FieldRole,
                                  self.horizontalLayout)

        self.applyDemoLabel = QLabel(self.operationSelect)
        self.applyDemoLabel.setObjectName(u"applyDemoLabel")

        self.formLayout.setWidget(0, QFormLayout.LabelRole,
                                  self.applyDemoLabel)

        self.demoTargetCombo = QComboBox(self.operationSelect)
        self.demoTargetCombo.setObjectName(u"demoTargetCombo")

        self.formLayout.setWidget(0, QFormLayout.FieldRole,
                                  self.demoTargetCombo)

        self.verticalLayout_3.addLayout(self.formLayout)

        self.opLayout.addWidget(self.operationSelect)

        self.groupBox_6 = QGroupBox(opsWidget)
        self.groupBox_6.setObjectName(u"groupBox_6")
        self.groupBox_6.setEnabled(True)
        self.groupBox_6.setFlat(True)
        self.verticalLayout = QVBoxLayout(self.groupBox_6)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.verticalLayout.setContentsMargins(4, 4, 4, 4)
        self.opsParamsStack = QStackedWidget(self.groupBox_6)
        self.opsParamsStack.setObjectName(u"opsParamsStack")
        self.opsParamsStack.setAutoFillBackground(False)
        self.shellTab = QWidget()
        self.shellTab.setObjectName(u"shellTab")
        self.shellTab.setAutoFillBackground(False)
        self.formLayout_2 = QFormLayout(self.shellTab)
        self.formLayout_2.setObjectName(u"formLayout_2")
        self.formLayout_2.setLabelAlignment(Qt.AlignLeading | Qt.AlignLeft
                                            | Qt.AlignVCenter)
        self.formLayout_2.setFormAlignment(Qt.AlignLeading | Qt.AlignLeft
                                           | Qt.AlignVCenter)
        self.formLayout_2.setVerticalSpacing(40)
        self.formLayout_2.setContentsMargins(-1, 11, -1, -1)
        self.label = QLabel(self.shellTab)
        self.label.setObjectName(u"label")

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

        self.horizontalLayout_4 = QHBoxLayout()
        self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
        self.shellImgPath = QLineEdit(self.shellTab)
        self.shellImgPath.setObjectName(u"shellImgPath")

        self.horizontalLayout_4.addWidget(self.shellImgPath)

        self.shellBrowseImgBtn = QPushButton(self.shellTab)
        self.shellBrowseImgBtn.setObjectName(u"shellBrowseImgBtn")

        self.horizontalLayout_4.addWidget(self.shellBrowseImgBtn)

        self.formLayout_2.setLayout(0, QFormLayout.FieldRole,
                                    self.horizontalLayout_4)

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

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

        self.horizontalLayout_7 = QHBoxLayout()
        self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
        self.label_3 = QLabel(self.shellTab)
        self.label_3.setObjectName(u"label_3")
        self.label_3.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_7.addWidget(self.label_3)

        self.shellFgX = QSpinBox(self.shellTab)
        self.shellFgX.setObjectName(u"shellFgX")
        self.shellFgX.setMaximum(100000000)

        self.horizontalLayout_7.addWidget(self.shellFgX)

        self.label_4 = QLabel(self.shellTab)
        self.label_4.setObjectName(u"label_4")
        self.label_4.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_7.addWidget(self.label_4)

        self.shellFgY = QSpinBox(self.shellTab)
        self.shellFgY.setObjectName(u"shellFgY")
        self.shellFgY.setMaximum(100000000)

        self.horizontalLayout_7.addWidget(self.shellFgY)

        self.formLayout_2.setLayout(1, QFormLayout.FieldRole,
                                    self.horizontalLayout_7)

        self.label_5 = QLabel(self.shellTab)
        self.label_5.setObjectName(u"label_5")

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

        self.horizontalLayout_8 = QHBoxLayout()
        self.horizontalLayout_8.setObjectName(u"horizontalLayout_8")
        self.label_7 = QLabel(self.shellTab)
        self.label_7.setObjectName(u"label_7")
        self.label_7.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_8.addWidget(self.label_7)

        self.shellFgW = QSpinBox(self.shellTab)
        self.shellFgW.setObjectName(u"shellFgW")
        self.shellFgW.setMaximum(100000000)

        self.horizontalLayout_8.addWidget(self.shellFgW)

        self.label_6 = QLabel(self.shellTab)
        self.label_6.setObjectName(u"label_6")
        self.label_6.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_8.addWidget(self.label_6)

        self.shellFgH = QSpinBox(self.shellTab)
        self.shellFgH.setObjectName(u"shellFgH")
        self.shellFgH.setMaximum(10000000)

        self.horizontalLayout_8.addWidget(self.shellFgH)

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

        self.opsParamsStack.addWidget(self.shellTab)
        self.insertTab = QWidget()
        self.insertTab.setObjectName(u"insertTab")
        self.formLayout_3 = QFormLayout(self.insertTab)
        self.formLayout_3.setObjectName(u"formLayout_3")
        self.formLayout_3.setVerticalSpacing(40)
        self.formLayout_3.setContentsMargins(-1, 40, -1, -1)
        self.label_32 = QLabel(self.insertTab)
        self.label_32.setObjectName(u"label_32")

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

        self.horizontalLayout_20 = QHBoxLayout()
        self.horizontalLayout_20.setObjectName(u"horizontalLayout_20")
        self.insertImgPath = QLineEdit(self.insertTab)
        self.insertImgPath.setObjectName(u"insertImgPath")

        self.horizontalLayout_20.addWidget(self.insertImgPath)

        self.insertBrowseImgBtn = QPushButton(self.insertTab)
        self.insertBrowseImgBtn.setObjectName(u"insertBrowseImgBtn")

        self.horizontalLayout_20.addWidget(self.insertBrowseImgBtn)

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

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

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

        self.horizontalLayout_18 = QHBoxLayout()
        self.horizontalLayout_18.setObjectName(u"horizontalLayout_18")
        self.label_26 = QLabel(self.insertTab)
        self.label_26.setObjectName(u"label_26")
        self.label_26.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_18.addWidget(self.label_26)

        self.insertFgX = QSpinBox(self.insertTab)
        self.insertFgX.setObjectName(u"insertFgX")
        sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
        sizePolicy1.setHorizontalStretch(0)
        sizePolicy1.setVerticalStretch(0)
        sizePolicy1.setHeightForWidth(
            self.insertFgX.sizePolicy().hasHeightForWidth())
        self.insertFgX.setSizePolicy(sizePolicy1)
        self.insertFgX.setMaximum(10000000)

        self.horizontalLayout_18.addWidget(self.insertFgX)

        self.label_29 = QLabel(self.insertTab)
        self.label_29.setObjectName(u"label_29")
        self.label_29.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_18.addWidget(self.label_29)

        self.insertFgY = QSpinBox(self.insertTab)
        self.insertFgY.setObjectName(u"insertFgY")
        self.insertFgY.setMaximum(10000000)

        self.horizontalLayout_18.addWidget(self.insertFgY)

        self.formLayout_3.setLayout(1, QFormLayout.FieldRole,
                                    self.horizontalLayout_18)

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

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

        self.horizontalLayout_21 = QHBoxLayout()
        self.horizontalLayout_21.setObjectName(u"horizontalLayout_21")
        self.label_33 = QLabel(self.insertTab)
        self.label_33.setObjectName(u"label_33")
        self.label_33.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_21.addWidget(self.label_33)

        self.insertFgW = QSpinBox(self.insertTab)
        self.insertFgW.setObjectName(u"insertFgW")
        self.insertFgW.setBaseSize(QSize(1920, 0))
        self.insertFgW.setMaximum(1000000)
        self.insertFgW.setValue(1920)

        self.horizontalLayout_21.addWidget(self.insertFgW)

        self.label_34 = QLabel(self.insertTab)
        self.label_34.setObjectName(u"label_34")
        self.label_34.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_21.addWidget(self.label_34)

        self.insertFgH = QSpinBox(self.insertTab)
        self.insertFgH.setObjectName(u"insertFgH")
        self.insertFgH.setMaximum(1000000000)
        self.insertFgH.setValue(1080)

        self.horizontalLayout_21.addWidget(self.insertFgH)

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

        self.opsParamsStack.addWidget(self.insertTab)
        self.sectionTab = QWidget()
        self.sectionTab.setObjectName(u"sectionTab")
        self.formLayout_6 = QFormLayout(self.sectionTab)
        self.formLayout_6.setObjectName(u"formLayout_6")
        self.sectionRulesListWidget = QListWidget(self.sectionTab)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        QListWidgetItem(self.sectionRulesListWidget)
        self.sectionRulesListWidget.setObjectName(u"sectionRulesListWidget")
        self.sectionRulesListWidget.setMaximumSize(QSize(16777215, 100))

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

        self.label_10 = QLabel(self.sectionTab)
        self.label_10.setObjectName(u"label_10")
        self.label_10.setMaximumSize(QSize(16777215, 20))

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

        self.sectionCoverageLabel = QLabel(self.sectionTab)
        self.sectionCoverageLabel.setObjectName(u"sectionCoverageLabel")
        self.sectionCoverageLabel.setMaximumSize(QSize(16777215, 20))

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

        self.label_11 = QLabel(self.sectionTab)
        self.label_11.setObjectName(u"label_11")
        self.label_11.setMaximumSize(QSize(16777215, 20))

        self.formLayout_6.setWidget(3, QFormLayout.FieldRole, self.label_11)

        self.opsParamsStack.addWidget(self.sectionTab)
        self.audioTab = QWidget()
        self.audioTab.setObjectName(u"audioTab")
        self.formLayout_8 = QFormLayout(self.audioTab)
        self.formLayout_8.setObjectName(u"formLayout_8")
        self.comboBox = QComboBox(self.audioTab)
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.setObjectName(u"comboBox")

        self.formLayout_8.setWidget(0, QFormLayout.FieldRole, self.comboBox)

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

        self.formLayout_8.setWidget(0, QFormLayout.LabelRole, self.label_8)

        self.opsParamsStack.addWidget(self.audioTab)
        self.cropTab = QWidget()
        self.cropTab.setObjectName(u"cropTab")
        self.formLayout_4 = QFormLayout(self.cropTab)
        self.formLayout_4.setObjectName(u"formLayout_4")
        self.formLayout_4.setVerticalSpacing(40)
        self.formLayout_4.setContentsMargins(-1, 40, -1, -1)
        self.label_14 = QLabel(self.cropTab)
        self.label_14.setObjectName(u"label_14")

        self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_14)

        self.horizontalLayout_19 = QHBoxLayout()
        self.horizontalLayout_19.setObjectName(u"horizontalLayout_19")
        self.label_30 = QLabel(self.cropTab)
        self.label_30.setObjectName(u"label_30")
        self.label_30.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_19.addWidget(self.label_30)

        self.spinBox_21 = QSpinBox(self.cropTab)
        self.spinBox_21.setObjectName(u"spinBox_21")

        self.horizontalLayout_19.addWidget(self.spinBox_21)

        self.label_31 = QLabel(self.cropTab)
        self.label_31.setObjectName(u"label_31")
        self.label_31.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_19.addWidget(self.label_31)

        self.spinBox_22 = QSpinBox(self.cropTab)
        self.spinBox_22.setObjectName(u"spinBox_22")

        self.horizontalLayout_19.addWidget(self.spinBox_22)

        self.formLayout_4.setLayout(0, QFormLayout.FieldRole,
                                    self.horizontalLayout_19)

        self.label_15 = QLabel(self.cropTab)
        self.label_15.setObjectName(u"label_15")

        self.formLayout_4.setWidget(1, QFormLayout.LabelRole, self.label_15)

        self.horizontalLayout_22 = QHBoxLayout()
        self.horizontalLayout_22.setObjectName(u"horizontalLayout_22")
        self.label_35 = QLabel(self.cropTab)
        self.label_35.setObjectName(u"label_35")
        self.label_35.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_22.addWidget(self.label_35)

        self.spinBox_25 = QSpinBox(self.cropTab)
        self.spinBox_25.setObjectName(u"spinBox_25")

        self.horizontalLayout_22.addWidget(self.spinBox_25)

        self.label_36 = QLabel(self.cropTab)
        self.label_36.setObjectName(u"label_36")
        self.label_36.setAlignment(Qt.AlignCenter)

        self.horizontalLayout_22.addWidget(self.label_36)

        self.spinBox_26 = QSpinBox(self.cropTab)
        self.spinBox_26.setObjectName(u"spinBox_26")

        self.horizontalLayout_22.addWidget(self.spinBox_26)

        self.formLayout_4.setLayout(1, QFormLayout.FieldRole,
                                    self.horizontalLayout_22)

        self.opsParamsStack.addWidget(self.cropTab)
        self.composeTab = QWidget()
        self.composeTab.setObjectName(u"composeTab")
        self.verticalLayout_12 = QVBoxLayout(self.composeTab)
        self.verticalLayout_12.setObjectName(u"verticalLayout_12")
        self.verticalLayout_11 = QVBoxLayout()
        self.verticalLayout_11.setObjectName(u"verticalLayout_11")

        self.verticalLayout_12.addLayout(self.verticalLayout_11)

        self.opsParamsStack.addWidget(self.composeTab)
        self.resizeTab = QWidget()
        self.resizeTab.setObjectName(u"resizeTab")
        self.verticalLayout_10 = QVBoxLayout(self.resizeTab)
        self.verticalLayout_10.setObjectName(u"verticalLayout_10")
        self.verticalLayout_9 = QVBoxLayout()
        self.verticalLayout_9.setObjectName(u"verticalLayout_9")

        self.verticalLayout_10.addLayout(self.verticalLayout_9)

        self.opsParamsStack.addWidget(self.resizeTab)
        self.pacingTab = QWidget()
        self.pacingTab.setObjectName(u"pacingTab")
        self.verticalLayout_5 = QVBoxLayout(self.pacingTab)
        self.verticalLayout_5.setObjectName(u"verticalLayout_5")
        self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
        self.tabWidget = QTabWidget(self.pacingTab)
        self.tabWidget.setObjectName(u"tabWidget")
        self.tab = QWidget()
        self.tab.setObjectName(u"tab")
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QWidget()
        self.tab_2.setObjectName(u"tab_2")
        self.tabWidget.addTab(self.tab_2, "")

        self.verticalLayout_5.addWidget(self.tabWidget)

        self.opsParamsStack.addWidget(self.pacingTab)
        self.animateTab = QWidget()
        self.animateTab.setObjectName(u"animateTab")
        self.verticalLayout_14 = QVBoxLayout(self.animateTab)
        self.verticalLayout_14.setObjectName(u"verticalLayout_14")
        self.verticalLayout_13 = QVBoxLayout()
        self.verticalLayout_13.setObjectName(u"verticalLayout_13")

        self.verticalLayout_14.addLayout(self.verticalLayout_13)

        self.opsParamsStack.addWidget(self.animateTab)
        self.renderTab = QWidget()
        self.renderTab.setObjectName(u"renderTab")
        self.verticalLayout_4 = QVBoxLayout(self.renderTab)
        self.verticalLayout_4.setObjectName(u"verticalLayout_4")
        self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
        self.renderTabTabs = QTabWidget(self.renderTab)
        self.renderTabTabs.setObjectName(u"renderTabTabs")
        self.renderTabVideoTab = QWidget()
        self.renderTabVideoTab.setObjectName(u"renderTabVideoTab")
        self.verticalLayout_2 = QVBoxLayout(self.renderTabVideoTab)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.verticalLayout_2.setContentsMargins(5, 5, 5, 5)
        self.scrollArea = QScrollArea(self.renderTabVideoTab)
        self.scrollArea.setObjectName(u"scrollArea")
        self.scrollArea.setFrameShape(QFrame.Panel)
        self.scrollArea.setFrameShadow(QFrame.Plain)
        self.scrollArea.setLineWidth(0)
        self.scrollArea.setWidgetResizable(True)
        self.scrollAreaWidgetContents = QWidget()
        self.scrollAreaWidgetContents.setObjectName(
            u"scrollAreaWidgetContents")
        self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 438, 412))
        self.formLayout_10 = QFormLayout(self.scrollAreaWidgetContents)
        self.formLayout_10.setObjectName(u"formLayout_10")
        self.videoTitleLabel = QLabel(self.scrollAreaWidgetContents)
        self.videoTitleLabel.setObjectName(u"videoTitleLabel")

        self.formLayout_10.setWidget(0, QFormLayout.LabelRole,
                                     self.videoTitleLabel)

        self.renderOutputTitle = QLineEdit(self.scrollAreaWidgetContents)
        self.renderOutputTitle.setObjectName(u"renderOutputTitle")

        self.formLayout_10.setWidget(0, QFormLayout.FieldRole,
                                     self.renderOutputTitle)

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

        self.formLayout_10.setWidget(1, QFormLayout.LabelRole,
                                     self.videoDirectoryLabel)

        self.renderOutputDir = QLineEdit(self.scrollAreaWidgetContents)
        self.renderOutputDir.setObjectName(u"renderOutputDir")

        self.formLayout_10.setWidget(1, QFormLayout.FieldRole,
                                     self.renderOutputDir)

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

        self.formLayout_10.setWidget(2, QFormLayout.LabelRole,
                                     self.videoFormatLabel)

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

        self.formLayout_10.setWidget(2, QFormLayout.FieldRole,
                                     self.renderOutputFormat)

        self.scrollArea.setWidget(self.scrollAreaWidgetContents)

        self.verticalLayout_2.addWidget(self.scrollArea)

        self.renderTabTabs.addTab(self.renderTabVideoTab, "")
        self.renderTabAudioTab = QWidget()
        self.renderTabAudioTab.setObjectName(u"renderTabAudioTab")
        self.verticalLayout_6 = QVBoxLayout(self.renderTabAudioTab)
        self.verticalLayout_6.setObjectName(u"verticalLayout_6")
        self.scrollArea_2 = QScrollArea(self.renderTabAudioTab)
        self.scrollArea_2.setObjectName(u"scrollArea_2")
        self.scrollArea_2.setWidgetResizable(True)
        self.scrollAreaWidgetContents_2 = QWidget()
        self.scrollAreaWidgetContents_2.setObjectName(
            u"scrollAreaWidgetContents_2")
        self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 428, 402))
        self.formLayout_11 = QFormLayout(self.scrollAreaWidgetContents_2)
        self.formLayout_11.setObjectName(u"formLayout_11")
        self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2)

        self.verticalLayout_6.addWidget(self.scrollArea_2)

        self.renderTabTabs.addTab(self.renderTabAudioTab, "")
        self.renderTabPacingTab = QWidget()
        self.renderTabPacingTab.setObjectName(u"renderTabPacingTab")
        self.verticalLayout_8 = QVBoxLayout(self.renderTabPacingTab)
        self.verticalLayout_8.setObjectName(u"verticalLayout_8")
        self.scrollArea_3 = QScrollArea(self.renderTabPacingTab)
        self.scrollArea_3.setObjectName(u"scrollArea_3")
        self.scrollArea_3.setWidgetResizable(True)
        self.scrollAreaWidgetContents_3 = QWidget()
        self.scrollAreaWidgetContents_3.setObjectName(
            u"scrollAreaWidgetContents_3")
        self.scrollAreaWidgetContents_3.setGeometry(QRect(0, 0, 428, 402))
        self.formLayout_12 = QFormLayout(self.scrollAreaWidgetContents_3)
        self.formLayout_12.setObjectName(u"formLayout_12")
        self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3)

        self.verticalLayout_8.addWidget(self.scrollArea_3)

        self.renderTabTabs.addTab(self.renderTabPacingTab, "")

        self.verticalLayout_4.addWidget(self.renderTabTabs)

        self.opsParamsStack.addWidget(self.renderTab)
        self.extraTab = QWidget()
        self.extraTab.setObjectName(u"extraTab")
        self.formLayout_7 = QFormLayout(self.extraTab)
        self.formLayout_7.setObjectName(u"formLayout_7")
        self.opsParamsStack.addWidget(self.extraTab)

        self.verticalLayout.addWidget(self.opsParamsStack)

        self.opLayout.addWidget(self.groupBox_6)

        self.horizontalLayout_9 = QHBoxLayout()
        self.horizontalLayout_9.setObjectName(u"horizontalLayout_9")
        self.horizontalLayout_9.setContentsMargins(10, 10, 10, 10)
        self.resetStepParamsBtn = QPushButton(opsWidget)
        self.resetStepParamsBtn.setObjectName(u"resetStepParamsBtn")

        self.horizontalLayout_9.addWidget(self.resetStepParamsBtn)

        self.saveStepParamsBtn = QPushButton(opsWidget)
        self.saveStepParamsBtn.setObjectName(u"saveStepParamsBtn")

        self.horizontalLayout_9.addWidget(self.saveStepParamsBtn)

        self.opLayout.addLayout(self.horizontalLayout_9)

        self.retranslateUi(opsWidget)
        self.opCombo.currentIndexChanged.connect(
            self.opsParamsStack.setCurrentIndex)

        self.opsParamsStack.setCurrentIndex(9)
        self.renderTabTabs.setCurrentIndex(0)

        QMetaObject.connectSlotsByName(opsWidget)

    # setupUi

    def retranslateUi(self, opsWidget):
        self.operationSelect.setTitle(
            QCoreApplication.translate("opsWidget", u"Operation", None))
        self.applyOpLabel.setText(
            QCoreApplication.translate("opsWidget", u"Operation", None))
        self.opCombo.setItemText(
            0, QCoreApplication.translate("opsWidget", u"Shell", None))
        self.opCombo.setItemText(
            1, QCoreApplication.translate("opsWidget", u"Insert", None))
        self.opCombo.setItemText(
            2, QCoreApplication.translate("opsWidget", u"Section", None))
        self.opCombo.setItemText(
            3, QCoreApplication.translate("opsWidget", u"Audio", None))
        self.opCombo.setItemText(
            4, QCoreApplication.translate("opsWidget", u"Crop", None))
        self.opCombo.setItemText(
            5, QCoreApplication.translate("opsWidget", u"Compose Demos", None))
        self.opCombo.setItemText(
            6, QCoreApplication.translate("opsWidget", u"Resize", None))
        self.opCombo.setItemText(
            7, QCoreApplication.translate("opsWidget", u"Add pacing", None))
        self.opCombo.setItemText(
            8,
            QCoreApplication.translate("opsWidget", u"Animate scroll steps",
                                       None))
        self.opCombo.setItemText(
            9, QCoreApplication.translate("opsWidget", u"Render to video",
                                          None))

        self.applyToLabel.setText(
            QCoreApplication.translate("opsWidget", u"Apply to:", None))
        self.allDemoCheck.setText(
            QCoreApplication.translate("opsWidget", u"Apply to all demos",
                                       None))
        self.allStepsCheck.setText(
            QCoreApplication.translate("opsWidget", u"Apply to all steps",
                                       None))
        self.matchSubstringCheck.setText(
            QCoreApplication.translate(
                "opsWidget", u"Apply to steps with matching substring:", None))
        self.label_16.setText(
            QCoreApplication.translate("opsWidget", u"Steps containing:",
                                       None))
        self.applyDemoLabel.setText(
            QCoreApplication.translate("opsWidget", u"Demo", None))
        self.groupBox_6.setTitle(
            QCoreApplication.translate("opsWidget", u"Parameters", None))
        self.label.setText(
            QCoreApplication.translate("opsWidget", u"Background", None))
        #if QT_CONFIG(statustip)
        self.shellImgPath.setStatusTip(
            QCoreApplication.translate(
                "opsWidget",
                u"Filepath of image to be used as shell for demo assets",
                None))
        #endif // QT_CONFIG(statustip)
        self.shellBrowseImgBtn.setText(
            QCoreApplication.translate("opsWidget", u"Browse", None))
        self.label_2.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Coordinates of assets on shell",
                                       None))
        self.label_3.setText(
            QCoreApplication.translate("opsWidget", u"X", None))
        self.label_4.setText(
            QCoreApplication.translate("opsWidget", u"Y", None))
        self.label_5.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Dimensions of assets on shell", None))
        self.label_7.setText(
            QCoreApplication.translate("opsWidget", u"Width", None))
        self.label_6.setText(
            QCoreApplication.translate("opsWidget", u"Height", None))
        self.label_32.setText(
            QCoreApplication.translate("opsWidget", u"Image to paste", None))
        self.insertBrowseImgBtn.setText(
            QCoreApplication.translate("opsWidget", u"Browse", None))
        self.label_13.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Coords of image on assets", None))
        self.label_26.setText(
            QCoreApplication.translate("opsWidget", u"X", None))
        self.label_29.setText(
            QCoreApplication.translate("opsWidget", u"Y", None))
        self.label_12.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Dimensions of image on assets", None))
        self.label_33.setText(
            QCoreApplication.translate("opsWidget", u"Width", None))
        self.label_34.setText(
            QCoreApplication.translate("opsWidget", u"Height", None))

        __sortingEnabled = self.sectionRulesListWidget.isSortingEnabled()
        self.sectionRulesListWidget.setSortingEnabled(False)
        ___qlistwidgetitem = self.sectionRulesListWidget.item(0)
        ___qlistwidgetitem.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Step has TP, next step without TP",
                                       None))
        ___qlistwidgetitem1 = self.sectionRulesListWidget.item(1)
        ___qlistwidgetitem1.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Step has TP, next step with TP",
                                       None))
        ___qlistwidgetitem2 = self.sectionRulesListWidget.item(2)
        ___qlistwidgetitem2.setText(
            QCoreApplication.translate(
                "opsWidget", u"Step has TP, previous step without TP", None))
        ___qlistwidgetitem3 = self.sectionRulesListWidget.item(3)
        ___qlistwidgetitem3.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Step has TP, previous step with TP",
                                       None))
        ___qlistwidgetitem4 = self.sectionRulesListWidget.item(4)
        ___qlistwidgetitem4.setText(
            QCoreApplication.translate("opsWidget", u"Step has fade-in", None))
        ___qlistwidgetitem5 = self.sectionRulesListWidget.item(5)
        ___qlistwidgetitem5.setText(
            QCoreApplication.translate("opsWidget", u"Step has jump box",
                                       None))
        ___qlistwidgetitem6 = self.sectionRulesListWidget.item(6)
        ___qlistwidgetitem6.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Step TP contains text pattern...",
                                       None))
        self.sectionRulesListWidget.setSortingEnabled(__sortingEnabled)

        self.label_10.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Insert new section on...", None))
        self.sectionCoverageLabel.setText(
            QCoreApplication.translate(
                "opsWidget", u"Covers 0 steps in selected sections/steps",
                None))
        self.label_11.setText(
            QCoreApplication.translate(
                "opsWidget",
                u"May not match number of audio soundbites (audio not imported)",
                None))
        self.comboBox.setItemText(
            0,
            QCoreApplication.translate("opsWidget",
                                       u"Mixed section and step audio", None))
        self.comboBox.setItemText(
            1,
            QCoreApplication.translate("opsWidget", u"Section audio only",
                                       None))
        self.comboBox.setItemText(
            2, QCoreApplication.translate("opsWidget", u"Step audio only",
                                          None))

        self.label_8.setText(
            QCoreApplication.translate("opsWidget",
                                       u"Audio attachment behavior", None))
        self.label_14.setText(
            QCoreApplication.translate("opsWidget", u"Crop start coordinates",
                                       None))
        self.label_30.setText(
            QCoreApplication.translate("opsWidget", u"X", None))
        self.label_31.setText(
            QCoreApplication.translate("opsWidget", u"Y", None))
        self.label_15.setText(
            QCoreApplication.translate("opsWidget", u"Crop dimensions", None))
        self.label_35.setText(
            QCoreApplication.translate("opsWidget", u"Width", None))
        self.label_36.setText(
            QCoreApplication.translate("opsWidget", u"Height", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab),
            QCoreApplication.translate("opsWidget", u"Tab 1", None))
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_2),
            QCoreApplication.translate("opsWidget", u"Tab 2", None))
        self.videoTitleLabel.setText(
            QCoreApplication.translate("opsWidget", u"Video Title", None))
        self.videoDirectoryLabel.setText(
            QCoreApplication.translate("opsWidget", u"Video Directory", None))
        self.videoFormatLabel.setText(
            QCoreApplication.translate("opsWidget", u"Video Format", None))
        self.renderOutputFormat.setItemText(
            0, QCoreApplication.translate("opsWidget", u"avi", None))
        self.renderOutputFormat.setItemText(
            1, QCoreApplication.translate("opsWidget", u"mp4", None))

        self.renderTabTabs.setTabText(
            self.renderTabTabs.indexOf(self.renderTabVideoTab),
            QCoreApplication.translate("opsWidget", u"Video", None))
        self.renderTabTabs.setTabText(
            self.renderTabTabs.indexOf(self.renderTabAudioTab),
            QCoreApplication.translate("opsWidget", u"Audio", None))
        self.renderTabTabs.setTabText(
            self.renderTabTabs.indexOf(self.renderTabPacingTab),
            QCoreApplication.translate("opsWidget", u"Pacing", None))
        self.resetStepParamsBtn.setText(
            QCoreApplication.translate("opsWidget", u"Reset to default", None))
        self.saveStepParamsBtn.setText(
            QCoreApplication.translate("opsWidget", u"Save step parameters",
                                       None))
        pass