def __init__(self, parent=None, name=None, fl=0): CreateTaskBase.__init__(self, parent, name, fl, 'Standard') if not name: self.setName("create_discrete_widget") self.previous_energy = None self.init_models() # # Layout # v_layout = qt.QVBoxLayout(self, 2, 5, "v_layout") self._acq_gbox = qt.QVGroupBox('Acquisition', self, 'acq_gbox') self._acq_widget = \ AcquisitionWidget(self._acq_gbox, "acquisition_widget", layout='vertical', acq_params=self._acquisition_parameters, path_template=self._path_template) self._data_path_gbox = qt.QVGroupBox('Data location', self, 'data_path_gbox') self._data_path_widget = \ DataPathWidget(self._data_path_gbox, 'create_dc_path_widget', data_model=self._path_template, layout='vertical') self._processing_gbox = qt.QVGroupBox('Processing', self, 'processing_gbox') self._processing_widget = \ ProcessingWidget(self._processing_gbox, data_model=self._processing_parameters) v_layout.addWidget(self._acq_gbox) v_layout.addWidget(self._data_path_gbox) v_layout.addWidget(self._processing_gbox) v_layout.addStretch() dp_layout = self._data_path_widget.data_path_widget_layout self.connect(self._acq_widget, qt.PYSIGNAL('mad_energy_selected'), self.mad_energy_selected) self.connect(dp_layout.child('prefix_ledit'), qt.SIGNAL("textChanged(const QString &)"), self._prefix_ledit_change) self.connect(dp_layout.child('run_number_ledit'), qt.SIGNAL("textChanged(const QString &)"), self._run_number_ledit_change) self.connect(self._acq_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict) self.connect(self._data_path_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict)
def __init__(self, parent=None, name=None, fl=0): qt.QWidget.__init__(self, parent, name, fl) # AsyncResult to return values self._async_result = None # Layout qt.QVBoxLayout(self) main_layout = self.layout() main_layout.setSpacing(10) main_layout.setMargin(6) self.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.setCaption("GPhL Workflow parameters") # Info box self.info_gbox = qt.QVGroupBox("Info", self, "info_gbox") main_layout.addWidget(self.info_gbox) self.info_text = qt.QTextEdit(self.info_gbox, "info_text") self.info_text.setTextFormat(0) # PlainText self.info_text.setFont(qt.QFont("Courier")) self.info_text.setReadOnly(True) # Special parameter box self.cplx_gbox = qt.QVGroupBox("Indexing solution", self, "cplx_gbox") main_layout.addWidget(self.cplx_gbox) self.cplx_widget = None # Parameter box self.parameter_gbox = qt.QVGroupBox("Parameters", self, "parameter_gbox") main_layout.addWidget(self.parameter_gbox) self.params_widget = None # Button bar button_layout = qt.QHBoxLayout(None, 0, 6, "button_layout") hspacer = qt.QSpacerItem(1, 20, qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum) button_layout.addItem(hspacer) self.continue_button = qt.QPushButton("Continue", self, "continue_button") button_layout.addWidget(self.continue_button) self.cancel_button = qt.QPushButton("Abort", self, "cancel_button") button_layout.addWidget(self.cancel_button) main_layout.addLayout(button_layout) qt.QObject.connect(self.continue_button, qt.SIGNAL("clicked()"), self.continue_button_click) qt.QObject.connect(self.cancel_button, qt.SIGNAL("clicked()"), self.cancel_button_click) self.resize(qt.QSize(1018, 472).expandedTo(self.minimumSizeHint())) self.clearWState(qt.Qt.WState_Polished)
def __init__(self, parent=None, name=None, fl=0): CreateTaskBase.__init__(self, parent, name, fl, "Workflow") # Data attributes self.workflow_hwobj = None self.workflows = {} self.init_models() # Layout v_layout = qt.QVBoxLayout(self, 2, 5, "main_v_layout") self._workflow_type_gbox = qt.QVGroupBox("Workflow type", self, "workflow_rtype") self._workflow_cbox = qt.QComboBox(self._workflow_type_gbox) self._data_path_gbox = qt.QVGroupBox("Data location", self, "data_path_gbox") self._data_path_widget = DataPathWidget(self._data_path_gbox, data_model=self._path_template, layout="vertical") self._data_path_widget.data_path_widget_layout.child( "file_name_label").setText("") self._data_path_widget.data_path_widget_layout.child( "file_name_value_label").hide() # self._grid_widget = MxLookupScanBrick.MxLookupScanBrick(self, 'grid_widget') v_layout.addWidget(self._workflow_type_gbox) v_layout.addWidget(self._data_path_gbox) # v_layout.addWidget(self._grid_widget) v_layout.addStretch() self.connect( self._data_path_widget.data_path_widget_layout.child( "prefix_ledit"), qt.SIGNAL("textChanged(const QString &)"), self._prefix_ledit_change, ) self.connect( self._data_path_widget.data_path_widget_layout.child( "run_number_ledit"), qt.SIGNAL("textChanged(const QString &)"), self._run_number_ledit_change, ) self.connect( self._data_path_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict, )
def __init__(self, parent = None, name = "task_toolbox"): qt.QWidget.__init__(self, parent, name) # Data atributes self.shape_history = None self.tree_brick = None self.previous_page_index = 0 #Layout self.v_layout = qt.QVBoxLayout(self) self.v_layout.setSpacing(10) self.method_group_box = qt.QVGroupBox("Collection method", self) font = self.method_group_box.font() font.setPointSize(12) self.method_group_box.setFont(font) self.tool_box = qt.QToolBox(self.method_group_box , "tool_box") self.tool_box.setFixedWidth(475) font = self.tool_box.font() font.setPointSize(10) self.tool_box.setFont(font) self.discrete_page = CreateDiscreteWidget(self.tool_box, "Discrete",) self.discrete_page.setBackgroundMode(qt.QWidget.PaletteBackground) self.char_page = CreateCharWidget(self.tool_box, "Characterise") self.char_page.setBackgroundMode(qt.QWidget.PaletteBackground) self.helical_page = CreateHelicalWidget(self.tool_box, "helical_page") self.helical_page.setBackgroundMode(qt.QWidget.PaletteBackground) self.energy_scan_page = CreateEnergyScanWidget(self.tool_box, "energy_scan") self.xrf_scan_page = CreateXRFScanWidget(self.tool_box, "xrf_scan") self.workflow_page = CreateWorkflowWidget(self.tool_box, 'workflow') self.tool_box.addItem(self.discrete_page, "Standard Collection") self.tool_box.addItem(self.char_page, "Characterisation") self.tool_box.addItem(self.helical_page, "Helical Collection") self.tool_box.addItem(self.energy_scan_page, "Energy Scan") self.tool_box.addItem(self.xrf_scan_page, "XRF Scan") self.tool_box.addItem(self.workflow_page, "Advanced") self.add_pixmap = Icons.load("add_row.png") self.create_task_button = qt.QPushButton(" Add to queue", self) self.create_task_button.setIconSet(qt.QIconSet(self.add_pixmap)) msg = "Add the collection method to the selected sample" qt.QToolTip.add(self.create_task_button, msg) self.v_layout.addWidget(self.method_group_box) self.button_hlayout = qt.QHBoxLayout(None) self.spacer = qt.QSpacerItem(1, 20, qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum) self.button_hlayout.addItem(self.spacer) self.button_hlayout.addWidget(self.create_task_button) self.method_group_box.layout().setSpacing(10) self.method_group_box.layout().addLayout(self.button_hlayout) qt.QObject.connect(self.create_task_button, qt.SIGNAL("clicked()"), self.create_task_button_click) qt.QObject.connect(self.tool_box, qt.SIGNAL("currentChanged( int )"), self.current_page_changed)
def __init__(self, parent=None, name=None, fl=0): CreateTaskBase.__init__(self, parent, name, fl, "XRF-spectrum") self.count_time = None # Data attributes self.init_models() xrfspectrum_model = queue_model_objects.XRFSpectrum() self.xrfspectrum_mib = DataModelInputBinder(xrfspectrum_model) # Layout v_layout = qt.QVBoxLayout(self, 2, 6, "main_v_layout") self._data_path_gbox = qt.QVGroupBox("Data location", self, "data_path_gbox") self._data_path_widget = DataPathWidget( self._data_path_gbox, data_model=self._path_template, layout="vertical" ) parameters_hor_gbox = qt.QHGroupBox("Parameters", self) self.count_time_label = qt.QLabel("Count time", parameters_hor_gbox) self.count_time_label.setFixedWidth(83) self.count_time_ledit = qt.QLineEdit( "1.0", parameters_hor_gbox, "count_time_ledit" ) self.count_time_ledit.setFixedWidth(50) self.xrfspectrum_mib.bind_value_update( "count_time", self.count_time_ledit, float ) # , spacer = qt.QWidget(parameters_hor_gbox) spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Fixed) v_layout.addWidget(self._data_path_gbox) v_layout.addWidget(parameters_hor_gbox) v_layout.addStretch() self.connect( self._data_path_widget.data_path_widget_layout.child("run_number_ledit"), qt.SIGNAL("textChanged(const QString &)"), self._run_number_ledit_change, ) self.connect( self._data_path_widget.data_path_widget_layout.child("prefix_ledit"), qt.SIGNAL("textChanged(const QString &)"), self._prefix_ledit_change, ) self.connect( self._data_path_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict, )
def renew(self): self.windowPreviewBox.close(True) self.windowPreviewBox = qt.QVGroupBox("Window preview", self) self.windowPreview = GUIDisplay.WindowDisplayWidget(self.windowPreviewBox) qt.QObject.connect(self.windowPreview, qt.PYSIGNAL("itemClicked"), self.previewItemClicked) self.layout().addWidget(self.windowPreviewBox) self.windowPreviewBox.show()
def __init__(self, *args, **kwargs): qt.QWidget.__init__(self, *args) self.setCaption("GUI Preview") self.windowPreviewBox = qt.QVGroupBox("Window preview", self) self.windowPreview = GUIDisplay.WindowDisplayWidget(self.windowPreviewBox) qt.QObject.connect(self.windowPreview, qt.PYSIGNAL("itemClicked"), self.previewItemClicked) qt.QVBoxLayout(self) self.layout().addWidget(self.windowPreviewBox) # set arbitrary default size self.resize(640,480)
def __init__(self, parent=None, name=None, fl=0): CreateTaskBase.__init__(self, parent, name, fl, "Energy-scan") # Data attributes self.init_models() # Layout v_layout = qt.QVBoxLayout(self, 2, 5, "main_v_layout") h_box = qt.QHGroupBox("Available elements", self) self.periodic_table = PeriodicTableBrick(h_box) font = self.periodic_table.font() font.setPointSize(8) self.periodic_table.setFont(font) h_box.setMaximumWidth(470) h_box.setMaximumHeight(310) self._data_path_gbox = qt.QVGroupBox("Data location", self, "data_path_gbox") self._data_path_widget = DataPathWidget( self._data_path_gbox, data_model=self._path_template, layout="vertical" ) v_layout.addWidget(h_box) v_layout.addWidget(self._data_path_gbox) v_layout.addStretch() self.connect( self._data_path_widget.data_path_widget_layout.child("prefix_ledit"), qt.SIGNAL("textChanged(const QString &)"), self._prefix_ledit_change, ) self.connect( self._data_path_widget.data_path_widget_layout.child("run_number_ledit"), qt.SIGNAL("textChanged(const QString &)"), self._run_number_ledit_change, ) self.connect( self._data_path_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict, ) qt.QObject.connect( self.periodic_table, qt.PYSIGNAL("edgeSelected"), self.element_clicked )
def __init__(self, *args, **kwargs): BaseComponents.BlissWidget.__init__(self, *args, **kwargs) self.detector_ho = None self.addProperty("mnemonic", "string", "") self.addProperty("nb_ccd", "integer", 9) self.gbox = qt.QVGroupBox("ADSC temperature", self) self.gbox.setInsideSpacing(0) self.gbox.setAlignment(qt.QLabel.AlignCenter) self.lblStatus = qt.QLabel("<nobr>unknown state</nobr>", self.gbox) self.lblStatus.setSizePolicy(qt.QSizePolicy.MinimumExpanding, qt.QSizePolicy.Fixed) self.lblStatus.setPaletteBackgroundColor(qt.Qt.lightGray) self.lblStatus.setAlignment(qt.Qt.AlignCenter) self.tempPanel = TemperaturePanel(self.gbox) qt.QVBoxLayout(self) self.layout().addWidget(self.gbox)
def __init__(self, parent=None): super(UpdatePage, self).__init__(parent) updateGroup = qt.QVGroupBox("Package selection", self) systemCheckBox = qt.QCheckBox("Update system", updateGroup) appsCheckBox = qt.QCheckBox("Update applications", updateGroup) docsCheckBox = qt.QCheckBox("Update documentation", updateGroup) packageGroup = qt.QHGroupBox("Existing packages", self) packageList = qt.QListView(packageGroup) packageList.addColumn("") packageList.setColumnWidthMode(0, qt.QListView.Maximum) packageList.setColumnWidth(0, packageList.width()) qtItem = qt.QListViewItem(packageList) qtItem.setText(0, "Qt") qsaItem = qt.QListViewItem(packageList) qsaItem.setText(0, "QSA") teamBuilderItem = qt.QListViewItem(packageList) teamBuilderItem.setText(0, "Teambuilder") self.setSpacing(12) startUpdateButton = qt.QPushButton("Start update", self)
def __init__(self, parent=None, name="parameter_widget"): qt.QWidget.__init__(self, parent, name) self._data_collection = None self.add_dc_cb = None self._tree_view_item = None self.queue_model = None self._beamline_setup_hwobj = None self.caution_pixmap = Icons.load("Caution2.png") self.path_widget = DataPathWidget(self, 'dc_params_path_widget') self.acq_gbox = qt.QVGroupBox("Acquisition", self) self.acq_gbox.setInsideMargin(2) self.acq_widget = AcquisitionWidget(self.acq_gbox, layout='horizontal') self.acq_widget.setFixedHeight(170) widget_ui = os.path.join(os.path.dirname(__file__), 'ui_files/snapshot_widget_layout.ui') widget = qtui.QWidgetFactory.create(widget_ui) widget.reparent(self, qt.QPoint(0, 0)) self.position_widget = widget self._processing_gbox = qt.QVGroupBox('Processing', self, 'processing_gbox') self.processing_widget = ProcessingWidget(self._processing_gbox) v_layout = qt.QVBoxLayout(self, 11, 10, "main_layout") rone_hlayout = qt.QHBoxLayout(v_layout, 10, "rone") rone_vlayout = qt.QVBoxLayout(rone_hlayout) rone_sv_layout = qt.QVBoxLayout(rone_hlayout) rone_vlayout.addWidget(self.path_widget) rone_vlayout.addWidget(self.acq_gbox) rtwo_hlayout = qt.QHBoxLayout(rone_vlayout, 10, "rtwo") rone_vlayout.addStretch(10) rone_sv_layout.addWidget(self.position_widget) rone_sv_layout.addStretch(10) rone_hlayout.addStretch() rtwo_hlayout.addWidget(self._processing_gbox) rtwo_hlayout.addStretch(10) v_layout.addStretch() self.connect(self.acq_widget, qt.PYSIGNAL('mad_energy_selected'), self.mad_energy_selected) self.connect( self.path_widget.data_path_widget_layout.child('prefix_ledit'), qt.SIGNAL("textChanged(const QString &)"), self._prefix_ledit_change) self.connect( self.path_widget.data_path_widget_layout.child('run_number_ledit'), qt.SIGNAL("textChanged(const QString &)"), self._run_number_ledit_change) self.connect(self.acq_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict) self.connect(self.path_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict) qt.QObject.connect(qt.qApp, qt.PYSIGNAL('tab_changed'), self.tab_changed)
def __init__(self, parent=None): self._window = qt.QDialog(None) self._window.setIcon(getPixmap("smart")) self._window.setCaption(_("Flags")) self._window.setModal(True) self._window.setMinimumSize(600, 400) layout = qt.QVBoxLayout(self._window) layout.setResizeMode(qt.QLayout.FreeResize) topvbox = qt.QVBox(self._window) topvbox.setMargin(10) topvbox.setSpacing(10) topvbox.show() layout.addWidget(topvbox) tophbox = qt.QHBox(topvbox) tophbox.setSpacing(20) tophbox.show() # Left side vbox = qt.QVGroupBox(tophbox) vbox.setInsideSpacing(10) vbox.show() self._flagsview = qt.QListView(vbox) self._flagsview.show() qt.QObject.connect(self._flagsview, qt.SIGNAL("selectionChanged()"), self.flagSelectionChanged) self._flagsview.addColumn(_("Flags")) bbox = qt.QHBox(vbox) bbox.setMargin(5) bbox.setSpacing(10) bbox.show() button = qt.QPushButton(_("New"), bbox) button.setEnabled(True) button.setIconSet(qt.QIconSet(getPixmap("crystal-add"))) button.show() qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newFlag) self._newflag = button button = qt.QPushButton(_("Delete"), bbox) button.setEnabled(False) button.setIconSet(qt.QIconSet(getPixmap("crystal-delete"))) button.show() qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delFlag) self._delflag = button # Right side vbox = qt.QVGroupBox(tophbox) vbox.setInsideSpacing(10) vbox.show() self._targetsview = qt.QListView(vbox) self._targetsview.show() qt.QObject.connect(self._targetsview, qt.SIGNAL("selectionChanged()"), self.targetSelectionChanged) self._targetsview.addColumn(_("Targets")) bbox = qt.QHBox(vbox) bbox.setMargin(5) bbox.setSpacing(10) bbox.show() button = qt.QPushButton(_("New"), bbox) button.setEnabled(False) button.setIconSet(qt.QIconSet(getPixmap("crystal-add"))) button.show() qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.newTarget) self._newtarget = button button = qt.QPushButton(_("Delete"), bbox) button.setEnabled(False) button.setIconSet(qt.QIconSet(getPixmap("crystal-delete"))) button.show() qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.delTarget) self._deltarget = button # Bottom sep = qt.QFrame(topvbox) sep.setFrameShape(qt.QFrame.HLine) sep.setFrameShadow(qt.QFrame.Sunken) sep.show() bbox = qt.QHBox(topvbox) bbox.setSpacing(10) bbox.layout().addStretch(1) bbox.show() button = qt.QPushButton(_("Close"), bbox) button.show() qt.QObject.connect(button, qt.SIGNAL("clicked()"), self._window, qt.SLOT("accept()")) button.setDefault(True)
def __init__(self, parent=None, name=None, fl=0): CreateTaskBase.__init__(self, parent, name, fl, 'Helical') if not name: self.setName("create_helical_widget") # # Data attributes # self.init_models() self._prev_pos = None self._current_pos = None self._list_item_map = {} self.init_models() # # Layout # v_layout = qt.QVBoxLayout(self, 2, 5, "v_layout") self._lines_gbox = qt.QGroupBox('Lines', self, "lines_gbox") self._lines_gbox.setColumnLayout(0, qt.Qt.Vertical) self._lines_gbox.layout().setSpacing(6) self._lines_gbox.layout().setMargin(11) lines_gbox_layout = qt.QHBoxLayout(self._lines_gbox.layout()) lines_gbox_layout.setAlignment(qt.Qt.AlignTop) self._list_box = qt.QListBox(self._lines_gbox, "helical_page") self._list_box.setSelectionMode(qt.QListBox.Extended) self._list_box.setFixedWidth(200) self._list_box.setFixedHeight(75) list_box_tool_tip = "Select the line(s) to perfrom helical scan on" qt.QToolTip.add(self._list_box, list_box_tool_tip) lines_gbox_layout.addWidget(self._list_box) button_layout = qt.QVBoxLayout(None, 0, 6, "button_layout") button_layout.setSpacing(5) add_button = qt.QPushButton("+", self._lines_gbox, "add_button") add_button.setFixedWidth(20) add_button.setFixedHeight(20) remove_button = qt.QPushButton("-", self._lines_gbox, "add_button") remove_button.setFixedWidth(20) remove_button.setFixedHeight(20) button_layout.addWidget(add_button) button_layout.addWidget(remove_button) lines_gbox_layout.addLayout(button_layout) add_button_tool_tip = "Add a line between two saved positions, " \ "CTRL click to select more than one position" qt.QToolTip.add(add_button, add_button_tool_tip) remove_button_tool_tip = "Remove selected line(s)" qt.QToolTip.add(remove_button, remove_button_tool_tip) self._acq_gbox = qt.QVGroupBox('Acquisition', self, 'acq_gbox') self._acq_widget = \ AcquisitionWidget(self._acq_gbox, "acquisition_widget", layout='vertical', acq_params=self._acquisition_parameters, path_template=self._path_template) self._acq_widget.disable_inverse_beam(True) self._data_path_gbox = qt.QVGroupBox('Data location', self, 'data_path_gbox') self._data_path_widget = \ DataPathWidget(self._data_path_gbox, data_model = self._path_template, layout = 'vertical') self._processing_gbox = qt.QVGroupBox('Processing', self, 'processing_gbox') self._processing_widget = \ ProcessingWidget(self._processing_gbox, data_model = self._processing_parameters) v_layout.addWidget(self._lines_gbox) v_layout.addWidget(self._acq_gbox) v_layout.addWidget(self._data_path_gbox) v_layout.addWidget(self._processing_gbox) qt.QObject.connect(add_button, qt.SIGNAL("clicked()"), self.add_clicked) qt.QObject.connect(remove_button, qt.SIGNAL("clicked()"), self.remove_clicked) qt.QObject.connect(self._list_box, qt.SIGNAL("selectionChanged()"), self.list_box_selection_changed) prefix_ledit = self._data_path_widget.\ data_path_widget_layout.child('prefix_ledit') run_number_ledit = self._data_path_widget.\ data_path_widget_layout.child('run_number_ledit') self.connect(prefix_ledit, qt.SIGNAL("textChanged(const QString &)"), self._prefix_ledit_change) self.connect(run_number_ledit, qt.SIGNAL("textChanged(const QString &)"), self._run_number_ledit_change) self.connect(self._data_path_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict)
def __init__(self, parent=None, name=None, fl=0): CreateTaskBase.__init__(self, parent, name, fl, 'Characterisation') if not name: self.setName("create_char_widget") # # Data attributes # self._current_selected_item = None self.init_models() self._char_params_mib = DataModelInputBinder(self._char_params) # # Layout # v_layout = qt.QVBoxLayout(self, 2, 6, "v_layout") self._acq_widget = \ AcquisitionWidgetSimple(self, acq_params = self._acquisition_parameters, path_template = self._path_template) #self._acq_widget.setFixedHeight(170) current_dir = os.path.dirname(__file__) ui_file = 'ui_files/vertical_crystal_dimension_widget_layout.ui' widget = qtui.QWidgetFactory.create(os.path.join(current_dir, ui_file)) widget.reparent(self, qt.QPoint(0, 0)) self._vertical_dimension_widget = widget ui_file = 'ui_files/characterise_simple_widget_vertical_layout.ui' widget = qtui.QWidgetFactory.\ create(os.path.join(current_dir, ui_file)) widget.reparent(self, qt.QPoint(0, 0)) self._char_widget = widget self._data_path_gbox = \ qt.QVGroupBox('Data location', self, 'data_path_gbox') self._data_path_widget = \ DataPathWidget(self._data_path_gbox, data_model = self._path_template, layout = 'vertical') v_layout.addWidget(self._acq_widget) v_layout.addWidget(self._data_path_gbox) v_layout.addWidget(self._char_widget) v_layout.addWidget(self._vertical_dimension_widget) v_layout.addStretch(100) # # Logic # optimised_sad_cbx = self._char_widget.\ child('optimised_sad_cbx') account_rad_dmg_cbx = self._char_widget.\ child('account_rad_dmg_cbx') start_comp_cbox = self._char_widget.child('start_comp_cbox') #induced_burn_cbx = self._char_widget.child('induced_burn_cbx') max_vdim_ledit = self._vertical_dimension_widget.\ child('max_vdim_ledit') min_vdim_ledit = self._vertical_dimension_widget.\ child('min_vdim_ledit') min_vphi_ledit = self._vertical_dimension_widget.\ child('min_vphi_ledit') max_vphi_ledit = self._vertical_dimension_widget.\ child('max_vphi_ledit') space_group_ledit = self._vertical_dimension_widget.\ child('space_group_ledit') self._char_params_mib.bind_value_update('opt_sad', optimised_sad_cbx, bool, None) self._char_params_mib.bind_value_update('account_rad_damage', account_rad_dmg_cbx, bool, None) #self._char_params_mib.bind_value_update('determine_rad_params', # induced_burn_cbx, # bool, None) self._char_params_mib.bind_value_update('strategy_complexity', start_comp_cbox, int, None) self._char_params_mib.\ bind_value_update('max_crystal_vdim', max_vdim_ledit, float, qt.QDoubleValidator(0.0, 1000, 2, self)) self._char_params_mib.\ bind_value_update('min_crystal_vdim', min_vdim_ledit, float, qt.QDoubleValidator(0.0, 1000, 2, self)) self._char_params_mib.\ bind_value_update('min_crystal_vphi', min_vphi_ledit, float, qt.QDoubleValidator(0.0, 1000, 2, self)) self._char_params_mib.\ bind_value_update('max_crystal_vphi', max_vphi_ledit, float, qt.QDoubleValidator(0.0, 1000, 2, self)) space_group_ledit.insertStrList(XTAL_SPACEGROUPS) prefix_ledit = self._data_path_widget.\ data_path_widget_layout.child('prefix_ledit') run_number_ledit = self._data_path_widget.\ data_path_widget_layout.child('run_number_ledit') self.connect(prefix_ledit, qt.SIGNAL("textChanged(const QString &)"), self._prefix_ledit_change) self.connect(run_number_ledit, qt.SIGNAL("textChanged(const QString &)"), self._run_number_ledit_change) self.connect(space_group_ledit, qt.SIGNAL("activated(int)"), self._space_group_change) self.connect(self._data_path_widget, qt.PYSIGNAL("path_template_changed"), self.handle_path_conflict)
def buildBrokerPage(self, config, frame): """ buildBrokerPage(...) -> construct widgets for the broker settings """ readpath = config.readPathEntry readnum = config.readNumEntry dsn = config.readEntry(keys.brokerDsn, defaults.brokerDsn) keyscript = readpath(keys.keyScript, defaults.keyScript) startscript = readpath(keys.brokerScript, defaults.brokerScript) connectdelay = readnum(keys.connectDelay, defaults.connectDelay) embeddelay = readnum(keys.embedDelay, defaults.embedDelay) connectgroup = qt.QVGroupBox(i18n('Network Connection'), frame) qt.QLabel(i18n('Broker connection string:'), connectgroup) dsnline = qt.QLineEdit(dsn, connectgroup) connectwid = buildIntSlider( connectgroup, i18n('Seconds to delay before connecting to broker after launch:'), connectdelay) scriptsgroup = qt.QVGroupBox(i18n('Scripts'), frame) qt.QLabel(i18n('Broker application start command:'), scriptsgroup) startline = kfile.KURLRequester(startscript, scriptsgroup) qt.QLabel(i18n('Keystroke automation command:'), scriptsgroup) keyline = kfile.KURLRequester(keyscript, scriptsgroup) label = i18n('Seconds to delay before embedding broker window:') embedgroup = qt.QVGroupBox(i18n('Window Embedding'), frame) embedwid = buildIntSlider(embedgroup, label, embeddelay) layout = qt.QVBoxLayout(frame, gridMargin, gridSpace) layout.addWidget(connectgroup) layout.addWidget(scriptsgroup) layout.addWidget(embedgroup) layout.addStretch(10) self.setConfigWidget(frame, (keys.brokerDsn, dsnline, defaults.brokerDsn, dsnline.text, dsnline.setText)) self.setConfigWidget( frame, (keys.brokerScript, startline, defaults.brokerScript, startline.url, startline.setURL)) self.setConfigWidget(frame, (keys.keyScript, keyline, defaults.keyScript, keyline.url, keyline.setURL)) self.setConfigWidget( frame, (keys.connectDelay, connectwid, defaults.connectDelay, connectwid.value, connectwid.setValue)) self.setConfigWidget(frame, (keys.embedDelay, embedwid, defaults.embedDelay, embedwid.value, embedwid.setValue)) self.connectChanged( (dsnline, util.sigTextChanged), (startline, util.sigTextChanged), (keyline, util.sigTextChanged), (connectwid, util.sigValueChanged), (embedwid, util.sigValueChanged), )