예제 #1
0
    def create_button(self, data_dict):
        """
        Implements BaseButtonGroup create_button abstract function
        :param data_dict:
        :return:
        """

        return buttons.BaseRadioButton()
예제 #2
0
    def ui(self):
        super(RadioButtonExample, self).ui()

        folder_icon = tpDcc.ResourcesMgr().icon('folder')
        play_icon = tpDcc.ResourcesMgr().icon('play')
        user_icon = tpDcc.ResourcesMgr().icon('user')

        lyt1 = layouts.HorizontalLayout()
        lyt1.addWidget(buttons.BaseRadioButton('Maya'))
        lyt1.addWidget(buttons.BaseRadioButton('Nuke'))
        lyt1.addWidget(buttons.BaseRadioButton('Houdini'))

        cbx_single = buttons.BaseRadioButton('Single')
        cbx_single.setChecked(True)
        cbx_single.setEnabled(False)

        lyt2 = layouts.HorizontalLayout()
        cbx_icon1 = buttons.BaseRadioButton('Folder')
        cbx_icon1.setIcon(folder_icon)
        cbx_icon2 = buttons.BaseRadioButton('Play')
        cbx_icon2.setIcon(play_icon)
        cbx_icon3 = buttons.BaseRadioButton('User')
        cbx_icon3.setIcon(user_icon)
        lyt2.addWidget(cbx_icon1)
        lyt2.addWidget(cbx_icon2)
        lyt2.addWidget(cbx_icon3)

        cbx_bind = buttons.BaseRadioButton('Data Bind')
        lbl = label.BaseLabel()
        btn = buttons.BaseButton(text='Change State')
        btn.clicked.connect(
            lambda: self.set_field('checked', not self.field('checked')))
        self.register_field('checked', True)
        self.register_field('checked_text', lambda: 'Yes!'
                            if self.field('checked') else 'No!')
        self.bind('checked', cbx_bind, 'checked', signal='toggled')
        self.bind('checked_text', lbl, 'text')

        self.main_layout.addWidget(dividers.Divider('Basic'))
        self.main_layout.addLayout(lyt1)
        self.main_layout.addWidget(cbx_single)
        self.main_layout.addWidget(dividers.Divider('Icon'))
        self.main_layout.addLayout(lyt2)
        self.main_layout.addWidget(dividers.Divider('Data Bind'))
        self.main_layout.addWidget(cbx_bind)
        self.main_layout.addWidget(lbl)
        self.main_layout.addWidget(btn)
        self.main_layout.addStretch()
예제 #3
0
    def set_items(self, items):
        """
        Sets the items for the field widget
        :param items: list(str)
        """

        self.clear()

        for item in items:
            widget = buttons.BaseRadioButton(parent=self)
            widget.setText(item)
            widget.clicked.connect(self._on_emit_value_changed)
            self._radio_buttons.append(widget)
            self._radio_frame.layout().addWidget(widget)
예제 #4
0
    def ui(self):
        super(ManualJointOrientView, self).ui()

        manual_joint_ori_layout = layouts.HorizontalLayout()
        self._manual_joint_ori_x_spin = spinbox.DoubleSpinBoxAxis(axis='x',
                                                                  min=-360,
                                                                  max=360,
                                                                  parent=self)
        self._manual_joint_ori_y_spin = spinbox.DoubleSpinBoxAxis(axis='y',
                                                                  min=-360,
                                                                  max=360,
                                                                  parent=self)
        self._manual_joint_ori_z_spin = spinbox.DoubleSpinBoxAxis(axis='z',
                                                                  min=-360,
                                                                  max=360,
                                                                  parent=self)
        self._manual_joint_ori_x_spin.setDecimals(3)
        self._manual_joint_ori_y_spin.setDecimals(3)
        self._manual_joint_ori_z_spin.setDecimals(3)
        self._manual_joint_ori_reset_btn = buttons.BaseButton('Reset',
                                                              parent=self)
        self._manual_joint_ori_reset_btn.setIcon(resources.icon('reset'))
        manual_joint_ori_layout.addWidget(self._manual_joint_ori_x_spin)
        manual_joint_ori_layout.addWidget(self._manual_joint_ori_y_spin)
        manual_joint_ori_layout.addWidget(self._manual_joint_ori_z_spin)
        manual_joint_ori_layout.addWidget(self._manual_joint_ori_reset_btn)

        manual_joint_splitter_layout = layouts.HorizontalLayout()
        manual_joint_splitter_layout.addStretch()
        self._degrees_checks = list()
        for degree in self._model.available_degrees:
            degree_radio = buttons.BaseRadioButton(str(degree), parent=self)
            manual_joint_splitter_layout.addWidget(degree_radio)
            self._degrees_checks.append(degree_radio)
        manual_joint_splitter_layout.addStretch()

        manual_joint_ori_buttons_layout = layouts.HorizontalLayout(
            spacing=5, margins=(2, 2, 2, 2))
        self._manual_joint_ori_add_btn = buttons.BaseButton('Add', parent=self)
        self._manual_joint_ori_subtract_btn = buttons.BaseButton('Subract',
                                                                 parent=self)
        self._manual_joint_ori_set_btn = buttons.BaseButton('Set', parent=self)
        self._manual_joint_ori_set_cbx = checkbox.BaseCheckBox(
            'Affect children', parent=self)
        self._manual_joint_ori_add_btn.setIcon(resources.icon('add'))
        self._manual_joint_ori_subtract_btn.setIcon(resources.icon('minus'))
        self._manual_joint_ori_set_btn.setIcon(resources.icon('equals'))
        manual_joint_ori_buttons_layout.addWidget(
            self._manual_joint_ori_add_btn)
        manual_joint_ori_buttons_layout.addWidget(
            self._manual_joint_ori_subtract_btn)
        manual_joint_ori_buttons_layout.addWidget(
            self._manual_joint_ori_set_btn)
        manual_joint_ori_buttons_layout.addWidget(
            self._manual_joint_ori_set_cbx)

        set_rot_axis_widget = QWidget()
        set_rot_axis_widget.setLayout(layouts.VerticalLayout())
        set_rot_axis_widget.setSizePolicy(QSizePolicy.Minimum,
                                          QSizePolicy.Fixed)
        set_rot_axis_widget.layout().setContentsMargins(5, 5, 5, 5)
        set_rot_axis_widget.layout().setSpacing(10)

        self.main_layout.addLayout(manual_joint_splitter_layout)
        self.main_layout.addLayout(manual_joint_ori_layout)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addLayout(manual_joint_ori_buttons_layout)
        self.main_layout.addWidget(set_rot_axis_widget)
    def ui(self):
        super(BaseAlembicImporter, self).ui()

        buttons_layout = layouts.GridLayout()
        self.main_layout.addLayout(buttons_layout)

        shot_name_lbl = label.BaseLabel('Shot Name: ', parent=self)
        self._shot_line = lineedit.BaseLineEdit(parent=self)
        buttons_layout.addWidget(shot_name_lbl, 1, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(self._shot_line, 1, 1)
        shot_name_lbl.setVisible(False)
        self._shot_line.setVisible(False)

        folder_icon = resources.icon('folder')
        alembic_path_layout = layouts.HorizontalLayout(spacing=2,
                                                       margins=(2, 2, 2, 2))
        alembic_path_widget = QWidget()
        alembic_path_widget.setLayout(alembic_path_layout)
        alembic_path_lbl = label.BaseLabel('Alembic File: ', parent=self)
        self._alembic_path_line = lineedit.BaseLineEdit(parent=self)
        self._alembic_path_line.setReadOnly(True)
        self._alembic_path_btn = buttons.BaseButton(parent=self)
        self._alembic_path_btn.setIcon(folder_icon)
        self._alembic_path_btn.setIconSize(QSize(18, 18))
        self._alembic_path_btn.setStyleSheet(
            "background-color: rgba(255, 255, 255, 0); border: 0px solid rgba(255,255,255,0);"
        )
        alembic_path_layout.addWidget(self._alembic_path_line)
        alembic_path_layout.addWidget(self._alembic_path_btn)
        buttons_layout.addWidget(alembic_path_lbl, 2, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(alembic_path_widget, 2, 1)

        import_mode_layout = layouts.HorizontalLayout(spacing=2,
                                                      margins=(2, 2, 2, 2))
        import_mode_layout.setContentsMargins(2, 2, 2, 2)
        import_mode_layout.setSpacing(2)
        import_mode_widget = QWidget()
        import_mode_widget.setLayout(import_mode_layout)
        import_mode_lbl = label.BaseLabel('Import mode: ', parent=self)
        self._create_radio = buttons.BaseRadioButton('Create', parent=self)
        self._add_radio = buttons.BaseRadioButton('Add', parent=self)
        self._merge_radio = buttons.BaseRadioButton('Merge', parent=self)
        self._create_radio.setChecked(True)
        import_mode_layout.addWidget(self._create_radio)
        import_mode_layout.addWidget(self._add_radio)
        import_mode_layout.addWidget(self._merge_radio)
        buttons_layout.addWidget(import_mode_lbl, 3, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(import_mode_widget, 3, 1)
        import_mode_lbl.setVisible(False)
        import_mode_widget.setVisible(False)

        self._auto_display_lbl = label.BaseLabel('Auto Display Smooth?: ',
                                                 parent=self)
        self._auto_smooth_display = checkbox.BaseCheckBox(parent=self)
        self._auto_smooth_display.setChecked(True)
        buttons_layout.addWidget(self._auto_display_lbl, 4, 0, 1, 1,
                                 Qt.AlignRight)
        buttons_layout.addWidget(self._auto_smooth_display, 4, 1)

        if dcc.client().is_maya():
            maya_gpu_cache_lbl = label.BaseLabel(
                'Import Alembic as GPU Cache?', parent=self)
            self._maya_gpu_cache_cbx = checkbox.BaseCheckBox(parent=self)
            self._maya_gpu_cache_cbx.setChecked(True)
            buttons_layout.addWidget(maya_gpu_cache_lbl, 5, 0, 1, 1,
                                     Qt.AlignRight)
            buttons_layout.addWidget(self._maya_gpu_cache_cbx, 5, 1)
        elif dcc.client().is_houdini():
            hou_archive_abc_node_lbl = label.BaseLabel(
                'Import Alembic as Archive?', parent=self)
            self._hou_archive_abc_node_cbx = checkbox.BaseCheckBox(parent=self)
            buttons_layout.addWidget(hou_archive_abc_node_lbl, 5, 0, 1, 1,
                                     Qt.AlignRight)
            buttons_layout.addWidget(self._hou_archive_abc_node_cbx, 5, 1)

        self.main_layout.addStretch()
        self.main_layout.addLayout(dividers.DividerLayout())

        buttons_layout = layouts.HorizontalLayout(spacing=2,
                                                  margins=(2, 2, 2, 2))
        self.main_layout.addLayout(buttons_layout)
        self._import_btn = buttons.BaseButton('Import', parent=self)
        self._import_btn.setIcon(resources.icon('import'))
        self._import_btn.setSizePolicy(QSizePolicy.Expanding,
                                       QSizePolicy.Preferred)
        self._reference_btn = buttons.BaseButton('Reference', parent=self)
        self._reference_btn.setIcon(resources.icon('reference'))
        self._reference_btn.setSizePolicy(QSizePolicy.Expanding,
                                          QSizePolicy.Preferred)
        buttons_layout.addWidget(self._import_btn)
        buttons_layout.addWidget(self._reference_btn)

        if dcc.client().is_houdini():
            self._reference_btn.setEnabled(False)
    def ui(self):
        super(SymmeshView, self).ui()

        top_layout = layouts.GridLayout()
        mirror_axis_lbl = label.BaseLabel('Mirror Axis: ', parent=self)
        self._axis_radio_grp = QButtonGroup()
        self._yz_radio = buttons.BaseRadioButton(consts.AXIS[0], parent=self)
        self._xz_radio = buttons.BaseRadioButton(consts.AXIS[1], parent=self)
        self._xy_radio = buttons.BaseRadioButton(consts.AXIS[2], parent=self)
        self._radios = [self._yz_radio, self._xz_radio, self._xy_radio]
        self._axis_radio_grp.addButton(self._yz_radio)
        self._axis_radio_grp.addButton(self._xz_radio)
        self._axis_radio_grp.addButton(self._xy_radio)
        axis_radio_layout = layouts.HorizontalLayout(spacing=2, margins=(2, 2, 2, 2))
        axis_radio_layout.addWidget(self._yz_radio)
        axis_radio_layout.addWidget(self._xz_radio)
        axis_radio_layout.addWidget(self._xy_radio)
        axis_radio_layout.addStretch()
        global_tolerance_lbl = label.BaseLabel('Global Tolerance: ', parent=self)
        self._global_tolerance_spn = spinbox.BaseDoubleSpinBox(parent=self)
        self._global_tolerance_spn.setDecimals(4)
        self._global_tolerance_spn.setValue(0.0010)
        top_layout.addWidget(mirror_axis_lbl, 0, 0, Qt.AlignRight)
        top_layout.addLayout(axis_radio_layout, 0, 1)
        top_layout.addWidget(global_tolerance_lbl, 1, 0)
        top_layout.addWidget(self._global_tolerance_spn, 1, 1)

        options_cbx_layout = layouts.HorizontalLayout(spacing=2, margins=(2, 2, 2, 2))
        self._neg_to_pos_cbx = checkbox.BaseCheckBox('Operate -X to +X', parent=self)
        self._use_pivot_as_origin_cbx = checkbox.BaseCheckBox('Use Pivot as Origin', parent=self)
        self._use_pivot_as_origin_cbx.setChecked(True)
        options_cbx_layout.addWidget(self._neg_to_pos_cbx)
        options_cbx_layout.addItem(QSpacerItem(10, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
        options_cbx_layout.addWidget(self._use_pivot_as_origin_cbx)
        options_cbx_layout.addStretch()

        select_geo_layout = layouts.HorizontalLayout(spacing=2, margins=(2, 2, 2, 2))
        self._select_geo_line = lineedit.BaseLineEdit(parent=self)
        self._select_geo_line.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
        self._select_geo_line.setReadOnly(True)
        self._select_base_geo_btn = buttons.BaseButton('Select Base Geo', parent=self)
        self._select_base_geo_btn.setIcon(resources.icon('cursor'))
        select_geo_layout.addWidget(self._select_geo_line)
        select_geo_layout.addWidget(self._select_base_geo_btn)
        self._symmetry_message = message.BaseMessage('', parent=self).small()

        selection_widget = QWidget(parent=self)
        selection_layout = layouts.FlowLayout()
        selection_widget.setLayout(selection_layout)
        mirror_flip_widget = QWidget(parent=self)
        mirror_flip_layout = layouts.FlowLayout()
        mirror_flip_widget.setLayout(mirror_flip_layout)
        revert_widget = QWidget(parent=self)
        revert_layout = layouts.FlowLayout()
        revert_widget.setLayout(revert_layout)

        self._check_symmetry_btn = buttons.BaseButton('Check Symmetry', parent=self)
        self._selection_mirror_btn = buttons.BaseButton('Selection Mirror', parent=self)
        self._select_moved_vertices_btn = buttons.BaseButton('Select Moved Vertices', parent=self)
        self._mirror_selected_btn = buttons.BaseButton('Mirror Selected', parent=self)
        self._flip_selected_btn = buttons.BaseButton('Flip Selected', parent=self)
        self._revert_selected_to_base = buttons.BaseButton('Revert Selected to Base', parent=self)
        self._revert_bias_slider = sliders.HoudiniDoubleSlider(parent=self, slider_range=[0.0, 1.0])

        # TODO: Implement this feature
        self._live_revert_bias_cbx = checkbox.BaseCheckBox('Live', parent=self)
        self._live_revert_bias_cbx.setVisible(False)

        self._check_symmetry_btn.setIcon(resources.icon('refresh'))
        self._selection_mirror_btn.setIcon(resources.icon('vertex'))
        self._select_moved_vertices_btn.setIcon(resources.icon('cursor'))
        self._mirror_selected_btn.setIcon(resources.icon('mirror'))
        self._flip_selected_btn.setIcon(resources.icon('flip_vertical'))
        self._revert_selected_to_base.setIcon(resources.icon('rollback'))

        selection_layout.addWidget(self._check_symmetry_btn)
        selection_layout.addWidget(self._selection_mirror_btn)
        selection_layout.addWidget(self._select_moved_vertices_btn)
        mirror_flip_layout.addWidget(self._mirror_selected_btn)
        mirror_flip_layout.addWidget(self._flip_selected_btn)
        revert_layout.addWidget(self._revert_selected_to_base)
        revert_layout.addWidget(self._revert_bias_slider)
        revert_layout.addWidget(self._live_revert_bias_cbx)

        self.main_layout.addLayout(top_layout)
        self.main_layout.addLayout(options_cbx_layout)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addLayout(select_geo_layout)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addWidget(self._symmetry_message)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addWidget(selection_widget)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addWidget(mirror_flip_widget)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addWidget(revert_widget)
        self.main_layout.addStretch()
예제 #7
0
    def ui(self):
        super(JointOrientView, self).ui()

        aim_axis_box = group.BaseGroup(layout_orientation=Qt.Horizontal,
                                       layout_spacing=8,
                                       parent=self)
        aim_axis_box.setTitle('Aim Axis')
        self._aim_x_radio = buttons.BaseRadioButton(' X ', parent=self)
        self._aim_y_radio = buttons.BaseRadioButton(' Y ', parent=self)
        self._aim_z_radio = buttons.BaseRadioButton(' Z ', parent=self)
        self._aim_rev_cbx = checkbox.BaseCheckBox('Reverse', parent=self)
        aim_axis_box.addWidget(self._aim_x_radio)
        aim_axis_box.addWidget(self._aim_y_radio)
        aim_axis_box.addWidget(self._aim_z_radio)
        aim_axis_box.addWidget(self._aim_rev_cbx)
        self._aim_axis_boxes = [
            self._aim_x_radio, self._aim_y_radio, self._aim_z_radio
        ]

        up_axis_box = group.BaseGroup(layout_orientation=Qt.Horizontal,
                                      layout_spacing=8,
                                      parent=self)
        up_axis_box.setTitle('Up Axis')
        self._up_x_radio = buttons.BaseRadioButton(' X ', parent=self)
        self._up_y_radio = buttons.BaseRadioButton(' Y ', parent=self)
        self._up_z_radio = buttons.BaseRadioButton(' Z ', parent=self)
        self._up_rev_cbx = checkbox.BaseCheckBox('Reverse', parent=self)
        up_axis_box.addWidget(self._up_x_radio)
        up_axis_box.addWidget(self._up_y_radio)
        up_axis_box.addWidget(self._up_z_radio)
        up_axis_box.addWidget(self._up_rev_cbx)
        self._up_axis_boxes = [
            self._up_x_radio, self._up_y_radio, self._up_z_radio
        ]

        up_world_axis_box = group.BaseGroup(layout_orientation=Qt.Horizontal,
                                            layout_spacing=2,
                                            parent=self)
        up_world_axis_box.setTitle('Up World Axis')
        self._up_world_x_spin = spinbox.BaseDoubleSpinBox(parent=self)
        self._up_world_y_spin = spinbox.BaseDoubleSpinBox(parent=self)
        self._up_world_z_spin = spinbox.BaseDoubleSpinBox(parent=self)
        self._up_world_x_spin.setDecimals(3)
        self._up_world_y_spin.setDecimals(3)
        self._up_world_z_spin.setDecimals(3)
        self._up_world_x_spin.setRange(-360, 360)
        self._up_world_y_spin.setRange(-360, 360)
        self._up_world_z_spin.setRange(-360, 360)
        self._up_world_x_btn = buttons.get_axis_button('X',
                                                       parent=self,
                                                       as_tool_button=False)
        self._up_world_y_btn = buttons.get_axis_button('Y',
                                                       parent=self,
                                                       as_tool_button=False)
        self._up_world_z_btn = buttons.get_axis_button('Z',
                                                       parent=self,
                                                       as_tool_button=False)
        up_world_axis_box.addWidget(self._up_world_x_spin)
        up_world_axis_box.addWidget(self._up_world_y_spin)
        up_world_axis_box.addWidget(self._up_world_z_spin)
        up_world_axis_box.addWidget(self._up_world_x_btn)
        up_world_axis_box.addWidget(self._up_world_y_btn)
        up_world_axis_box.addWidget(self._up_world_z_btn)

        joint_orient_btn_layout = layouts.HorizontalLayout()
        joint_orient_btn_layout.addStretch()
        self._joint_orient_btn = buttons.BaseButton('Apply', parent=self)
        self._joint_orient_btn.setIcon(resources.icon('ok'))
        self._hierarchy_cbx = checkbox.BaseCheckBox('Hierarchy', parent=self)
        joint_orient_btn_layout.addWidget(self._joint_orient_btn)
        joint_orient_btn_layout.addWidget(self._hierarchy_cbx)
        joint_orient_btn_layout.addStretch()

        self.main_layout.addWidget(aim_axis_box)
        self.main_layout.addWidget(up_axis_box)
        self.main_layout.addWidget(up_world_axis_box)
        self.main_layout.addLayout(joint_orient_btn_layout)
예제 #8
0
    def ui(self):
        super(RenamerView, self).ui()

        top_layout = layouts.HorizontalLayout(spacing=2, margins=(2, 2, 2, 2))
        top_layout.setAlignment(Qt.AlignLeft)
        self._buttons_grp = QButtonGroup(self)
        self._buttons_grp.setExclusive(True)
        self.main_layout.addLayout(top_layout)
        self.main_layout.addLayout(dividers.DividerLayout())

        self._categories_layout = layouts.HorizontalLayout(spacing=2,
                                                           margins=(2, 2, 2,
                                                                    2))
        self._categories_layout.setAlignment(Qt.AlignLeft)

        selection_layout = layouts.HorizontalLayout(spacing=2,
                                                    margins=(4, 0, 4, 0))
        top_layout.addLayout(selection_layout)

        self._all_radio = buttons.BaseRadioButton('All', parent=self)
        self._all_radio.setFixedHeight(19)
        self._all_radio.setAutoExclusive(True)
        self._selected_radio = buttons.BaseRadioButton('Selected', parent=self)
        self._selected_radio.setFixedHeight(19)
        self._selected_radio.setChecked(True)
        self._selected_radio.setAutoExclusive(True)
        self._hierarchy_cbx = checkbox.BaseCheckBox('Hierarchy', parent=self)
        self._hierarchy_cbx.setFixedHeight(19)
        self._node_types_combo = combobox.BaseComboBox(parent=self)
        self._auto_rename_shapes_cbx = None
        self._auto_rename_shapes_cbx = checkbox.BaseCheckBox(
            'Auto Rename Shapes', parent=self)
        self._auto_rename_shapes_cbx.setChecked(True)
        if not dcc.client().is_maya():
            self._auto_rename_shapes_cbx.setVisible(False)

        selection_layout.addWidget(self._selected_radio)
        selection_layout.addWidget(self._all_radio)
        selection_layout.addItem(
            QSpacerItem(10, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
        selection_layout.addWidget(self._hierarchy_cbx)
        selection_layout.addItem(
            QSpacerItem(10, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
        selection_layout.addWidget(self._node_types_combo)
        if self._auto_rename_shapes_cbx:
            selection_layout.addItem(
                QSpacerItem(10, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
            selection_layout.addWidget(self._auto_rename_shapes_cbx)

        self._splitter = splitter.CollapsibleSplitter(parent=self)
        self._splitter.setOrientation(Qt.Horizontal)
        self._splitter.setSizePolicy(QSizePolicy.Minimum,
                                     QSizePolicy.Expanding)
        self._splitter.setMinimumHeight(750)
        self.main_layout.addWidget(self._splitter)

        self._rename_tab = tabs.BaseTabWidget(parent=self)
        self._splitter.addWidget(self._rename_tab)

        self._manual_rename_widget = manualrenamewidget.ManualRenameWidget(
            model=self._model, controller=self._controller, parent=self)
        self._auto_rename_widget = autorenamewidget.AutoRenameWidget(
            model=self._model, controller=self._controller, parent=self)

        self._rename_tab.addTab(self._manual_rename_widget, 'Manual')
        self._rename_tab.addTab(self._auto_rename_widget, 'Auto')

        self._stack = stack.SlidingStackedWidget()
        # splitter_right_widget = QWidget()
        # splitter_right_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0))
        # splitter_right_layout.addLayout(self._categories_layout)
        # splitter_right_layout.addWidget(self._stack)
        # splitter_right_widget.setLayout(splitter_right_layout)
        # self._splitter.addWidget(splitter_right_widget)
        #
        # no_items_widget = QFrame()
        # no_items_widget.setFrameShape(QFrame.StyledPanel)
        # no_items_widget.setFrameShadow(QFrame.Sunken)
        # no_items_widget.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
        # no_items_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0))
        # no_items_widget.setLayout(no_items_layout)
        # no_items_lbl = label.BaseLabel()
        # no_items_pixmap = tp.ResourcesMgr().pixmap('no_items')
        # no_items_lbl.setPixmap(no_items_pixmap)
        # no_items_lbl.setAlignment(Qt.AlignCenter)
        # no_items_layout.addItem(QSpacerItem(0, 10, QSizePolicy.Preferred, QSizePolicy.Expanding))
        # no_items_layout.addWidget(no_items_lbl)
        # no_items_layout.addItem(QSpacerItem(0, 10, QSizePolicy.Preferred, QSizePolicy.Expanding))
        #
        # self._stack.addWidget(no_items_widget)

        self._splitter.handle(0).collapse()
        self._splitter.setSizes([1, 0])
예제 #9
0
    def ui(self):
        super(NumberSideView, self).ui()

        rename_mult_layout = layouts.HorizontalLayout(spacing=5,
                                                      margins=(0, 0, 0, 0))
        rename_mult_layout.setAlignment(Qt.AlignLeft)
        self.main_layout.addLayout(rename_mult_layout)
        self._rename_mult_cbx = checkbox.BaseCheckBox(parent=self)
        self._rename_mult_cbx.setChecked(True)
        self._rename_mult_method_lbl = label.BaseLabel('Number: ', parent=self)
        self._renamer_mult_method_combo = combobox.BaseComboBox(parent=self)
        self._renamer_mult_method_combo.addItem('Numbers (0-9)')
        self._renamer_mult_method_combo.addItem('Letters (a-z)')
        rename_mult_layout.addWidget(self._rename_mult_cbx)
        rename_mult_layout.addWidget(self._rename_mult_method_lbl)
        rename_mult_layout.addWidget(self._renamer_mult_method_combo)
        self._frame_pad_lbl = label.BaseLabel('Pad: ', parent=self)
        self._frame_pad_spin = spinbox.BaseSpinBox(parent=self)
        self._frame_pad_spin.setValue(2)
        self._frame_pad_spin.setFocusPolicy(Qt.NoFocus)
        self._frame_pad_spin.setMinimum(1)
        self._frame_pad_spin.setMaximum(10)
        self._frame_combo = combobox.BaseComboBox(parent=self)
        self._frame_combo.setSizePolicy(QSizePolicy.Expanding,
                                        QSizePolicy.Fixed)
        self._frame_combo.addItems(['Replace', 'Append', 'Change Pad'])
        self._frame_btn = buttons.BaseButton()
        self._frame_btn.setIcon(resources.icon('numbered_list'))
        rename_mult_layout.addWidget(self._frame_pad_lbl)
        rename_mult_layout.addWidget(self._frame_pad_spin)
        rename_mult_layout.addWidget(self._frame_combo)
        lower_upper_grp = QButtonGroup(self)
        self._lower_radio = buttons.BaseRadioButton('Lower', parent=self)
        self._upper_radio = buttons.BaseRadioButton('Upper', parent=self)
        lower_upper_grp.addButton(self._lower_radio)
        lower_upper_grp.addButton(self._upper_radio)
        self._lower_radio.setVisible(False)
        self._upper_radio.setVisible(False)
        self._lower_radio.setFixedHeight(19)
        self._upper_radio.setFixedHeight(19)
        self._upper_radio.setAutoExclusive(True)
        self._lower_radio.setAutoExclusive(True)
        self._lower_radio.setChecked(True)
        self._lower_radio.setEnabled(False)
        self._upper_radio.setEnabled(False)
        rename_mult_layout.addWidget(self._lower_radio)
        rename_mult_layout.addWidget(self._upper_radio)
        rename_mult_layout.addWidget(self._frame_btn)

        self.main_layout.addLayout(dividers.DividerLayout())

        side_layout = layouts.HorizontalLayout(spacing=2, margins=(0, 0, 0, 0))
        side_layout.setAlignment(Qt.AlignLeft)
        self.main_layout.addLayout(side_layout)
        self._side_cbx = checkbox.BaseCheckBox(parent=self)
        self._side_cbx.setChecked(True)
        side_layout.addWidget(self._side_cbx)
        self._side_lbl = label.BaseLabel('Side: ', parent=self)
        self._none_side = buttons.BaseRadioButton('None', parent=self)
        self._right_side = buttons.BaseRadioButton('Right', parent=self)
        self._center_side = buttons.BaseRadioButton('Center', parent=self)
        self._mid_side = buttons.BaseRadioButton('Mid', parent=self)
        self._left_side = buttons.BaseRadioButton('Left', parent=self)
        self._none_side.setFixedHeight(15)
        self._right_side.setFixedHeight(15)
        self._center_side.setFixedHeight(15)
        self._mid_side.setFixedHeight(15)
        self._left_side.setFixedHeight(15)
        side_layout.addWidget(self._side_lbl)
        side_layout.addWidget(self._none_side)
        side_layout.addWidget(self._right_side)
        side_layout.addWidget(self._center_side)
        side_layout.addWidget(self._mid_side)
        side_layout.addWidget(self._left_side)
        self._none_side.setAutoExclusive(True)
        self._right_side.setAutoExclusive(True)
        self._center_side.setAutoExclusive(True)
        self._mid_side.setAutoExclusive(True)
        self._left_side.setAutoExclusive(True)
        self._none_side.setChecked(True)
        self._capital_side = checkbox.BaseCheckBox('Capital?', parent=self)
        self._side_btn = buttons.BaseButton(parent=self)
        self._side_btn.setIcon(resources.icon('font_size'))
        side_layout.addStretch()
        side_layout.addWidget(self._capital_side)
        side_layout.addStretch()
        side_layout.addWidget(self._side_btn)