Ejemplo n.º 1
0
    def create_layouts(self):
        """
        Creates layouts
        """

        form_layout = QtWidgets.QFormLayout()
        form_layout.addRow("Name", self.name_line_edit)
        form_layout.addRow("Login", self.login_line_edit)
        form_layout.addRow("Email", self.email_line_edit)
        form_layout.addRow("Password", self.password_line_edit)

        button_layout = QtWidgets.QHBoxLayout()
        button_layout.addStretch()
        button_layout.addWidget(self.ok_button)
        button_layout.addWidget(self.cancel_button)

        label_layout = QtWidgets.QVBoxLayout()
        label_layout.addWidget(self.dialog_label)
        label_layout.addWidget(self.line)
        label_layout.addStretch()

        main_layout = QtWidgets.QVBoxLayout(self)
        main_layout.addLayout(label_layout)
        main_layout.addLayout(form_layout)
        main_layout.addLayout(button_layout)

        self.resize(328, 184)
Ejemplo n.º 2
0
    def setup_ui(self):
        """creates the UI widgets
        """
        self.setStyleSheet("""
        QLabel[labelField="true"] {
            font-weight: bold;
        }
        """)

        # the main layout
        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        # the form layout
        from anima.ui.lib import QtCore
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.vertical_layout.addLayout(self.form_layout)

        i = -1
        # -------------------------------------------------------------
        # Name Field
        i += 1
        self.name_label = QtWidgets.QLabel(self)
        self.name_label.setText("Name")
        self.name_label.setProperty("labelField", True)

        self.name_field = QtWidgets.QLineEdit(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.name_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.name_field)

        # -------------------------------------------------------------
        # Type Field
        i += 1
        self.type_label = QtWidgets.QLabel(self)
        self.type_label.setText("Type")
        self.type_label.setProperty("labelField", True)

        self.type_field = QtWidgets.QComboBox(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.type_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.type_field)

        # -------------------------------------------------------------
        # Created By Field
        i += 1
        self.created_by_label = QtWidgets.QLabel(self)
        self.created_by_label.setText("Created By")
        self.created_by_label.setProperty("labelField", True)

        self.created_by_field = QtWidgets.QLabel(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.created_by_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.created_by_field)

        # -------------------------------------------------------------
        # Updated By Field
        i += 1
        self.updated_by_label = QtWidgets.QLabel(self)
        self.updated_by_label.setText("Updated By")
        self.updated_by_label.setProperty("labelField", True)

        self.updated_by_field = QtWidgets.QLabel(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.updated_by_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.updated_by_field)

        # -------------------------------------------------------------
        # Timing Field
        i += 1
        self.timing_label = QtWidgets.QLabel(self)
        self.timing_label.setText("Timing")
        self.timing_label.setProperty("labelField", True)

        self.timing_field = QtWidgets.QLabel(self)
        self.timing_field.setText('23 Hours ago -> an Hour ago!')

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.timing_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.timing_field)

        # -------------------------------------------------------------
        # Priority
        i += 1
        self.priority_label = QtWidgets.QLabel(self)
        self.priority_label.setText("Priority")
        self.priority_label.setProperty("labelField", True)

        self.priority_field = QtWidgets.QLabel(self)
        self.priority_field.setText('950')

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.priority_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.priority_field)

        # Create signals
        QtCore.QObject.connect(self.type_field,
                               QtCore.SIGNAL('currentIndexChanged(QString)'),
                               self.type_field_changed)
Ejemplo n.º 3
0
    def _setup_ui(self):
        """create UI elements
        """
        self.resize(517, 545)
        self.verticalLayout = QtWidgets.QVBoxLayout(self)

        self.setWindowTitle("Project Dialog")

        # ----------------------
        # Dialog Label
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setText('%s Project' % self.mode)
        self.dialog_label.setStyleSheet(
            "color: rgb(71, 143, 202);\nfont: 18pt;")
        self.verticalLayout.addWidget(self.dialog_label)
        self.line = QtWidgets.QFrame(self)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.verticalLayout.addWidget(self.line)

        self.project_info_formLayout = QtWidgets.QFormLayout()
        self.project_info_formLayout.setLabelAlignment(
            QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing
            | QtCore.Qt.AlignVCenter)

        # ----------------------
        # Name Fields
        self.name_label = QtWidgets.QLabel(self)
        self.name_label.setText("Name")
        self.project_info_formLayout.setWidget(0,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.name_label)

        self.name_fields_verticalLayout = QtWidgets.QVBoxLayout()
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setText("Validator Message")
        self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.name_fields_verticalLayout.addWidget(self.name_validator_label)
        self.project_info_formLayout.setLayout(0,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.name_fields_verticalLayout)

        # add name_lineEdit
        from anima.ui.widgets import ValidatedLineEdit
        self.name_lineEdit = ValidatedLineEdit(
            message_field=self.name_validator_label)
        self.name_fields_verticalLayout.insertWidget(0, self.name_lineEdit)

        # ----------------------
        # Code Fields
        self.code_label = QtWidgets.QLabel(self)
        self.code_label.setText("Code")
        self.project_info_formLayout.setWidget(1,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.code_label)
        self.code_fields_verticalLayout = QtWidgets.QVBoxLayout()
        self.code_validator_label = QtWidgets.QLabel(self)
        self.code_validator_label.setText("Validator Message")
        self.code_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.code_fields_verticalLayout.addWidget(self.code_validator_label)
        self.project_info_formLayout.setLayout(1,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.code_fields_verticalLayout)

        # add code_lineEdit
        self.code_lineEdit = ValidatedLineEdit(
            message_field=self.code_validator_label)
        self.code_fields_verticalLayout.insertWidget(0, self.code_lineEdit)

        # ----------------------
        # Type Fields
        self.type_label = QtWidgets.QLabel(self)
        self.type_label.setText("Type")
        self.project_info_formLayout.setWidget(2,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.type_label)
        self.type_comboBox = QtWidgets.QComboBox(self)
        self.type_comboBox.setEditable(True)
        self.project_info_formLayout.setWidget(2,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.type_comboBox)

        # ----------------------
        # Date Fields
        self.date_label = QtWidgets.QLabel(self)
        self.date_label.setText("Date")
        self.project_info_formLayout.setWidget(3,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.date_label)
        self.date_dateEdit = QtWidgets.QDateEdit(self)
        self.project_info_formLayout.setWidget(3,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.date_dateEdit)

        # ----------------------
        # Image Format Fields
        from anima.ui.widgets.image_format import ImageFormatWidget
        self.image_format = ImageFormatWidget(
            parent=self,
            parent_form_layout=self.project_info_formLayout,
            parent_form_layout_index=4)

        # ----------------------
        # FPS Fields
        self.fps_label = QtWidgets.QLabel(self)
        self.fps_label.setText("FPS")
        self.project_info_formLayout.setWidget(5,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.fps_label)
        self.fps_spinBox = QtWidgets.QSpinBox(self)
        self.fps_spinBox.setMinimum(1)
        self.fps_spinBox.setProperty("value", 25)
        self.project_info_formLayout.setWidget(5,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.fps_spinBox)

        # ----------------------
        # Repository Fields
        self.repository_label = QtWidgets.QLabel(self)
        self.repository_label.setText("Repository")
        self.project_info_formLayout.setWidget(6,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.repository_label)
        self.repository_horizontalLayout = QtWidgets.QHBoxLayout()
        self.repository_comboBox = QtWidgets.QComboBox(self)
        self.repository_horizontalLayout.addWidget(self.repository_comboBox)

        # Update Repository Push Button
        self.update_repository_pushButton = QtWidgets.QPushButton(self)
        self.update_repository_pushButton.setText("Update...")
        self.repository_horizontalLayout.addWidget(
            self.update_repository_pushButton)

        # Create Repository Push Button
        self.create_repository_pushButton = QtWidgets.QPushButton(self)
        self.create_repository_pushButton.setText("New...")
        self.repository_horizontalLayout.addWidget(
            self.create_repository_pushButton)

        self.repository_horizontalLayout.setStretch(0, 1)
        self.project_info_formLayout.setLayout(
            6, QtWidgets.QFormLayout.FieldRole,
            self.repository_horizontalLayout)

        # ----------------------
        self.structure_label = QtWidgets.QLabel(self)
        self.structure_label.setText("Structure")

        self.project_info_formLayout.setWidget(7,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.structure_label)
        self.structure_horizontalLayout = QtWidgets.QHBoxLayout()
        self.structure_comboBox = QtWidgets.QComboBox(self)
        self.structure_horizontalLayout.addWidget(self.structure_comboBox)

        # Update Structure Push Button
        self.update_structure_pushButton = QtWidgets.QPushButton(self)
        self.update_structure_pushButton.setText("Update...")
        self.structure_horizontalLayout.addWidget(
            self.update_structure_pushButton)

        # Create Structure Push Button
        self.create_structure_pushButton = QtWidgets.QPushButton(self)
        self.create_structure_pushButton.setText("New...")
        self.structure_horizontalLayout.addWidget(
            self.create_structure_pushButton)

        self.structure_horizontalLayout.setStretch(0, 1)
        self.project_info_formLayout.setLayout(7,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.structure_horizontalLayout)

        # ----------------------
        # Status Fields
        self.status_label = QtWidgets.QLabel(self)
        self.status_label.setText("Status")
        self.project_info_formLayout.setWidget(8,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.status_label)
        self.status_comboBox = QtWidgets.QComboBox(self)
        self.project_info_formLayout.setWidget(8,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.status_comboBox)
        self.verticalLayout.addLayout(self.project_info_formLayout)

        # ----------------------
        # Client Fields
        self.client_info_label = QtWidgets.QLabel(self)
        self.client_info_label.setText("Client Info")
        self.client_info_label.setStyleSheet(
            "color: rgb(71, 143, 202);\nfont: 18pt;")
        self.verticalLayout.addWidget(self.client_info_label)
        self.line_2 = QtWidgets.QFrame(self)
        self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.verticalLayout.addWidget(self.line_2)
        self.client_info_formLayout = QtWidgets.QFormLayout()
        self.client_info_formLayout.setLabelAlignment(QtCore.Qt.AlignRight
                                                      | QtCore.Qt.AlignTrailing
                                                      | QtCore.Qt.AlignVCenter)

        # Client Fields
        self.client_label = QtWidgets.QLabel(self)
        self.client_label.setText("Client")
        self.client_info_formLayout.setWidget(0,
                                              QtWidgets.QFormLayout.LabelRole,
                                              self.client_label)
        self.client_comboBox = QtWidgets.QComboBox(self)
        self.client_comboBox.setEditable(True)
        self.client_info_formLayout.setWidget(0,
                                              QtWidgets.QFormLayout.FieldRole,
                                              self.client_comboBox)

        # Agency Fields
        self.agency_label = QtWidgets.QLabel(self)
        self.agency_label.setText("Agency")
        self.client_info_formLayout.setWidget(1,
                                              QtWidgets.QFormLayout.LabelRole,
                                              self.agency_label)
        self.agency_comboBox = QtWidgets.QComboBox(self)
        self.agency_comboBox.setEditable(True)
        self.client_info_formLayout.setWidget(1,
                                              QtWidgets.QFormLayout.FieldRole,
                                              self.agency_comboBox)

        # Production Company Fields
        self.production_company_label = QtWidgets.QLabel(self)
        self.production_company_label.setText(
            "<html><head/><body><p align=\"right\">Production<br/>"
            "Company</p></body></html>")

        self.client_info_formLayout.setWidget(2,
                                              QtWidgets.QFormLayout.LabelRole,
                                              self.production_company_label)
        self.production_company_comboBox = QtWidgets.QComboBox(self)
        self.production_company_comboBox.setEditable(True)
        self.client_info_formLayout.setWidget(2,
                                              QtWidgets.QFormLayout.FieldRole,
                                              self.production_company_comboBox)
        self.verticalLayout.addLayout(self.client_info_formLayout)
        self.buttonBox = QtWidgets.QDialogButtonBox(self)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                          | QtWidgets.QDialogButtonBox.Ok)
        self.verticalLayout.addWidget(self.buttonBox)
        self.verticalLayout.setStretch(2, 2)
        self.verticalLayout.setStretch(5, 1)
Ejemplo n.º 4
0
    def _setup_ui(self):
        """create the ui elements
        """
        self.resize(1350, 950)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        # Dialog Label
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setText('Task Manager')
        self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);font: 18pt;")
        self.vertical_layout.addWidget(self.dialog_label)

        # Title Line
        line = QtWidgets.QFrame(self)
        line.setFrameShape(QtWidgets.QFrame.HLine)
        line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(line)

        # --------------------------------------------
        # Filter Fields
        label_role = QtWidgets.QFormLayout.LabelRole
        field_role = QtWidgets.QFormLayout.FieldRole

        expanding = QtWidgets.QSizePolicy.Expanding
        fixed = QtWidgets.QSizePolicy.Fixed
        minimum = QtWidgets.QSizePolicy.Minimum

        # Filters Form Layout
        self.filters_form_layout = QtWidgets.QFormLayout()
        self.filters_form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                                   | QtCore.Qt.AlignTrailing
                                                   | QtCore.Qt.AlignVCenter)
        self.vertical_layout.addLayout(self.filters_form_layout)

        # Filer By Label
        i = 0
        self.filter_by_label = QtWidgets.QLabel(self)
        self.filter_by_label.setText('Filter By')
        self.filters_form_layout.setWidget(i, field_role, self.filter_by_label)
        i += 1

        # Project
        #   Label
        self.filter_by_project_label = QtWidgets.QLabel(self)
        self.filter_by_project_label.setText('Project')

        self.filters_form_layout.setWidget(i, label_role,
                                           self.filter_by_project_label)

        #   Field
        self.filter_by_project_combo_box = QtWidgets.QComboBox(self)
        self.filter_by_project_combo_box.setSizePolicy(expanding, fixed)
        self.filter_by_project_combo_box.setEditable(True)

        self.filters_form_layout.setWidget(i, field_role,
                                           self.filter_by_project_combo_box)
        i += 1

        # Entity Type
        #   Label
        self.filter_by_entity_type_label = QtWidgets.QLabel(self)
        self.filter_by_entity_type_label.setText('Entity Type')
        self.filters_form_layout.setWidget(i, label_role,
                                           self.filter_by_entity_type_label)

        #   Field
        self.filter_by_entity_type_combo_box = QtWidgets.QComboBox(self)
        self.filter_by_entity_type_combo_box.setSizePolicy(expanding, fixed)
        self.filters_form_layout.setWidget(
            i, field_role, self.filter_by_entity_type_combo_box)
        i += 1

        # Task Type
        #   Label
        self.filter_by_task_type_label = QtWidgets.QLabel(self)
        self.filter_by_task_type_label.setText('Task Type')
        self.filters_form_layout.setWidget(i, label_role,
                                           self.filter_by_task_type_label)

        #   Field
        self.filter_by_task_type_combo_box = QtWidgets.QComboBox(self)
        self.filter_by_task_type_combo_box.setSizePolicy(expanding, fixed)
        self.filters_form_layout.setWidget(i, field_role,
                                           self.filter_by_task_type_combo_box)
        i += 1

        # Sequence
        #   Only visible when entity type is Shot
        #   Label
        self.filter_by_sequence_label = QtWidgets.QLabel(self)
        self.filter_by_sequence_label.setText('Sequence')
        self.filters_form_layout.setWidget(i, label_role,
                                           self.filter_by_sequence_label)

        #   Field
        self.filter_by_sequence_combo_box = QtWidgets.QComboBox(self)
        self.filter_by_sequence_combo_box.setSizePolicy(expanding, fixed)
        self.filters_form_layout.setWidget(i, field_role,
                                           self.filter_by_sequence_combo_box)
        i += 1

        # Resource
        #   Label
        self.filter_by_resource_label = QtWidgets.QLabel(self)
        self.filter_by_resource_label.setText('Resource')
        self.filters_form_layout.setWidget(i, label_role,
                                           self.filter_by_resource_label)

        #   Field
        self.filter_by_resource_combo_box = QtWidgets.QComboBox(self)
        self.filter_by_resource_combo_box.setSizePolicy(expanding, fixed)
        self.filters_form_layout.setWidget(i, field_role,
                                           self.filter_by_resource_combo_box)
        i += 1

        # ------------------------------------------------
        # Filter Button
        self.filter_button_horizontal_layout = QtWidgets.QHBoxLayout(self)
        self.filters_form_layout.setLayout(
            i, field_role, self.filter_button_horizontal_layout)

        self.filter_push_button = QtWidgets.QPushButton(self)
        self.filter_push_button.setText('-> Apply Filter <-')
        self.filter_button_horizontal_layout.addWidget(self.filter_push_button)

        # spacer
        spacer = QtWidgets.QSpacerItem(40, 20, expanding, minimum)
        self.filter_button_horizontal_layout.addItem(spacer)

        # ------------------------------------------------
        # The main table widget
        self.data_table_widget = QtWidgets.QTableWidget(self)
        self.data_table_widget.setAutoFillBackground(True)
        self.data_table_widget.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.data_table_widget.setColumnCount(2)
        self.data_table_widget.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.data_table_widget.setHorizontalHeaderItem(0, item)

        item = QtWidgets.QTableWidgetItem()
        self.data_table_widget.setHorizontalHeaderItem(1, item)

        self.data_table_widget.horizontalHeader().setStretchLastSection(True)
        self.vertical_layout.addWidget(self.data_table_widget)
Ejemplo n.º 5
0
    def setup_ui(self):
        """create UI widgets
        """
        self.resize(447, 546)
        self.setWindowTitle("TimeLog Dialog")

        # -----------------------------
        # Setup Main Layout
        self.main_layout = QtWidgets.QHBoxLayout(self)

        # create the left column
        self.left_layout = QtWidgets.QVBoxLayout()
        self.main_layout.addLayout(self.left_layout)

        # create the right column
        # this will list the previously entered time logs
        self.right_layout = QtWidgets.QVBoxLayout()
        self.main_layout.addLayout(self.right_layout)

        # -----------------------------
        # Setup Form Layout
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.AllNonFixedFieldsGrow
        )
        self.left_layout.addLayout(self.form_layout)

        # -----------------------------
        # Tasks
        self.tasks_label = QtWidgets.QLabel(self)
        self.tasks_label.setText("Task")
        self.form_layout.setWidget(
            0,
            QtWidgets.QFormLayout.LabelRole,
            self.tasks_label
        )

        from anima.ui.widgets import TaskComboBox
        self.tasks_combo_box = TaskComboBox(self)
        self.tasks_combo_box.setObjectName("tasks_combo_box")
        self.form_layout.setWidget(
            0,
            QtWidgets.QFormLayout.FieldRole,
            self.tasks_combo_box
        )

        # -----------------------------
        # Tasks Progress Bar
        self.task_progress_bar = QtWidgets.QProgressBar(self)
        self.task_progress_bar.setProperty("value", 24)
        self.form_layout.setWidget(
            1,
            QtWidgets.QFormLayout.FieldRole,
            self.task_progress_bar
        )

        # -----------------------------
        # Resources
        self.resources_label = QtWidgets.QLabel(self)
        self.resources_label.setText("Resource")
        self.form_layout.setWidget(
            2,
            QtWidgets.QFormLayout.LabelRole,
            self.resources_label
        )

        self.resource_combo_box = QtWidgets.QComboBox(self)
        self.form_layout.setWidget(
            2,
            QtWidgets.QFormLayout.FieldRole,
            self.resource_combo_box
        )

        # -----------------------------
        # Calendar, Start & End Time

        # Label
        self.date_label = QtWidgets.QLabel(self)
        self.date_label.setText("Date")
        self.form_layout.setWidget(
            3,
            QtWidgets.QFormLayout.LabelRole,
            self.date_label
        )

        # Calendar Widget
        self.calendar_widget = QtWidgets.QCalendarWidget(self)
        self.calendar_widget.setFirstDayOfWeek(QtCore.Qt.Monday)
        self.form_layout.setWidget(
            3,
            QtWidgets.QFormLayout.FieldRole,
            self.calendar_widget
        )

        # Start Time
        self.start_time_label = QtWidgets.QLabel(self)
        self.start_time_label.setText("Start")
        self.form_layout.setWidget(
            4,
            QtWidgets.QFormLayout.LabelRole,
            self.start_time_label
        )

        from anima.ui.widgets import TimeEdit
        self.start_time_edit = TimeEdit(self, resolution=timing_resolution)
        self.start_time_edit.setCurrentSection(
            QtWidgets.QDateTimeEdit.MinuteSection
        )
        self.start_time_edit.setCalendarPopup(True)
        self.start_time_edit.setObjectName("start_time_edit")
        self.start_time_edit.setWrapping(True)
        self.form_layout.setWidget(
            4,
            QtWidgets.QFormLayout.FieldRole,
            self.start_time_edit
        )
        self.start_time_edit.setDisplayFormat("HH:mm")

        # End Time
        self.end_time_label = QtWidgets.QLabel(self)
        self.end_time_label.setText("End")
        self.form_layout.setWidget(
            5,
            QtWidgets.QFormLayout.LabelRole,
            self.end_time_label
        )

        self.end_time_edit = TimeEdit(self, resolution=timing_resolution)
        self.end_time_edit.setCurrentSection(
            QtWidgets.QDateTimeEdit.MinuteSection
        )
        self.end_time_edit.setCalendarPopup(True)
        self.end_time_edit.setObjectName("end_time_edit")
        self.end_time_edit.setWrapping(True)
        self.form_layout.setWidget(
            5,
            QtWidgets.QFormLayout.FieldRole,
            self.end_time_edit
        )
        self.end_time_edit.setDisplayFormat("HH:mm")

        # -----------------------------
        # Time Left Info
        self.info_area_label = QtWidgets.QLabel(self)
        self.info_area_label.setText("INFO")
        self.form_layout.setWidget(
            6,
            QtWidgets.QFormLayout.FieldRole,
            self.info_area_label
        )

        # -----------------------------
        # Revision
        self.revision_label = QtWidgets.QLabel(self)
        self.revision_label.setText(
            """<html>
                <head/>
                <body>
                    <p align=\"right\">
                        Revision
                        <br/>
                        Type
                    </p>
                </body>
            </html>
            """
        )
        self.form_layout.setWidget(
            7,
            QtWidgets.QFormLayout.LabelRole,
            self.revision_label
        )

        self.revision_type_combo_box = QtWidgets.QComboBox(self)
        self.form_layout.setWidget(
            7,
            QtWidgets.QFormLayout.FieldRole,
            self.revision_type_combo_box
        )

        # -----------------------------
        # Description
        self.description_label = QtWidgets.QLabel(self)
        self.description_label.setText("Description")
        self.form_layout.setWidget(
            8,
            QtWidgets.QFormLayout.LabelRole,
            self.description_label
        )

        self.description_plain_text_edit = QtWidgets.QPlainTextEdit(self)
        self.form_layout.setWidget(
            8,
            QtWidgets.QFormLayout.FieldRole,
            self.description_plain_text_edit
        )

        # -----------------------------
        # Status
        self.status_label = QtWidgets.QLabel(self)
        self.status_label.setText("Status")
        self.form_layout.setWidget(
            9,
            QtWidgets.QFormLayout.LabelRole,
            self.status_label
        )

        self.not_finished_yet_radio_button = QtWidgets.QRadioButton(self)
        self.not_finished_yet_radio_button.setText("Not Finished Yet")
        self.not_finished_yet_radio_button.setChecked(True)
        self.form_layout.setWidget(
            9,
            QtWidgets.QFormLayout.FieldRole,
            self.not_finished_yet_radio_button
        )

        self.set_as_complete_radio_button = QtWidgets.QRadioButton(self)
        self.set_as_complete_radio_button.setText("Set As Complete")
        self.form_layout.setWidget(
            10,
            QtWidgets.QFormLayout.FieldRole,
            self.set_as_complete_radio_button
        )

        self.submit_for_final_review_radio_button = \
            QtWidgets.QRadioButton(self)
        self.submit_for_final_review_radio_button.setText(
            "Submit For Final Review"
        )
        self.form_layout.setWidget(
            11,
            QtWidgets.QFormLayout.FieldRole,
            self.submit_for_final_review_radio_button
        )

        # -----------------------------
        # Dialog Button Box
        self.dialog_button_box = QtWidgets.QDialogButtonBox(self)
        self.dialog_button_box.setOrientation(QtCore.Qt.Horizontal)
        self.dialog_button_box.setStandardButtons(
            QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok
        )
        self.left_layout.addWidget(self.dialog_button_box)

        # create the right column which is the current date details
        self.formatted_date_label = QtWidgets.QLabel(self)
        self.formatted_date_label.setText("")
        self.right_layout.addWidget(self.formatted_date_label)

        # create the right column which is the current date details
        self.time_log_info_label = QtWidgets.QLabel(self)
        self.time_log_info_label.setText("")
        self.right_layout.addWidget(self.time_log_info_label)

        # set stretch
        self.main_layout.setStretchFactor(self.left_layout, 0)
        self.main_layout.setStretchFactor(self.right_layout, 1)

        # setup signals
        self._setup_signals()

        # setup defaults
        self._set_defaults()

        # center window
        self.center_window()
Ejemplo n.º 6
0
    def setup_ui(self):
        self.resize(328, 184)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);\n"
                                        "font: 18pt;")
        self.vertical_layout.addWidget(self.dialog_label)
        self.line = QtWidgets.QFrame(self)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(self.line)
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.name_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.name_fields_vertical_layout.addWidget(self.name_validator_label)
        self.form_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole,
                                   self.name_fields_vertical_layout)
        self.width_height_label = QtWidgets.QLabel(self)
        self.form_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                   self.width_height_label)
        self.horizontal_layout = QtWidgets.QHBoxLayout()
        self.width_spin_box = QtWidgets.QSpinBox(self)
        self.width_spin_box.setMaximum(99999)
        self.horizontal_layout.addWidget(self.width_spin_box)
        self.label = QtWidgets.QLabel(self)
        self.horizontal_layout.addWidget(self.label)
        self.height_spin_box = QtWidgets.QSpinBox(self)
        self.height_spin_box.setMaximum(99999)
        self.horizontal_layout.addWidget(self.height_spin_box)
        self.horizontal_layout.setStretch(0, 1)
        self.horizontal_layout.setStretch(2, 1)
        self.form_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole,
                                   self.horizontal_layout)
        self.pixel_aspect_label = QtWidgets.QLabel(self)
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                   self.pixel_aspect_label)
        self.pixel_aspect_double_spin_box = QtWidgets.QDoubleSpinBox(self)
        self.pixel_aspect_double_spin_box.setProperty("value", 1.0)
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                   self.pixel_aspect_double_spin_box)
        self.name_label = QtWidgets.QLabel(self)
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                   self.name_label)
        self.vertical_layout.addLayout(self.form_layout)
        self.button_box = QtWidgets.QDialogButtonBox(self)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                           | QtWidgets.QDialogButtonBox.Ok)
        self.vertical_layout.addWidget(self.button_box)
        self.vertical_layout.setStretch(2, 1)

        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("accepted()"),
                               self.accept)
        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("rejected()"),
                               self.reject)
        QtCore.QMetaObject.connectSlotsByName(self)

        self.setWindowTitle("Image Format Dialog")
        self.dialog_label.setText("Create Image Format")
        self.name_validator_label.setText("Validator Message")
        self.width_height_label.setText("Width x Height")
        self.label.setText("x")
        self.pixel_aspect_label.setText("Pixel Aspect")
        self.name_label.setText("Name")
Ejemplo n.º 7
0
    def _setup_ui(self):
        """setup the ui elements
        """
        self.resize(750, 180)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        # Dialog Label
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setText('%s Filename Template' % self.mode)
        self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);font: 18pt;")
        self.vertical_layout.addWidget(self.dialog_label)

        # Title Line
        line = QtWidgets.QFrame(self)
        line.setFrameShape(QtWidgets.QFrame.HLine)
        line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(line)

        # Form Layout
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.vertical_layout.addLayout(self.form_layout)

        # ------------------------------------------------
        # Target Entity Type Field

        # label
        self.target_entity_type_label = \
            QtWidgets.QLabel('Target Entity Type', self)
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                   self.target_entity_type_label)

        # field
        self.target_entity_type_combo_box = QtWidgets.QComboBox(self)
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                   self.target_entity_type_combo_box)

        # ------------------------------------------------
        # Name Field
        self.name_label = QtWidgets.QLabel('Name', self)
        self.form_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                   self.name_label)
        self.name_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setStyleSheet('color: rgb(255, 0, 0);')

        from anima.ui.widgets import ValidatedLineEdit
        self.name_line_edit = ValidatedLineEdit(
            self, message_field=self.name_validator_label)

        self.name_fields_vertical_layout.addWidget(self.name_line_edit)
        self.name_fields_vertical_layout.addWidget(self.name_validator_label)
        self.form_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole,
                                   self.name_fields_vertical_layout)

        # ------------------------------------------------
        # Path Code Field
        self.path_label = QtWidgets.QLabel('Path', self)
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                   self.path_label)

        self.path_line_edit = QtWidgets.QLineEdit(self)
        # set the default value to something useful
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                   self.path_line_edit)

        # ------------------------------------------------
        # Filename Code Field
        self.filename_label = QtWidgets.QLabel('Filename', self)
        self.form_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                   self.filename_label)

        self.filename_line_edit = QtWidgets.QLineEdit(self)
        self.form_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                   self.filename_line_edit)

        # ------------------------------------------------
        # Button Box
        self.button_box = QtWidgets.QDialogButtonBox(self)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                           | QtWidgets.QDialogButtonBox.Ok)
        self.vertical_layout.addWidget(self.button_box)
        self.vertical_layout.setStretch(2, 1)

        # ------------------------------------------------
        # Default values
        self.target_entity_type_combo_box.addItems(
            ['Task', 'Asset', 'Shot', 'Sequence'])
        self.name_line_edit.set_invalid()  # Empty field is not valid
        self.path_line_edit.setText(
            '$REPO{{project.repository.code}}/{{project.code}}/'
            '{%- for parent_task in parent_tasks -%}{{parent_task.nice_name}}'
            '/{%- endfor -%}')
        self.filename_line_edit.setText(
            '{{version.nice_name}}_v{{"%03d"|format(version.version_number)}}')

        # ------------------------------------------------
        # Disable Fields
        if self.mode == 'Update':
            self.target_entity_type_combo_box.setEnabled(False)

        # ------------------------------------------------
        # Signals
        # Name
        QtCore.QObject.connect(self.name_line_edit,
                               QtCore.SIGNAL('textChanged(QString)'),
                               self.name_line_edit_changed)

        # Button box
        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("accepted()"),
                               self.accept)
        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("rejected()"),
                               self.reject)
Ejemplo n.º 8
0
    def setup_ui(self):
        """creates the UI widgets
        """
        self.setStyleSheet("""
            QLabel{
                background-color: #d9edf7;
                color: #3a87ad;
                padding-top: 2px;
                padding-bottom: 2px;
            }
            QLabel[labelField="true"] {
                font-weight: bold;
            }
        """)

        # the main layout
        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        # -------------------------------------------------------------
        # Title Label
        self.title_label = QtWidgets.QLabel(self)
        self.title_label.setText('Timing (0 TimeLogs)')
        self.title_label.setAlignment(QtCore.Qt.AlignCenter)
        self.title_label.setStyleSheet("""
            font-weight: bold;
            background-color: white;
            color: #7c9fca;
        """)
        self.vertical_layout.addWidget(self.title_label)

        # the form layout
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(
            QtCore.Qt.AlignRight |
            QtCore.Qt.AlignTrailing |
            QtCore.Qt.AlignVCenter
        )
        self.form_layout.setSpacing(2)
        self.vertical_layout.addLayout(self.form_layout)

        i = -1
        label_width = 120
        field_width = 60
        label_align = QtCore.Qt.AlignRight
        # -------------------------------------------------------------
        # Bid Field
        i += 1
        self.bid_label = QtWidgets.QLabel(self)
        self.bid_label.setText("Bid")
        self.bid_label.setProperty('labelField', True)
        self.bid_label.setMinimumWidth(label_width)
        self.bid_label.setAlignment(label_align)

        self.bid_field = QtWidgets.QLabel(self)
        self.bid_field.setMinimumWidth(field_width)

        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.bid_label
        )
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.bid_field
        )

        # -------------------------------------------------------------
        # Schedule Timing Field
        i += 1
        self.schedule_timing_label = QtWidgets.QLabel(self)
        self.schedule_timing_label.setText("Schedule Timing")
        self.schedule_timing_label.setProperty('labelField', True)
        self.schedule_timing_label.setMinimumWidth(label_width)
        self.schedule_timing_label.setAlignment(label_align)

        self.schedule_timing_field = QtWidgets.QLabel(self)
        self.schedule_timing_field.setMinimumWidth(field_width)

        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.schedule_timing_label
        )
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.schedule_timing_field
        )

        # -------------------------------------------------------------
        # Total TimeLogs Field
        i += 1
        self.total_time_logs_label = QtWidgets.QLabel(self)
        self.total_time_logs_label.setText("Total Time Logs")
        self.total_time_logs_label.setProperty('labelField', True)
        self.total_time_logs_label.setMinimumWidth(label_width)
        self.total_time_logs_label.setAlignment(label_align)

        self.total_time_logs_field = QtWidgets.QLabel(self)
        self.total_time_logs_field.setMinimumWidth(field_width)

        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.total_time_logs_label
        )
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.total_time_logs_field
        )

        # -------------------------------------------------------------
        # Time To Complete Field
        i += 1
        self.time_to_complete_label = QtWidgets.QLabel(self)
        self.time_to_complete_label.setText("Time To Complete")
        self.time_to_complete_label.setProperty('labelField', True)
        self.time_to_complete_label.setMinimumWidth(label_width)
        self.time_to_complete_label.setAlignment(label_align)

        self.time_to_complete_field = QtWidgets.QLabel(self)
        self.time_to_complete_field.setMinimumWidth(field_width)

        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.time_to_complete_label
        )
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.time_to_complete_field
        )

        # -------------------------------------------------------------
        # Schedule Model Field
        i += 1
        self.schedule_model_label = QtWidgets.QLabel(self)
        self.schedule_model_label.setText("Schedule Model")
        self.schedule_model_label.setProperty('labelField', True)
        self.schedule_model_label.setMinimumWidth(label_width)
        self.schedule_model_label.setAlignment(label_align)

        self.schedule_model_field = QtWidgets.QLabel(self)
        self.schedule_model_field.setMinimumWidth(field_width)

        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.schedule_model_label
        )
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.schedule_model_field
        )
Ejemplo n.º 9
0
    def _setup_ui(self):
        """the ui
        """
        self.resize(243, 209)

        # from anima.ui.lib import QtWidgets
        # if False:
        #     from PySide2 import QtWidgets
        # assert QtWidgets is QtWidgets
        from PySide2 import QtWidgets

        self.vertical_layout = QtWidgets.QVBoxLayout(self)
        self.setLayout(self.vertical_layout)
        self.vertical_layout.setStretch(2, 1)

        self.setWindowTitle(self.dialog_name)

        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.AllNonFixedFieldsGrow
        )
        self.form_layout.setLabelAlignment(
            QtCore.Qt.AlignRight |
            QtCore.Qt.AlignTrailing |
            QtCore.Qt.AlignVCenter
        )

        label_role = QtWidgets.QFormLayout.LabelRole
        field_role = QtWidgets.QFormLayout.FieldRole

        form_field_index = -1
        # --------------------
        # Number of Joints Field
        form_field_index += 1

        # Label
        self.number_of_joints_label = QtWidgets.QLabel(self)
        self.number_of_joints_label.setText("Number Of Joints")

        self.form_layout.setWidget(
            form_field_index, label_role, self.number_of_joints_label,
        )

        # Field
        self.number_of_joints_spin_box = QtWidgets.QSpinBox(self)
        self.form_layout.setWidget(
            form_field_index, field_role, self.number_of_joints_spin_box
        )
        self.number_of_joints_spin_box.setValue(2)
        self.number_of_joints_spin_box.setMinimum(2)

        # -----------------------
        # Orientation
        form_field_index += 1

        # Label
        self.orientation_label = QtWidgets.QLabel(self)
        self.orientation_label.setText("Orientation")
        self.form_layout.setWidget(
            form_field_index, label_role, self.orientation_label
        )

        # Field
        self.orientation_combo_box = QtWidgets.QComboBox(self)
        self.orientation_combo_box.addItems(
            [
                "xyz",
                "yzx",
                "zxy",
                "xzy",
                "yxz",
                "zyx",
            ]
        )

        self.form_layout.setWidget(
            form_field_index, field_role, self.orientation_combo_box
        )

        # ---------------------------
        # Second Axis World Orientation
        form_field_index += 1

        # Label
        self.second_axis_world_orientation_label = QtWidgets.QLabel(self)
        self.second_axis_world_orientation_label.setText(
            "Second Axis World Orientation"
        )
        self.form_layout.setWidget(
            form_field_index, label_role,
            self.second_axis_world_orientation_label
        )

        # Field
        self.second_axis_world_orientation_combo_box = \
            QtWidgets.QComboBox(self)
        self.second_axis_world_orientation_combo_box.addItems(
            [
                "+x",
                "-x",
                "+y",
                "-y",
                "+z",
                "-z",
            ]
        )
        self.form_layout.setWidget(
            form_field_index, field_role,
            self.second_axis_world_orientation_combo_box
        )

        # --------------------------------
        # Align To World
        form_field_index += 1

        # Label
        self.align_to_world_label = QtWidgets.QLabel(self)
        self.align_to_world_label.setText("Align To World")
        self.form_layout.setWidget(
            form_field_index, label_role, self.align_to_world_label
        )

        # Field
        self.align_to_world_check_box = QtWidgets.QCheckBox(self)
        self.form_layout.setWidget(
            form_field_index, field_role, self.align_to_world_check_box
        )

        # ----------------------------------
        # Reverse Curve
        form_field_index += 1

        # Label
        self.reverse_curve_label = QtWidgets.QLabel(self)
        self.reverse_curve_label.setText("Reverse Curve")
        self.form_layout.setWidget(
            form_field_index, label_role, self.reverse_curve_label
        )

        self.reverse_curve_check_box = QtWidgets.QCheckBox(self)
        self.form_layout.setWidget(
            form_field_index, field_role, self.reverse_curve_check_box
        )

        # -------------------------------
        # Joint Names
        form_field_index += 1

        # Label
        self.joint_names_label = QtWidgets.QLabel(self)
        self.joint_names_label.setText("Joint Names")
        self.form_layout.setWidget(
            form_field_index, label_role, self.joint_names_label
        )

        # Field
        self.joint_names_layout = QtWidgets.QHBoxLayout(self)
        self.joint_names_check_box = QtWidgets.QCheckBox(self)
        self.joint_names_line_edit = QtWidgets.QLineEdit(self)
        self.joint_names_line_edit.setText("joint")
        self.joint_names_line_edit.setEnabled(False)

        self.joint_names_layout.addWidget(self.joint_names_check_box)
        self.joint_names_layout.addWidget(self.joint_names_line_edit)

        self.form_layout.setLayout(
            form_field_index, field_role, self.joint_names_layout
        )

        # setup signals
        QtCore.QObject.connect(
            self.joint_names_check_box,
            QtCore.SIGNAL("stateChanged(int)"),
            self.joint_names_line_edit.setEnabled
        )

        # ------------------------
        # Suffix Joint Names
        form_field_index += 1

        # Label
        self.suffix_joint_names_label = QtWidgets.QLabel(self)
        self.suffix_joint_names_label.setText("Suffix Joint Names")
        self.form_layout.setWidget(
            form_field_index, label_role, self.suffix_joint_names_label
        )

        # Field
        self.suffix_joint_names_layout = QtWidgets.QHBoxLayout(self)
        self.suffix_joint_names_check_box = QtWidgets.QCheckBox(self)
        self.suffix_joint_names_line_edit = QtWidgets.QLineEdit(self)
        self.suffix_joint_names_line_edit.setText("_suffix")
        self.suffix_joint_names_line_edit.setEnabled(False)

        self.suffix_joint_names_layout.addWidget(
            self.suffix_joint_names_check_box
        )
        self.suffix_joint_names_layout.addWidget(
            self.suffix_joint_names_line_edit
        )

        self.form_layout.setLayout(
            form_field_index, field_role, self.suffix_joint_names_layout
        )

        # setup signals
        QtCore.QObject.connect(
            self.suffix_joint_names_check_box,
            QtCore.SIGNAL("stateChanged(int)"),
            self.suffix_joint_names_line_edit.setEnabled
        )

        # ----------------
        self.vertical_layout.addLayout(self.form_layout)

        # ----------------
        # Create Joints Button
        self.create_joints_button = QtWidgets.QPushButton()
        self.create_joints_button.setText("Create Joints")
        self.vertical_layout.addWidget(self.create_joints_button)

        # setup signals
        QtCore.QObject.connect(
            self.create_joints_button,
            QtCore.SIGNAL("clicked()"),
            self.create_joints
        )
Ejemplo n.º 10
0
    def _setup_ui(self):
        """create UI elements
        """
        self.resize(520, 550)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        # -------------------------
        # Dialog Label
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setText('Set Project Users')
        self.dialog_label.setStyleSheet(
            "color: rgb(71, 143, 202);\nfont: 18pt;")
        self.vertical_layout.addWidget(self.dialog_label)
        self.line = QtWidgets.QFrame(self)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(self.line)

        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.vertical_layout.addLayout(self.form_layout)

        i = -1

        # create Project Combo box
        i += 1
        self.projects_label = QtWidgets.QLabel(self)
        self.projects_label.setText('Projects')
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.projects_label)

        self.projects_combo_box = QtWidgets.QComboBox(self)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.projects_combo_box)

        # create DoubleListWidget
        i += 1
        self.users_label = QtWidgets.QLabel(self)
        self.users_label.setText('Users')
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.users_label)

        self.users_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.form_layout.setLayout(i, QtWidgets.QFormLayout.FieldRole,
                                   self.users_fields_vertical_layout)

        from anima.ui.widgets import DoubleListWidget
        self.users_double_list_widget = DoubleListWidget(
            dialog=self,
            parent_layout=self.users_fields_vertical_layout,
            primary_label_text='Users From DB',
            secondary_label_text='Selected Users')
        # set the tooltip
        self.users_double_list_widget\
            .primary_list_widget.setToolTip(
                "Right Click to Create/Update FilenameTemplates"
            )
        self.users_double_list_widget\
            .secondary_list_widget.setToolTip(
                "Right Click to Create/Update FilenameTemplates"
            )

        # Button Box
        self.button_box = QtWidgets.QDialogButtonBox(self)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                           | QtWidgets.QDialogButtonBox.Ok)
        self.vertical_layout.addWidget(self.button_box)
        self.vertical_layout.setStretch(2, 1)
Ejemplo n.º 11
0
    def _setup_ui(self):
        self.setObjectName("Dialog")
        self.resize(502, 220)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)
        self.vertical_layout.setObjectName("verticalLayout")
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setStyleSheet(
            "color: rgb(71, 143, 202);\n"
            "font: 18pt;"
        )
        self.dialog_label.setObjectName("dialog_label")
        self.dialog_label.setText("Create Repository")

        self.vertical_layout.addWidget(self.dialog_label)
        self.line = QtWidgets.QFrame(self)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.vertical_layout.addWidget(self.line)
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(
            QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter
        )
        self.form_layout.setObjectName("form_layout")

        row_number = 0
        # -------------
        # Name
        # Label
        self.name_label = QtWidgets.QLabel(self)
        self.name_label.setObjectName("name_label")
        self.name_label.setText("Name")
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.name_label)

        # Field
        self.name_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.name_fields_vertical_layout.setObjectName("name_fields_verticalLayout")
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.name_validator_label.setObjectName("name_validator_label")
        self.name_fields_vertical_layout.addWidget(self.name_validator_label)
        self.form_layout.setLayout(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.name_fields_vertical_layout
        )
        self.name_validator_label.setText("Validator Message")

        # create name_line_edit
        from anima.ui.widgets import ValidatedLineEdit
        self.name_line_edit = ValidatedLineEdit(
            message_field=self.name_validator_label
        )
        self.name_line_edit.setPlaceholderText('Enter Name')
        self.name_fields_vertical_layout.insertWidget(
            0, self.name_line_edit
        )

        row_number += 1
        # -------------
        # Code
        # Label
        self.code_label = QtWidgets.QLabel(self)
        self.code_label.setText("Code")
        self.code_label.setObjectName("code_label")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.code_label
        )

        # Field
        self.code_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.code_fields_vertical_layout.setObjectName("code_fields_verticalLayout")
        self.code_validator_label = QtWidgets.QLabel(self)
        self.code_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.code_validator_label.setObjectName("code_validator_label")
        self.code_fields_vertical_layout.addWidget(self.code_validator_label)
        self.form_layout.setLayout(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.code_fields_vertical_layout
        )

        # create code_line_edit
        from anima.ui.widgets import ValidatedLineEdit
        self.code_line_edit = ValidatedLineEdit(
            message_field=self.code_validator_label
        )
        self.code_line_edit.setPlaceholderText('Enter Code')
        self.code_fields_vertical_layout.insertWidget(
            0, self.code_line_edit
        )

        row_number += 1
        # -------------
        # Windows Path
        # Label
        self.windows_path_label = QtWidgets.QLabel(self)
        self.windows_path_label.setObjectName("windows_path_label")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.windows_path_label
        )
        self.windows_path_label.setText("Windows Path")

        # Field
        self.windows_path_line_edit = QtWidgets.QLineEdit(self)
        self.windows_path_line_edit.setObjectName("windows_path_lineEdit")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.windows_path_line_edit
        )

        row_number += 1
        # -------------
        # Linux Path
        # Label
        self.linux_label = QtWidgets.QLabel(self)
        self.linux_label.setObjectName("linux_label")
        self.linux_label.setText("Linux Path")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.linux_label
        )

        # Field
        self.linux_path_line_edit = QtWidgets.QLineEdit(self)
        self.linux_path_line_edit.setObjectName("linux_path_lineEdit")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.linux_path_line_edit
        )

        row_number += 1
        # -------------
        # OSX Path
        # Label
        self.osx_path_label = QtWidgets.QLabel(self)
        self.osx_path_label.setObjectName("osx_path_label")
        self.osx_path_label.setText("OSX Path")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.osx_path_label
        )

        # Field
        self.osx_path_line_edit = QtWidgets.QLineEdit(self)
        self.osx_path_line_edit.setObjectName("osx_path_lineEdit")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.osx_path_line_edit
        )
        self.vertical_layout.addLayout(self.form_layout)

        # Button Box
        self.button_box = QtWidgets.QDialogButtonBox(self)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(
            QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok
        )
        self.button_box.setObjectName("button_box")
        self.vertical_layout.addWidget(self.button_box)
        self.vertical_layout.setStretch(2, 1)

        QtCore.QObject.connect(
            self.button_box,
            QtCore.SIGNAL("accepted()"),
            self.accept
        )
        QtCore.QObject.connect(
            self.button_box,
            QtCore.SIGNAL("rejected()"),
            self.reject
        )
        QtCore.QMetaObject.connectSlotsByName(self)
Ejemplo n.º 12
0
    def setup_ui(self):
        """create UI widgets
        """
        self.resize(447, 546)
        self.setWindowTitle("TimeLog Dialog")

        # -----------------------------
        # Setup Main Layout
        self.main_layout = QtWidgets.QHBoxLayout(self)

        # create the left column
        self.left_layout = QtWidgets.QVBoxLayout()
        self.main_layout.addLayout(self.left_layout)

        # create the right column
        # this will list the previously entered time logs
        self.right_layout = QtWidgets.QVBoxLayout()
        self.main_layout.addLayout(self.right_layout)

        # -----------------------------
        # Setup Form Layout
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.AllNonFixedFieldsGrow
        )
        self.left_layout.addLayout(self.form_layout)

        i = 0
        # -----------------------------
        # Tasks
        self.tasks_label = QtWidgets.QLabel(self)
        self.tasks_label.setText("Task")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.tasks_label
        )

        from anima.ui.widgets import TaskComboBox
        self.tasks_combo_box = TaskComboBox(self)
        self.tasks_combo_box.setObjectName("tasks_combo_box")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.tasks_combo_box
        )

        # -----------------------------
        # Tasks Progress Bar
        i += 1
        self.task_progress_bar = QtWidgets.QProgressBar(self)
        self.task_progress_bar.setProperty("value", 24)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.task_progress_bar
        )

        # -----------------------------
        # Resources
        i += 1
        self.resources_label = QtWidgets.QLabel(self)
        self.resources_label.setText("Resource")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.resources_label
        )

        self.resource_combo_box = QtWidgets.QComboBox(self)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.resource_combo_box
        )

        # -----------------------------
        # Calendar, Start & End Time
        i += 1

        # Label
        self.date_label = QtWidgets.QLabel(self)
        self.date_label.setText("Date")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.date_label
        )

        # Calendar Widget
        self.calendar_widget = QtWidgets.QCalendarWidget(self)
        self.calendar_widget.setFirstDayOfWeek(QtCore.Qt.Monday)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.calendar_widget
        )

        # -----------------------------
        # Start Time
        from anima.ui.widgets import TimeEdit

        i += 1
        self.start_time_label = QtWidgets.QLabel(self)
        self.start_time_label.setText("Start")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.start_time_label
        )

        from anima import TIMING_RESOLUTION
        self.start_time_edit = TimeEdit(self, resolution=TIMING_RESOLUTION)
        self.start_time_edit.setCurrentSection(QtWidgets.QDateTimeEdit.MinuteSection)
        self.start_time_edit.setCalendarPopup(True)
        self.start_time_edit.setObjectName("start_time_edit")
        self.start_time_edit.setWrapping(True)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.start_time_edit
        )
        self.start_time_edit.setDisplayFormat("HH:mm")

        # -----------------------------
        # End Time
        i += 1
        self.end_time_label = QtWidgets.QLabel(self)
        self.end_time_label.setText("End")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.end_time_label
        )

        self.end_time_edit = TimeEdit(self, resolution=TIMING_RESOLUTION)
        self.end_time_edit.setCurrentSection(
            QtWidgets.QDateTimeEdit.MinuteSection
        )
        self.end_time_edit.setCalendarPopup(True)
        self.end_time_edit.setObjectName("end_time_edit")
        self.end_time_edit.setWrapping(True)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.end_time_edit
        )
        self.end_time_edit.setDisplayFormat("HH:mm")

        # -----------------------------
        # Effort
        i += 1

        # Label
        self.effort_label = QtWidgets.QLabel(self)
        self.effort_label.setText("Effort")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.effort_label
        )

        effort_layout = QtWidgets.QHBoxLayout(self)
        self.form_layout.setLayout(
            i,
            QtWidgets.QFormLayout.FieldRole,
            effort_layout
        )

        self.effort_time_edit = TimeEdit(self, resolution=TIMING_RESOLUTION)
        self.effort_time_edit.setCurrentSection(QtWidgets.QDateTimeEdit.MinuteSection)
        self.effort_time_edit.setCalendarPopup(True)
        self.effort_time_edit.setObjectName("effort_time_edit")
        self.effort_time_edit.setWrapping(True)
        # self.form_layout.setWidget(
        #     i,
        #     QtWidgets.QFormLayout.FieldRole,
        #     self.effort_time_edit
        # )
        effort_layout.addWidget(self.effort_time_edit)
        self.effort_time_edit.setDisplayFormat("HH:mm")

        # -----------------------------
        # Advanced Time Controls
        self.show_advanced_time_controls_check_box = QtWidgets.QCheckBox(self)
        self.show_advanced_time_controls_check_box.setText('Advanced Controls')
        effort_layout.addWidget(self.show_advanced_time_controls_check_box)

        # -----------------------------
        # Time Left Info
        i += 1
        self.info_area_label = QtWidgets.QLabel(self)
        self.info_area_label.setText("INFO")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.info_area_label
        )

        # -----------------------------
        # Status
        i += 1
        self.status_label = QtWidgets.QLabel(self)
        self.status_label.setText("Status")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            self.status_label
        )

        self.not_finished_yet_radio_button = QtWidgets.QRadioButton(self)
        self.not_finished_yet_radio_button.setText("Not Finished Yet")
        self.not_finished_yet_radio_button.setChecked(True)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.not_finished_yet_radio_button
        )

        i += 1
        self.set_as_complete_radio_button = QtWidgets.QRadioButton(self)
        self.set_as_complete_radio_button.setText("Set As Completed")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.set_as_complete_radio_button
        )

        i += 1
        self.submit_for_final_review_radio_button = \
            QtWidgets.QRadioButton(self)
        self.submit_for_final_review_radio_button.setText(
            "Submit For Final Review"
        )
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.submit_for_final_review_radio_button
        )

        # -----------------------------
        # Dialog Button Box
        self.dialog_button_box = QtWidgets.QDialogButtonBox(self)
        self.dialog_button_box.setOrientation(QtCore.Qt.Horizontal)
        self.dialog_button_box.setStandardButtons(
            QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok
        )
        self.left_layout.addWidget(self.dialog_button_box)

        # create the right column which is the current date details
        self.formatted_date_label = QtWidgets.QLabel(self)
        self.formatted_date_label.setText("")
        self.right_layout.addWidget(self.formatted_date_label)

        # create the right column which is the current date details
        self.time_log_info_label = QtWidgets.QLabel(self)
        self.time_log_info_label.setText("")
        self.right_layout.addWidget(self.time_log_info_label)

        # set stretch
        self.main_layout.setStretchFactor(self.left_layout, 0)
        self.main_layout.setStretchFactor(self.right_layout, 1)

        # setup signals
        self._setup_signals()

        # setup defaults
        self._set_defaults()

        # center window
        self.center_window()
Ejemplo n.º 13
0
    def setup_ui(self):
        """sets the ui up
        """
        from anima.utils import do_db_setup
        do_db_setup()

        # get logged in user
        self.get_logged_in_user()

        self.setWindowTitle("Shot Manager")

        self.main_layout = QtWidgets.QVBoxLayout(self)
        self.form_layout = QtWidgets.QFormLayout(self)
        self.main_layout.addLayout(self.form_layout)

        i = 0
        # Project
        label = QtWidgets.QLabel(self)
        label.setText("Project")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            label
        )

        from anima.ui.widgets.project import ProjectComboBox
        self.project_combo_box = ProjectComboBox(self)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.project_combo_box
        )

        # Sequence
        i += 1
        label = QtWidgets.QLabel(self)
        label.setText("Sequence")
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.LabelRole,
            label
        )

        from anima.ui.widgets.sequence import SequenceComboBox
        self.sequence_combo_box = SequenceComboBox(self)
        self.form_layout.setWidget(
            i,
            QtWidgets.QFormLayout.FieldRole,
            self.sequence_combo_box
        )

        # Get Shot List button
        get_shot_list_push_button = QtWidgets.QPushButton(self)
        get_shot_list_push_button.setText("Get Shot List")
        self.main_layout.addWidget(get_shot_list_push_button)

        # Check Duplicate Shot Code
        validate_shots_push_button = QtWidgets.QPushButton(self)
        validate_shots_push_button.setText("Validate Shots")
        self.main_layout.addWidget(validate_shots_push_button)

        # Check Duplicate Shot Code
        check_duplicate_shot_code_push_button = QtWidgets.QPushButton(self)
        check_duplicate_shot_code_push_button.setText("Check Duplicate Shot Code")
        self.main_layout.addWidget(check_duplicate_shot_code_push_button)

        # Create Render Jobs button
        create_render_jobs_button = QtWidgets.QPushButton(self)
        create_render_jobs_button.setText("Create Render Jobs")
        self.main_layout.addWidget(create_render_jobs_button)

        # Update Shot Thumbnail button
        update_shot_thumbnail_button = QtWidgets.QPushButton(self)
        update_shot_thumbnail_button.setText("Update Shot Thumbnail")
        self.main_layout.addWidget(update_shot_thumbnail_button)

        # Ok button
        ok_button = QtWidgets.QPushButton(self)
        ok_button.setText("OK")
        self.main_layout.addWidget(ok_button)

        # Signals
        self.project_changed(None)

        QtCore.QObject.connect(
            self.project_combo_box,
            QtCore.SIGNAL("currentIndexChanged(QString)"),
            self.project_changed
        )

        QtCore.QObject.connect(
            ok_button,
            QtCore.SIGNAL("clicked()"),
            self.close
        )

        QtCore.QObject.connect(
            create_render_jobs_button,
            QtCore.SIGNAL("clicked()"),
            self.create_render_jobs
        )

        QtCore.QObject.connect(
            get_shot_list_push_button,
            QtCore.SIGNAL("clicked()"),
            self.get_shot_list
        )

        QtCore.QObject.connect(
            check_duplicate_shot_code_push_button,
            QtCore.SIGNAL("clicked()"),
            self.check_duplicate_shots
        )

        QtCore.QObject.connect(
            validate_shots_push_button,
            QtCore.SIGNAL("clicked()"),
            self.validate_shot_codes
        )

        QtCore.QObject.connect(
            update_shot_thumbnail_button,
            QtCore.SIGNAL("clicked()"),
            self.update_shot_thumbnail
        )