Esempio n. 1
0
    def build_ui(self):
        """Build the Plug-in UI and append it to the main ui as a tab."""
        self.plugin_layout = QtWidgets.QWidget()
        main_layout = QtWidgets.QVBoxLayout()
        project_layout = QtWidgets.QHBoxLayout()
        project_btns_layout = QtWidgets.QVBoxLayout()
        project_btns_layout.setAlignment(QtCore.Qt.AlignCenter)
        object_layout = QtWidgets.QHBoxLayout()
        object_btns_layout = QtWidgets.QVBoxLayout()
        object_btns_layout.setAlignment(QtCore.Qt.AlignCenter)
        selection_layout = QtWidgets.QHBoxLayout()
        wireframe_layout = QtWidgets.QHBoxLayout()
        material_layout = QtWidgets.QHBoxLayout()
        red_text = '#AA0000'

        # Current Selections
        self.ui_selected_project = None
        self.ui_selected_object = None

        # Create UI widgets
        self.refresh = QtWidgets.QPushButton("refresh")
        self.sync_selection = QtWidgets.QCheckBox("Selection Sync")
        self.sync_selection_mode = QtWidgets.QComboBox()
        self.sync_selection_mode.addItem("Set Selection")
        self.sync_selection_mode.addItem("Members Selection")

        self.project_new_btn = QtWidgets.QPushButton("new texture project")
        self.project_delete_btn = QtWidgets.QPushButton("X")
        self.project_delete_btn.setStyleSheet('QPushButton {color: %s;}' %
                                              red_text)

        self.list_projects = QtWidgets.QListWidget()
        self.list_projects.setSortingEnabled(True)

        self.btn_new_texture_object = QtWidgets.QPushButton(
            "new texture object")
        self.btn_delete_texture_object = QtWidgets.QPushButton("X")
        self.btn_delete_texture_object.setStyleSheet(
            'QPushButton {color: %s;}' % red_text)
        self.btn_add_to_surfacing_object = QtWidgets.QPushButton(
            "add selected")

        self.list_texture_objects = QtWidgets.QListWidget()
        self.list_texture_objects.setSortingEnabled(True)
        self.lbl_validate_scene = QtWidgets.QLabel("validation")
        self.btn_validate_scene = QtWidgets.QPushButton("check scene")
        self.btn_validate_scene.setToolTip(
            'Pops any non-allow types from surfacing\n'
            'projects and objects. And makes sure meshes are\n'
            'in one and only one surfacing object')

        self.lbl_export = QtWidgets.QLabel("Export")
        self.lbl_subdiv_level = QtWidgets.QLabel("subdiv level")
        self.cmb_export_subdiv = QtWidgets.QComboBox()
        self.cmb_export_subdiv.addItem('0')
        self.cmb_export_subdiv.addItem('1')
        self.cmb_export_subdiv.addItem('2')

        self.btn_export_project = QtWidgets.QPushButton("Selected Project")
        self.btn_export_all = QtWidgets.QPushButton("All Projects")

        # Attach widgets to the main layout
        main_layout.addWidget(self.refresh)
        main_layout.addLayout(selection_layout)
        selection_layout.addWidget(self.sync_selection)
        selection_layout.addWidget(self.sync_selection_mode)
        main_layout.addLayout(project_layout)
        project_layout.addWidget(self.list_projects)
        project_layout.addLayout(project_btns_layout)
        project_btns_layout.addWidget(self.project_new_btn)
        project_btns_layout.addWidget(self.project_delete_btn)
        main_layout.addLayout(object_layout)
        object_layout.addWidget(self.list_texture_objects)
        object_layout.addLayout(object_btns_layout)
        object_btns_layout.addWidget(self.btn_new_texture_object)
        object_btns_layout.addWidget(self.btn_add_to_surfacing_object)
        object_btns_layout.addWidget(self.btn_delete_texture_object)
        main_layout.addWidget(self.lbl_validate_scene)
        main_layout.addWidget(self.btn_validate_scene)
        main_layout.addWidget(self.lbl_export)
        main_layout.addWidget(self.lbl_subdiv_level)
        main_layout.addWidget(self.cmb_export_subdiv)
        main_layout.addWidget(self.btn_export_project)
        main_layout.addWidget(self.btn_export_all)

        # Set main layout
        self.plugin_layout.setLayout(main_layout)

        # Connect buttons signals
        self.refresh.clicked.connect(self.update_ui_projects)
        self.project_new_btn.clicked.connect(self.create_project)
        self.project_delete_btn.clicked.connect(self.delete_project)
        self.list_projects.itemClicked.connect(self.update_ui_texture_objects)
        self.list_projects.itemDoubleClicked.connect(self.editItem)
        self.btn_new_texture_object.clicked.connect(
            self.create_surfacing_object)
        self.btn_delete_texture_object.clicked.connect(
            self.delete_texture_object)
        self.btn_add_to_surfacing_object.clicked.connect(
            self.add_to_surfacing_object)
        self.btn_validate_scene.clicked.connect(self.validate_scene)
        self.list_texture_objects.itemClicked.connect(
            self.select_surfacing_object)
        self.list_texture_objects.itemDoubleClicked.connect(self.editItem)
        self.btn_export_project.clicked.connect(self.export_project)
        self.btn_export_all.clicked.connect(self.export_all_projects)
Esempio n. 2
0
    def __init__(self):
        super(CharacterWidget, self).__init__()

        # layout

        main_layout = QtWidgets.QVBoxLayout()
        self.setLayout(main_layout)

        header_layout = QtWidgets.QHBoxLayout()
        main_layout.addLayout(header_layout)

        name_label = QtWidgets.QLabel("Name")
        self.name_ql = QtWidgets.QLineEdit("")

        health_label = QtWidgets.QLabel("Health")
        self.health_cb = QtWidgets.QComboBox()
        self.health_cb.addItems(["5", "4", "3", "2", "1", "0"])
        self.health_cb.setFixedSize(75, 40)

        spirit_label = QtWidgets.QLabel("Spirit")
        self.spirit_cb = QtWidgets.QComboBox()
        self.spirit_cb.addItems(["5", "4", "3", "2", "1", "0"])
        self.spirit_cb.setFixedSize(75, 40)

        supply_label = QtWidgets.QLabel("Supply")
        self.supply_cb = QtWidgets.QComboBox()
        self.supply_cb.addItems(["5", "4", "3", "2", "1", "0"])
        self.supply_cb.setFixedSize(75, 40)

        momentum_label = QtWidgets.QLabel("Momentum")
        self.momentum_cb = QtWidgets.QComboBox()
        self.momentum_cb.addItems([
            "10", "9", "8", "7", "6", "5", "4", "3", "2", "1", "0", "-1", "-2",
            "-3", "-4", "-5", "-6"
        ])
        self.momentum_cb.setFixedSize(75, 40)

        header_layout.addWidget(name_label)
        header_layout.addWidget(self.name_ql)
        header_layout.addWidget(health_label)
        header_layout.addWidget(self.health_cb)
        header_layout.addWidget(spirit_label)
        header_layout.addWidget(self.spirit_cb)
        header_layout.addWidget(supply_label)
        header_layout.addWidget(self.supply_cb)
        header_layout.addWidget(momentum_label)
        header_layout.addWidget(self.momentum_cb)

        stats_layout = QtWidgets.QHBoxLayout()
        main_layout.addLayout(stats_layout)

        edge_label = QtWidgets.QLabel("Edge")
        self.edge_ql = QtWidgets.QLineEdit()
        self.edge_ql.setFixedSize(75, 40)

        heart_label = QtWidgets.QLabel("Heart")
        self.heart_ql = QtWidgets.QLineEdit()
        self.heart_ql.setFixedSize(75, 40)

        iron_label = QtWidgets.QLabel("Iron")
        self.iron_ql = QtWidgets.QLineEdit()
        self.iron_ql.setFixedSize(75, 40)

        shadow_label = QtWidgets.QLabel("Shadow")
        self.shadow_ql = QtWidgets.QLineEdit()
        self.shadow_ql.setFixedSize(75, 40)

        wits_label = QtWidgets.QLabel("Wits")
        self.wits_ql = QtWidgets.QLineEdit()
        self.wits_ql.setFixedSize(75, 40)

        xp_label = QtWidgets.QLabel("XP")
        self.xp_ql = QtWidgets.QLineEdit()
        self.xp_ql.setFixedSize(75, 40)

        xp_spent_label = QtWidgets.QLabel("XP Spent")
        self.xp_spent_ql = QtWidgets.QLineEdit()
        self.xp_spent_ql.setFixedSize(75, 40)

        stats_layout.addWidget(edge_label)
        stats_layout.addWidget(self.edge_ql)
        stats_layout.addWidget(heart_label)
        stats_layout.addWidget(self.heart_ql)
        stats_layout.addWidget(iron_label)
        stats_layout.addWidget(self.iron_ql)
        stats_layout.addWidget(shadow_label)
        stats_layout.addWidget(self.shadow_ql)
        stats_layout.addWidget(wits_label)
        stats_layout.addWidget(self.wits_ql)
        stats_layout.addWidget(xp_label)
        stats_layout.addWidget(self.xp_ql)
        stats_layout.addWidget(xp_spent_label)
        stats_layout.addWidget(self.xp_spent_ql)

        state_layout = QtWidgets.QHBoxLayout()
        main_layout.addLayout(state_layout)

        wounded_label = QtWidgets.QLabel("Wounded")
        self.wounded = QtWidgets.QCheckBox()
        shaken_label = QtWidgets.QLabel("Shaken")
        self.shaken = QtWidgets.QCheckBox()
        unprepared_label = QtWidgets.QLabel("Unprepared")
        self.unprepared = QtWidgets.QCheckBox()
        encumbered_label = QtWidgets.QLabel("Encumbered")
        self.encumbered = QtWidgets.QCheckBox()

        corrupted_label = QtWidgets.QLabel("Corrupted")
        self.corrupted = QtWidgets.QCheckBox()
        cursed_label = QtWidgets.QLabel("Cursed")
        self.cursed = QtWidgets.QCheckBox()
        maimed_label = QtWidgets.QLabel("Maimed")
        self.maimed = QtWidgets.QCheckBox()
        tormented_label = QtWidgets.QLabel("Tormented")
        self.tormented = QtWidgets.QCheckBox()

        state_layout.addWidget(wounded_label)
        state_layout.addWidget(self.wounded)
        state_layout.addWidget(shaken_label)
        state_layout.addWidget(self.shaken)
        state_layout.addWidget(unprepared_label)
        state_layout.addWidget(self.unprepared)
        state_layout.addWidget(encumbered_label)
        state_layout.addWidget(self.encumbered)

        state_layout.addWidget(corrupted_label)
        state_layout.addWidget(self.corrupted)
        state_layout.addWidget(cursed_label)
        state_layout.addWidget(self.cursed)
        state_layout.addWidget(maimed_label)
        state_layout.addWidget(self.maimed)
        state_layout.addWidget(tormented_label)
        state_layout.addWidget(self.tormented)

        self.restored_saved_data()
Esempio n. 3
0
    def __init__(self):
        super(RecieptBuddy_RecieptManager,self).__init__()
        self.rootItems = {}
        self.taxRate = 9.5
        self.recieptItems = []
        self.currentItem = None
        self.lastBackup = datetime.datetime.now()

        # data
        self.RecieptDir = os.path.join(os.environ.get('ArletaHouse'),'tools','recieptBuddy','source','lib','reciepts')
        if not os.path.isdir(self.RecieptDir):
            os.makedirs(self.RecieptDir)

        # widget creation
        self.uiRecieptSelector = QtWidgets.QComboBox()
        self.uiPayTo = QtWidgets.QComboBox()
        self.uiTaxRate = QtWidgets.QDoubleSpinBox()
        self.uiGroceryTreeWidget = QtWidgets.QTreeWidget()
        self.uiTemplateGroup = QtWidgets.QGroupBox('Item Template')
        self.uiItemTemplate = GroceryItemWidget()
        self.uiAddItem = QtWidgets.QPushButton(StyleUtils.getIcon('add'),'Add Item')

        # widget settings
        self.uiTaxRate.setValue(9.5)
        self.uiTemplateGroup.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum))
        self.uiGroceryTreeWidget.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding))
        for k in sorted(BillTo.keys()):
            self.uiPayTo.addItem(BillTo[k])
        self.uiAddItem.setEnabled(False)
        self.uiGroceryTreeWidget.setHeaderLabels(['Item Name', 'Item Price','CRV','Taxable','Tax','Subtotal','Bill To'])
        self.uiGroceryTreeWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.uiGroceryTreeWidget.customContextMenuRequested.connect(self.groceryTreeMenuRequested)

        #Layout Construction
        self.layMain = QtWidgets.QVBoxLayout()
        self.layForm = QtWidgets.QFormLayout()
        self.layTemplate = QtWidgets.QVBoxLayout()
        self.layOperators = QtWidgets.QHBoxLayout()

        #layout settings
        self.layTemplate.addWidget(self.uiItemTemplate)
        self.layTemplate.addLayout(self.layOperators)

        self.layOperators.addStretch()
        self.layOperators.addWidget(self.uiAddItem)

        self.layForm.addRow('Reciept:',self.uiRecieptSelector)
        self.layForm.addRow('Pay To:',self.uiPayTo)
        self.layForm.addRow('Tax Rate:',self.uiTaxRate)
        # self.layForm.addRow('Items:',self.uiGroceryTreeWidget)

        self.layMain.addLayout(self.layForm)
        self.layMain.addWidget(self.uiGroceryTreeWidget)
        self.layMain.addWidget(self.uiTemplateGroup)

        # layout application
        self.setLayout(self.layMain)
        self.uiTemplateGroup.setLayout(self.layTemplate)

        self.uiItemTemplate.itemUpdated.connect(self.verifyTemplate)
        self.uiAddItem.clicked.connect(self.addItem)
        self.uiRecieptSelector.currentIndexChanged.connect(self.openReciept)
        self.uiTaxRate.valueChanged.connect(self.updateTaxRate)
        self.uiTaxRate.valueChanged.connect(self.updateRecieptFile)
        self.uiPayTo.currentIndexChanged.connect(self.updateRecieptFile)
        self.recieptUpdated.connect(self.updateRecieptFile)

        self.populateReciepts()
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(498, 189)
        Form.setMaximumSize(QtCore.QSize(16777215, 195))
        self.mainLayout = QtGui.QVBoxLayout(Form)
        # self.mainLayout.setMargin(2)
        self.mainLayout.setSpacing(2)
        self.mainLayout.setObjectName(_fromUtf8("mainLayout"))
        self.delete_this = QtGui.QPushButton(Form)
        self.delete_this.setMinimumSize(QtCore.QSize(25, 25))
        self.delete_this.setMaximumSize(QtCore.QSize(25, 25))
        self.delete_this.setText(_fromUtf8(""))
        self.delete_this.setObjectName(_fromUtf8("delete_this"))
        self.mainLayout.addWidget(self.delete_this)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.attr_name = QtGui.QLineEdit(Form)
        self.attr_name.setMaximumSize(QtCore.QSize(270, 16777215))
        self.attr_name.setObjectName(_fromUtf8("attr_name"))
        self.horizontalLayout.addWidget(self.attr_name)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 2)
        self.label_10 = QtGui.QLabel(Form)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 1, 0, 1, 1)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.variation = QtGui.QRadioButton(Form)
        self.variation.setChecked(True)
        self.variation.setObjectName(_fromUtf8("variation"))
        self.horizontalLayout_5.addWidget(self.variation)
        self.uniform = QtGui.QRadioButton(Form)
        self.uniform.setObjectName(_fromUtf8("uniform"))
        self.horizontalLayout_5.addWidget(self.uniform)
        self.type = QtGui.QComboBox(Form)
        self.type.setObjectName(_fromUtf8("type"))
        self.type.addItem(_fromUtf8(""))
        self.type.addItem(_fromUtf8(""))
        self.horizontalLayout_5.addWidget(self.type)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_5.addItem(spacerItem)
        self.gridLayout.addLayout(self.horizontalLayout_5, 1, 1, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label_3 = QtGui.QLabel(Form)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.horizontalLayout_3.addWidget(self.label_3)
        self.min_x_value = QtGui.QDoubleSpinBox(Form)
        self.min_x_value.setSingleStep(0.1)
        self.min_x_value.setObjectName(_fromUtf8("min_x_value"))
        self.horizontalLayout_3.addWidget(self.min_x_value)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem1)
        self.label_7 = QtGui.QLabel(Form)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.horizontalLayout_3.addWidget(self.label_7)
        self.min_y_value = QtGui.QDoubleSpinBox(Form)
        self.min_y_value.setSingleStep(0.1)
        self.min_y_value.setObjectName(_fromUtf8("min_y_value"))
        self.horizontalLayout_3.addWidget(self.min_y_value)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem2)
        self.label_8 = QtGui.QLabel(Form)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.horizontalLayout_3.addWidget(self.label_8)
        self.min_z_value = QtGui.QDoubleSpinBox(Form)
        self.min_z_value.setSingleStep(0.1)
        self.min_z_value.setObjectName(_fromUtf8("min_z_value"))
        self.horizontalLayout_3.addWidget(self.min_z_value)
        self.gridLayout.addLayout(self.horizontalLayout_3, 2, 1, 1, 1)
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.label_4 = QtGui.QLabel(Form)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.horizontalLayout_4.addWidget(self.label_4)
        self.max_x_value = QtGui.QDoubleSpinBox(Form)
        self.max_x_value.setSingleStep(0.1)
        self.max_x_value.setProperty("value", 1.0)
        self.max_x_value.setObjectName(_fromUtf8("max_x_value"))
        self.horizontalLayout_4.addWidget(self.max_x_value)
        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem3)
        self.label_6 = QtGui.QLabel(Form)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.horizontalLayout_4.addWidget(self.label_6)
        self.max_y_value = QtGui.QDoubleSpinBox(Form)
        self.max_y_value.setSingleStep(0.1)
        self.max_y_value.setProperty("value", 1.0)
        self.max_y_value.setObjectName(_fromUtf8("max_y_value"))
        self.horizontalLayout_4.addWidget(self.max_y_value)
        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem4)
        self.label_9 = QtGui.QLabel(Form)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.horizontalLayout_4.addWidget(self.label_9)
        self.max_z_value = QtGui.QDoubleSpinBox(Form)
        self.max_z_value.setSingleStep(0.1)
        self.max_z_value.setProperty("value", 1.0)
        self.max_z_value.setObjectName(_fromUtf8("max_z_value"))
        self.horizontalLayout_4.addWidget(self.max_z_value)
        self.gridLayout.addLayout(self.horizontalLayout_4, 3, 1, 1, 1)
        self.mainLayout.addLayout(self.gridLayout)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.label_5 = QtGui.QLabel(Form)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.horizontalLayout_2.addWidget(self.label_5)
        self.primvar_node_name = QtGui.QLineEdit(Form)
        self.primvar_node_name.setMinimumSize(QtCore.QSize(110, 0))
        self.primvar_node_name.setObjectName(_fromUtf8("primvar_node_name"))
        self.horizontalLayout_2.addWidget(self.primvar_node_name)
        self.get_node_name = QtGui.QPushButton(Form)
        self.get_node_name.setObjectName(_fromUtf8("get_node_name"))
        self.horizontalLayout_2.addWidget(self.get_node_name)
        self.create_node = QtGui.QPushButton(Form)
        self.create_node.setObjectName(_fromUtf8("create_node"))
        self.horizontalLayout_2.addWidget(self.create_node)
        self.mainLayout.addLayout(self.horizontalLayout_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Esempio n. 5
0
    def addParams(self, card):
        self.card = card
        self.clearContents()
        self.params = []
        self.paramSceneOptions = {}

        #cardSettings = cardRigging.ParamInfo.toDict( card.rigParams )
        #cardSettings = card.rigData.get('ikParams', {})

        metaControl = cardRigging.registeredControls[card.rigData['rigCmd']]

        # &&& I'm looking at ik and fk args, but all the data is set to "ik", does fk have anything?

        totalCount = len(metaControl.ikInput) + len(metaControl.fkInput)

        if totalCount == 0:
            self.setRowCount(1)
            self.setItem(0, 0, Label('No options'))
            self.setItem(0, 1, Label(''))
            return

        self.setRowCount(totalCount)

        # &&& I don't think there is a shared param #for kwargName, param in metaControl.shared.items() + metaControl.ikInput.items():
        for row, (kwargName, param) in enumerate(
                itertools.chain(metaControl.ikInput.items(),
                                metaControl.fkInput.items())):

            #with columnLayout( p=self.controlSpecificParams, co=('both', 9)) as paramLayout:
            # Param takes multiple input types
            if isinstance(param, list):

                dropdown = QtWidgets.QComboBox()
                dropdown.addItems([p.name for p in param])

                self.setCellWidget(row, 0, dropdown)

                value = card.rigData.get('ikKwargs',
                                         {}).get(kwargName, NOT_FOUND)
                if value is not NOT_FOUND:
                    type = cardRigging.ParamInfo.determineDataType(value)

                    for i, p in enumerate(param):
                        if p.type == type:
                            dropdown.setCurrentIndex(i)
                            self.setInputField(card, row, p)
                            break
                    else:
                        self.setInputField(card, row, param[0])

                else:
                    self.setInputField(card, row, param[0])
                '''
                menu = optionMenu(h=20, cc=alt.Callback(self.changeInputType, paramLayout, param, kwargName))
                for p in param:
                    menuItem( l=p.name )
                
                # Figure out which kind of input the existing data is if the card has the setting
                if kwargName in cardSettings:
                    type = cardRigging.ParamInfo.determineDataType(cardSettings[kwargName])
                
                    for p in param:
                        if p.type == type:
                            menu.setValue(p.name)
                            p.buildUI(card)
                            break
                    else:
                        p.buildUI(card)
                    
                else:
                    param[0].buildUI(card)
                '''
            # Param only takes one data type
            else:
                self.setItem(row, 0, Label(param.name))

                self.setInputField(card, row, param)

        self.cellChanged.connect(self.dataChange)
Esempio n. 6
0
    def controllersAsset(self, assettype = 'Plate', assettypecolumn = 1, assetpath = '', assetquality = [] , assetfilter = '', assetfiletype = [], assetfalse='', asset_sub_list=[] , asset_list=[], asset_path_list=[], asset_versions_dict={} ,asset = ''):

        self.layout_count_x = 2
        self.versions_path = assetpath + '/' + asset + '/' + 'versions' #we get the versions folder

        if assettype == 'Edit_ref':

            self.versions_path = assetpath
            #print self.versions_path

        version_list = asset_versions_dict.get(asset)


        if os.path.exists(self.versions_path): #we check if the version folder exists if not we assume the asset is rubbish

            ## we create a text per asset
            btn = QtWidgets.QLabel(str(asset))
            btn.setToolTip('Name of the ' + assettype)
            self.sub_grid_low_assets_assettype.addWidget(btn, self.layout_count_y , 0)
            self.label_cache.append(btn)
            ##
   
            ## we deal with versions and versions dropdown cache here
            versiondropdown = QtWidgets.QComboBox() # the dropdown widget
            versiondropdown.setToolTip('Choose the asset version you want to import')                 
                                           
            self.dropdown_cache.append(versiondropdown)
            ##

            ## we create the dropdown
            for k in version_list:
                newk = 'v' + k.rpartition(assetfilter)[2]
                if '.abc' in newk:
                    newk = newk.rpartition('.abc')[0]
                versiondropdown.addItem(newk)
            
            self.sub_grid_low_assets_assettype.addWidget(versiondropdown, self.layout_count_y , 1)
            #####

            ### we create the checkboxes
            if assetquality is not None: # create the checkbox if an asset has subtypes
                self.checkbox_cache.append([])
                for quality in assetquality:
                    
                    self.check = QtWidgets.QCheckBox(quality)# create checkboxes
                    self.checkboxTooltip(self.check,quality)
                    self.sub_grid_low_assets_assettype.addWidget(self.check, self.layout_count_y , self.layout_count_x) # add them to the layout
                    self.checkbox_cache[len(self.checkbox_cache)-1].append(self.check) ## this is freaking important checkbox cache is a list that contains lists of checkboxes to keep track of the index print it to see it
                    self.layout_count_x += 1
                    connect_list = []
                    connect_list.append(self.check)

            ###

            
            self.layout_count_y += 1

            # self.sub_grid_low_assets_assettype.addWidget(self.VLine(), 0, self.layout_count_x)
            # self.layout_count_x += 1

        else:
            pass

        self.column_row_rel[assettypecolumn] = self.layout_count_y
        #print self.column_row_rel
        self.already_loaded_asset_versions_dict.update(asset_versions_dict) # we refresh the already loaded assets
        #print self.already_loaded_assets
                  
        versiondropdown.currentIndexChanged.connect(lambda: self.restore_color(btn)) 
Esempio n. 7
0
    def create_ui(self):
        """Creates the PyQt Interface.

        All the PyQt logic needed is contained in this function,
        including the PyQt elements and connect functions.
        """

        # =====================================================================
        # PYQT Widget Defintions
        # =====================================================================

        # window title
        self.setWindowTitle('Pyotoshop')

        # sets ToolTip font for the UI
        QtWidgets.QToolTip.setFont(QtWidgets.QFont('SansSerif', 10))

        # main widget ---------------------------------------------------------
        central_widget = QtWidgets.QWidget()
        central_widget.setLayout(QtWidgets.QVBoxLayout())

        # Search Directory QFormLayout-----------------------------------------
        add_dir_widget = QtWidgets.QFormLayout()

        # Resize texture button layout, child of central_widget ---------------
        add_directory_btn_layout = QtWidgets.QHBoxLayout()

        # Spacer used to place add_directory_btn in the center of the ui
        add_directory_btn_spacer = QtWidgets.QSpacerItem(0, 0)

        add_directory_btn = QtWidgets.QPushButton('Choose Directory')
        add_directory_btn.setToolTip(
            'Select Directory that contains textures to be processed')
        add_directory_btn.setFixedWidth(150)

        dir_name_lbl = QtWidgets.QLabel('Selected Directory:')
        dir_name_lbl.setAlignment(QtCore.Qt.AlignCenter)

        directory_lbl = QtWidgets.QLabel('')
        directory_lbl.setAlignment(QtCore.Qt.AlignCenter)
        directory_lbl.setWordWrap(True)

        # parent widget for texture resizer elements,
        # child of texture_tools_tab_widget -----------------------------------
        texture_resizer_widget = QtWidgets.QWidget()
        texture_resizer_widget.setLayout(QtWidgets.QVBoxLayout())

        texture_resize_description_lbl = QtWidgets.QLabel(
            'Finds textures that are larger than the target size and ' +
            'resizes textures accordingly into a duplicate file.')
        texture_resize_description_lbl.setAlignment(QtCore.Qt.AlignCenter)
        texture_resize_description_lbl.setWordWrap(True)

        # layout for combobox that contains varying texture sizes
        # child of target_size_combobox_layout ------------------------
        target_texture_size_formlayout = QtWidgets.QFormLayout()
        target_texture_size_formlayout.setRowWrapPolicy(
            QtWidgets.QFormLayout.DontWrapRows)
        target_texture_size_formlayout.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.FieldsStayAtSizeHint)
        target_texture_size_formlayout.setLabelAlignment(QtCore.Qt.AlignRight)
        target_texture_size_formlayout.setFormAlignment(QtCore.Qt.AlignVCenter)

        # Resize texture button layout, child of texture_resizer_widget -------
        target_size_combobox_layout = QtWidgets.QHBoxLayout()

        # Spacer used to place add_directory_btn in the center of the ui
        target_size_combobox_l_spacer = QtWidgets.QSpacerItem(30, 50)
        target_size_combobox_r_spacer = QtWidgets.QSpacerItem(10, 50)

        # creates combobox for texture sizes
        self.target_texture_size_combobox = QtWidgets.QComboBox()
        self.target_texture_size_combobox.setFixedWidth(50)
        self.target_texture_size_combobox.setToolTip(
            'Available sizes to resize textures to a smaller resolution.')

        for sizes in TEXTURE_SIZES:
            self.target_texture_size_combobox.addItem(str(sizes))

        # texture_resize_btn_layout, child of texture_resizer_widget ----------
        texture_resize_btn_layout = QtWidgets.QHBoxLayout()

        # Spacer used to place pack_textures_btn in the center of the ui
        resize_pack_btn_spacer = QtWidgets.QSpacerItem(10, 5)

        resize_textures_btn = QtWidgets.QPushButton('Resize Textures')
        resize_textures_btn.setToolTip('Resize available textures.')
        resize_textures_btn.setFixedWidth(150)

        # Texture Packer widget to contain all elements need to run this tool -
        texture_packer_widget = QtWidgets.QWidget()
        texture_packer_widget.setLayout(QtWidgets.QVBoxLayout())
        texture_packer_widget.layout().setAlignment(QtCore.Qt.AlignRight)

        # input_channel_formlayout, child of texture_packer_widget ------------
        input_channel_formlayout = QtWidgets.QFormLayout()
        input_channel_formlayout.setRowWrapPolicy(
            QtWidgets.QFormLayout.DontWrapRows)
        input_channel_formlayout.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.FieldsStayAtSizeHint)
        input_channel_formlayout.setLabelAlignment(QtCore.Qt.AlignRight)
        input_channel_formlayout.setFormAlignment(QtCore.Qt.AlignVCenter)

        texture_pack_description_lbl = QtWidgets.QLabel(
            'Finds textures that having matching suffixes and ' +
            'packs them into a new texture.')
        texture_pack_description_lbl.setAlignment(QtCore.Qt.AlignCenter)
        texture_pack_description_lbl.setWordWrap(True)

        channel_inputs_lbl = QtWidgets.QLabel(
            '- Enter Suffixes of Texture Files to Search for -')
        channel_inputs_lbl.setAlignment(QtCore.Qt.AlignCenter)

        self.r_channel_le = QtWidgets.QLineEdit('')
        self.g_channel_le = QtWidgets.QLineEdit('')
        self.b_channel_le = QtWidgets.QLineEdit('')

        # QCheckbox is initialized at false
        self.a_channel_checkbox = QtWidgets.QCheckBox('A Channel')
        self.a_channel_checkbox.setChecked(False)

        self.a_channel_checkbox.setToolTip(
            'Toggle whether or not an alpha ' +
            'channel is included in texture packing')

        # QLineEdit is initialized at false
        self.a_channel_le = QtWidgets.QLineEdit('')
        self.a_channel_le.setEnabled(False)

        channel_placeholder = 'Enter Suffix Here...'
        self.r_channel_le.setPlaceholderText(channel_placeholder)
        self.g_channel_le.setPlaceholderText(channel_placeholder)
        self.b_channel_le.setPlaceholderText(channel_placeholder)
        self.a_channel_le.setPlaceholderText(channel_placeholder)

        channel_tool_tip = 'Enter suffix for texture to search'
        self.r_channel_le.setToolTip(channel_tool_tip)
        self.g_channel_le.setToolTip(channel_tool_tip)
        self.b_channel_le.setToolTip(channel_tool_tip)
        self.a_channel_le.setToolTip(channel_tool_tip)

        self.r_channel_le.setFixedWidth(110)
        self.g_channel_le.setFixedWidth(110)
        self.b_channel_le.setFixedWidth(110)
        self.a_channel_le.setFixedWidth(110)

        output_format_lbl = QtWidgets.QLabel(
            '- Packed Texture Format - 24 bit .tga -')
        output_format_lbl.setAlignment(QtCore.Qt.AlignCenter)

        self.packed_texture_le = QtWidgets.QLineEdit('')
        self.packed_texture_le.setPlaceholderText(channel_placeholder)
        self.packed_texture_le.setToolTip(
            'Enter suffix to add to the created packed texture')
        self.packed_texture_le.setFixedWidth(110)

        # Output texture_pack_btn_layout,
        # child of input_channel_formlayout -----------------------------------
        texture_pack_btn_layout = QtWidgets.QHBoxLayout()

        # Spacer used to place pack_textures_btn in the center of the ui
        texture_pack_btn_spacer = QtWidgets.QSpacerItem(10, 5)

        pack_textures_btn = QtWidgets.QPushButton('Create Packed Textures')
        pack_textures_btn.setToolTip(
            'Pack texture that contain input suffixes into a new texture')
        pack_textures_btn.setFixedWidth(150)

        # =====================================================================
        # PYQT Widget Assignments
        # =====================================================================

        # Assigments for add_directory_btn_layout -----------------------------

        add_directory_btn_layout.addItem(add_directory_btn_spacer)
        add_directory_btn_layout.addWidget(add_directory_btn)

        add_dir_widget.addRow(add_directory_btn_layout)
        add_dir_widget.addRow(dir_name_lbl)

        # Assigments for texture_pack_btn_layout ------------------------------

        texture_pack_btn_layout.addItem(texture_pack_btn_spacer)
        texture_pack_btn_layout.addWidget(pack_textures_btn)

        # Assigments for input_channel_formlayout -----------------------------

        input_channel_formlayout.addRow(channel_inputs_lbl)
        input_channel_formlayout.addRow(QtWidgets.QLabel('R Channel'),
                                        self.r_channel_le)
        input_channel_formlayout.addRow(QtWidgets.QLabel('G Channel'),
                                        self.g_channel_le)
        input_channel_formlayout.addRow(QtWidgets.QLabel('B Channel'),
                                        self.b_channel_le)
        input_channel_formlayout.addRow(self.a_channel_checkbox,
                                        self.a_channel_le)
        input_channel_formlayout.addRow(output_format_lbl)
        input_channel_formlayout.addRow(QtWidgets.QLabel('Packed Texture'),
                                        self.packed_texture_le)

        input_channel_formlayout.addRow(texture_pack_btn_layout)

        # Assigments for texture_packer_widget --------------------------------

        texture_packer_widget.layout().addLayout(input_channel_formlayout)

        # tab widget to contain all the subset tools --------------------------
        # child widgets of central_widget -------------------------------------
        texture_tools_tab_widget = QtWidgets.QTabWidget()
        texture_tools_tab_widget.setLayout(QtWidgets.QHBoxLayout())

        texture_tools_tab_widget.addTab(texture_packer_widget, 'Pack Textures')
        texture_tools_tab_widget.addTab(texture_resizer_widget,
                                        'Resize Textures')
        texture_tools_tab_widget.setEnabled(False)

        # Assigments for target_texture_size_formlayout -----------------------
        target_texture_size_formlayout.addRow(
            QtWidgets.QLabel('Target Texture Size:'),
            self.target_texture_size_combobox)

        # Assigments for texture resizer QFormLayout with spacers -------------
        target_size_combobox_layout.addItem(target_size_combobox_l_spacer)

        target_size_combobox_layout.addLayout(target_texture_size_formlayout)

        target_size_combobox_layout.addItem(target_size_combobox_r_spacer)

        # Assigments for texture resize button layout -------------------------
        texture_resize_btn_layout.addItem(resize_pack_btn_spacer)
        texture_resize_btn_layout.addWidget(resize_textures_btn)

        # Assigments for texture packer parent widget -------------------------
        texture_resizer_widget.layout().addWidget(
            texture_resize_description_lbl)
        texture_resizer_widget.layout().addLayout(target_size_combobox_layout)
        texture_resizer_widget.layout().addLayout(texture_resize_btn_layout)

        # adds directiory widget and tab widgets to central widget ------------
        central_widget.layout().addLayout(add_dir_widget)
        central_widget.layout().addWidget(directory_lbl)
        central_widget.layout().addWidget(texture_tools_tab_widget)

        # sets central widget for PyQt window
        self.setCentralWidget(central_widget)
        self.setFixedSize(self.sizeHint())

        # =====================================================================
        # PYQT Execution Connections
        # =====================================================================

        # triggers for buttons
        add_directory_btn.clicked.connect(lambda: self.get_directory(
            directory_lbl, texture_tools_tab_widget))

        resize_textures_btn.clicked.connect(
            lambda: self.parse_texture_to_resize(str(directory_lbl.text())))

        pack_textures_btn.clicked.connect(
            lambda: self.parse_texture_dirs_to_pack(str(directory_lbl.text())))

        self.a_channel_checkbox.toggled.connect(
            lambda: self.toggle_alpha_input(self.a_channel_checkbox, self.
                                            a_channel_le, output_format_lbl))
Esempio n. 8
0
    def __setup_ui(self):

        self.setWindowTitle('Mirror Tool')
        self.setObjectName('MirrorToolWindow')

        # some widget I can use as parent for the main layout
        self.centralWidget = QtWidgets.QWidget()
        self.setCentralWidget(self.centralWidget)

        # main vertical layout
        self.mainLayout = QtWidgets.QVBoxLayout(self.centralWidget)

        ###############################################################

        # character layout
        self.characterLayout = QtWidgets.QHBoxLayout()
        self.characterLayout.setAlignment(QtCore.Qt.AlignLeft)
        self.mainLayout.addLayout(self.characterLayout)

        # character label
        self.characterLabel = QtWidgets.QLabel('Character:')
        self.characterLabel.setMaximumWidth(60)
        self.characterLabel.setMinimumWidth(60)
        self.characterLayout.addWidget(self.characterLabel)

        # character combobox
        self.characterComboBox = QtWidgets.QComboBox()
        self.characterLayout.addWidget(self.characterComboBox)

        # character export button
        self.characterExportBtn = QtWidgets.QPushButton('New character')
        self.characterExportBtn.setObjectName("characterBrowseBtn")
        self.characterExportBtn.setMaximumWidth(90)
        self.characterExportBtn.setMinimumWidth(90)
        self.characterLayout.addWidget(self.characterExportBtn)
        self.characterExportBtn.clicked.connect(
            self.__show_export_character_tool)

        # character reload button
        self.characterReloadBtn = QtWidgets.QPushButton('Reload')
        self.characterReloadBtn.setObjectName("characterBrowseBtn")
        self.characterReloadBtn.setMaximumWidth(50)
        self.characterReloadBtn.setMinimumWidth(50)
        self.characterLayout.addWidget(self.characterReloadBtn)
        self.characterReloadBtn.clicked.connect(self.__load_characters)

        # namespace layout
        self.nameSpaceLayout = QtWidgets.QHBoxLayout()
        self.nameSpaceLayout.setAlignment(QtCore.Qt.AlignLeft)
        self.mainLayout.addLayout(self.nameSpaceLayout)

        # namespace label
        self.nameSpaceLabel = QtWidgets.QLabel('Namespace:')
        self.nameSpaceLabel.setMaximumWidth(60)
        self.nameSpaceLabel.setMinimumWidth(60)
        self.nameSpaceLayout.addWidget(self.nameSpaceLabel)

        # namespace combobox
        self.nameSpaceComboBox = QtWidgets.QComboBox()
        self.nameSpaceLayout.addWidget(self.nameSpaceComboBox)

        # namespace reload button
        self.nameSpaceReloadBtn = QtWidgets.QPushButton('Reload')
        self.nameSpaceReloadBtn.setObjectName("nameSpaceReloadBtn")
        self.nameSpaceReloadBtn.setMaximumWidth(50)
        self.nameSpaceReloadBtn.setMinimumWidth(50)
        self.nameSpaceLayout.addWidget(self.nameSpaceReloadBtn)
        self.nameSpaceReloadBtn.clicked.connect(self.__set_namespaces)

        # line separator
        self.lineBelowCharacter = QtWidgets.QFrame()
        self.lineBelowCharacter.setFrameShape(QtWidgets.QFrame.HLine)
        self.mainLayout.addWidget(self.lineBelowCharacter)

        ###############################################################

        # mirror options layout
        self.mirrorOptionsLayout = QtWidgets.QHBoxLayout()
        self.mirrorOptionsLayout.setAlignment(QtCore.Qt.AlignLeft)
        self.mainLayout.addLayout(self.mirrorOptionsLayout)

        # yz label
        self.yzLabel = QtWidgets.QLabel('yz')
        self.yzLabel.setMaximumWidth(10)
        self.yzLabel.setMinimumWidth(10)
        self.mirrorOptionsLayout.addWidget(self.yzLabel)

        # yz checkbox
        self.yzCheckBox = QtWidgets.QCheckBox()
        self.mirrorOptionsLayout.addWidget(self.yzCheckBox)
        # yz checked as default
        self.yzCheckBox.setCheckState(QtCore.Qt.Checked)

        # xz label
        self.xzLabel = QtWidgets.QLabel('xz')
        self.xzLabel.setMaximumWidth(10)
        self.xzLabel.setMinimumWidth(10)
        self.mirrorOptionsLayout.addWidget(self.xzLabel)

        # xz checkbox
        self.xzCheckBox = QtWidgets.QCheckBox()
        self.mirrorOptionsLayout.addWidget(self.xzCheckBox)

        # xy label
        self.xyLabel = QtWidgets.QLabel('xy')
        self.xyLabel.setMaximumWidth(10)
        self.xyLabel.setMinimumWidth(10)
        self.mirrorOptionsLayout.addWidget(self.xyLabel)

        # xy checkbox
        self.xyCheckBox = QtWidgets.QCheckBox()
        self.mirrorOptionsLayout.addWidget(self.xyCheckBox)

        # custom plane label
        self.customLabel = QtWidgets.QLabel('custom plane')
        self.customLabel.setMaximumWidth(70)
        self.customLabel.setMinimumWidth(70)
        self.mirrorOptionsLayout.addWidget(self.customLabel)

        # custom plane checkbox
        self.customCheckBox = QtWidgets.QCheckBox()
        self.mirrorOptionsLayout.addWidget(self.customCheckBox)
        self.customCheckBox.stateChanged.connect(self.__set_plane)

        # line separator
        self.lineBelowMirrorOptions = QtWidgets.QFrame()
        self.lineBelowMirrorOptions.setFrameShape(QtWidgets.QFrame.HLine)
        self.mainLayout.addWidget(self.lineBelowMirrorOptions)

        ######################## UI call back #########################
        # only one checkbox can be set at a time

        self.yzCheckBox.stateChanged.connect(
            partial(self.__uicb_set_boxes, self.yzCheckBox,
                    [self.xzCheckBox, self.xyCheckBox, self.customCheckBox]))

        self.xzCheckBox.stateChanged.connect(
            partial(self.__uicb_set_boxes, self.xzCheckBox,
                    [self.yzCheckBox, self.xyCheckBox, self.customCheckBox]))

        self.xyCheckBox.stateChanged.connect(
            partial(self.__uicb_set_boxes, self.xyCheckBox,
                    [self.yzCheckBox, self.xzCheckBox, self.customCheckBox]))

        self.customCheckBox.stateChanged.connect(
            partial(self.__uicb_set_boxes, self.customCheckBox,
                    [self.yzCheckBox, self.xyCheckBox, self.xzCheckBox]))

        ###############################################################

        # in range layout
        self.inRangeLayout = QtWidgets.QHBoxLayout()
        self.inRangeLayout.setAlignment(QtCore.Qt.AlignLeft)
        self.mainLayout.addLayout(self.inRangeLayout)

        # in range label
        self.inRangeLabel = QtWidgets.QLabel('In range')
        self.inRangeLabel.setMaximumWidth(45)
        self.inRangeLabel.setMinimumWidth(45)
        self.inRangeLayout.addWidget(self.inRangeLabel)

        # in range checkbox
        self.inRangeCheckBox = QtWidgets.QCheckBox()
        self.inRangeLayout.addWidget(self.inRangeCheckBox)

        # frame range layout
        self.frameRangeLayout = QtWidgets.QHBoxLayout()
        self.frameRangeLayout.setAlignment(QtCore.Qt.AlignLeft)
        self.mainLayout.addLayout(self.frameRangeLayout)

        # start frame
        self.startFrameTextBox = QtWidgets.QLineEdit()
        self.startFrameTextBox.setMaximumWidth(50)
        self.startFrameTextBox.setMinimumWidth(50)
        self.frameRangeLayout.addWidget(self.startFrameTextBox)
        self.startFrameTextBox.setEnabled(False)

        # end frame
        self.endFrameTextBox = QtWidgets.QLineEdit()
        self.endFrameTextBox.setMaximumWidth(50)
        self.endFrameTextBox.setMinimumWidth(50)
        self.frameRangeLayout.addWidget(self.endFrameTextBox)
        self.endFrameTextBox.setEnabled(False)

        # frame range button
        self.frameRangeBtn = QtWidgets.QPushButton('From scene')
        self.frameRangeBtn.setObjectName("frameRangeBtn")
        self.frameRangeBtn.setMaximumWidth(60)
        self.frameRangeBtn.setMinimumWidth(60)
        self.frameRangeLayout.addWidget(self.frameRangeBtn)
        self.frameRangeBtn.clicked.connect(self.__set_frame_range)
        self.frameRangeBtn.setEnabled(False)

        # line separator
        self.lineBelowFrameRangeOptions = QtWidgets.QFrame()
        self.lineBelowFrameRangeOptions.setFrameShape(QtWidgets.QFrame.HLine)
        self.mainLayout.addWidget(self.lineBelowFrameRangeOptions)

        ######################## UI call back #########################
        # frame range should only be enabled when box is checked

        self.inRangeCheckBox.stateChanged.connect(
            partial(self.__uicb_match_state_of_box, self.inRangeCheckBox,
                    self.startFrameTextBox))

        self.inRangeCheckBox.stateChanged.connect(
            partial(self.__uicb_match_state_of_box, self.inRangeCheckBox,
                    self.endFrameTextBox))

        self.inRangeCheckBox.stateChanged.connect(
            partial(self.__uicb_match_state_of_box, self.inRangeCheckBox,
                    self.frameRangeBtn))

        ###############################################################

        # mirror button
        self.mirrorBtn = QtWidgets.QPushButton('mirror')
        self.mirrorBtn.setObjectName("mirrorBtn")
        self.mirrorBtn.setMaximumWidth(60)
        self.mirrorBtn.setMinimumWidth(60)
        self.mainLayout.addWidget(self.mirrorBtn)
        self.mirrorBtn.clicked.connect(self.__mirror)
Esempio n. 9
0
    def build_ui(self):
        """Build the Plug-in UI and append it to the main ui as a tab."""
        self.plugin_layout = QtWidgets.QWidget()
        main_layout = QtWidgets.QVBoxLayout()
        project_btns_layout = QtWidgets.QHBoxLayout()
        object_btns_layout = QtWidgets.QHBoxLayout()
        selection_layout = QtWidgets.QHBoxLayout()
        wireframe_layout = QtWidgets.QHBoxLayout()
        material_layout = QtWidgets.QHBoxLayout()
        red_text = '#AA0000'

        # wireframe colors
        self.lbl_wireframe = QtWidgets.QLabel("wireframe colors")
        self.btn_wireframe_color_projects = QtWidgets.QPushButton(
            "per Surfacing Project"
        )
        self.btn_wireframe_color_objects = QtWidgets.QPushButton(
            "per Surfacing Object")
        self.btn_wireframe_color_none = QtWidgets.QPushButton("X")
        self.btn_wireframe_color_none.setMaximumWidth(20)
        self.btn_wireframe_color_none.setStyleSheet(
            'QPushButton {color: %s;}' % red_text)
        # material colors
        self.lbl_materials = QtWidgets.QLabel("material colors")
        self.shader_type = QtWidgets.QComboBox()
        self.shader_type.addItem("blinn")
        self.shader_type.addItem("aiStandardSurface")
        self.btn_material_color_projects = QtWidgets.QPushButton(
            "per Surfacing Project")
        self.btn_material_color_objects = QtWidgets.QPushButton(
            "per Surfacing Object")

        # Attach widgets to the main layout
        main_layout.addWidget(self.lbl_wireframe)
        main_layout.addLayout(wireframe_layout)
        main_layout.setAlignment(QtCore.Qt.AlignTop)
        wireframe_layout.addWidget(self.btn_wireframe_color_projects)
        wireframe_layout.addWidget(self.btn_wireframe_color_objects)
        wireframe_layout.addWidget(self.btn_wireframe_color_none)
        main_layout.addWidget(self.lbl_materials)
        main_layout.addLayout(material_layout)
        material_layout.addWidget(self.shader_type)
        material_layout.addWidget(self.btn_material_color_projects)
        material_layout.addWidget(self.btn_material_color_objects)

        # Set main layout
        self.plugin_layout.setLayout(main_layout)

        # Connect buttons signals
        self.btn_wireframe_color_projects.clicked.connect(
            ldtmaya.set_wireframe_colors_per_project
        )
        self.btn_wireframe_color_objects.clicked.connect(
            ldtmaya.set_wireframe_colors_per_object
        )
        self.btn_wireframe_color_none.clicked.connect(
            ldtmaya.set_wifreframe_color_none
        )
        self.btn_material_color_projects.clicked.connect(
            lambda: ldtmaya.set_materials_per_project(self.shader_type.currentText())
        )
        self.btn_material_color_objects.clicked.connect(
            lambda: ldtmaya.set_materials_per_object(self.shader_type.currentText())
        )
def createDialog():
    def createLayoutH(i_args):
        h_layout = QtWidgets.QHBoxLayout()
        i_args['layout'].addLayout(h_layout)
        if 'spacing' in i_args: h_layout.addSpacing(i_args['spacing'])
        return h_layout

    def createLabel(i_args):
        label = QtWidgets.QLabel(i_args['label'])
        i_args['layout'].addWidget(label)
        label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
        if 'lwidth' in i_args:
            label.setFixedWidth(i_args['lwidth'])
        if 'tip' in i_args:
            label.setToolTip(i_args['tip'])

    def createField(i_args):
        i_args['layout'] = createLayoutH({'layout': i_args['layout']})
        createLabel(i_args)
        if not 'type' in i_args: i_args['type'] = 'str'
        if i_args['type'] == 'int':
            edit = QtWidgets.QSpinBox()
            if 'min' in i_args: edit.setMinimum(i_args['min'])
            else: edit.setMinimum(-1000000000)
            if 'max' in i_args: edit.setMaximum(i_args['max'])
            else: edit.setMaximum(1000000000)
            if 'val' in i_args: edit.setValue(i_args['val'])
        else:
            edit = QtWidgets.QLineEdit()
            if 'val' in i_args: edit.setText(i_args['val'])
        if 'ewidth' in i_args: edit.setFixedWidth(i_args['ewidth'])
        i_args['layout'].addWidget(edit)
        Fields[i_args['name']] = edit

    def createButton(i_args):
        btn = QtWidgets.QPushButton(i_args['label'])
        i_args['layout'].addWidget(btn)
        if 'width' in i_args: btn.setFixedWidth(i_args['width'])
        btn.pressed.connect(i_args['slot'])
        return btn

    # Top widget:
    dialog = QtWidgets.QWidget()
    dialog.setWindowTitle('Afanasy Submit')
    dialog.setWindowIcon(
        QtWidgets.QIcon('%s/icons/afanasy.png' %
                        cgruconfig.VARS['CGRU_LOCATION']))
    dialog_layout = QtWidgets.QVBoxLayout(dialog)
    tabs = QtWidgets.QTabWidget(dialog)
    dialog_layout.addWidget(tabs)

    # General Tab:
    tab = QtWidgets.QWidget(tabs)
    tabs.addTab(tab, 'General')
    tab_layout = QtWidgets.QVBoxLayout(tab)
    lwidth = 80
    rwidth = 80

    # Job name:
    h_layout = createLayoutH({'layout': tab_layout})
    createField({
        'name': 'job_name',
        'label': 'Job Name',
        'layout': h_layout,
        'val': os.path.basename(Filename),
        'lwidth': lwidth
    })
    # Engine:
    createLabel({'label': 'Engine', 'layout': h_layout, 'lwidth': lwidth})
    engines = ['clarisse_node', 'clarisse_render', 'cnode', 'crender']
    combo = QtWidgets.QComboBox()
    combo.setFixedWidth(150)
    h_layout.addWidget(combo)
    for engine in engines:
        combo.addItem(engine)
    Fields['engine'] = combo
    # Help button:
    createButton({
        'label': 'Help',
        'slot': showHelp,
        'layout': h_layout,
        'width': rwidth
    })

    # Archive:
    h_layout = createLayoutH({'layout': tab_layout})
    createField({
        'name': 'archive',
        'label': 'Archive',
        'layout': h_layout,
        'val': Archive,
        'lwidth': lwidth,
        'tip': '"@TIME@" will be replaced with the current time.'
    })
    createButton({
        'label': 'Browse',
        'slot': browseArchive,
        'layout': h_layout,
        'width': rwidth
    })
    h_layout = createLayoutH({'layout': tab_layout, 'spacing': lwidth + 10})
    archive_save = QtWidgets.QCheckBox('Export Archive')
    archive_save.setToolTip(
        'Export project file to render archive before job sending.')
    archive_save.setChecked(True)
    h_layout.addWidget(archive_save)
    Fields['archive_save'] = archive_save
    archive_del = QtWidgets.QCheckBox('Delete Archive')
    archive_del.setToolTip('Delete render archive after job deletion.')
    archive_del.setChecked(True)
    h_layout.addWidget(archive_del)
    Fields['archive_del'] = archive_del

    # Images:
    h_layout = createLayoutH({'layout': tab_layout})

    def getAllImages():
        objects = ix.api.OfObjectArray()
        ix.application.get_factory().get_all_objects("Image", objects)
        return objects

    def imageChanged(i_index=0):
        Fields['output'].setText(
            getAllImages()[i_index].get_attribute('save_as').get_string())

    h_layout = createLayoutH({'layout': tab_layout})
    createLabel({'label': 'Image', 'layout': h_layout, 'lwidth': lwidth})
    combo = QtWidgets.QComboBox()
    for img in getAllImages():
        name = img.get_full_name().replace('project://', '')
        combo.addItem(name)
    combo.currentIndexChanged.connect(imageChanged)
    h_layout.addWidget(combo)
    Fields['image'] = combo
    createField({
        'name':
        'format',
        'label':
        'Format',
        'layout':
        h_layout,
        'lwidth':
        60,
        'ewidth':
        rwidth,
        'tip':
        'Output images format.\nIf empty, it will not be changed.'
    })

    # Output:
    h_layout = createLayoutH({'layout': tab_layout})
    createField({
        'name': 'output',
        'label': 'Output',
        'layout': h_layout,
        'lwidth': lwidth
    })
    imageChanged()
    createButton({
        'label': 'Browse',
        'slot': browseOutput,
        'layout': h_layout,
        'width': rwidth
    })

    # Frame range:
    frange = ix.application.get_current_frame_range()
    h_layout = createLayoutH({'layout': tab_layout})
    createField({
        'name': 'frame_first',
        'label': 'Frame First',
        'type': 'int',
        'val': frange[0],
        'layout': h_layout,
        'lwidth': lwidth
    })
    createField({
        'name': 'frame_last',
        'label': 'Frame Last',
        'type': 'int',
        'val': frange[1],
        'layout': h_layout,
        'lwidth': lwidth
    })
    createField({
        'name': 'frame_step',
        'label': 'Frame Step',
        'type': 'int',
        'val': 1,
        'min': 1,
        'layout': h_layout,
        'lwidth': lwidth,
        'ewidth': rwidth
    })
    h_layout = createLayoutH({'layout': tab_layout, 'spacing': lwidth + 10})
    createField({
        'name': 'frames_per_task',
        'label': 'Frames Per Task',
        'type': 'int',
        'val': 2,
        'min': 1,
        'layout': h_layout
    })
    createField({
        'name': 'frame_sequential',
        'label': 'Frame Sequential',
        'type': 'int',
        'val': 1,
        'layout': h_layout,
        'ewidth': rwidth
    })
    tab_layout.addStretch()

    # Settings Tab:
    tab = QtWidgets.QWidget(tabs)
    tabs.addTab(tab, 'Settings')
    tab_layout = QtWidgets.QVBoxLayout(tab)
    lwidth = 120
    h_layout = createLayoutH({'layout': tab_layout})
    createField({
        'name': 'priority',
        'label': 'Priority',
        'type': 'int',
        'val': -1,
        'min': -1,
        'layout': h_layout,
        'lwidth': lwidth
    })
    createField({
        'name': 'capacity',
        'label': 'Capacity',
        'type': 'int',
        'val': -1,
        'min': -1,
        'layout': h_layout,
        'lwidth': lwidth
    })
    h_layout = createLayoutH({'layout': tab_layout})
    createField({
        'name': 'max_running_tasks',
        'label': 'Max Run Tasks',
        'type': 'int',
        'val': -1,
        'min': -1,
        'layout': h_layout,
        'lwidth': lwidth
    })
    createField({
        'name': 'max_running_tasks_per_host',
        'label': 'Per Host',
        'type': 'int',
        'val': -1,
        'min': -1,
        'layout': h_layout,
        'lwidth': lwidth
    })
    createField({
        'name': 'tasks_max_run_time',
        'label': 'Max Run Time',
        'type': 'int',
        'val': -1,
        'min': -1,
        'layout': tab_layout,
        'lwidth': lwidth,
        'tip': 'Maximum time (in hours) that tasks are allowed to run.'
    })
    # Wait time:
    h_layout = createLayoutH({'layout': tab_layout})
    createLabel({
        'label': 'Wait Time',
        'layout': h_layout,
        'tip': 'Job will wait this time to start.',
        'lwidth': lwidth
    })
    wait_time = QtWidgets.QDateTimeEdit(QtCore.QDateTime.currentDateTime())
    wait_time.setDisplayFormat('yyyy.MM.dd hh:mm:ss')
    Fields['wait_time'] = wait_time
    h_layout.addWidget(wait_time)
    # Service/Parser:
    createField({
        'name': 'service',
        'label': 'Service',
        'val': 'clarisse',
        'layout': tab_layout,
        'lwidth': lwidth
    })
    createField({
        'name': 'parser',
        'label': 'Parser',
        'val': 'clarisse',
        'layout': tab_layout,
        'lwidth': lwidth
    })
    tab_layout.addStretch()

    # Conditions Tab:
    tab = QtWidgets.QWidget(tabs)
    tabs.addTab(tab, 'Conditions')
    tab_layout = QtWidgets.QVBoxLayout(tab)
    lwidth = 150
    createField({
        'name': 'need_os',
        'label': 'Needed OS',
        'layout': tab_layout,
        'lwidth': lwidth,
        'tip': 'Job tasks will run only on clients with specified OS.'
    })
    createField({
        'name':
        'need_properties',
        'label':
        'Needed Properties',
        'layout':
        tab_layout,
        'lwidth':
        lwidth,
        'tip':
        'Job tasks will run only on clients with specified properties.'
    })
    createField({
        'name':
        'depend_mask',
        'label':
        'Depend Mask',
        'layout':
        tab_layout,
        'lwidth':
        lwidth,
        'tip':
        'Job will wait all jobs from the same user which name matches this regular expression.'
    })
    createField({
        'name':
        'depend_mask_global',
        'label':
        'Global Depend Mask',
        'layout':
        tab_layout,
        'lwidth':
        lwidth,
        'tip':
        'Job will wait all jobs from all users which name matches this regular expression.'
    })
    createField({
        'name':
        'hosts_mask',
        'label':
        'Hosts Mask',
        'layout':
        tab_layout,
        'lwidth':
        lwidth,
        'tip':
        'Job tasks will run only on hosts which name matches this regular expression.'
    })
    createField({
        'name':
        'hosts_mask_exclude',
        'label':
        'Exclude Hosts Mask',
        'layout':
        tab_layout,
        'lwidth':
        lwidth,
        'tip':
        'Job tasks will not run on hosts which name matches this regular expression.'
    })
    tab_layout.addStretch()

    # Send job buttons:
    h_layout = createLayoutH({'layout': dialog_layout})
    Fields['btn_send'] = createButton({
        'label': 'Send Job',
        'slot': createJob,
        'layout': h_layout
    })
    # Paused:
    paused = QtWidgets.QCheckBox('Paused')
    paused.setToolTip(
        'Job will be sent with "OFFLINE" state.\nTasks execution is paused.')
    paused.setFixedWidth(rwidth + 10)
    h_layout.addWidget(paused)
    Fields['paused'] = paused

    # Info line:
    line = QtWidgets.QLineEdit()
    dialog_layout.addWidget(line)
    line.setReadOnly(True)
    Fields['info'] = line

    dialog.show()

    return dialog
    def setupUi(self, themeEditor):
        themeEditor.setObjectName(_fromUtf8("themeEditor"))
        themeEditor.resize(724, 461)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(themeEditor)
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.splitter = QtWidgets.QSplitter(themeEditor)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.widget = QtWidgets.QWidget(self.splitter)
        self.widget.setObjectName(_fromUtf8("widget"))
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.widget)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.colors_lwd = QtWidgets.QListWidget(self.widget)
        self.colors_lwd.setObjectName(_fromUtf8("colors_lwd"))
        self.verticalLayout_2.addWidget(self.colors_lwd)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label = QtWidgets.QLabel(self.widget)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout_3.addWidget(self.label)
        self.textSize_spb = QtWidgets.QSpinBox(self.widget)
        self.textSize_spb.setMinimum(9)
        self.textSize_spb.setMaximum(25)
        self.textSize_spb.setProperty("value", 11)
        self.textSize_spb.setObjectName(_fromUtf8("textSize_spb"))
        self.horizontalLayout_3.addWidget(self.textSize_spb)
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem)
        self.verticalLayout_2.addLayout(self.horizontalLayout_3)
        self.layoutWidget = QtWidgets.QWidget(self.splitter)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.themeList_cbb = QtWidgets.QComboBox(self.layoutWidget)
        self.themeList_cbb.setObjectName(_fromUtf8("themeList_cbb"))
        self.horizontalLayout.addWidget(self.themeList_cbb)
        self.save_btn = QtWidgets.QPushButton(self.layoutWidget)
        self.save_btn.setMaximumSize(QtCore.QSize(60, 16777215))
        self.save_btn.setObjectName(_fromUtf8("save_btn"))
        self.horizontalLayout.addWidget(self.save_btn)
        self.del_btn = QtWidgets.QPushButton(self.layoutWidget)
        self.del_btn.setMaximumSize(QtCore.QSize(60, 16777215))
        self.del_btn.setObjectName(_fromUtf8("del_btn"))
        self.horizontalLayout.addWidget(self.del_btn)
        self.horizontalLayout.setStretch(0, 1)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.preview_ly = QtWidgets.QVBoxLayout()
        self.preview_ly.setObjectName(_fromUtf8("preview_ly"))
        self.verticalLayout.addLayout(self.preview_ly)
        self.verticalLayout.setStretch(1, 1)
        self.verticalLayout_3.addWidget(self.splitter)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        spacerItem1 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.apply_btn = QtWidgets.QPushButton(themeEditor)
        self.apply_btn.setObjectName(_fromUtf8("apply_btn"))
        self.horizontalLayout_2.addWidget(self.apply_btn)
        self.verticalLayout_3.addLayout(self.horizontalLayout_2)
        self.verticalLayout_3.setStretch(0, 1)

        self.retranslateUi(themeEditor)
        QtCore.QMetaObject.connectSlotsByName(themeEditor)
Esempio n. 12
0
    def init_widgets(self):

        c = QtWidgets.QComboBox(parent=self.parent())
        c.activated.connect(self.emit_changed)
        return (c, )
Esempio n. 13
0
    def __init__(self, parent=None):
        super(ReplaceReadNodeView, self).__init__(parent)
        self.setWindowTitle('Replace Read Node')
        self.resize(550, 120)
        self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowCloseButtonHint
                            | QtCore.Qt.WindowMinimizeButtonHint)

        main_layout = QtGui.QVBoxLayout(self)
        main_layout.setContentsMargins(5, 15, 5, 10)

        file_path_layout = QtGui.QHBoxLayout()
        file_path_label = QtGui.QLabel('The File Path')
        file_path_label.setAlignment(QtCore.Qt.AlignVCenter)
        file_path_label.setFixedWidth(80)
        file_path_label.setAlignment(QtCore.Qt.AlignRight)
        self.file_path_cbox = QtGui.QComboBox()
        self.file_path_cbox.setEditable(True)
        self.file_path_btn = QtGui.QToolButton()
        icon = QtGui.QIcon()
        icon.addPixmap(self.style().standardPixmap(
            QtGui.QStyle.SP_DirOpenIcon))
        self.file_path_btn.setIcon(icon)
        separator_label = QtGui.QLabel('Sep:')
        separator_label.setFixedWidth(30)
        self.separator_cbox = QtGui.QComboBox()
        self.separator_cbox.setFixedWidth(30)
        for separator in ['.', '_']:
            self.separator_cbox.addItem(separator)
        self.import_btn = QtGui.QPushButton('Import')
        self.import_btn.setFixedWidth(75)

        file_path_layout.addWidget(file_path_label)
        file_path_layout.addWidget(self.file_path_cbox)
        file_path_layout.addWidget(self.file_path_btn)
        file_path_layout.addWidget(separator_label)
        file_path_layout.addWidget(self.separator_cbox)
        file_path_layout.addWidget(self.import_btn)

        replace_grp = QtGui.QGroupBox('Replace')
        replace_layout = QtGui.QHBoxLayout(replace_grp)
        replace_layout.setContentsMargins(10, 15, 10, 15)
        shot_attr_layout = QtGui.QVBoxLayout()
        shot_attr_layout.setSpacing(20)
        current_shot_layout = QtGui.QHBoxLayout()
        current_shot_layout.setSpacing(3)
        current_shot_label = QtGui.QLabel('Current scene/shot no.')
        current_shot_label.setFixedWidth(130)
        current_shot_label.setAlignment(QtCore.Qt.AlignRight)
        self.current_shot_cbox = QtGui.QComboBox()
        self.current_shot_cbox.setEditable(True)
        current_shot_layout.addWidget(current_shot_label)
        current_shot_layout.addWidget(self.current_shot_cbox)
        new_shot_layout = QtGui.QHBoxLayout()
        new_shot_layout.setSpacing(3)
        new_shot_label = QtGui.QLabel('New scene/shot no.')
        new_shot_label.setFixedWidth(130)
        new_shot_label.setAlignment(QtCore.Qt.AlignRight)
        self.new_shot_le = QtGui.QLineEdit()
        new_shot_layout.addWidget(new_shot_label)
        new_shot_layout.addWidget(self.new_shot_le)

        shot_attr_layout.addLayout(current_shot_layout)
        shot_attr_layout.addLayout(new_shot_layout)

        self.replace_btn = QtGui.QPushButton('Replace')
        self.replace_btn.setFixedSize(75, 62)

        replace_layout.addLayout(shot_attr_layout)
        replace_layout.addWidget(self.replace_btn)

        button_layout = QtGui.QHBoxLayout()
        self.replace_and_import_btn = QtGui.QPushButton('Replace And Import')
        button_layout.addStretch()
        button_layout.addWidget(self.replace_and_import_btn)
        main_layout.addLayout(file_path_layout)
        main_layout.addWidget(replace_grp)
        main_layout.addLayout(button_layout)
def get_input(title, data, options=FormOptions()):
    """
    Get input from user
    
    If the user accepts the dialog then the current values will be
    written back to the data object.
    Note that for list queries this will change the value type!
    
    Args:
       title (str): Dialog title
       data (dict | OrderedDict): Input data to build tha dialog for
       options(FormOptions): Options to control dialog behavior
    
    Returns:
        bool: Returns True if dialog is accepted, False otherwise
    """
    dialog = QtWidgets.QDialog()
    dialog.setWindowTitle(title)

    layout = QtWidgets.QGridLayout(dialog)
    layout.setMargin(2)
    layout.setSpacing(4)

    widgets = {}

    for row, key in enumerate(data):
        label = QtWidgets.QLabel(key + ':')
        layout.addWidget(label)

        value = data[key]
        if isinstance(value, bool):
            widget = QtWidgets.QCheckBox()
            widget.setChecked(value)
            layout.addWidget(widget, row, 1)
            widgets[key] = widget
        elif isinstance(value, QtGui.QColor):
            widget = ColorSwatchButton()
            widget.set_color(value)
            layout.addWidget(widget, row, 1)
            widgets[key] = widget
        elif isinstance(value, float):
            widget = QtWidgets.QDoubleSpinBox()
            widget.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)
            widget.setMaximum(options.numeric_max)
            widget.setMinimum(options.numeric_min)
            widget.setDecimals(options.numeric_precision)
            widget.setValue(value)
            layout.addWidget(widget, row, 1)
            widgets[key] = widget
        elif isinstance(value, int):
            widget = QtWidgets.QSpinBox()
            widget.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)
            widget.setMaximum(options.numeric_max)
            widget.setMinimum(options.numeric_min)
            widget.setValue(value)
            layout.addWidget(widget, row, 1)
            widgets[key] = widget
        elif isinstance(value, basestring):
            widget = QtWidgets.QLineEdit(value)
            layout.addWidget(widget, row, 1)
            widgets[key] = widget
        elif isinstance(value, list):
            if options.list_displays_as_radios:
                widget = QtWidgets.QWidget()
                widget_layout = QtWidgets.QHBoxLayout(widget)
                widget_layout.setMargin(2)
                widget_layout.setSpacing(2)

                is_checked = False
                for item in value:
                    button = QtWidgets.QRadioButton(item)
                    widget_layout.addWidget(button)

                    if not is_checked:
                        button.setChecked(True)
                        is_checked = True

                layout.addWidget(widget, row, 1)
                widgets[key] = widget
            else:
                widget = QtWidgets.QComboBox()
                widget.addItems(value)
                layout.addWidget(widget, row, 1)
                widgets[key] = widget
        elif isinstance(value, QtGui.QVector2D) or isinstance(
                value, QtGui.QVector3D):
            widget = QtWidgets.QWidget()
            widget_layout = QtWidgets.QHBoxLayout(widget)
            widget_layout.setMargin(2)
            widget_layout.setSpacing(2)

            x_widget = QtWidgets.QDoubleSpinBox()
            x_widget.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)
            x_widget.setMaximum(options.numeric_max)
            x_widget.setMinimum(options.numeric_min)
            x_widget.setDecimals(options.numeric_precision)
            x_widget.setValue(value.x())

            y_widget = QtWidgets.QDoubleSpinBox()
            y_widget.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)
            y_widget.setMaximum(options.numeric_max)
            y_widget.setMinimum(options.numeric_min)
            y_widget.setDecimals(options.numeric_precision)
            y_widget.setValue(value.y())

            widget_layout.addWidget(x_widget)
            widget_layout.addWidget(y_widget)

            if isinstance(value, QtGui.QVector3D):
                z_widget = QtWidgets.QDoubleSpinBox()
                z_widget.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)
                z_widget.setMaximum(options.numeric_max)
                z_widget.setMinimum(options.numeric_min)
                z_widget.setDecimals(options.numeric_precision)
                z_widget.setValue(value.y())
                widget_layout.addWidget(z_widget)

            layout.addWidget(widget, row, 1)
            widgets[key] = widget
        else:
            raise ValueError(
                'Data of type "{}" is not supported!'.format(value_type))

    button_layout = QtWidgets.QHBoxLayout()
    button_layout.setMargin(2)
    button_layout.setSpacing(2)
    layout.addLayout(button_layout, row + 1, 0, 1, 2)

    ok_button = QtWidgets.QPushButton('Ok')
    ok_button.setDefault(True)
    ok_button.clicked.connect(dialog.accept)
    button_layout.addWidget(ok_button)

    cancel_button = QtWidgets.QPushButton('Cancel')
    cancel_button.clicked.connect(dialog.reject)
    button_layout.addWidget(cancel_button)

    if dialog.exec_() != QtWidgets.QDialog.Accepted:
        dialog.deleteLater()
        return False

    for key in data:
        value = data[key]
        if isinstance(value, bool):
            data[key] = widgets[key].isChecked()
        elif isinstance(value, QtGui.QColor):
            data[key] = widgets[key].color()
        elif isinstance(value, float) or isinstance(value, int):
            data[key] = widgets[key].value()
        elif isinstance(value, basestring):
            data[key] = widgets[key].text()
        elif isinstance(value, list):
            if options.list_displays_as_radios:
                children = widgets[key].children()
                for index, child in enumerate(children):
                    if not isinstance(child, QtWidgets.QRadioButton):
                        continue

                    if child.isChecked():
                        if options.list_returns_index:
                            data[key] = index
                        else:
                            data[key] = child.text()
            else:
                if options.list_returns_index:
                    data[key] = widgets[key].currentIndex()
                else:
                    data[key] = widgets[key].currentText()
        elif isinstance(value, QtGui.QVector2D):
            children = widgets[key].children()
            data[key] = QtGui.QVector2D(children[1].value(),
                                        children[2].value())
        elif isinstance(value, QtGui.QVector3D):
            children = widgets[key].children()
            data[key] = QtGui.QVector3D(children[1].value(),
                                        children[2].value(),
                                        children[3].value())

    dialog.deleteLater()
    return True
Esempio n. 15
0
    def __init__(self, ui_file):
        super(SoftwareManagerGUI, self).__init__()
        # parent custom widget
        RenderAwesomeUI(ui_file=ui_file, parent_widget=self, css_file=CSS_FILE)
        # init attribute
        self.offset = None
        self.app_launchers = htk.get_launchers()
        self.resources = HZResources()
        self.user_name = env.USERNAME.string
        self.local_profile_folder = get_local_profile_dir()
        self.drag_file = ''
        self.wrappers_dir = WRAPPERS
        self.app_dir = APP_DIR
        self.icon_combo_box = QtWidgets.QComboBox()
        self.user_image = htk.pathjoin(self.local_profile_folder, "user.png")
        self.delete = False
        self.gui_show = True
        self.drag_pos = QtCore.QPoint(0, 0)
        self.right_button = False
        self.background_image = None
        _image = om.read(self.local_profile_folder, 'skin')

        # init windows
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Window
                            | QtCore.Qt.WindowStaysOnTopHint
                            | QtCore.Qt.WindowSoftkeysRespondHint)
        self.comboBox_project_list.addItems(self.get_project_list())

        self.set_current_project()

        self.icon_combo_box.addItem(self.icon("default_software_icon.png"),
                                    "Dmyz")
        self.quit_action = QtWidgets.QAction(
            "exit", self, triggered=QtWidgets.QApplication.quit)
        open_log_action = QtWidgets.QAction("Explore Log Folder ",
                                            self,
                                            triggered=self.go_to_log_folder)

        self.open_local_folder = QtWidgets.QAction(
            "Open Local Settings Folder",
            self,
            triggered=self.explore_local_settings_folder)
        project_manager_action = QtWidgets.QAction(
            "project manager", self, triggered=self.go_to_log_folder)

        self.tray_icon_menu = QtWidgets.QMenu(self)
        if _image:
            self.background_image = _image.encode("utf-8").replace("\\", "/")

        self.skin_action = QtWidgets.QAction('Skin Store',
                                             self,
                                             triggered=self.show_skin_widget)

        self.change_css = QtWidgets.QMenu('Change CSS', self.tray_icon_menu)

        default = QtWidgets.QAction("default",
                                    self.change_css,
                                    triggered=self.change_css_default)

        self.change_css.addAction(default)

        self.tray_icon_menu.addAction(self.skin_action)

        self.tray_icon_menu.addAction(self.open_local_folder)

        self.tray_icon_menu.addAction(project_manager_action)

        self.tray_icon_menu.addAction(open_log_action)

        random_skin_aciton = self._action("random_skin", self._skin_timer)
        random_skin_aciton.setCheckable(True)
        status = om.read(self.local_profile_folder, "random_skin")
        if status:
            random_skin_aciton.setChecked(status)

        self.tray_icon_menu.addAction(random_skin_aciton)

        self.tray_icon_menu.addMenu(self.change_css)
        self.tray_icon_menu.addAction(self.quit_action)
        gif_file = HZResources.get_icon_resources("default_software_icon.gif")
        self.tray_icon = AnimatedSystemTrayIcon(QtGui.QMovie(gif_file), self)
        self.tray_icon.setContextMenu(self.tray_icon_menu)
        self.icon_combo_box.currentIndexChanged.connect(self.set_icon)
        self.setWindowIcon(self.icon("default_software_icon.png"))
        self.icon_combo_box.setCurrentIndex(1)
        self.tray_icon.show()
        self.tray_icon.setToolTip('HZ')
        self.tray_icon.activated.connect(self.icon_activated)
        self.setAcceptDrops(True)
        self.set_transparency(True)

        if os.path.isfile(self.user_image):
            self.user_button.setIcon(
                self.create_round_thumbnail(self.user_image))
        else:
            self.user_button.setIcon(
                self.create_round_thumbnail(
                    self.icon("default_user_thumb.png", True)))

        self.pushButton_bottom_icon.setIcon(self.icon("software_name.png"))
        self.pushButton_top_icon.setIcon(self.icon("hz_label.png"))
        self.pushButton_hide.setIcon(self.icon("software_manager_hide.png"))
        self.pushButton_close.setIcon(self.icon("software_manager_close.png"))
        self.pushButton_hide.clicked.connect(self.close)
        self.pushButton_close.clicked.connect(QtWidgets.QApplication.quit)
        self.tool_box = QtWidgets.QToolBox()
        self.software_commands = QtWidgets.QListWidget(self)
        self.software_commands.itemDoubleClicked.connect(self.launch)
        self.software_commands.setContextMenuPolicy(
            QtCore.Qt.ActionsContextMenu)
        self.verticalLayout_3.addWidget(self.software_commands)
        self.search_text.textChanged.connect(self.search_software)
        self.pushButton_bottom_icon.clicked.connect(self.popup_web)

        self.user_menu = QtWidgets.QMenu(self)

        self.user_menu.addSeparator()

        user_action = QtWidgets.QAction("change user image",
                                        self,
                                        triggered=self.set_user_image)

        self.user_menu.addAction(user_action)

        self.user_button.setMenu(self.user_menu)

        self.desktop = QtWidgets.QDesktopWidget()

        self.move(self.desktop.availableGeometry().width() - self.width(),
                  self.desktop.availableGeometry().height() - self.height())

        self.save_current_project()
        self.set_items()
        self.comboBox_project_list.activated.connect(self.set_items)
        self.update_info_file = htk.pathjoin(self.resources.resources_root,
                                             'update.txt')
        self.file_watcher = QtCore.QFileSystemWatcher([self.update_info_file])
        self.file_watcher.fileChanged.connect(self.on_file_changed)
        self.timer = QtCore.QTimer(self)
        self.timer.timeout.connect(self.time_task)
        self.timer.start(1000)
        if self.background_image:
            self.set_background_image_css(
                self.background_image.decode("utf-8"))
        else:
            self.set_background_image_css(self.get_skin())
        self.skin_timer = QtCore.QTimer(self)
        self.skin_timer.timeout.connect(self.random_skin)
        if status:
            self.skin_timer.start(20000)
Esempio n. 16
0
    def setup_ui(self):
        # Set up basic dimensions and central layout
        self.program_title = 'NoteTaker'
        self.resize(850, 600)
        self.centralwidget = QtWidgets.QWidget(self)
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)

        # Define database configuration widget
        self.dbconfigFrame = QtWidgets.QFrame(self.centralwidget)
        # self.dbconfigFrame.setMaximumSize(QtCore.QSize(16777215, 55))
        self.dbconfigHorizontalLayout = QtWidgets.QHBoxLayout(
            self.dbconfigFrame)
        self.dbconfigHorizontalLayout.setContentsMargins(0, -1, -1, -1)
        self.dbconfigLabel = QtWidgets.QLabel(self.dbconfigFrame)
        self.dbconfigLabel.setText('Notes Database Path')
        self.dbconfigHorizontalLayout.addWidget(self.dbconfigLabel)
        self.dbconfigLineEdit = QtWidgets.QLineEdit(self.dbconfigFrame)
        self.dbconfigComboBox = QtWidgets.QComboBox(self.dbconfigFrame)
        self.dbconfigComboBox.setEditable(True)
        self.dbconfigComboBox.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Preferred)
        self.dbconfigComboBox.setLineEdit(self.dbconfigLineEdit)
        # TODO: Remember database from previous session and open automatically
        # TODO: Make this field an editable dropdown that remembers up to N previous databases
        self.dbconfigLineEdit.setText('notes.db')
        # Set up data model
        self.sourceTableModel = NoteTakerTableModel(
            self.db_type, self.dbconfigLineEdit.text())
        self.current_db = self.dbconfigLineEdit.text()
        self.proxyTableModel = NoteTakerSortFilterProxyModel()
        self.proxyTableModel.setSourceModel(self.sourceTableModel)
        # TODO: Add dropdown to select db type (or detect automatically)
        # self.dbconfigHorizontalLayout.addWidget(self.dbconfigLineEdit)
        self.dbconfigHorizontalLayout.addWidget(self.dbconfigComboBox)
        self.browseDatabaseButton = QtWidgets.QPushButton(self.dbconfigFrame)
        self.browseDatabaseButton.setText('Browse for database')
        self.browseDatabaseButton.clicked.connect(self.browse_db_connection)
        self.dbconfigHorizontalLayout.addWidget(self.browseDatabaseButton)
        self.loadDatabaseButton = QtWidgets.QPushButton(self.dbconfigFrame)
        self.loadDatabaseButton.setText('Load selected database')
        self.loadDatabaseButton.clicked.connect(self.load_database)
        self.dbconfigHorizontalLayout.addWidget(self.loadDatabaseButton)
        self.verticalLayout.addWidget(self.dbconfigFrame)

        # Define text filter
        self.filterFrame = QtWidgets.QFrame(self.centralwidget)
        # self.filterFrame.setMaximumSize(QtCore.QSize(16777215, 55))
        self.filterHorizontalLayout = QtWidgets.QHBoxLayout(self.filterFrame)
        self.filterHorizontalLayout.setContentsMargins(0, -1, -1, -1)
        self.filterHorizontalLabel = QtWidgets.QLabel(self.filterFrame)
        self.filterHorizontalLabel.setText('Filter')
        self.filterHorizontalLayout.addWidget(self.filterHorizontalLabel)
        self.filterLineEdit = QtWidgets.QLineEdit(self.filterFrame)
        # TODO: Implement find-as-you-type to encompass date
        self.filterLineEdit.textChanged.connect(self.filter_view)
        self.filterHorizontalLayout.addWidget(self.filterLineEdit)
        self.verticalLayout.addWidget(self.filterFrame)

        # Define View and Edit windows
        self.splitter = QtWidgets.QSplitter(self.centralwidget)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setHandleWidth(10)
        self.splitter.setChildrenCollapsible(False)
        self.tableView = QtWidgets.QTableView(self.splitter)
        self.tableView.setModel(self.proxyTableModel)
        self.tableView.setFont(
            QtGui.QFont('Courier New'))  # Probably not cross platform
        self.tableView.resizeColumnsToContents()
        self.tableView.setSortingEnabled(True)
        # TODO: Fix sorting (most recent at bottom)
        # __binding__ checks are to handle a caveat https://github.com/mottosso/Qt.py/blob/master/CAVEATS.md#qtwidgetsqheaderviewsetresizemode
        if __binding__ in ("PyQt4", "PySide"):
            self.tableView.horizontalHeader().setResizeMode(
                1, QtWidgets.QHeaderView.Stretch)
        else:
            self.tableView.horizontalHeader().setSectionResizeMode(
                1, QtWidgets.QHeaderView.Stretch)
        self.tableView.sortByColumn(0, QtCore.Qt.AscendingOrder)
        if __binding__ in ("PyQt4", "PySide"):
            self.tableView.verticalHeader().setResizeMode(
                QtWidgets.QHeaderView.ResizeToContents)
        else:
            self.tableView.verticalHeader().setSectionResizeMode(
                QtWidgets.QHeaderView.ResizeToContents)
        self.noteFrame = QtWidgets.QFrame(self.splitter)
        self.noteFrame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.noteFrame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.noteFrame)
        self.horizontalLayout.setContentsMargins(0, -1, -1, -1)
        self.textEdit = PlainTextEditWithAttachments(self.noteFrame)
        self.textEdit.setFont(
            QtGui.QFont('Courier New'))  # Probably not cross platform
        self.textEdit.viewport().setProperty(
            "cursor", QtGui.QCursor(QtCore.Qt.IBeamCursor))
        self.horizontalLayout.addWidget(self.textEdit)
        self.attachmentWidget = QtWidgets.QListWidget()
        self.attachmentWidget.hide()
        self.horizontalLayout.addWidget(self.attachmentWidget)
        self.commitButton = QtWidgets.QPushButton(self.noteFrame)
        self.commitButton.setText('Commit')
        self.commitButton.setStatusTip(
            'Click or press Control+Enter to commit this message to the database'
        )
        self.commitButton.clicked.connect(self.commit_new_note)
        QtWidgets.QShortcut(QtGui.QKeySequence('Ctrl+Return'), self,
                            self.commit_new_note)
        QtWidgets.QShortcut(QtGui.QKeySequence('Ctrl+Enter'), self,
                            self.commit_new_note)
        self.horizontalLayout.addWidget(self.commitButton)
        self.verticalLayout.addWidget(self.splitter)

        # Define statusbar and toolbar
        self.statusbar = QtWidgets.QStatusBar(self)
        self.setStatusBar(self.statusbar)

        # TODO: Allow user to create custom hotkey-able buttons to insert common text e.g. "Test complete. Pass"
        self.toolBar = QtWidgets.QToolBar(self)
        self.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)

        # Define the menu
        self.menubar = QtWidgets.QMenuBar()
        self.menuFile = self.menubar.addMenu('&File')
        self.menuEdit = self.menubar.addMenu('&Edit')
        self.menuHelp = self.menubar.addMenu('&Help')
        self.setMenuBar(self.menubar)

        # File menu options
        self.actionLoad = QtWidgets.QAction(
            QtGui.QIcon.fromTheme("document-open"), '&Load Database', self)
        self.actionLoad.setShortcut('Ctrl+L')
        self.actionLoad.setStatusTip('Load a NoteTaker database')
        self.actionLoad.triggered.connect(self.browse_db_connection)

        self.actionExport = QtWidgets.QAction(
            QtGui.QIcon.fromTheme("document-save-as"), '&Export Notes', self)
        self.actionExport.setShortcut('Ctrl+S')
        self.actionExport.setStatusTip('Export notes')
        self.actionExport.triggered.connect(self.onExportClicked)

        self.actionExit = QtWidgets.QAction('&Exit', self)
        self.actionExit.setShortcut('Ctrl+Q')
        self.actionExit.setStatusTip('Exit application')
        self.actionExit.triggered.connect(self._exit)

        # Edit menu options
        self.actionPrefs = QtWidgets.QAction('&Preferences', self)
        self.actionPrefs.setShortcut('Ctrl+P')
        self.actionPrefs.setStatusTip('Edit preferences')
        # self.actioPrefs.triggered.connect(self.onPrefsClicked)

        self.userDialog = QtWidgets.QAction('&Change User', self)
        self.userDialog.setStatusTip('Change currently logged in user')
        self.userDialog.triggered.connect(self.user_dialog)

        # Help Menu options
        self.actionAbout = QtWidgets.QAction(
            QtGui.QIcon.fromTheme('system-help'), '&About', self)
        self.actionAbout.setStatusTip('Version and Copyright information')
        self.actionAbout.triggered.connect(self._about)

        self.menuFile.addAction(self.actionLoad)
        self.menuFile.addAction(self.actionExport)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionExit)
        self.menuHelp.addAction(self.actionAbout)
        self.menuEdit.addAction(self.actionPrefs)
        self.menuEdit.addAction(self.userDialog)
        self.menuHelp.addAction(self.actionAbout)
        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuEdit.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())

        self.setWindowTitle('{} - {} - {}'.format(self.program_title,
                                                  self.current_user,
                                                  self.current_db))

        self.setCentralWidget(self.centralwidget)
Esempio n. 17
0
    def __init__(self, task_id=None, parent=None):
        super(CommentWidget, self).__init__(parent)

        # Breadcrumbs
        breadcrumbs = TaskBreadcrumb()

        # Thumbnail
        thumbnail_label = QtWidgets.QLabel("Take a screenshot:")
        thumbnail = DragDropLabel()
        thumbnail.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                QtWidgets.QSizePolicy.Expanding)
        thumbnail.setAlignment(QtCore.Qt.AlignCenter)
        thumbnail.setFrameStyle(QtWidgets.QFrame.StyledPanel)
        thumbnail.setToolTip("Left-click to take new screenshot")
        thumbnail.setStyleSheet("QLabel { background-color : #333333; }")
        thumbnail.setMinimumSize(240, 160)
        thumbnail.clicked.connect(self.on_thumbnail_clicked)
        thumbnail.dropped.connect(self.on_thumbnail_dropped)

        # Whenever we drop an attachment that cannot be previewed as image
        # then we display the "path" to the file - to ensure we read as
        # much as possible of it let it word wrap.
        thumbnail.setWordWrap(True)

        pixmap = QtGui.QPixmap()
        pixmap.load(PLACEHOLDER)
        thumbnail.setPixmap(pixmap)

        # Comment
        comment_label = QtWidgets.QLabel("Comment:")
        comment = QtWidgets.QTextEdit()
        comment.setTabChangesFocus(True)

        # Task Status
        status = QtWidgets.QComboBox()
        # force custom list view so we can customize item stylesheet
        # todo: avoid this hack for forcing our style change?
        view = QtWidgets.QListView()
        view.setSpacing(4)
        status.setView(view)
        status.setStyleSheet(
            "QComboBox QAbstractItemView::item { padding: 3px; }"
        )

        # Create buttons
        submit_button = QtWidgets.QPushButton("Submit")
        submit_button.clicked.connect(self.submit)

        buttons_layout = QtWidgets.QHBoxLayout()
        buttons_layout.addStretch()
        buttons_layout.addWidget(submit_button)

        main_layout = QtWidgets.QVBoxLayout(self)
        main_layout.addWidget(breadcrumbs)
        main_layout.addWidget(thumbnail_label)
        main_layout.addWidget(thumbnail)
        main_layout.addWidget(comment_label)
        main_layout.addWidget(comment)
        main_layout.addWidget(status)
        main_layout.addLayout(buttons_layout)

        self.breadcrumbs = breadcrumbs
        self.thumbnail_label = thumbnail_label
        self.thumbnail = thumbnail
        self.status = status
        self.comment = comment
        self.buttons = [submit_button]

        self._close_on_submit = True
        self._allow_screenshot = True
        self._screenshot = None # Pixmap storage for screenshot
        self._attachment = None

        self.setWindowTitle("Submit comment to CG-Wire")
        self.resize(350, 400)

        self.refresh_all_task_statuses()

        # Set the task
        if task_id is not None:
            self.set_task(task_id)
Esempio n. 18
0
    def __init__(self, ctrName=None, nodeName=None, parent=getMayaWindow()):
        super(AnamorphosisLinkUI, self).__init__(parent)
        self.colorMapDict = {
            0: [(0, 0, 0), 1.0],
            1: [(255, 255, 255), 0.9],
            2: [(255, 0, 0), 0.00],
            3: [(0, 255, 0), 0.30],
            4: [(0, 0, 255), 0.65],
            5: [(255, 255, 0), 0.15],
            6: [(255, 108, 49), 0.10],
            7: [(5, 220, 255), 0.50],
            8: [(200, 0, 200), 0.85],
            9: [(72, 72, 72), 0.283],
            10: [(171, 171, 171), 0.671]
        }

        self.ctrName = ctrName
        self.nodeName = nodeName
        self.geoName = None

        self.resize(460, 300)

        self.tabWidget = QtWidgets.QTabWidget(self)
        self.tabWidget.setGeometry(self.geometry())
        self.tabWidget.setTabPosition(QtWidgets.QTabWidget.North)
        self.tabWidget.setTabShape(QtWidgets.QTabWidget.Rounded)
        self.tabWidget.setElideMode(QtCore.Qt.ElideNone)
        self.tabWidget.setMovable(False)
        self.tabWidget.setStyleSheet('background-color: rgb(68, 68, 68);')

        self.tab_1 = QtWidgets.QWidget()
        self.tabWidget.addTab(self.tab_1, 'Hi File')
        #self.tab_1.setStyleSheet('color: rgb(0, 181, 0);')

        #self.hiLine = Splitter('Hi File' ,self.tab)
        #self.hiLine.setGeometry(QtCore.QRect(5, 5, 460, 20))

        self.hiGroupBox = QtWidgets.QGroupBox('Get Control And SG Node Name',
                                              self.tab_1)
        self.hiGroupBox.setGeometry(QtCore.QRect(5, 5, 450, 260))

        self.stlabel = QtWidgets.QLabel('Automatic Access To The Node :',
                                        self.hiGroupBox)
        self.stlabel.setGeometry(QtCore.QRect(10, 20, 170, 20))
        self.stlabel.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft
                                  | QtCore.Qt.AlignVCenter)
        self.stlabel.setStyleSheet('color: rgb(255, 0, 0);')

        self.stButton = QtWidgets.QPushButton('Get All SG', self.hiGroupBox)
        self.stButton.setGeometry(QtCore.QRect(190, 20, 80, 20))
        self.stButton.setStyleSheet(
            'color: rgb(255, 0, 0);\nbackground-color: rgb(255, 255, 0);')

        self.hiLine = Splitter('Below So', self.hiGroupBox)
        self.hiLine.setGeometry(QtCore.QRect(5, 40, 440, 20))

        self.qGroupBox = QtWidgets.QGroupBox(self.hiGroupBox)
        self.qGroupBox.setGeometry(QtCore.QRect(5, 65, 440, 100))

        self.label1 = QtWidgets.QLabel('Control Name', self.qGroupBox)
        self.label1.setGeometry(QtCore.QRect(5, 10, 70, 20))
        self.label1.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignRight
                                 | QtCore.Qt.AlignVCenter)

        self.linetxt1 = QtWidgets.QLineEdit(self.qGroupBox)
        self.linetxt1.setGeometry(QtCore.QRect(85, 10, 60, 20))
        self.linetxt1.setStyleSheet('background-color: rgb(42, 42, 42);')

        self.PushButton1 = QtWidgets.QPushButton('Get', self.qGroupBox)
        self.PushButton1.setGeometry(QtCore.QRect(155, 10, 50, 20))
        self.PushButton1.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.comBox = QtWidgets.QComboBox(self.qGroupBox)
        self.comBox.setGeometry(QtCore.QRect(375, 10, 60, 20))
        self.comBox.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.label1add = QtWidgets.QLabel('Attribute', self.qGroupBox)
        self.label1add.setGeometry(QtCore.QRect(215, 10, 50, 20))
        self.label1add.setAlignment(QtCore.Qt.AlignLeading
                                    | QtCore.Qt.AlignRight
                                    | QtCore.Qt.AlignVCenter)

        self.comBoxAdd = QtWidgets.QComboBox(self.qGroupBox)
        self.comBoxAdd.setGeometry(QtCore.QRect(275, 10, 90, 20))
        self.comBoxAdd.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.labelm = QtWidgets.QLabel('Tou Geo Name', self.qGroupBox)
        self.labelm.setGeometry(QtCore.QRect(5, 40, 80, 20))
        self.labelm.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignRight
                                 | QtCore.Qt.AlignVCenter)

        self.linetxtm = QtWidgets.QLineEdit(self.qGroupBox)
        self.linetxtm.setGeometry(QtCore.QRect(95, 40, 180, 20))
        self.linetxtm.setStyleSheet('background-color: rgb(42, 42, 42);')

        self.PushButtonm = QtWidgets.QPushButton('Get', self.qGroupBox)
        self.PushButtonm.setGeometry(QtCore.QRect(285, 40, 50, 20))
        self.PushButtonm.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.label2 = QtWidgets.QLabel('SG Node Name', self.qGroupBox)
        self.label2.setGeometry(QtCore.QRect(5, 70, 80, 20))
        self.label2.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignRight
                                 | QtCore.Qt.AlignVCenter)

        self.linetxt2 = QtWidgets.QLineEdit(self.qGroupBox)
        self.linetxt2.setGeometry(QtCore.QRect(95, 70, 180, 20))
        self.linetxt2.setStyleSheet('background-color: rgb(42, 42, 42);')

        self.PushButton2 = QtWidgets.QPushButton('Get', self.qGroupBox)
        self.PushButton2.setGeometry(QtCore.QRect(285, 70, 50, 20))
        self.PushButton2.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.linetxt3 = QtWidgets.QLineEdit(self.qGroupBox)
        self.linetxt3.setGeometry(QtCore.QRect(345, 70, 90, 20))
        self.linetxt3.setStyleSheet('background-color: rgb(42, 42, 42);')

        self.line1 = Splitter(parent=self.hiGroupBox,
                              shadow=False,
                              color=(60, 60, 60))
        self.line1.setGeometry(QtCore.QRect(40, 165, 370, 20))

        self.gropWid = QtWidgets.QWidget(self.hiGroupBox)
        self.gropWid.setGeometry(QtCore.QRect(5, 180, 440, 30))

        self.qGrid2 = QtWidgets.QGridLayout(self.gropWid)
        self.qGrid2.setContentsMargins(4, 2, 4, 2)

        self.colotButtonList = [
            self.colotButton(i, self.qGrid2) for i in range(11)
        ]

        self.okButton = QtWidgets.QPushButton('Set Driven Keyframe',
                                              self.hiGroupBox)
        self.okButton.setGeometry(QtCore.QRect(5, 220, 440, 30))
        self.okButton.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.tab_2 = QtWidgets.QWidget()
        self.tabWidget.addTab(self.tab_2, 'Low File')
        #self.tab_2.setStyleSheet('color: rgb(0, 181, 0);')

        sTex1 = QtWidgets.QLabel('Method :', self.tab_2)
        sTex1.setGeometry(QtCore.QRect(5, 5, 450, 20))
        sTex1.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignHCenter
                           | QtCore.Qt.AlignVCenter)

        sTex2 = QtWidgets.QLabel('1. Open Low File', self.tab_2)
        sTex2.setGeometry(QtCore.QRect(5, 30, 450, 20))
        sTex2.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignHCenter
                           | QtCore.Qt.AlignVCenter)

        sTex3 = QtWidgets.QLabel('2. Reference Hi file ', self.tab_2)
        sTex3.setGeometry(QtCore.QRect(5, 55, 450, 20))
        sTex3.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignHCenter
                           | QtCore.Qt.AlignVCenter)

        self.lowGroupBox = QtWidgets.QGroupBox('Reference Hi File', self.tab_2)
        self.lowGroupBox.setGeometry(QtCore.QRect(5, 85, 450, 160))

        self.label = QtWidgets.QLabel('Low Control :', self.lowGroupBox)
        self.label.setGeometry(QtCore.QRect(10, 20, 80, 20))
        self.label.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignRight
                                | QtCore.Qt.AlignVCenter)

        self.lineEdit = QtWidgets.QLineEdit(self.lowGroupBox)
        self.lineEdit.setGeometry(QtCore.QRect(100, 20, 231, 20))
        self.lineEdit.setStyleSheet('background-color: rgb(42, 42, 42);')

        self.pushButton = QtWidgets.QPushButton('Get', self.lowGroupBox)
        self.pushButton.setGeometry(QtCore.QRect(350, 20, 81, 20))
        self.pushButton.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.label_2 = QtWidgets.QLabel('Hi Mesh :', self.lowGroupBox)
        self.label_2.setGeometry(QtCore.QRect(10, 50, 80, 20))
        self.label_2.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignVCenter)

        self.lineEdit_2 = QtWidgets.QLineEdit(self.lowGroupBox)
        self.lineEdit_2.setGeometry(QtCore.QRect(100, 50, 231, 20))
        self.lineEdit_2.setStyleSheet('background-color: rgb(42, 42, 42);')

        self.pushButton_2 = QtWidgets.QPushButton('Get', self.lowGroupBox)
        self.pushButton_2.setGeometry(QtCore.QRect(350, 50, 81, 23))
        self.pushButton_2.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.label_3 = QtWidgets.QLabel('Low Mesh :', self.lowGroupBox)
        self.label_3.setGeometry(QtCore.QRect(10, 80, 80, 20))
        self.label_3.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignVCenter)

        self.lineEdit_3 = QtWidgets.QLineEdit(self.lowGroupBox)
        self.lineEdit_3.setGeometry(QtCore.QRect(100, 80, 231, 20))
        self.lineEdit_3.setStyleSheet('background-color: rgb(42, 42, 42);')

        self.pushButton_3 = QtWidgets.QPushButton('Get', self.lowGroupBox)
        self.pushButton_3.setGeometry(QtCore.QRect(350, 80, 81, 23))
        self.pushButton_3.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.line = QtWidgets.QFrame(self.lowGroupBox)
        self.line.setGeometry(QtCore.QRect(10, 100, 431, 20))
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)

        self.pushButton_4 = QtWidgets.QPushButton('Transfer', self.lowGroupBox)
        self.pushButton_4.setGeometry(QtCore.QRect(10, 120, 431, 30))
        self.pushButton_4.setStyleSheet('background-color: rgb(98, 98, 98);')

        self.makeConnections()
        self.setWindowTitle("SG Node UI")

        self.setMinimumSize(QtCore.QSize(460, 300))
        self.setMaximumSize(QtCore.QSize(460, 300))
        self.initUiState()
        self.show()
Esempio n. 19
0
    def build_ui(self):
        self.newWindow.resize(1400, 800)
        self.newWindow.setWindowTitle(self.ui_name)
        self.all_layout = QtWidgets.QVBoxLayout(self.newWindow)
        self.main_widget = QtWidgets.QWidget(self.newWindow)
        self.main_Layout = QtWidgets.QHBoxLayout(self.main_widget)
        self.main_Layout.setContentsMargins(0, 0, 0, 0)

        self.render_in_Layout = QtWidgets.QVBoxLayout()
        self.render_in_box = QtWidgets.QComboBox(self.main_widget)
        self.render_in_box.currentIndexChanged.connect(self.populate_render_in)
        self.render_in_Layout.addWidget(self.render_in_box)

        self.checks_layout_in = QtWidgets.QHBoxLayout()

        self.inherited_check_in = QtWidgets.QCheckBox(self.main_widget)
        self.inherited_check_in.setText("Inherited")
        self.inherited_check_in.setChecked(True)
        self.inherited_check_in.stateChanged.connect(self.populate_render_in)
        self.checks_layout_in.addWidget(self.inherited_check_in)

        self.maps_check_in = QtWidgets.QCheckBox(self.main_widget)
        self.maps_check_in.setText("Float3")
        self.maps_check_in.setChecked(True)
        self.maps_check_in.stateChanged.connect(self.populate_render_in)
        self.checks_layout_in.addWidget(self.maps_check_in)

        self.float_check_in = QtWidgets.QCheckBox(self.main_widget)
        self.float_check_in.setText("Float")
        self.float_check_in.setChecked(True)
        self.float_check_in.stateChanged.connect(self.populate_render_in)
        self.checks_layout_in.addWidget(self.float_check_in)

        self.integer_check_in = QtWidgets.QCheckBox(self.main_widget)
        self.integer_check_in.setText("Integer")
        self.integer_check_in.setChecked(True)
        self.integer_check_in.stateChanged.connect(self.populate_render_in)
        self.checks_layout_in.addWidget(self.integer_check_in)

        self.bool_check_in = QtWidgets.QCheckBox(self.main_widget)
        self.bool_check_in.setText("Bool")
        self.bool_check_in.setChecked(True)
        self.bool_check_in.stateChanged.connect(self.populate_render_in)
        self.checks_layout_in.addWidget(self.bool_check_in)

        self.other_check_in = QtWidgets.QCheckBox(self.main_widget)
        self.other_check_in.setText("Other")
        self.other_check_in.setChecked(True)
        self.other_check_in.stateChanged.connect(self.populate_render_in)
        self.checks_layout_in.addWidget(self.other_check_in)

        self.expand_button_in = QtWidgets.QPushButton(self.main_widget)
        self.expand_button_in.setText("+")
        self.expand_button_in.setMaximumSize(25, 25)
        self.checks_layout_in.addWidget(self.expand_button_in)

        self.collapse_button_in = QtWidgets.QPushButton(self.main_widget)
        self.collapse_button_in.setText("-")
        self.collapse_button_in.setMaximumSize(25, 25)
        self.checks_layout_in.addWidget(self.collapse_button_in)

        self.render_in_Layout.addLayout(self.checks_layout_in)

        self.render_in_tree = QtWidgets.QTreeWidget(self.main_widget)
        self.render_in_tree.setAutoFillBackground(True)
        self.render_in_tree.setAlternatingRowColors(True)
        self.render_in_tree.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.render_in_tree.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.render_in_tree.setColumnCount(3)
        self.render_in_tree.setHeaderHidden(True)

        self.render_in_Layout.addWidget(self.render_in_tree)

        self.main_Layout.addLayout(self.render_in_Layout)

        self.render_out_Layout = QtWidgets.QVBoxLayout()
        self.render_out_box = QtWidgets.QComboBox(self.main_widget)
        self.render_out_box.currentIndexChanged.connect(
            self.populate_render_out)
        self.render_out_Layout.addWidget(self.render_out_box)

        self.checks_layout_out = QtWidgets.QHBoxLayout()

        self.inherited_check_out = QtWidgets.QCheckBox(self.main_widget)
        self.inherited_check_out.setText("Inherited")
        self.inherited_check_out.setChecked(True)
        self.inherited_check_out.stateChanged.connect(self.populate_render_out)
        self.checks_layout_out.addWidget(self.inherited_check_out)

        self.maps_check_out = QtWidgets.QCheckBox(self.main_widget)
        self.maps_check_out.setText("Float3")
        self.maps_check_out.setChecked(True)
        self.maps_check_out.stateChanged.connect(self.populate_render_out)
        self.checks_layout_out.addWidget(self.maps_check_out)

        self.float_check_out = QtWidgets.QCheckBox(self.main_widget)
        self.float_check_out.setText("Float")
        self.float_check_out.setChecked(True)
        self.float_check_out.stateChanged.connect(self.populate_render_out)
        self.checks_layout_out.addWidget(self.float_check_out)

        self.integer_check_out = QtWidgets.QCheckBox(self.main_widget)
        self.integer_check_out.setText("Integer")
        self.integer_check_out.setChecked(True)
        self.integer_check_out.stateChanged.connect(self.populate_render_out)
        self.checks_layout_out.addWidget(self.integer_check_out)

        self.bool_check_out = QtWidgets.QCheckBox(self.main_widget)
        self.bool_check_out.setText("Bool")
        self.bool_check_out.setChecked(True)
        self.bool_check_out.stateChanged.connect(self.populate_render_out)
        self.checks_layout_out.addWidget(self.bool_check_out)

        self.other_check_out = QtWidgets.QCheckBox(self.main_widget)
        self.other_check_out.setText("Other")
        self.other_check_out.setChecked(True)
        self.other_check_out.stateChanged.connect(self.populate_render_out)
        self.checks_layout_out.addWidget(self.other_check_out)

        self.expand_button_out = QtWidgets.QPushButton(self.main_widget)
        self.expand_button_out.setText("+")
        self.expand_button_out.setMaximumSize(25, 25)
        self.checks_layout_out.addWidget(self.expand_button_out)

        self.collapse_button_out = QtWidgets.QPushButton(self.main_widget)
        self.collapse_button_out.setText("-")
        self.collapse_button_out.setMaximumSize(25, 25)
        self.checks_layout_out.addWidget(self.collapse_button_out)

        self.render_out_Layout.addLayout(self.checks_layout_out)

        self.render_out_tree = QtWidgets.QTreeWidget(self.main_widget)
        self.render_out_tree.setAutoFillBackground(True)
        self.render_out_tree.setAlternatingRowColors(True)
        self.render_out_tree.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.render_out_tree.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.render_out_tree.setColumnCount(3)
        self.render_out_tree.setHeaderHidden(True)
        self.render_out_Layout.addWidget(self.render_out_tree)
        self.main_Layout.addLayout(self.render_out_Layout)

        self.match_widget = QtWidgets.QWidget(self.main_widget)
        self.match_layout = QtWidgets.QVBoxLayout(self.match_widget)

        self.match_button = QtWidgets.QPushButton(self.main_widget)
        self.match_button.setMinimumSize(15, 600)
        self.match_button.setMaximumSize(25, 700)
        self.match_button.clicked.connect(self.match_selection)
        self.match_layout.addWidget(self.match_button)

        self.main_Layout.addWidget(self.match_widget)

        self.render_tree = QtWidgets.QTreeWidget(self.main_widget)
        self.render_tree.setAutoFillBackground(True)
        self.render_tree.setAlternatingRowColors(True)
        self.render_tree.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.render_tree.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.render_tree.setColumnCount(4)
        self.render_tree.setHeaderLabels(['In', 'Out', 'Type', 'Factor'])
        self.render_tree.itemClicked.connect(self.select_source)
        self.main_Layout.addWidget(self.render_tree)

        self.all_layout.addWidget(self.main_widget)

        self.buttons_widget = QtWidgets.QWidget(self.main_widget)
        self.buttons_layout = QtWidgets.QVBoxLayout(self.buttons_widget)

        self.delete_button = QtWidgets.QPushButton(self.buttons_widget)
        self.delete_button.clicked.connect(self.remove_selected)
        self.buttons_layout.addWidget(self.delete_button)
        self.clear_button = QtWidgets.QPushButton(self.buttons_widget)
        self.clear_button.clicked.connect(self.clear_all)
        self.buttons_layout.addWidget(self.clear_button)

        self.inverse_button = QtWidgets.QPushButton(self.buttons_widget)
        self.inverse_button.clicked.connect(self.add_inverse)
        self.buttons_layout.addWidget(self.inverse_button)

        self.override_button = QtWidgets.QPushButton(self.buttons_widget)
        self.override_button.clicked.connect(self.add_override)
        self.buttons_layout.addWidget(self.override_button)

        self.remove_button = QtWidgets.QPushButton(self.buttons_widget)
        self.remove_button.clicked.connect(self.remove_override)
        self.buttons_layout.addWidget(self.remove_button)

        spacerItemB = QtWidgets.QSpacerItem(20, 20,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.buttons_layout.addItem(spacerItemB)

        self.save_button = QtWidgets.QPushButton(self.buttons_widget)
        self.save_button.clicked.connect(self.save_file)
        self.buttons_layout.addWidget(self.save_button)
        self.load_button = QtWidgets.QPushButton(self.buttons_widget)
        self.load_button.clicked.connect(self.load_file)
        self.buttons_layout.addWidget(self.load_button)

        spacerItemC = QtWidgets.QSpacerItem(20, 500,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.buttons_layout.addItem(spacerItemC)

        self.main_Layout.addWidget(self.buttons_widget)

        self.expand_button_in.clicked.connect(self.render_in_tree.expandAll)
        self.collapse_button_in.clicked.connect(
            self.render_in_tree.collapseAll)
        self.expand_button_out.clicked.connect(self.render_out_tree.expandAll)
        self.collapse_button_out.clicked.connect(
            self.render_out_tree.collapseAll)

        self.match_button.setText(">")
        self.delete_button.setText("Delete selected")
        self.clear_button.setText("Clear All")
        self.save_button.setText("Save")
        self.load_button.setText("Load")
        self.inverse_button.setText("Inverse Value")
        self.override_button.setText("Override Value")
        self.remove_button.setText("Remove Value")
Esempio n. 20
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(257, 504)
        font = QtGui.QFont()
        font.setWeight(50)
        font.setBold(False)
        Form.setFont(font)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.groupBox_4 = QtWidgets.QGroupBox(Form)
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 255, 191))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(106, 212, 159))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(42, 85, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(56, 113, 84))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 212, 191))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 255, 191))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(106, 212, 159))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(42, 85, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(56, 113, 84))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 212, 191))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(42, 85, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(127, 255, 191))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(106, 212, 159))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(42, 85, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(56, 113, 84))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(42, 85, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(42, 85, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 170, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
        self.groupBox_4.setPalette(palette)
        font = QtGui.QFont()
        font.setWeight(50)
        font.setBold(False)
        self.groupBox_4.setFont(font)
        self.groupBox_4.setObjectName("groupBox_4")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox_4)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label_4 = QtWidgets.QLabel(self.groupBox_4)
        self.label_4.setObjectName("label_4")
        self.horizontalLayout.addWidget(self.label_4)
        self.lineEdit_prefix = QtWidgets.QLineEdit(self.groupBox_4)
        self.lineEdit_prefix.setText("")
        self.lineEdit_prefix.setObjectName("lineEdit_prefix")
        self.horizontalLayout.addWidget(self.lineEdit_prefix)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.pushButton_buildLayout = QtWidgets.QPushButton(self.groupBox_4)
        self.pushButton_buildLayout.setObjectName("pushButton_buildLayout")
        self.verticalLayout.addWidget(self.pushButton_buildLayout)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label = QtWidgets.QLabel(self.groupBox_4)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        self.lineEdit_jntNum = QtWidgets.QLineEdit(self.groupBox_4)
        self.lineEdit_jntNum.setText("")
        self.lineEdit_jntNum.setObjectName("lineEdit_jntNum")
        self.horizontalLayout_2.addWidget(self.lineEdit_jntNum)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.groupBox_fk = QtWidgets.QGroupBox(self.groupBox_4)
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(212, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(212, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
        self.groupBox_fk.setPalette(palette)
        self.groupBox_fk.setCheckable(True)
        self.groupBox_fk.setObjectName("groupBox_fk")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_fk)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.label_7 = QtWidgets.QLabel(self.groupBox_fk)
        self.label_7.setObjectName("label_7")
        self.gridLayout_4.addWidget(self.label_7, 0, 0, 1, 1)
        self.comboBox_fkType = QtWidgets.QComboBox(self.groupBox_fk)
        self.comboBox_fkType.setObjectName("comboBox_fkType")
        self.comboBox_fkType.addItem("")
        self.comboBox_fkType.addItem("")
        self.gridLayout_4.addWidget(self.comboBox_fkType, 0, 1, 1, 1)
        self.label_8 = QtWidgets.QLabel(self.groupBox_fk)
        self.label_8.setObjectName("label_8")
        self.gridLayout_4.addWidget(self.label_8, 1, 0, 1, 1)
        self.lineEdit_fkCtrlNum = QtWidgets.QLineEdit(self.groupBox_fk)
        self.lineEdit_fkCtrlNum.setObjectName("lineEdit_fkCtrlNum")
        self.gridLayout_4.addWidget(self.lineEdit_fkCtrlNum, 1, 1, 1, 1)
        self.verticalLayout.addWidget(self.groupBox_fk)
        self.groupBox_ik = QtWidgets.QGroupBox(self.groupBox_4)
        self.groupBox_ik.setEnabled(True)
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(212, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(212, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
        self.groupBox_ik.setPalette(palette)
        self.groupBox_ik.setCheckable(True)
        self.groupBox_ik.setObjectName("groupBox_ik")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_ik)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.label_2 = QtWidgets.QLabel(self.groupBox_ik)
        self.label_2.setObjectName("label_2")
        self.gridLayout_3.addWidget(self.label_2, 0, 0, 1, 1)
        self.lineEdit_masterCtrlNum = QtWidgets.QLineEdit(self.groupBox_ik)
        self.lineEdit_masterCtrlNum.setObjectName("lineEdit_masterCtrlNum")
        self.gridLayout_3.addWidget(self.lineEdit_masterCtrlNum, 0, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(self.groupBox_ik)
        self.label_3.setObjectName("label_3")
        self.gridLayout_3.addWidget(self.label_3, 1, 0, 1, 1)
        self.lineEdit_ibtCtrlNum = QtWidgets.QLineEdit(self.groupBox_ik)
        self.lineEdit_ibtCtrlNum.setObjectName("lineEdit_ibtCtrlNum")
        self.gridLayout_3.addWidget(self.lineEdit_ibtCtrlNum, 1, 1, 1, 1)
        self.checkBox_psvVolume = QtWidgets.QCheckBox(self.groupBox_ik)
        self.checkBox_psvVolume.setEnabled(False)
        self.checkBox_psvVolume.setObjectName("checkBox_psvVolume")
        self.gridLayout_3.addWidget(self.checkBox_psvVolume, 2, 0, 1, 1)
        self.checkBox_psvLength = QtWidgets.QCheckBox(self.groupBox_ik)
        self.checkBox_psvLength.setObjectName("checkBox_psvLength")
        self.gridLayout_3.addWidget(self.checkBox_psvLength, 3, 0, 1, 2)
        self.verticalLayout.addWidget(self.groupBox_ik)
        self.groupBox_dynamic = QtWidgets.QGroupBox(self.groupBox_4)
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(212, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(212, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(213, 255, 127))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush)
        brush = QtGui.QBrush(QtGui.QColor(191, 255, 63))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush)
        brush = QtGui.QBrush(QtGui.QColor(113, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush)
        brush = QtGui.QBrush(QtGui.QColor(85, 127, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush)
        brush = QtGui.QBrush(QtGui.QColor(170, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 220))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush)
        self.groupBox_dynamic.setPalette(palette)
        self.groupBox_dynamic.setCheckable(True)
        self.groupBox_dynamic.setObjectName("groupBox_dynamic")
        self.gridLayout = QtWidgets.QGridLayout(self.groupBox_dynamic)
        self.gridLayout.setObjectName("gridLayout")
        self.label_10 = QtWidgets.QLabel(self.groupBox_dynamic)
        self.label_10.setObjectName("label_10")
        self.gridLayout.addWidget(self.label_10, 0, 0, 1, 1)
        self.comboBox_hairSystem = QtWidgets.QComboBox(self.groupBox_dynamic)
        self.comboBox_hairSystem.setEnabled(True)
        self.comboBox_hairSystem.setObjectName("comboBox_hairSystem")
        self.comboBox_hairSystem.addItem("")
        self.gridLayout.addWidget(self.comboBox_hairSystem, 0, 1, 1, 1)
        self.verticalLayout.addWidget(self.groupBox_dynamic)
        self.pushButton_buildRig = QtWidgets.QPushButton(self.groupBox_4)
        self.pushButton_buildRig.setObjectName("pushButton_buildRig")
        self.verticalLayout.addWidget(self.pushButton_buildRig)
        self.verticalLayout_2.addWidget(self.groupBox_4)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Esempio n. 21
0
    def __init__(self, parent, root, anatomy, template_key, session=None):
        super(NameWindow, self).__init__(parent=parent)
        self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint)

        self.result = None
        self.host = api.registered_host()
        self.root = root
        self.work_file = None

        if not session:
            # Fallback to active session
            session = api.Session

        # Set work file data for template formatting
        asset_name = session["AVALON_ASSET"]
        project_doc = io.find_one({"type": "project"})
        self.data = {
            "project": {
                "name": project_doc["name"],
                "code": project_doc["data"].get("code")
            },
            "asset": asset_name,
            "task": session["AVALON_TASK"],
            "version": 1,
            "user": getpass.getuser(),
            "comment": "",
            "ext": None
        }

        # Store project anatomy
        self.anatomy = anatomy
        self.template = anatomy.templates[template_key]["file"]
        self.template_key = template_key

        # Btns widget
        btns_widget = QtWidgets.QWidget(self)

        btn_ok = QtWidgets.QPushButton("Ok", btns_widget)
        btn_cancel = QtWidgets.QPushButton("Cancel", btns_widget)

        btns_layout = QtWidgets.QHBoxLayout(btns_widget)
        btns_layout.addWidget(btn_ok)
        btns_layout.addWidget(btn_cancel)

        # Inputs widget
        inputs_widget = QtWidgets.QWidget(self)

        # Version widget
        version_widget = QtWidgets.QWidget(inputs_widget)

        # Version number input
        version_input = QtWidgets.QSpinBox(version_widget)
        version_input.setMinimum(1)
        version_input.setMaximum(9999)

        # Last version checkbox
        last_version_check = QtWidgets.QCheckBox("Next Available Version",
                                                 version_widget)
        last_version_check.setChecked(True)

        version_layout = QtWidgets.QHBoxLayout(version_widget)
        version_layout.setContentsMargins(0, 0, 0, 0)
        version_layout.addWidget(version_input)
        version_layout.addWidget(last_version_check)

        # Preview widget
        preview_label = QtWidgets.QLabel("Preview filename", inputs_widget)

        # Subversion input
        subversion_input = QtWidgets.QLineEdit(inputs_widget)
        subversion_input.setPlaceholderText("Will be part of filename.")

        # Extensions combobox
        ext_combo = QtWidgets.QComboBox(inputs_widget)
        ext_combo.addItems(self.host.file_extensions())

        # Build inputs
        inputs_layout = QtWidgets.QFormLayout(inputs_widget)
        # Add version only if template contain version key
        # - since the version can be padded with "{version:0>4}" we only search
        #   for "{version".
        if "{version" in self.template:
            inputs_layout.addRow("Version:", version_widget)

        # Add subversion only if template containt `{comment}`
        if "{comment}" in self.template:
            inputs_layout.addRow("Subversion:", subversion_input)
        inputs_layout.addRow("Extension:", ext_combo)
        inputs_layout.addRow("Preview:", preview_label)

        # Build layout
        main_layout = QtWidgets.QVBoxLayout(self)
        main_layout.addWidget(inputs_widget)
        main_layout.addWidget(btns_widget)

        # Singal callback registration
        version_input.valueChanged.connect(self.on_version_spinbox_changed)
        last_version_check.stateChanged.connect(
            self.on_version_checkbox_changed)

        subversion_input.textChanged.connect(self.on_comment_changed)
        ext_combo.currentIndexChanged.connect(self.on_extension_changed)

        btn_ok.pressed.connect(self.on_ok_pressed)
        btn_cancel.pressed.connect(self.on_cancel_pressed)

        # Allow "Enter" key to accept the save.
        btn_ok.setDefault(True)

        # Force default focus to comment, some hosts didn't automatically
        # apply focus to this line edit (e.g. Houdini)
        subversion_input.setFocus()

        # Store widgets
        self.btn_ok = btn_ok

        self.version_widget = version_widget

        self.version_input = version_input
        self.last_version_check = last_version_check

        self.preview_label = preview_label
        self.subversion_input = subversion_input
        self.ext_combo = ext_combo

        self.refresh()
Esempio n. 22
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(531, 626)
        self.gridLayout_2 = QtWidgets.QGridLayout(Form)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.horizontalLayout_3.addWidget(self.label)
        self.lineEdit = QtWidgets.QLineEdit(Form)
        self.lineEdit.setObjectName("lineEdit")
        self.horizontalLayout_3.addWidget(self.lineEdit)
        self.toolButton = QtWidgets.QToolButton(Form)
        self.toolButton.setObjectName("toolButton")
        self.horizontalLayout_3.addWidget(self.toolButton)
        self.pushButton = QtWidgets.QPushButton(Form)
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout_3.addWidget(self.pushButton)
        self.gridLayout_2.addLayout(self.horizontalLayout_3, 0, 0, 1, 2)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.fontComboBox = QtWidgets.QFontComboBox(Form)
        self.fontComboBox.setObjectName("fontComboBox")
        self.horizontalLayout_2.addWidget(self.fontComboBox)
        self.spinBox = QtWidgets.QSpinBox(Form)
        self.spinBox.setObjectName("spinBox")
        self.horizontalLayout_2.addWidget(self.spinBox)
        self.lcdNumber = QtWidgets.QLCDNumber(Form)
        self.lcdNumber.setObjectName("lcdNumber")
        self.horizontalLayout_2.addWidget(self.lcdNumber)
        self.dial = QtWidgets.QDial(Form)
        self.dial.setObjectName("dial")
        self.horizontalLayout_2.addWidget(self.dial)
        self.lcdNumber_2 = QtWidgets.QLCDNumber(Form)
        self.lcdNumber_2.setObjectName("lcdNumber_2")
        self.horizontalLayout_2.addWidget(self.lcdNumber_2)
        self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 2)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.radioButton = QtWidgets.QRadioButton(Form)
        self.radioButton.setObjectName("radioButton")
        self.horizontalLayout.addWidget(self.radioButton)
        self.radioButton_2 = QtWidgets.QRadioButton(Form)
        self.radioButton_2.setObjectName("radioButton_2")
        self.horizontalLayout.addWidget(self.radioButton_2)
        self.checkBox = QtWidgets.QCheckBox(Form)
        self.checkBox.setObjectName("checkBox")
        self.horizontalLayout.addWidget(self.checkBox)
        self.comboBox = QtWidgets.QComboBox(Form)
        self.comboBox.setObjectName("comboBox")
        self.horizontalLayout.addWidget(self.comboBox)
        self.gridLayout_2.addLayout(self.horizontalLayout, 2, 0, 1, 2)
        self.commandLinkButton = QtWidgets.QCommandLinkButton(Form)
        self.commandLinkButton.setObjectName("commandLinkButton")
        self.gridLayout_2.addWidget(self.commandLinkButton, 3, 0, 1, 1)
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.treeWidget = QtWidgets.QTreeWidget(Form)
        self.treeWidget.setObjectName("treeWidget")
        self.treeWidget.headerItem().setText(0, "1")
        self.gridLayout.addWidget(self.treeWidget, 0, 0, 1, 1)
        self.listWidget = QtWidgets.QListWidget(Form)
        self.listWidget.setObjectName("listWidget")
        self.gridLayout.addWidget(self.listWidget, 0, 1, 1, 1)
        self.tableWidget = QtWidgets.QTableWidget(Form)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(0)
        self.tableWidget.setRowCount(0)
        self.gridLayout.addWidget(self.tableWidget, 1, 0, 1, 1)
        self.textBrowser = QtWidgets.QTextBrowser(Form)
        self.textBrowser.setObjectName("textBrowser")
        self.gridLayout.addWidget(self.textBrowser, 1, 1, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout, 4, 0, 1, 2)
        self.buttonBox = QtWidgets.QDialogButtonBox(Form)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                          | QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout_2.addWidget(self.buttonBox, 5, 1, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Esempio n. 23
0
    def setInputField(self, card, row, param):
        '''
        Given a `Param`, build, and place, the correct ui element for the param's data type.
        '''
        self.params.append(param)

        if param.type == param.BOOL:
            checkBox = QtWidgets.QTableWidgetItem()
            state = Qt.Checked if card.rigData.get('ikParams', {}).get(
                param.kwargName, param.default) else Qt.Unchecked
            checkBox.setCheckState(state)
            self.setItem(row, 1, checkBox)

        elif param.type == param.INT:
            self.setItem(
                row, 1,
                QtWidgets.QTableWidgetItem(
                    str(
                        card.rigData.get('ikParams',
                                         {}).get(param.kwargName,
                                                 param.default))))

        elif param.type == param.FLOAT:
            self.setItem(
                row, 1,
                QtWidgets.QTableWidgetItem(
                    str(
                        card.rigData.get('ikParams',
                                         {}).get(param.kwargName,
                                                 param.default))))

        elif param.type == param.ENUM:
            dropdown = QtWidgets.QComboBox()
            dropdown.addItems(param.enum.keys())
            #dropdown.currentIndexChanged.connect( partial(self.enumChange, param) )
            #for key, val in param.enum.items():
            #    dropdown.addItem( key ).triggered.connect( partial(self.changeEnum, param.kwargName, val) )

            self.setCellWidget(row, 1, dropdown)

            try:
                enumVal = param.enum.values().index(
                    card.rigData.get('ikParams',
                                     {}).get(param.kwargName, param.default))
                dropdown.setCurrentIndex(enumVal)
                dropdown.currentIndexChanged.connect(
                    partial(self.enumChange, param=param))
            except:
                print('oerror with', param.kwargName, param.default, card, row)

        elif param.type == param.STR:
            val = card.rigData.get('ikParams', {}).get(param.kwargName,
                                                       param.default)
            self.setItem(row, 1, QtWidgets.QTableWidgetItem(val))

        elif param.type in (
                param.CURVE,
                param.NODE_0):  # Just accept curves, they are all I connect to
            dropdown = QtWidgets.QComboBox()
            # Get all the curve transforms under the skeletonBlueprint
            curves = cmds.listRelatives(cmds.listRelatives('skeletonBlueprint',
                                                           type='nurbsCurve',
                                                           f=True,
                                                           ad=True),
                                        p=True,
                                        f=True)
            self.paramSceneOptions[param] = curves
            dropdown.addItems(curves)

            self.setCellWidget(row, 1, dropdown)
Esempio n. 24
0
    def __init__(self):
        super(DagCapturePanel, self).__init__()

        # Variables
        self.dag = get_dag()
        if not self.dag:
            raise RuntimeError("Couldn't get DAG widget")

        self.dag_bbox = None
        self.capture_thread = DagCapture(self.dag)
        self.capture_thread.finished.connect(self.show_finished_popup)
        self.selection = []

        # UI
        self.setWindowTitle("DAG Capture options")

        main_layout = QtWidgets.QVBoxLayout()
        form_layout = QtWidgets.QFormLayout()
        form_layout.setFieldGrowthPolicy(form_layout.AllNonFixedFieldsGrow)
        form_layout.setLabelAlignment(QtCore.Qt.AlignRight)
        main_layout.addLayout(form_layout)

        # Options
        # Path
        container = QtWidgets.QWidget()
        path_layout = QtWidgets.QHBoxLayout()
        path_layout.setMargin(0)
        container.setLayout(path_layout)
        self.path = QtWidgets.QLineEdit()
        browse_button = QtWidgets.QPushButton("Browse")
        browse_button.clicked.connect(self.show_file_browser)
        path_layout.addWidget(self.path)
        path_layout.addWidget(browse_button)
        form_layout.addRow("File Path", container)

        # Zoom
        self.zoom_level = QtWidgets.QDoubleSpinBox()
        self.zoom_level.setValue(1.0)
        self.zoom_level.setRange(0.01, 5)
        self.zoom_level.setSingleStep(.5)
        self.zoom_level.valueChanged.connect(self.display_info)
        form_layout.addRow("Zoom Level", self.zoom_level)

        # Margins
        self.margins = QtWidgets.QSpinBox()
        self.margins.setRange(0, 1000)
        self.margins.setValue(20)
        self.margins.setSuffix("px")
        self.margins.setSingleStep(10)
        self.margins.valueChanged.connect(self.display_info)
        form_layout.addRow("Margins", self.margins)

        # Right Crop
        self.ignore_right = QtWidgets.QSpinBox()
        self.ignore_right.setRange(0, 1000)
        self.ignore_right.setValue(200)
        self.ignore_right.setSuffix("px")
        self.ignore_right.setToolTip(
            "The right side of the DAG usually contains a mini version of itself.\n"
            "This gets included in the screen capture, so it is required to crop it out. \n"
            "If you scaled it down, you can reduce this number to speed up capture slightly."
        )
        self.ignore_right.valueChanged.connect(self.display_info)
        form_layout.addRow("Crop Right Side", self.ignore_right)

        # Delay
        self.delay = QtWidgets.QDoubleSpinBox()
        self.delay.setValue(.3)
        self.delay.setRange(0.1, 1)
        self.delay.setSuffix("s")
        self.delay.setSingleStep(.1)
        self.delay.valueChanged.connect(self.display_info)
        self.delay.setToolTip(
            "A longer delay ensures the Nuke DAG has fully refreshed between capturing tiles.\n"
            "It makes the capture slower, but ensures a correct result.\n"
            "Feel free to adjust based on results you have seen on your machine.\n"
            "Increase if the capture looks incorrect.")
        form_layout.addRow("Delay Between Captures", self.delay)

        # Capture all nodes or selection
        self.capture = QtWidgets.QComboBox()
        self.capture.addItems(["All Nodes", "Selected Nodes"])
        self.capture.currentIndexChanged.connect(self.inspect_dag)
        form_layout.addRow("Nodes to Capture", self.capture)

        # Deselect Nodes before Capture?
        self.deselect = QtWidgets.QCheckBox("Deselect Nodes before capture")
        self.deselect.setChecked(True)
        form_layout.addWidget(self.deselect)

        # Add Information box
        self.info = QtWidgets.QLabel("Hi")
        info_box = QtWidgets.QFrame()
        info_box.setFrameStyle(info_box.StyledPanel)
        info_box.setLayout(QtWidgets.QVBoxLayout())
        info_box.layout().addWidget(self.info)
        main_layout.addWidget(info_box)

        # Buttons
        button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
        button_box.accepted.connect(self.do_capture)
        button_box.rejected.connect(self.reject)
        main_layout.addWidget(button_box)

        self.setLayout(main_layout)

        self.inspect_dag()
Esempio n. 25
0
    def __init__(self, controller, parent=None):
        super(Window, self).__init__(parent=parent)

        self._suspend_logs = False

        # Use plastique style for specific ocations
        # TODO set style name via environment variable
        low_keys = {key.lower(): key for key in QtWidgets.QStyleFactory.keys()}
        if "plastique" in low_keys:
            self.setStyle(QtWidgets.QStyleFactory.create(
                low_keys["plastique"]))

        icon = QtGui.QIcon(util.get_asset("img", "logo-extrasmall.png"))
        if parent is None:
            on_top_flag = QtCore.Qt.WindowStaysOnTopHint
        else:
            on_top_flag = QtCore.Qt.Dialog

        self.setWindowFlags(self.windowFlags()
                            | QtCore.Qt.WindowTitleHint
                            | QtCore.Qt.WindowMaximizeButtonHint
                            | QtCore.Qt.WindowMinimizeButtonHint
                            | QtCore.Qt.WindowCloseButtonHint
                            | on_top_flag)
        self.setWindowIcon(icon)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

        self.controller = controller

        main_widget = QtWidgets.QWidget(self)

        # General layout
        header_widget = QtWidgets.QWidget(parent=main_widget)

        header_tab_widget = QtWidgets.QWidget(header_widget)
        header_tab_overview = QtWidgets.QRadioButton(header_tab_widget)
        header_tab_terminal = QtWidgets.QRadioButton(header_tab_widget)
        header_spacer = QtWidgets.QWidget(header_tab_widget)

        button_suspend_logs_widget = QtWidgets.QWidget()
        button_suspend_logs_widget_layout = QtWidgets.QHBoxLayout(
            button_suspend_logs_widget)
        button_suspend_logs_widget_layout.setContentsMargins(0, 10, 0, 10)
        button_suspend_logs = QtWidgets.QPushButton(header_widget)
        button_suspend_logs.setFixedWidth(7)
        button_suspend_logs.setSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                          QtWidgets.QSizePolicy.Expanding)
        button_suspend_logs_widget_layout.addWidget(button_suspend_logs)
        header_aditional_btns = QtWidgets.QWidget(header_tab_widget)

        aditional_btns_layout = QtWidgets.QHBoxLayout(header_aditional_btns)

        presets_button = widgets.ButtonWithMenu(awesome["filter"])
        presets_button.setEnabled(False)
        aditional_btns_layout.addWidget(presets_button)

        layout_tab = QtWidgets.QHBoxLayout(header_tab_widget)
        layout_tab.setContentsMargins(0, 0, 0, 0)
        layout_tab.setSpacing(0)
        layout_tab.addWidget(header_tab_overview, 0)
        layout_tab.addWidget(header_tab_terminal, 0)
        layout_tab.addWidget(button_suspend_logs_widget, 0)

        # Compress items to the left
        layout_tab.addWidget(header_spacer, 1)
        layout_tab.addWidget(header_aditional_btns, 0)

        layout = QtWidgets.QHBoxLayout(header_widget)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        layout.addWidget(header_tab_widget)

        header_widget.setLayout(layout)

        # Overview Page
        # TODO add parent
        overview_page = QtWidgets.QWidget()

        overview_instance_view = view.InstanceView(animated=settings.Animated,
                                                   parent=overview_page)
        overview_instance_delegate = delegate.InstanceDelegate(
            parent=overview_instance_view)
        instance_model = model.InstanceModel(controller)
        instance_sort_proxy = model.InstanceSortProxy()
        instance_sort_proxy.setSourceModel(instance_model)

        overview_instance_view.setItemDelegate(overview_instance_delegate)
        overview_instance_view.setModel(instance_sort_proxy)

        overview_plugin_view = view.PluginView(animated=settings.Animated,
                                               parent=overview_page)
        overview_plugin_delegate = delegate.PluginDelegate(
            parent=overview_plugin_view)
        overview_plugin_view.setItemDelegate(overview_plugin_delegate)
        plugin_model = model.PluginModel(controller)
        plugin_proxy = model.PluginFilterProxy()
        plugin_proxy.setSourceModel(plugin_model)
        overview_plugin_view.setModel(plugin_proxy)

        layout = QtWidgets.QHBoxLayout(overview_page)
        layout.addWidget(overview_instance_view, 1)
        layout.addWidget(overview_plugin_view, 1)
        layout.setContentsMargins(5, 5, 5, 5)
        layout.setSpacing(0)
        overview_page.setLayout(layout)

        # Terminal
        terminal_container = QtWidgets.QWidget()

        terminal_view = view.TerminalView()
        terminal_model = model.TerminalModel()
        terminal_proxy = model.TerminalProxy(terminal_view)
        terminal_proxy.setSourceModel(terminal_model)

        terminal_view.setModel(terminal_proxy)
        terminal_delegate = delegate.TerminalItem()
        terminal_view.setItemDelegate(terminal_delegate)

        layout = QtWidgets.QVBoxLayout(terminal_container)
        layout.addWidget(terminal_view)
        layout.setContentsMargins(5, 5, 5, 5)
        layout.setSpacing(0)

        terminal_container.setLayout(layout)

        terminal_page = QtWidgets.QWidget()
        layout = QtWidgets.QVBoxLayout(terminal_page)
        layout.addWidget(terminal_container)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)

        # Add some room between window borders and contents
        body_widget = QtWidgets.QWidget(main_widget)
        layout = QtWidgets.QHBoxLayout(body_widget)
        layout.setContentsMargins(5, 5, 5, 1)
        layout.addWidget(overview_page)
        layout.addWidget(terminal_page)

        # Comment Box
        comment_box = widgets.CommentBox("Comment...", self)

        intent_box = QtWidgets.QComboBox()

        intent_model = model.IntentModel()
        intent_box.setModel(intent_model)

        comment_intent_widget = QtWidgets.QWidget()
        comment_intent_layout = QtWidgets.QHBoxLayout(comment_intent_widget)
        comment_intent_layout.setContentsMargins(0, 0, 0, 0)
        comment_intent_layout.setSpacing(5)
        comment_intent_layout.addWidget(comment_box)
        comment_intent_layout.addWidget(intent_box)

        # Terminal filtering
        terminal_filters_widget = widgets.TerminalFilterWidget()

        # Footer
        footer_widget = QtWidgets.QWidget(main_widget)

        footer_info = QtWidgets.QLabel(footer_widget)
        footer_spacer = QtWidgets.QWidget(footer_widget)

        footer_button_stop = QtWidgets.QPushButton(awesome["stop"],
                                                   footer_widget)
        footer_button_reset = QtWidgets.QPushButton(awesome["refresh"],
                                                    footer_widget)
        footer_button_validate = QtWidgets.QPushButton(awesome["flask"],
                                                       footer_widget)
        footer_button_play = QtWidgets.QPushButton(awesome["play"],
                                                   footer_widget)

        layout = QtWidgets.QHBoxLayout()
        layout.setContentsMargins(5, 5, 5, 5)
        layout.addWidget(footer_info, 0)
        layout.addWidget(footer_spacer, 1)

        layout.addWidget(footer_button_stop, 0)
        layout.addWidget(footer_button_reset, 0)
        layout.addWidget(footer_button_validate, 0)
        layout.addWidget(footer_button_play, 0)

        footer_layout = QtWidgets.QVBoxLayout(footer_widget)
        footer_layout.addWidget(terminal_filters_widget)
        footer_layout.addWidget(comment_intent_widget)
        footer_layout.addLayout(layout)

        footer_widget.setProperty("success", -1)

        # Placeholder for when GUI is closing
        # TODO(marcus): Fade to black and the the user about what's happening
        closing_placeholder = QtWidgets.QWidget(main_widget)
        closing_placeholder.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                          QtWidgets.QSizePolicy.Expanding)
        closing_placeholder.hide()

        perspective_widget = widgets.PerspectiveWidget(main_widget)
        perspective_widget.hide()

        pages_widget = QtWidgets.QWidget(main_widget)
        layout = QtWidgets.QVBoxLayout(pages_widget)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        layout.addWidget(header_widget, 0)
        layout.addWidget(body_widget, 1)

        # Main layout
        layout = QtWidgets.QVBoxLayout(main_widget)
        layout.addWidget(pages_widget, 3)
        layout.addWidget(perspective_widget, 3)
        layout.addWidget(closing_placeholder, 1)
        layout.addWidget(footer_widget, 0)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        main_widget.setLayout(layout)

        self.main_layout = QtWidgets.QVBoxLayout(self)
        self.main_layout.setContentsMargins(0, 0, 0, 0)
        self.main_layout.setSpacing(0)
        self.main_layout.addWidget(main_widget)

        # Display info
        info_effect = QtWidgets.QGraphicsOpacityEffect(footer_info)
        footer_info.setGraphicsEffect(info_effect)

        on = QtCore.QPropertyAnimation(info_effect, b"opacity")
        on.setDuration(0)
        on.setStartValue(0)
        on.setEndValue(1)

        off = QtCore.QPropertyAnimation(info_effect, b"opacity")
        off.setDuration(0)
        off.setStartValue(1)
        off.setEndValue(0)

        fade = QtCore.QPropertyAnimation(info_effect, b"opacity")
        fade.setDuration(500)
        fade.setStartValue(1.0)
        fade.setEndValue(0.0)

        animation_info_msg = QtCore.QSequentialAnimationGroup()
        animation_info_msg.addAnimation(on)
        animation_info_msg.addPause(50)
        animation_info_msg.addAnimation(off)
        animation_info_msg.addPause(50)
        animation_info_msg.addAnimation(on)
        animation_info_msg.addPause(2000)
        animation_info_msg.addAnimation(fade)
        """Setup

        Widgets are referred to in CSS via their object-name. We
        use the same mechanism internally to refer to objects; so rather
        than storing widgets as self.my_widget, it is referred to as:

        >>> my_widget = self.findChild(QtWidgets.QWidget, "MyWidget")

        This way there is only ever a single method of referring to any widget.
        """

        names = {
            # Main
            "Header": header_widget,
            "Body": body_widget,
            "Footer": footer_widget,

            # Pages
            "Overview": overview_page,
            "Terminal": terminal_page,

            # Tabs
            "OverviewTab": header_tab_overview,
            "TerminalTab": header_tab_terminal,

            # Views
            "TerminalView": terminal_view,

            # Buttons
            "SuspendLogsBtn": button_suspend_logs,
            "Stop": footer_button_stop,
            "Reset": footer_button_reset,
            "Validate": footer_button_validate,
            "Play": footer_button_play,

            # Misc
            "HeaderSpacer": header_spacer,
            "FooterSpacer": footer_spacer,
            "FooterInfo": footer_info,
            "CommentIntentWidget": comment_intent_widget,
            "CommentBox": comment_box,
            "CommentPlaceholder": comment_box.placeholder,
            "ClosingPlaceholder": closing_placeholder,
            "IntentBox": intent_box
        }

        for name, _widget in names.items():
            _widget.setObjectName(name)

        # Enable CSS on plain QWidget objects
        for _widget in (pages_widget, header_widget, body_widget, comment_box,
                        overview_page, terminal_page, footer_widget,
                        button_suspend_logs, footer_button_stop,
                        footer_button_reset, footer_button_validate,
                        footer_button_play, footer_spacer,
                        closing_placeholder):
            _widget.setAttribute(QtCore.Qt.WA_StyledBackground)

        # Signals
        header_tab_overview.toggled.connect(
            lambda: self.on_tab_changed("overview"))
        header_tab_terminal.toggled.connect(
            lambda: self.on_tab_changed("terminal"))

        overview_instance_view.show_perspective.connect(
            self.toggle_perspective_widget)
        overview_plugin_view.show_perspective.connect(
            self.toggle_perspective_widget)

        controller.switch_toggleability.connect(self.change_toggleability)

        controller.was_reset.connect(self.on_was_reset)
        # This is called synchronously on each process
        controller.was_processed.connect(self.on_was_processed)
        controller.passed_group.connect(self.on_passed_group)
        controller.was_stopped.connect(self.on_was_stopped)
        controller.was_finished.connect(self.on_was_finished)

        controller.was_skipped.connect(self.on_was_skipped)
        controller.was_acted.connect(self.on_was_acted)

        # NOTE: Listeners to this signal are run in the main thread
        controller.about_to_process.connect(self.on_about_to_process,
                                            QtCore.Qt.DirectConnection)

        overview_instance_view.toggled.connect(self.on_instance_toggle)
        overview_plugin_view.toggled.connect(self.on_plugin_toggle)

        button_suspend_logs.clicked.connect(self.on_suspend_clicked)
        footer_button_stop.clicked.connect(self.on_stop_clicked)
        footer_button_reset.clicked.connect(self.on_reset_clicked)
        footer_button_validate.clicked.connect(self.on_validate_clicked)
        footer_button_play.clicked.connect(self.on_play_clicked)

        comment_box.textChanged.connect(self.on_comment_entered)
        comment_box.returnPressed.connect(self.on_play_clicked)
        overview_plugin_view.customContextMenuRequested.connect(
            self.on_plugin_action_menu_requested)

        instance_model.group_created.connect(self.on_instance_group_created)

        self.main_widget = main_widget

        self.pages_widget = pages_widget
        self.header_widget = header_widget
        self.body_widget = body_widget

        self.terminal_filters_widget = terminal_filters_widget

        self.footer_widget = footer_widget
        self.button_suspend_logs = button_suspend_logs
        self.footer_button_stop = footer_button_stop
        self.footer_button_reset = footer_button_reset
        self.footer_button_validate = footer_button_validate
        self.footer_button_play = footer_button_play

        self.overview_instance_view = overview_instance_view
        self.overview_plugin_view = overview_plugin_view
        self.plugin_model = plugin_model
        self.plugin_proxy = plugin_proxy
        self.instance_model = instance_model
        self.instance_sort_proxy = instance_sort_proxy

        self.presets_button = presets_button

        self.animation_info_msg = animation_info_msg

        self.terminal_model = terminal_model
        self.terminal_proxy = terminal_proxy
        self.terminal_view = terminal_view

        self.comment_main_widget = comment_intent_widget
        self.comment_box = comment_box
        self.intent_box = intent_box
        self.intent_model = intent_model

        self.perspective_widget = perspective_widget

        self.tabs = {
            "overview": header_tab_overview,
            "terminal": header_tab_terminal
        }
        self.pages = (("overview", overview_page), ("terminal", terminal_page))

        current_page = settings.InitialTab or "overview"
        self.comment_main_widget.setVisible(not current_page == "terminal")
        self.terminal_filters_widget.setVisible(current_page == "terminal")

        self.state = {"is_closing": False, "current_page": current_page}

        self.tabs[current_page].setChecked(True)

        self.apply_log_suspend_value(
            util.env_variable_to_bool("PYBLISH_SUSPEND_LOGS"))
Esempio n. 26
0
    def buildUI(self):

        mainLayout = QtWidgets.QGridLayout(self)

        #RigName
        nameLabel = QtWidgets.QLabel()
        nameLabel.setText('Rig Name')
        mainLayout.addWidget(nameLabel, 0, 0)
        self.name = QtWidgets.QLineEdit()
        self.name.setPlaceholderText('inner_house')
        mainLayout.addWidget(self.name, 0, 1, 1, 2)

        #No.Lights
        nLightsLabel = QtWidgets.QLabel()
        nLightsLabel.setText('Number of Lights')
        mainLayout.addWidget(nLightsLabel, 1, 0)
        self.nLights = QtWidgets.QLineEdit()
        self.nLights.setText('5')
        validator = QtGui.QIntValidator(1, 999, self)
        self.nLights.setValidator(validator)
        self.nLights.textChanged.connect(self.nLightsSliderMod)
        self.nLights.setMinimumSize(80, 10)
        self.nLights.setMaximumSize(80, 20)
        mainLayout.addWidget(self.nLights, 1, 1, 1, 1)
        self.nLightsSlider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
        self.nLightsSlider.setMaximum(10)
        self.nLightsSlider.setMinimum(1)
        self.nLightsSlider.setValue(5)
        self.nLightsSlider.valueChanged.connect(self.nLightsMod)
        mainLayout.addWidget(self.nLightsSlider, 1, 2, 1, 2)

        #Placement Method
        placementLabel = QtWidgets.QLabel()
        placementLabel.setText('Placement')
        mainLayout.addWidget(placementLabel, 2, 0)
        self.placement = QtWidgets.QComboBox()
        self.placement.addItems(['Stick to Selected', 'Distance'])
        self.placement.currentIndexChanged.connect(self.position)
        self.placement.setToolTip(
            'Two locators are created, position them to get the desired distance'
        )
        mainLayout.addWidget(self.placement, 2, 1)

        #LightType
        lightTypeLabel = QtWidgets.QLabel()
        lightTypeLabel.setText('Light Type')
        mainLayout.addWidget(lightTypeLabel, 2, 2)
        self.lightType = QtWidgets.QComboBox()
        for lightype in self.lightTypes:
            self.lightType.addItem(lightype)
        mainLayout.addWidget(self.lightType, 2, 3)

        #Create Rig Button
        createBtn = QtWidgets.QPushButton('Create Rig')
        createBtn.clicked.connect(self.createRig)
        mainLayout.addWidget(createBtn, 3, 0, 1, 2)

        #Create Rig from existing Lights
        createExistingBtn = QtWidgets.QPushButton('Create rig from selection')
        createExistingBtn.clicked.connect(self.createRigFromSelected)
        mainLayout.addWidget(createExistingBtn, 3, 2, 1, 2)

        #CreateRigSpace
        rigSpace = QtWidgets.QWidget()
        rigSpace.setSizePolicy(QtWidgets.QSizePolicy.Maximum,
                               QtWidgets.QSizePolicy.Maximum)
        self.scrollLayout = QtWidgets.QVBoxLayout(rigSpace)
        rigArea = QtWidgets.QScrollArea()
        rigArea.setWidgetResizable(True)
        rigArea.setWidget(rigSpace)
        mainLayout.addWidget(rigArea, 4, 0, 1, 4)

        #Refresh Button
        refreshBtn = QtWidgets.QPushButton('Refresh')
        refreshBtn.clicked.connect(self.populate)
        mainLayout.addWidget(refreshBtn)
    def buildUI(self):
        # Like in the LightWidget we show our
        layout = QtWidgets.QGridLayout(self)

        # We create a combobox
        # Comboboxes are essentially dropdown selectionwidgets
        self.lightTypeCB = QtWidgets.QComboBox()
        # We populate it with the items in our lightTypes dictionary
        # I like to have my items alphabetically so I sort it to begin with
        for lightType in sorted(self.lightTypes):
            # We add the option to the combobox
            self.lightTypeCB.addItem(lightType)
        # Finally we add it to the layout in row 0, column 0
        # We tell it take 1 row and two columns worth of space
        layout.addWidget(self.lightTypeCB, 0, 0, 1, 2)

        # We create a button to create the chosen lights
        createBtn = QtWidgets.QPushButton('Create')
        # We connect the button so it calls the createLight method when its clicked
        createBtn.clicked.connect(self.createLight)
        # We add it to the layout in row 0, column 2
        layout.addWidget(createBtn, 0, 2)

        # We want to put all the LightWidgets inside a scrolling container
        # We first need a container widget
        scrollWidget = QtWidgets.QWidget()
        # We want to make sure this widget only tries to be the maximum size of its contents
        scrollWidget.setSizePolicy(QtWidgets.QSizePolicy.Maximum,
                                   QtWidgets.QSizePolicy.Maximum)
        # Then we give it a vertical layout because we want everything arranged vertically
        self.scrollLayout = QtWidgets.QVBoxLayout(scrollWidget)

        # Finally we create a scrollArea that will be in charge of scrolling its contents
        scrollArea = QtWidgets.QScrollArea()
        # Make sure it's resizable so it resizes as the UI grows or shrinks
        scrollArea.setWidgetResizable(True)
        # Then we set it to use our container widget to scroll
        scrollArea.setWidget(scrollWidget)
        # Then we add this scrollArea to the main layout, at row 1, column 0
        # We tell it to take 1 row and 3 columns of space
        layout.addWidget(scrollArea, 1, 0, 1, 3)

        # We add the save button to save our lights
        saveBtn = QtWidgets.QPushButton('Save')
        # When clicked it will call the saveLights method
        saveBtn.clicked.connect(self.saveLights)
        # We add it to row 2, column 0
        layout.addWidget(saveBtn, 2, 0)

        # We also add an import button to import our lights
        importBtn = QtWidgets.QPushButton('Import')
        # When clicked it will call the importLights method
        importBtn.clicked.connect(self.importLights)
        # We add it to row 2, column 1
        layout.addWidget(importBtn, 2, 1)

        # We need a refresh button to manually force the UI to refresh on changes
        refreshBtn = QtWidgets.QPushButton('Refresh')
        # We'll connect this to the refresh method
        refreshBtn.clicked.connect(self.refresh)
        # Finally we add it to the layout at row 2, column 2
        layout.addWidget(refreshBtn, 2, 2)
Esempio n. 28
0
    def __init__(self):

        # Main Window
        QtWidgets.QWidget.__init__(self)
        self.constructed = False
        self.evaluated = False
        self.output = ''
        self.setWindowTitle('Afanasy Starter   CGRU %s' %
                            os.getenv('CGRU_VERSION', ''))
        self.fields = dict()
        self.labels = dict()

        # Get File Type dependant dicts
        self.labelNode_name = labelNodeNameDict()
        self.labelNode_tooltip = labelNodeTooltipsDict()
        self.labelTake_name = labelTakeNameDict()
        self.labelTake_tooltip = labelTakeTooltipsDict()

        # Top level layouts:
        topLayout = QtWidgets.QVBoxLayout(self)
        tabwidget = QtWidgets.QTabWidget(self)
        topLayout.addWidget(tabwidget)

        # General Tab:
        generalwidget = QtWidgets.QWidget(self)
        tabwidget.addTab(generalwidget, 'Scene')
        generallayout = QtWidgets.QVBoxLayout(generalwidget)

        # Job Tab:
        jobwidget = QtWidgets.QWidget(self)
        tabwidget.addTab(jobwidget, 'Job')
        joblayout = QtWidgets.QVBoxLayout(jobwidget)

        # Advanced Tab:
        auxwidget = QtWidgets.QWidget(self)
        tabwidget.addTab(auxwidget, 'Advanced')
        advlayout = QtWidgets.QVBoxLayout(auxwidget)

        # Service Type:
        lFileType = QtWidgets.QHBoxLayout()
        generallayout.addLayout(lFileType)
        lFileType.addWidget(QtWidgets.QLabel('Override Service Type:', self))
        self.fields['servicetype'] = QtWidgets.QComboBox(self)
        lFileType.addWidget(self.fields['servicetype'])
        self.fields['servicetype'].currentIndexChanged.connect(
            self.setFileType)

        # Scene:
        lScene = QtWidgets.QHBoxLayout()
        generallayout.addLayout(lScene)
        lScene.addWidget(QtWidgets.QLabel('File:', self))
        self.fields['scenefile'] = QtWidgets.QLineEdit(Scene, self)
        lScene.addWidget(self.fields['scenefile'])
        self.fields['scenefile'].editingFinished.connect(self.evaluate)
        bBrowseScene = QtWidgets.QPushButton('Browse', self)
        lScene.addWidget(bBrowseScene)
        bBrowseScene.pressed.connect(self.browseScene)

        # Working Directory:
        lWDir = QtWidgets.QHBoxLayout()
        generallayout.addLayout(lWDir)
        lWDir.addWidget(QtWidgets.QLabel('Working Directory/Project:', self))
        self.fields['wdir'] = QtWidgets.QLineEdit(self)
        lWDir.addWidget(self.fields['wdir'])
        self.fields['wdir'].editingFinished.connect(self.evaluate)
        self.fields['scenewdir'] = QtWidgets.QCheckBox('Use Scene Folder',
                                                       self)
        self.fields['scenewdir'].setChecked(True)
        self.fields['scenewdir'].stateChanged.connect(self.evaluate)
        lWDir.addWidget(self.fields['scenewdir'])

        # Output images:
        lImages = QtWidgets.QHBoxLayout()
        generallayout.addLayout(lImages)
        lImages.addWidget(QtWidgets.QLabel('Output Images:', self))
        self.fields['outimages'] = QtWidgets.QLineEdit(self)
        lImages.addWidget(self.fields['outimages'])
        self.fields['outimages'].editingFinished.connect(self.evaluate)
        lImages.addWidget(QtWidgets.QLabel('Browse'))
        bBrowseOutImages = QtWidgets.QPushButton('File', self)
        lImages.addWidget(bBrowseOutImages)
        bBrowseOutImages.pressed.connect(self.browseOutImages)
        bBrowseOutFolder = QtWidgets.QPushButton('Dir', self)
        lImages.addWidget(bBrowseOutFolder)
        bBrowseOutFolder.pressed.connect(self.browseOutFolder)

        # Frames:
        lFrames = QtWidgets.QHBoxLayout()
        generallayout.addLayout(lFrames)
        lFrames.addWidget(QtWidgets.QLabel('Frames:', self))
        self.fields['framestart'] = QtWidgets.QSpinBox(self)
        self.fields['framestart'].setRange(-1000000000, 1000000000)
        self.fields['framestart'].setValue(1)
        self.fields['framestart'].valueChanged.connect(self.evaluate)
        lFrames.addWidget(self.fields['framestart'])

        self.fields['frameend'] = QtWidgets.QSpinBox(self)
        self.fields['frameend'].setRange(-1000000000, 1000000000)
        self.fields['frameend'].setValue(1)
        self.fields['frameend'].valueChanged.connect(self.evaluate)
        lFrames.addWidget(self.fields['frameend'])

        lFrames.addWidget(QtWidgets.QLabel('By:', self))
        self.fields['frameby'] = QtWidgets.QSpinBox(self)
        lFrames.addWidget(self.fields['frameby'])
        self.fields['frameby'].valueChanged.connect(self.evaluate)
        self.fields['frameby'].setRange(1, 1000000000)

        lFrames.addWidget(QtWidgets.QLabel('FPT:', self))
        self.fields['framespt'] = QtWidgets.QSpinBox(self)
        lFrames.addWidget(self.fields['framespt'])
        self.fields['framespt'].valueChanged.connect(self.evaluate)
        self.fields['framespt'].setRange(1, 1000000000)
        self.fields['framespt'].setToolTip('Frames per task.')

        lFrames.addWidget(QtWidgets.QLabel('Seq:', self))
        self.fields['frameseq'] = QtWidgets.QSpinBox(self)
        lFrames.addWidget(self.fields['frameseq'])
        self.fields['frameseq'].valueChanged.connect(self.evaluate)
        self.fields['frameseq'].setRange(-1000000, 1000000)
        self.fields['frameseq'].setValue(1)
        self.fields['frameseq'].setToolTip(
            'Solve task with this step at first.')

        # Node / Camera / Take:
        lNode = QtWidgets.QHBoxLayout()
        generallayout.addLayout(lNode)
        self.labels['node'] = QtWidgets.QLabel(self.labelNode_name['default'])
        lNode.addWidget(self.labels['node'])
        self.labels['node'].setToolTip(self.labelNode_tooltip['default'])
        self.fields['node'] = QtWidgets.QLineEdit(self)
        lNode.addWidget(self.fields['node'])
        self.fields['node'].textEdited.connect(self.evaluate)
        self.labels['take'] = QtWidgets.QLabel(self.labelTake_name['default'])
        lNode.addWidget(self.labels['take'])
        self.labels['take'].setToolTip(self.labelTake_tooltip['default'])
        self.fields['take'] = QtWidgets.QLineEdit(self)
        lNode.addWidget(self.fields['take'])
        self.fields['take'].textEdited.connect(self.evaluate)

        # Advanced:
        # OS Type:
        osLayout = QtWidgets.QHBoxLayout()
        advlayout.addLayout(osLayout)
        osLayout.addWidget(QtWidgets.QLabel('Operating System Type:'))
        self.fields['os'] = QtWidgets.QLineEdit(self)
        osLayout.addWidget(self.fields['os'])
        self.fields['os'].textEdited.connect(self.evaluate)

        # Tasks Command:
        exelayout = QtWidgets.QHBoxLayout()
        advlayout.addLayout(exelayout)
        label = QtWidgets.QLabel('Tasks Executable:')
        label.setToolTip('Override launching programm')
        exelayout.addWidget(label)
        self.fields['exec'] = QtWidgets.QLineEdit(self)
        exelayout.addWidget(self.fields['exec'])
        self.fields['exec'].textEdited.connect(self.evaluate)
        self.execBrowseButton = QtWidgets.QPushButton('Browse', self)
        exelayout.addWidget(self.execBrowseButton)
        self.execBrowseButton.pressed.connect(self.browseExec)

        # Extra Arguments:
        exarglayout = QtWidgets.QHBoxLayout()
        advlayout.addLayout(exarglayout)
        exarglayout.addWidget(QtWidgets.QLabel('Extra Arguments:'))
        self.fields['extrargs'] = QtWidgets.QLineEdit(self)
        exarglayout.addWidget(self.fields['extrargs'])
        self.fields['extrargs'].textEdited.connect(self.evaluate)

        # Preview:
        prvlayout = QtWidgets.QHBoxLayout()
        advlayout.addLayout(prvlayout)
        prvlayout.addWidget(QtWidgets.QLabel('Preview:'))
        self.fields['preview'] = QtWidgets.QLineEdit(self)
        prvlayout.addWidget(self.fields['preview'])
        self.fields['preview'].textEdited.connect(self.evaluate)

        # Job:
        lJobName = QtWidgets.QHBoxLayout()
        joblayout.addLayout(lJobName)
        lJobName.addWidget(QtWidgets.QLabel('Name:', self))
        self.fields['jobname'] = QtWidgets.QLineEdit(self)
        lJobName.addWidget(self.fields['jobname'])
        self.fields['jobname'].textEdited.connect(self.evaluate)
        self.fields['jobnamescene'] = QtWidgets.QCheckBox(
            'Use Scene Name', self)
        lJobName.addWidget(self.fields['jobnamescene'])
        self.fields['jobnamescene'].setChecked(True)
        self.fields['jobnamescene'].stateChanged.connect(self.evaluate)

        # Capacity, max run tasks, priority, max tasks per host:
        lCapMax = QtWidgets.QHBoxLayout()
        joblayout.addLayout(lCapMax)
        lCapMax.addWidget(QtWidgets.QLabel('Capacity:', self))
        self.fields['capacity'] = QtWidgets.QSpinBox(self)
        lCapMax.addWidget(self.fields['capacity'])
        self.fields['capacity'].setRange(-1, 1000000)
        self.fields['capacity'].setValue(-1)
        self.fields['capacity'].valueChanged.connect(self.evaluate)
        lCapMax.addWidget(QtWidgets.QLabel('Maximum Running Tasks:', self))
        self.fields['maxruntasks'] = QtWidgets.QSpinBox(self)
        lCapMax.addWidget(self.fields['maxruntasks'])
        self.fields['maxruntasks'].setRange(-1, 1000000)
        self.fields['maxruntasks'].setValue(-1)
        self.fields['maxruntasks'].valueChanged.connect(self.evaluate)
        lCapMax.addWidget(QtWidgets.QLabel('Maximum Tasks Per Host:', self))
        self.fields['maxtasksperhost'] = QtWidgets.QSpinBox(self)
        lCapMax.addWidget(self.fields['maxtasksperhost'])
        self.fields['maxtasksperhost'].setRange(-1, 1000000)
        self.fields['maxtasksperhost'].setValue(-1)
        self.fields['maxtasksperhost'].valueChanged.connect(self.evaluate)
        lCapMax.addWidget(QtWidgets.QLabel('Priority:', self))
        self.fields['priority'] = QtWidgets.QSpinBox(self)
        lCapMax.addWidget(self.fields['priority'])
        self.fields['priority'].setRange(-1, 250)
        self.fields['priority'].setValue(-1)
        self.fields['priority'].valueChanged.connect(self.evaluate)

        # Depend Masks:
        lDepends = QtWidgets.QHBoxLayout()
        joblayout.addLayout(lDepends)
        lDepends.addWidget(QtWidgets.QLabel('Depend Mask:', self))
        self.fields['dependmask'] = QtWidgets.QLineEdit(self)
        lDepends.addWidget(self.fields['dependmask'])
        self.fields['dependmask'].textEdited.connect(self.evaluate)
        lDepends.addWidget(QtWidgets.QLabel('Global:', self))
        self.fields['dependglobal'] = QtWidgets.QLineEdit(self)
        lDepends.addWidget(self.fields['dependglobal'])
        self.fields['dependglobal'].textEdited.connect(self.evaluate)

        # Host Masks:
        lHostMasks = QtWidgets.QHBoxLayout()
        joblayout.addLayout(lHostMasks)
        lHostMasks.addWidget(QtWidgets.QLabel('Hosts Mask:', self))
        self.fields['hostsmask'] = QtWidgets.QLineEdit(self)
        lHostMasks.addWidget(self.fields['hostsmask'])
        self.fields['hostsmask'].textEdited.connect(self.evaluate)
        lHostMasks.addWidget(QtWidgets.QLabel('Exclude:', self))
        self.fields['hostsexclude'] = QtWidgets.QLineEdit(self)
        lHostMasks.addWidget(self.fields['hostsexclude'])
        self.fields['hostsexclude'].textEdited.connect(self.evaluate)

        # Presets:
        presetsLayout = QtWidgets.QHBoxLayout()
        topLayout.addLayout(presetsLayout)
        presetsLayout.addWidget(QtWidgets.QLabel('Recent:', self))
        self.cbRecent = QtWidgets.QComboBox(self)
        self.cbRecent.activated.connect(self.loadRecent)
        presetsLayout.addWidget(self.cbRecent)
        self.bBrowseLoad = QtWidgets.QPushButton('Load', self)
        presetsLayout.addWidget(self.bBrowseLoad)
        self.bBrowseLoad.pressed.connect(self.browseLoad)
        self.bBrowseSave = QtWidgets.QPushButton('Save', self)
        presetsLayout.addWidget(self.bBrowseSave)
        self.bBrowseSave.pressed.connect(self.browseSave)

        # Command Field:
        self.teCmd = QtWidgets.QTextEdit(self)
        topLayout.addWidget(self.teCmd)

        # Buttons:
        buttonsLayout = QtWidgets.QHBoxLayout()
        topLayout.addLayout(buttonsLayout)
        self.bStart = QtWidgets.QPushButton('&Start', self)
        buttonsLayout.addWidget(self.bStart)
        self.bStart.pressed.connect(self.start)
        self.fields['paused'] = QtWidgets.QCheckBox('Paused', self)
        buttonsLayout.addWidget(self.fields['paused'])
        self.fields['paused'].stateChanged.connect(self.evaluate)
        self.bRefresh = QtWidgets.QPushButton('&Refresh', self)
        buttonsLayout.addWidget(self.bRefresh)
        self.bRefresh.pressed.connect(self.evaluate)
        self.bQuitSave = QtWidgets.QPushButton('&Quit&&Store', self)
        buttonsLayout.addWidget(self.bQuitSave)
        self.bQuitSave.pressed.connect(self.quitsave)

        self.constructed = True

        # Set window icon:
        iconpath = cgruutils.getIconFileName('afanasy')
        if iconpath is not None:
            self.setWindowIcon(QtGui.QIcon(iconpath))

        # Refresh recent:
        self.refreshRecent()

        # Load last settings:
        if not self.load(FileLast):
            self.evaluate()
Esempio n. 29
0
    def __init__(self, parent):
        super(DelvesDialog, self).__init__(parent)

        self.setWindowTitle("Ironsworn App | Delves")

        # layout
        main_layout = QtWidgets.QVBoxLayout()
        self.setLayout(main_layout)

        progress_track_widget = ProgressWidget()
        main_layout.addWidget(progress_track_widget)

        domain_layout = QtWidgets.QHBoxLayout()
        domains_group_box = QtWidgets.QGroupBox("Theme/Domain")
        domains_group_box.setLayout(domain_layout)

        themes = ["Ancient"]
        self.theme_cb = QtWidgets.QComboBox()

        for theme in themes:
            self.theme_cb.addItem(theme)

        domain_layout.addWidget(self.theme_cb)

        domains = ["Ruins"]
        self.domain_cb = QtWidgets.QComboBox()

        for domain in domains:
            self.domain_cb.addItem(domain)

        domain_layout.addWidget(self.domain_cb)

        main_layout.addWidget(domains_group_box)

        self.log_widget = QtWidgets.QTextEdit()
        self.log_widget.setReadOnly(True)
        main_layout.addWidget(self.log_widget)

        btn_layout = QtWidgets.QHBoxLayout()
        generators_group_box = QtWidgets.QGroupBox("Generators")
        generators_group_box.setLayout(btn_layout)

        feature_btn = QtWidgets.QPushButton("Features")
        btn_layout.addWidget(feature_btn)
        feature_btn.clicked.connect(self.generate_feature)

        danger_btn = QtWidgets.QPushButton("Dangers")
        btn_layout.addWidget(danger_btn)
        danger_btn.clicked.connect(self.generate_dangers)

        opportunity_btn = QtWidgets.QPushButton("Opportunity")
        btn_layout.addWidget(opportunity_btn)
        opportunity_btn.clicked.connect(self.generate_opportunity)

        trap_btn = QtWidgets.QPushButton("Trap")
        btn_layout.addWidget(trap_btn)
        opportunity_btn.clicked.connect(self.generate_trap)

        loot_btn = QtWidgets.QPushButton("Loot")
        btn_layout.addWidget(loot_btn)
        loot_btn.clicked.connect(self.generate_loot)

        main_layout.addWidget(generators_group_box)
Esempio n. 30
0
    def setupUi(self, CookieDialog):
        CookieDialog.setObjectName("CookieDialog")
        CookieDialog.resize(400, 245)
        self.formLayout = QtWidgets.QFormLayout(CookieDialog)
        self.formLayout.setObjectName("formLayout")
        self.label = QtWidgets.QLabel(CookieDialog)
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                  self.label)
        self.m_nameLineEdit = QtWidgets.QLineEdit(CookieDialog)
        self.m_nameLineEdit.setReadOnly(True)
        self.m_nameLineEdit.setObjectName("m_nameLineEdit")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                  self.m_nameLineEdit)
        self.label_2 = QtWidgets.QLabel(CookieDialog)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                  self.label_2)
        self.m_domainLineEdit = QtWidgets.QLineEdit(CookieDialog)
        self.m_domainLineEdit.setReadOnly(True)
        self.m_domainLineEdit.setObjectName("m_domainLineEdit")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                  self.m_domainLineEdit)
        self.label_4 = QtWidgets.QLabel(CookieDialog)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole,
                                  self.label_4)
        self.m_pathLineEdit = QtWidgets.QLineEdit(CookieDialog)
        self.m_pathLineEdit.setReadOnly(True)
        self.m_pathLineEdit.setObjectName("m_pathLineEdit")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole,
                                  self.m_pathLineEdit)
        self.label_5 = QtWidgets.QLabel(CookieDialog)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.LabelRole,
                                  self.label_5)
        self.m_isHttpOnlyComboBox = QtWidgets.QComboBox(CookieDialog)
        self.m_isHttpOnlyComboBox.setObjectName("m_isHttpOnlyComboBox")
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.FieldRole,
                                  self.m_isHttpOnlyComboBox)
        self.label_3 = QtWidgets.QLabel(CookieDialog)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole,
                                  self.label_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.m_addButton = QtWidgets.QPushButton(CookieDialog)
        self.m_addButton.setEnabled(True)
        self.m_addButton.setObjectName("m_addButton")
        self.horizontalLayout.addWidget(self.m_addButton)
        self.m_cancelButton = QtWidgets.QPushButton(CookieDialog)
        self.m_cancelButton.setObjectName("m_cancelButton")
        self.horizontalLayout.addWidget(self.m_cancelButton)
        self.formLayout.setLayout(8, QtWidgets.QFormLayout.FieldRole,
                                  self.horizontalLayout)
        self.m_isSecureComboBox = QtWidgets.QComboBox(CookieDialog)
        self.m_isSecureComboBox.setObjectName("m_isSecureComboBox")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.FieldRole,
                                  self.m_isSecureComboBox)
        self.label_6 = QtWidgets.QLabel(CookieDialog)
        self.label_6.setObjectName("label_6")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                  self.label_6)
        self.m_valueLineEdit = QtWidgets.QLineEdit(CookieDialog)
        self.m_valueLineEdit.setReadOnly(True)
        self.m_valueLineEdit.setObjectName("m_valueLineEdit")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                  self.m_valueLineEdit)
        self.m_dateEdit = QtWidgets.QDateEdit(CookieDialog)
        self.m_dateEdit.setReadOnly(True)
        self.m_dateEdit.setObjectName("m_dateEdit")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole,
                                  self.m_dateEdit)
        self.label_7 = QtWidgets.QLabel(CookieDialog)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole,
                                  self.label_7)

        self.retranslateUi(CookieDialog)
        self.m_cancelButton.clicked.connect(CookieDialog.reject)
        self.m_addButton.clicked.connect(CookieDialog.accept)
        QtCore.QMetaObject.connectSlotsByName(CookieDialog)
        CookieDialog.setTabOrder(self.m_nameLineEdit, self.m_domainLineEdit)
        CookieDialog.setTabOrder(self.m_domainLineEdit, self.m_valueLineEdit)
        CookieDialog.setTabOrder(self.m_valueLineEdit, self.m_dateEdit)
        CookieDialog.setTabOrder(self.m_dateEdit, self.m_pathLineEdit)
        CookieDialog.setTabOrder(self.m_pathLineEdit,
                                 self.m_isHttpOnlyComboBox)
        CookieDialog.setTabOrder(self.m_isHttpOnlyComboBox,
                                 self.m_isSecureComboBox)
        CookieDialog.setTabOrder(self.m_isSecureComboBox, self.m_addButton)
        CookieDialog.setTabOrder(self.m_addButton, self.m_cancelButton)