示例#1
0
    def __init__(self, cluster, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.__cluster = cluster

        self.txt_name = QtGui.QLineEdit(self.__cluster.name, self)
        self.list_tags = ManagedListWidget(cluster.tags, self)
        self.cb_locked = BooleanCheckBox(cluster.isLocked)
        self.cb_default = BooleanCheckBox(cluster.isDefault)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok
                                         | QtGui.QDialogButtonBox.Cancel)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        layout = QtGui.QFormLayout()
        layout.setLabelAlignment(QtCore.Qt.AlignLeft)
        layout.addRow(FormWidgetLabel("Name", "cluster.name"), self.txt_name)
        layout.addRow(FormWidgetLabel("Tags", "cluster.tags"), self.list_tags)
        layout.addRow(FormWidgetLabel("Locked", "cluster.locked"),
                      self.cb_locked)
        layout.addRow(FormWidgetLabel("Default", "cluster.default"),
                      self.cb_default)
        layout.addRow(buttons)
        self.setLayout(layout)
示例#2
0
    def __init__(self, attrs, parent=None):
        QtGui.QDialog.__init__(self, parent)
        layout = QtGui.QVBoxLayout(self)

        self.sliderRefresh = SpinSliderWidget(1, 60, attrs["refreshSeconds"],
                                              self)
        self.sliderRefresh.slider.setTickInterval(5)
        self.sliderRefresh.slider.setTickPosition(QtGui.QSlider.TicksBelow)
        self.checkboxLoadMine = BooleanCheckBox(bool(attrs["loadMine"]))
        self.listUsers = ManagedListWidget(attrs["users"], "name", self)
        self.checkboxLoadErrors = QtGui.QCheckBox(self)

        projects = [project.code for project in plow.client.get_projects()]
        self.listProjects = CheckableListBox("Projects", projects,
                                             attrs["projects"],
                                             bool(attrs["allProjects"]), self)

        group_box1 = QtGui.QGroupBox("Auto Load Jobs", self)

        form_layout1 = QtGui.QFormLayout(group_box1)
        form_layout1.addRow("Refresh", self.sliderRefresh)
        form_layout1.addRow("Load Mine:", self.checkboxLoadMine)
        form_layout1.addRow("Load User:"******"Load With Errors:", self.checkboxLoadErrors)

        # move to project multi-select widget
        group_box2 = QtGui.QGroupBox("Filters", self)
        form_layout2 = QtGui.QFormLayout(group_box2)
        form_layout2.addRow("For Projects:", self.listProjects)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok
                                         | QtGui.QDialogButtonBox.Cancel)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        layout.addWidget(group_box1)
        layout.addWidget(group_box2)
        layout.addWidget(buttons)