def __init__(self, parent=None, project=None, **kwargs): super(ChooseTargetsPage, self).__init__(parent) self.__project = project self.setTitle("Apply the dependency") layout = QtGui.QVBoxLayout(self) layout.setContentsMargins(2, 0, 2, 0) self.__errText = QtGui.QLabel("", self) self.group1 = group1 = QtGui.QGroupBox("Dependant Item", self) groupLayout1 = QtGui.QVBoxLayout(group1) groupLayout1.setContentsMargins(0, 0, 0, 0) self.__sourceSelector = src = common.job.JobColumnWidget( project=project, parent=self) # src.setSingleSelections(True) groupLayout1.addWidget(src) self.group2 = group2 = QtGui.QGroupBox("Item Depends On", self) groupLayout2 = QtGui.QVBoxLayout(group2) groupLayout2.setContentsMargins(0, 0, 0, 0) self.__destSelector = dst = common.job.JobColumnWidget(project=project, parent=self) groupLayout2.addWidget(self.__destSelector) layout.addWidget(self.__errText) layout.addWidget(group1) layout.addWidget(group2) self.registerField("sourceSelection*", self, "sourceSelection") self.registerField("destSelection*", self, "destSelection")
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)
def __init__(self, title, options, cols=3, parent=None): QtGui.QWidget.__init__(self, parent) layout = QtGui.QVBoxLayout(self) group_box = QtGui.QGroupBox(title) group_box_layout = QtGui.QGridLayout(group_box) row = 0 for item, opt in enumerate(options): row = item / cols radio = QtGui.QRadioButton(opt, self) group_box_layout.addWidget(radio, row, item % cols) layout.addWidget(group_box)