示例#1
0
    def initUI(self):
        """Initialize the UI."""
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        # =====================================================================

        self.group_chooser = QtWidgets.QComboBox()
        layout.addWidget(self.group_chooser)

        # Start menu index.
        start_idx = -1

        # Populate the group chooser with all the existing groups.
        for idx, group in enumerate(sorted(manager.MANAGER.groups.values())):
            label = group.name

            self.group_chooser.addItem(utils.getIconFromGroup(group), label,
                                       group)

            # The group matches our start group so set the start index.
            if group == self.group:
                start_idx = idx

        if start_idx != -1:
            self.group_chooser.setCurrentIndex(start_idx)

        self.group_chooser.currentIndexChanged.connect(self.selectionChanged)

        # =====================================================================

        self.table = widgets.AOVGroupInfoTableWidget(self.group)
        layout.addWidget(self.table)

        # =====================================================================

        self.members = widgets.GroupMemberListWidget(self.group)
        layout.addWidget(self.members)

        # =====================================================================

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok)
        layout.addWidget(self.button_box)

        self.button_box.accepted.connect(self.accept)

        # Button to launch the Edit dialog on the current group.
        self.edit_button = QtWidgets.QPushButton(
            hou.qt.createIcon("BUTTONS_edit"), "Edit")

        self.edit_button.setToolTip("Edit this group.")

        # Use HelpRole to force the button to the left size of the dialog.
        self.button_box.addButton(self.edit_button,
                                  QtWidgets.QDialogButtonBox.HelpRole)
        self.edit_button.clicked.connect(self.edit)

        # =====================================================================

        self.delete_button = QtWidgets.QPushButton(
            hou.qt.createIcon("COMMON_delete"), "Delete")

        self.button_box.addButton(self.delete_button,
                                  QtWidgets.QDialogButtonBox.HelpRole)

        self.delete_button.setToolTip("Delete this group.")
        self.delete_button.clicked.connect(self.delete)

        # =====================================================================

        self.table.resizeColumnToContents(0)
        self.setMinimumSize(self.table.size())
示例#2
0
    def initUI(self):
        """Initialize the UI."""
        layout = QtGui.QVBoxLayout()
        self.setLayout(layout)

        # =====================================================================

        self.group_chooser = QtGui.QComboBox()
        layout.addWidget(self.group_chooser)

        # Start menu index.
        start_idx = -1

        # Populate the group chooser with all the existing groups.
        for idx, group in enumerate(sorted(manager.MANAGER.groups.values())):
            label = group.name

            self.group_chooser.addItem(
                utils.getIconFromGroup(group),
                label,
                group
            )

            # The group matches our start group so set the start index.
            if group == self.group:
                start_idx = idx

        if start_idx != -1:
            self.group_chooser.setCurrentIndex(start_idx)

        self.group_chooser.currentIndexChanged.connect(self.selectionChanged)

        # =====================================================================

        self.table = widgets.AOVGroupInfoTableWidget(self.group)
        layout.addWidget(self.table)

        # =====================================================================

        self.members = widgets.GroupMemberListWidget(self.group)
        layout.addWidget(self.members)

        # =====================================================================

        self.button_box = QtGui.QDialogButtonBox(
            QtGui.QDialogButtonBox.Ok
        )
        layout.addWidget(self.button_box)

        self.button_box.accepted.connect(self.accept)

        # Button to launch the Edit dialog on the current group.
        self.edit_button = QtGui.QPushButton(
            hou.ui.createQtIcon("BUTTONS_edit"),
            "Edit"
        )

        self.edit_button.setToolTip("Edit this group.")

        # Use HelpRole to force the button to the left size of the dialog.
        self.button_box.addButton(self.edit_button, QtGui.QDialogButtonBox.HelpRole)
        self.edit_button.clicked.connect(self.edit)

        # =====================================================================

        self.delete_button = QtGui.QPushButton(
            hou.ui.createQtIcon("COMMON_delete"),
            "Delete"
        )

        self.button_box.addButton(self.delete_button, QtGui.QDialogButtonBox.HelpRole)

        self.delete_button.setToolTip("Delete this group.")
        self.delete_button.clicked.connect(self.delete)

        # =====================================================================

        self.table.resizeColumnToContents(0)
        self.setMinimumSize(self.table.size())
示例#3
0
 def icon(self):
     """Icon for this AOV group."""
     return utils.getIconFromGroup(self.group)
示例#4
0
 def icon(self):
     """Icon for this AOV group."""
     return utils.getIconFromGroup(self.group)