Exemple #1
0
    def setup_ui(self):
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 2, 0, 0)
        top_layout = QHBoxLayout()

        self.select_check = QCheckBox("Select in Maya")
        self.select_check.setChecked(True)

        self.filter_le = Filter()
        self.filter_le.setPlaceholderText("Search...")
        self.update_btn = QToolButton()
        icon_path = join_path.join_path2(pipeGlobal.icons_dir, "update.png")
        self.update_btn.setIcon(QIcon(icon_path))
        self.update_btn.setStyleSheet(
            "QToolButton{background:transparent;border: 0px;}"
            "QToolButton::hover{background:#AAAAAA;}")

        top_layout.addWidget(self.select_check)
        top_layout.addStretch()
        top_layout.addWidget(self.filter_le)
        top_layout.addWidget(self.update_btn)

        self.tree_view = QTreeView()

        btn_layout = QHBoxLayout()
        self.replace_btn = QPushButton("Replace")
        self.replace_btn.setFixedHeight(30)
        btn_layout.addWidget(self.replace_btn)

        # main_layout.addLayout(top_layout)
        main_layout.addWidget(self.tree_view)
Exemple #2
0
class CommonWidget(QWidget):
    add_signal = Signal(basestring)

    def __init__(self, parent=None):
        super(CommonWidget, self).__init__(parent)
        self.resize(150, 180)
        self.model_data = list()
        self.group_name = None

        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)
        self.group_box = QGroupBox()
        main_layout.addWidget(self.group_box)
        group_layout = QVBoxLayout()

        icon_dir = pipeGlobal.icons_dir
        icon_path = join_path.join_path2(icon_dir, "search.png")
        self.filter_le = Filter(icon_path)

        self.list_view = ListView()
        group_layout.addWidget(self.filter_le)
        group_layout.addWidget(self.list_view)
        self.group_box.setLayout(group_layout)
        self.set_model()
        # self.set_signals()

    def set_model(self):
        self.list_model = ListModel(self.model_data)
        self.proxy_model = QSortFilterProxyModel()
        self.proxy_model.setSourceModel(self.list_model)
        self.proxy_model.setDynamicSortFilter(True)
        self.proxy_model.setFilterCaseSensitivity(Qt.CaseInsensitive)
        self.proxy_model.setSortCaseSensitivity(Qt.CaseInsensitive)
        self.list_view.setModel(self.proxy_model)
        self.filter_le.textChanged.connect(self.proxy_model.setFilterRegExp)

    def set_signals(self):
        self.add_btn.clicked.connect(self.add)

    def set_group_name(self, value):
        self.group_box.setTitle(value)

    def set_model_data(self, value):
        if not value:
            return
        self.model_data = value
        self.set_model()

    def set_enable(self, value):
        if not value:
            self.filter_le.setEnabled(False)
            self.add_btn.setEnabled(False)
            self.list_view.setEnabled(False)
            self.list_view.clear()
        else:
            self.filter_le.setEnabled(True)
            self.add_btn.setEnabled(True)
            self.list_view.setEnabled(True)
Exemple #3
0
class ReplaceAssetUI(QDialog):
    def __init__(self, parent=None):
        super(ReplaceAssetUI, self).__init__(parent)
        self.resize(1000, 600)
        self.setObjectName("Replace Asset")
        self.setup_ui()
        self.setWindowFlags(Qt.Window)

    def setup_ui(self):
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 2, 0, 0)
        top_layout = QHBoxLayout()

        convert_layout = QHBoxLayout()
        convert_label = QLabel("Convert")
        self.src_cbox = QComboBox()
        to_label = QLabel("=========>")
        self.dst_cbox = QComboBox()
        convert_layout.addWidget(convert_label)
        convert_layout.addWidget(self.src_cbox)
        convert_layout.addWidget(to_label)
        convert_layout.addWidget(self.dst_cbox)

        self.select_check = QCheckBox("Select in Maya")
        self.select_check.setChecked(True)

        self.filter_le = Filter()
        self.filter_le.setPlaceholderText("Search...")
        self.update_btn = QToolButton()
        icon_path = join_path.join_path2(pipeGlobal.icons_dir, "update.png")
        self.update_btn.setIcon(QIcon(icon_path))
        self.update_btn.setStyleSheet("QToolButton{background:transparent;border: 0px;}"
                                      "QToolButton::hover{background:#AAAAAA;}")

        top_layout.addLayout(convert_layout)
        top_layout.addWidget(self.select_check)
        top_layout.addStretch()
        top_layout.addWidget(self.filter_le)
        top_layout.addWidget(self.update_btn)

        self.tree_view = QTreeView()

        btn_layout = QHBoxLayout()
        self.replace_btn = QPushButton("Replace")
        self.replace_btn.setFixedHeight(30)
        btn_layout.addWidget(self.replace_btn)

        main_layout.addLayout(top_layout)
        main_layout.addWidget(self.tree_view)
        main_layout.addLayout(btn_layout)
Exemple #4
0
    def setup_ui(self):
        self.resize(380, 600)
        main_layout = QVBoxLayout(self)

        project_layout = QHBoxLayout()
        project_label = QLabel("Project")
        project_label.setFixedWidth(50)
        self.project_cbox = ProjectCombo()
        project_layout.addWidget(project_label)
        project_layout.addWidget(self.project_cbox)

        self.filter_le = Filter()

        layout = QHBoxLayout()
        self.final_check = QCheckBox("Delivered")
        self.refresh_btn = RefreshButton()
        layout.addWidget(self.final_check)
        layout.addStretch()
        layout.addWidget(self.refresh_btn)

        self.task_view = QListView()
        self.task_view.setFocusPolicy(Qt.NoFocus)
        self.task_view.setStyleSheet(LIST_VIEW_STYLE)

        main_layout.addLayout(project_layout)
        main_layout.addWidget(self.filter_le)
        main_layout.addLayout(layout)
        main_layout.addWidget(self.task_view)
Exemple #5
0
    def setup_ui(self):
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)
        proxy_filter_layout = QHBoxLayout()
        self.filter_le = Filter()
        proxy_filter_layout.addStretch()
        proxy_filter_layout.addWidget(self.filter_le)
        self.update_btn = QToolButton()
        icon_path = join_path.join_path2(pipeGlobal.icons_dir, "update.png")
        self.update_btn.setIcon(QIcon(icon_path))
        self.update_btn.setStyleSheet(
            "QToolButton{background:transparent;}"
            "QToolButton::hover{background:#00BFFF;border-color:#00BFFF;}")
        proxy_filter_layout.addWidget(self.update_btn)

        self.table_view = QTableView()
        self.table_view.verticalHeader().hide()
        self.table_view.horizontalHeader().setStretchLastSection(True)
        self.table_view.setSortingEnabled(True)
        self.table_view.setAlternatingRowColors(True)
        self.table_view.setSelectionBehavior(QAbstractItemView.SelectRows)

        btn_layout = QHBoxLayout()
        self.switch_btn = QPushButton("Switch")
        self.cancel_btn = QPushButton("Cancel")
        btn_layout.addStretch()
        btn_layout.addWidget(self.switch_btn)
        btn_layout.addWidget(self.cancel_btn)
        # --filter layout
        filter_layout = QHBoxLayout()
        filter_layout.setContentsMargins(0, 0, 0, 0)
        filter_group = QGroupBox()
        filter_layout.addWidget(filter_group)
        check_layout = QHBoxLayout(filter_group)
        check_layout.setContentsMargins(3, 1, 0, 1)
        filter_label = QLabel("Filters")
        self.check_btn_group = QButtonGroup()
        self.check_btn_group.setExclusive(False)
        self.green_check = QCheckBox()
        self.green_check.setChecked(True)
        self.green_check.setIcon(QIcon(self.green_icon_path))
        self.red_check = QCheckBox()
        self.red_check.setChecked(True)
        self.red_check.setIcon(QIcon(self.red_icon_path))
        check_layout.addWidget(filter_label)
        check_layout.addWidget(self.green_check)
        check_layout.addWidget(self.red_check)
        self.check_btn_group.addButton(self.green_check)
        self.check_btn_group.addButton(self.red_check)

        bottom_layout = QHBoxLayout()
        bottom_layout.addLayout(filter_layout)
        bottom_layout.addStretch()
        bottom_layout.addLayout(btn_layout)

        main_layout.addLayout(proxy_filter_layout)
        main_layout.addWidget(self.table_view)
        main_layout.addLayout(bottom_layout)
Exemple #6
0
    def __init__(self, parent=None):
        super(CommonWidget, self).__init__(parent)
        self.resize(150, 180)
        self.model_data = list()
        self.group_name = None

        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)
        self.group_box = QGroupBox()
        main_layout.addWidget(self.group_box)
        group_layout = QVBoxLayout()

        icon_dir = pipeGlobal.icons_dir
        icon_path = join_path.join_path2(icon_dir, "search.png")
        self.filter_le = Filter(icon_path)

        self.list_view = ListView()
        group_layout.addWidget(self.filter_le)
        group_layout.addWidget(self.list_view)
        self.group_box.setLayout(group_layout)
        self.set_model()
Exemple #7
0
 def create_user_info_group(self):
     user_info_grp = QGroupBox("User Info")
     user_info_layout = QVBoxLayout(user_info_grp)
     filter_layout = QHBoxLayout()
     self.filter_le = Filter()
     self.user_count_label = QLabel()
     filter_layout.addWidget(self.user_count_label)
     filter_layout.addStretch()
     filter_layout.addWidget(self.filter_le)
     self.user_info_view = QTableView()
     self.user_info_view.verticalHeader().hide()
     self.user_info_view.setAlternatingRowColors(True)
     self.user_info_view.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.user_info_view.setSelectionMode(
         QAbstractItemView.ExtendedSelection)
     user_info_layout.addLayout(filter_layout)
     user_info_layout.addWidget(self.user_info_view)
     return user_info_grp
Exemple #8
0
    def setup_ui(self):
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)
        project_layout = QHBoxLayout()
        project_label = QLabel("Project")
        project_label.setFixedWidth(50)
        self.project_combo = ProjectCombo()
        project_layout.addWidget(project_label)
        project_layout.addWidget(self.project_combo)

        self.filter_le = Filter()

        self.tree_view = QTreeView()
        self.tree_view.setHeaderHidden(True)

        main_layout.addLayout(project_layout)
        main_layout.addWidget(self.filter_le)
        main_layout.addWidget(self.tree_view)
Exemple #9
0
    def __init__(self, parent=None):
        super(SwitchShader, self).__init__(parent)
        self.logger = logging.getLogger(__name__)
        self.setWindowFlags(Qt.Dialog | Qt.WindowCloseButtonHint
                            | Qt.WindowMinimizeButtonHint)
        self.setWindowTitle("Switch Shader")
        self.resize(400, 350)
        self.current_project = get_current_project.get_current_project()
        self.__db = sql_api.SqlApi(self.current_project)
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(4, 4, 4, 4)

        self.filter_layout = QHBoxLayout()
        self.filter_le = Filter()
        self.filter_layout.addStretch()
        self.filter_layout.addWidget(self.filter_le)
        self.update_btn = QToolButton()
        icon_path = join_path.join_path2(pipeGlobal.icons_dir, "update.png")
        self.update_btn.setIcon(QIcon(icon_path))
        self.update_btn.setStyleSheet(
            "QToolButton{background:transparent;}"
            "QToolButton::hover{background:#00BFFF;border-color:#00BFFF;}")
        self.filter_layout.addWidget(self.update_btn)

        self.table_view = QTableView()
        self.table_view.verticalHeader().hide()
        self.table_view.horizontalHeader().setStretchLastSection(True)
        self.table_view.setSortingEnabled(True)
        self.table_view.setAlternatingRowColors(True)
        self.table_view.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.btn_layout = QHBoxLayout()
        self.switch_btn = QPushButton("Switch")
        self.cancel_btn = QPushButton("Cancel")
        self.btn_layout.addStretch()
        self.btn_layout.addWidget(self.switch_btn)
        self.btn_layout.addWidget(self.cancel_btn)

        main_layout.addLayout(self.filter_layout)
        main_layout.addWidget(self.table_view)
        main_layout.addLayout(self.btn_layout)

        self.set_model()
        self.set_signals()
Exemple #10
0
 def __init__(self, parent=None):
     super(SinglePublishUI, self).__init__(parent)
     self.resize(400, 300)
     main_layout = QVBoxLayout(self)
     main_layout.setContentsMargins(0, 1, 0, 1)
     # filter layout
     filter_layout = QHBoxLayout()
     filter_layout.addStretch()
     self.filter_le = Filter()
     filter_layout.addWidget(self.filter_le)
     self.update_btn = QToolButton()
     icon_path = join_path.join_path2(pipeGlobal.icons_dir, "update.png")
     self.update_btn.setIcon(QIcon(icon_path))
     self.update_btn.setStyleSheet("QToolButton{background:transparent;}"
                                   "QToolButton::hover{background:#00BFFF;border-color:#00BFFF;}")
     filter_layout.addWidget(self.update_btn)
     # table view
     self.table_view = QTableView()
     main_layout.addLayout(filter_layout)
     main_layout.addWidget(self.table_view)
Exemple #11
0
    def __init__(self, parent=None):
        super(LayoutProducerUI, self).__init__(parent)
        self.setWindowTitle("Layout creater")
        self.resize(440, 600)
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(2, 2, 2, 2)
        main_layout.setSpacing(2)

        project_layout = QHBoxLayout()
        project_layout.setContentsMargins(10, 2, 10, 2)
        project_label = QLabel("Project")
        project_label.setFixedWidth(50)
        self.project_cbox = QComboBox()
        project_layout.addWidget(project_label)
        project_layout.addWidget(self.project_cbox)

        asset_group = QGroupBox("asset type")
        asset_layout = QHBoxLayout(asset_group)
        self.asset_btn_grp = QButtonGroup()
        self.asset_btn_grp.setExclusive(True)
        for asset_type in ["Character", "Prop", "Environment"]:
            self.asset_type_check = QCheckBox(asset_type)
            self.asset_btn_grp.addButton(self.asset_type_check)
            asset_layout.addWidget(self.asset_type_check)

        filter_layout = QHBoxLayout()
        filter_layout.setContentsMargins(15, 0, 0, 0)
        self.low_check = QCheckBox("low")
        self.low_check.setChecked(True)
        namespace_label = QLabel("namespace")
        self.name_space_cbox = QComboBox()
        self.filter_le = Filter()
        self.update_btn = QToolButton()
        icon_path = join_path.join_path2(pipeGlobal.icons_dir, "update.png")
        self.update_btn.setIcon(QIcon(icon_path))
        self.update_btn.setStyleSheet("QToolButton{background:transparent;}"
                                      "QToolButton::hover{background:#00BFFF;border-color:#00BFFF;}")
        filter_layout.addWidget(self.low_check)
        filter_layout.addStretch()
        filter_layout.addWidget(namespace_label)
        filter_layout.addWidget(self.name_space_cbox)
        filter_layout.addStretch()
        filter_layout.addWidget(self.filter_le)
        filter_layout.addWidget(self.update_btn)

        splitter = QSplitter(Qt.Vertical)

        asset_widget = QWidget()
        asset_layout = QVBoxLayout(asset_widget)
        asset_layout.setContentsMargins(0, 0, 0, 0)
        self.asset_list_view = ThumbListView()

        add_btn_layout = QHBoxLayout()
        self.add_btn = QToolButton()
        self.add_btn.setShortcut("Ctrl+D")
        self.add_btn.setToolTip("Ctrl+D")
        icon_dir = pipeGlobal.icons_dir
        arrow_down_path = join_path.join_path2(icon_dir, "arrow_dow.png")
        self.add_btn.setIcon(QIcon(arrow_down_path))
        add_btn_layout.addWidget(self.add_btn)
        asset_layout.addWidget(self.asset_list_view)
        asset_layout.addLayout(add_btn_layout)

        self.include_list_view = ThumbListView()

        splitter.addWidget(asset_widget)
        splitter.addWidget(self.include_list_view)

        btn_layout = QHBoxLayout()
        self.reference_all_btn = QPushButton("Reference All")
        self.reference_sel_btn = QPushButton("Reference Selected")
        btn_layout.setSpacing(6)
        btn_layout.addStretch()
        btn_layout.addWidget(self.reference_all_btn)
        btn_layout.addWidget(self.reference_sel_btn)

        main_layout.addLayout(project_layout)
        main_layout.addWidget(asset_group)
        main_layout.addLayout(filter_layout)
        main_layout.addWidget(splitter)
        main_layout.addLayout(btn_layout)
        splitter.setSizes([self.height()*0.8, self.height()*0.2])
Exemple #12
0
    def __init__(self, parent=None):
        super(TaskGetUI, self).__init__(parent)
        self.setWindowFlags(Qt.Window)
        self.setWindowTitle("Task get")
        self.setObjectName("Task get")
        self.resize(750, 630)
        main_layout = QVBoxLayout(self)
        main_layout.setContentsMargins(0, 0, 0, 0)

        project_layout = QHBoxLayout()
        project_label = QLabel("Project")
        project_label.setFixedWidth(50)
        self.project_cbox = ProjectCombo()
        project_layout.addWidget(project_label)
        project_layout.addWidget(self.project_cbox)

        main_splitter = QSplitter(Qt.Horizontal, self)

        task_widget = QTabWidget()
        my_task_widget = QWidget()
        task_widget.addTab(my_task_widget, "My Tasks")
        my_task_layout = QVBoxLayout(my_task_widget)
        self.filter_le = Filter()
        mid_layout = QHBoxLayout()
        self.final_checkbox = QCheckBox("Delivered")
        self.final_checkbox.setChecked(False)
        self.refresh_btn = RefreshButton()
        mid_layout.addWidget(self.final_checkbox)
        mid_layout.addStretch()
        mid_layout.addWidget(self.refresh_btn)
        self.task_view = QTreeView()
        my_task_layout.addWidget(self.filter_le)
        my_task_layout.addLayout(mid_layout)
        my_task_layout.addWidget(self.task_view)

        info_widget = QWidget()
        info_layout = QVBoxLayout(info_widget)
        info_layout.setContentsMargins(0, 0, 0, 0)

        detail_widget = QWidget()
        layout = QVBoxLayout(detail_widget)
        layout.setContentsMargins(0, 0, 0, 0)
        detail_group = QGroupBox()
        layout.addWidget(detail_group)
        detail_layout = QGridLayout(detail_group)
        status_label = QLabel()
        status_label.setText("<font size=3 color=#DDD>Stauts:</font>")
        self.status_label = QLabel()
        due_label = QLabel()
        due_label.setText("<font size=3 color=#DDD>Due Date:</font>")
        self.due_label = QLabel()
        detail_layout.addWidget(status_label, 0, 0, 1, 1)
        detail_layout.addWidget(self.status_label, 0, 1, 1, 4)
        detail_layout.addWidget(due_label, 1, 0, 1, 1)
        detail_layout.addWidget(self.due_label, 1, 1, 1, 4)
        detail_layout.setVerticalSpacing(11)

        init_layout = QHBoxLayout()
        init_layout.setContentsMargins(0, 0, 0, 0)
        self.init_btn = QPushButton("+ Initialize Task")
        self.init_btn.setStyleSheet(
            "color: #00b4ff; font-size: 10pt; font-weight: bold; ")
        init_layout.addStretch()
        init_layout.addWidget(self.init_btn)

        self.file_widget = QTabWidget()
        self.local_file_widget = FileTreeView("local")
        self.work_file_widget = FileTreeView("work")
        self.publish_file_widget = FileTreeView("publish")
        self.file_widget.addTab(self.local_file_widget, "Local")
        self.file_widget.addTab(self.work_file_widget, "Working")
        self.file_widget.addTab(self.publish_file_widget, "Publishes")

        info_layout.addWidget(detail_widget)
        info_layout.addLayout(init_layout)
        info_layout.addWidget(self.file_widget)

        main_splitter.addWidget(task_widget)
        main_splitter.addWidget(info_widget)

        main_splitter.setSizes([self.width() * 0.45, self.width() * 0.55])
        main_splitter.setStretchFactor(1, 1)

        main_layout.addLayout(project_layout)
        main_layout.addWidget(main_splitter)
Exemple #13
0
    def __init__(self, parent=None):
        super(EntityUI, self).__init__(parent)
        self.setWindowTitle("Loader")
        self.setObjectName("Loader")
        main_layout = QVBoxLayout(self)
        main_layout.setAlignment(Qt.AlignTop)
        main_layout.setContentsMargins(2, 2, 2, 2)
        main_layout.setSpacing(2)

        project_layout = QHBoxLayout()
        project_layout.setContentsMargins(0, 0, 0, 0)
        project_label = QLabel("Project")
        project_label.setFixedWidth(50)
        self.project_cbox = ProjectCombo()
        project_layout.addWidget(project_label)
        project_layout.addWidget(self.project_cbox)

        show_image_layout = QHBoxLayout()
        self.show_image_btn = QPushButton("show image")
        self.show_image_btn.setStyleSheet(
            "QPushButton{color: #00b4ff; font: bold; font-size: 12px; font-family: Arial;"
            "background:transparent; border: 0px;}"
            "QPushButton:hover{color:#ff8c00;}QPushButton:pressed{color: #8B0000}"
        )
        show_image_layout.addStretch()
        show_image_layout.addWidget(self.show_image_btn)

        self.entity_tab = QTabWidget()
        asset_widget = QWidget()
        self.asset_layout = QHBoxLayout(asset_widget)
        self.asset_layout.setAlignment(Qt.AlignTop)
        self.asset_btn_grp = QButtonGroup()
        self.asset_btn_grp.setExclusive(True)
        self.entity_tab.addTab(asset_widget, "Asset")
        self.entity_tab.setMaximumHeight(60)

        shot_widget = QWidget()
        shot_layout = QHBoxLayout(shot_widget)
        sequence_label = QLabel("Sequence")
        sequence_label.setFixedWidth(60)
        self.sequence_le = QLineEdit()
        shot_layout.addWidget(sequence_label)
        shot_layout.addWidget(self.sequence_le)
        self.entity_tab.addTab(shot_widget, "Shot")

        filter_layout = QHBoxLayout()
        self.filter_le = Filter()
        filter_layout.addStretch()
        filter_layout.addWidget(self.filter_le)

        self.list_view = ThumbListView()
        show_layout = QHBoxLayout()
        show_label = QLabel("Current Selected:")
        self.show_le = QLineEdit()
        self.show_le.setReadOnly(True)
        self.show_le.setStyleSheet("border: 0px solid;")
        show_layout.addWidget(show_label)
        show_layout.addWidget(self.show_le)

        main_layout.addLayout(project_layout)
        main_layout.addLayout(show_image_layout)
        main_layout.addWidget(self.entity_tab)
        main_layout.addLayout(filter_layout)
        main_layout.addWidget(self.list_view)
        main_layout.addLayout(show_layout)

        self.waiting_widget = Waiting(self.list_view)
        self.waiting_widget.hide()