def build_widgets(self, values, show_labels=False, width=240, height=20, value_width=120): widgets_matrix = [] for row in values: widgets_row = [] for cell in row: cell_frame = self.create_frame_with_gridlayout() count = 0 for synoptic in sorted(cell): self.debug("processing synoptic %s" % synoptic) name = model = synoptic self.debug('Creating TaurusValue with model = %s' % model) synoptic_value = TaurusValue(cell_frame) self.modelsQueue.put((synoptic_value, model)) QtCore.QObject.connect( synoptic_value, QtCore.SIGNAL("itemClicked(QString)"), self.itemClicked) if self.hideLabels: synoptic_value.setLabelWidgetClass(None) else: # DO NOT DELETE THIS LINE!!! synoptic_value.setLabelConfig('label') cell_frame.layout().addWidget(synoptic_value, count, 0) self._widgets_list.append(synoptic_value) count += 1 # Done in this way as TauValue.mousePressEvent are never called def mousePressEvent(event, obj): # print 'In cell clicked' targets = set( str(child.getModelName()) for child in obj.children() if hasattr(child, 'underMouse') and child.underMouse() and hasattr(child, 'getModelName')) [ obj.emit(Qt.SIGNAL("itemClicked(QString)"), t) for t in targets ] cell_frame.mousePressEvent = partial(mousePressEvent, obj=cell_frame) QtCore.QObject.connect(cell_frame, QtCore.SIGNAL("itemClicked(QString)"), self.itemClicked) widgets_row.append(cell_frame) widgets_matrix.append(widgets_row) return widgets_matrix
def __init__(self, parent=None): print('In EditTextDialog.__init__()') QtGui.QDialog.__init__(self, parent) self.setModal(1) self.initComponents() self.show() self.result = 0 # Signals QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.pressOK) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.close)
def retranslateUi(self, Form): if Form.ctxID: Form.setWindowTitle( QtGui.QApplication.translate("Form", "Modify Context", None, QtGui.QApplication.UnicodeUTF8)) self.pushButtonCreate.setText( QtGui.QApplication.translate("Form", "Modify", None, QtGui.QApplication.UnicodeUTF8)) self.pushButtonCreate.setToolTip( QtGui.QApplication.translate("Form", "Modify Context", None, QtGui.QApplication.UnicodeUTF8)) else: Form.setWindowTitle( QtGui.QApplication.translate("Form", "Create Context", None, QtGui.QApplication.UnicodeUTF8)) self.pushButtonCreate.setText( QtGui.QApplication.translate("Form", "Create", None, QtGui.QApplication.UnicodeUTF8)) self.pushButtonCreate.setToolTip( QtGui.QApplication.translate("Form", "Create Context", None, QtGui.QApplication.UnicodeUTF8)) self.pushButtonCancel.setText( QtGui.QApplication.translate("Form", "Cancel", None, QtGui.QApplication.UnicodeUTF8)) self.pushButtonCancel.setToolTip( QtGui.QApplication.translate("Form", "Cancel", None, QtGui.QApplication.UnicodeUTF8)) self.label_name.setText( QtGui.QApplication.translate("Form", "Name:", None, QtGui.QApplication.UnicodeUTF8)) self.label_author.setText( QtGui.QApplication.translate("Form", "Author:", None, QtGui.QApplication.UnicodeUTF8)) self.label_reason.setText( QtGui.QApplication.translate("Form", "Reason:", None, QtGui.QApplication.UnicodeUTF8)) self.label_description.setText( QtGui.QApplication.translate("Form", "Description:", None, QtGui.QApplication.UnicodeUTF8)) self.att_label.setText( QtGui.QApplication.translate("Form", "Add / remove attributes:", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QObject.connect(self.pushButtonCreate, QtCore.SIGNAL("pressed()"), Form.onCreatePressed) QtCore.QObject.connect(self.pushButtonCancel, QtCore.SIGNAL("pressed()"), Form.onCancelPressed)
def onEditPressed(self): cid = self.getCurrentContext() self.CtxEditForm = ContextEditWidget(ctxID=cid) QtCore.QObject.connect(self.CtxEditForm, QtCore.SIGNAL("ContextModified(int)"), self.refresh) self.CtxEditForm.show()
def createNewContext(self): try: self.snapapi = SnapAPI() attributes = [] for i in range(self.ui.final_List.count()): attributes.append(str(self.ui.final_List.item(i).text())) self.snapapi.create_context(str(self.ui.line_author.text()), str(self.ui.line_name.text()), str(self.ui.line_reason.text()), str(self.ui.line_description.text()), attributes) except Exception: print traceback.format_exc() Qt.QMessageBox.critical(self,"Tango Archiving Problem", "Could not create new context.<br>" + \ "Was not possible to talk with SnapManager DS.<br>" + \ "Please check if DS is running.") return self.newID = self.snapapi.contexts.keys()[ len(self.snapapi.contexts.items()) - 1] print('un contexte nou: %d' % self.newID) self.emit(QtCore.SIGNAL("NewContextCreated(int)"), self.newID) self.onCancelPressed() Qt.QMessageBox.information(self, "Context", "Context created succesfully!")
def modifyContext(self, cid): print 'In modifyContext(%s)'%cid try: attributes=[] for i in range(self.ui.final_List.count()): attributes.append(str(self.ui.final_List.item(i).text())) #self.snapapi = SnapAPI() self.ctx.name=str(self.ui.line_name.text()) self.ctx.author=str(self.ui.line_author.text()) self.ctx.reason=str(self.ui.line_reason.text()) self.ctx.description=str(self.ui.line_description.text()) #self.snapapi.db.update_context(self.ctx) #self.snapapi.db.update_context_attributes(cid, attributes) self.snapapi.modify_context(cid,self.ctx.author,self.ctx.name, self.ctx.reason,self.ctx.description,attributes) except Exception: print traceback.format_exc() Qt.QMessageBox.critical(self,"Tango Archiving Problem", "Could not modify context.<br>" + \ "Was not possible to talk with SnapManager DS.<br>" + \ "Please check if DS is running.") return Qt.QMessageBox.information(self,"Context","Context modified succesfully!") self.emit(QtCore.SIGNAL("ContextModified(int)"), cid) self.onCancelPressed()
def contextMenuEvent(self, event): ''' This function is called when right clicking on qwt plot area. A pop up menu will be shown with the available options. ''' self.info('TaurusPropTable.contextMenuEvent()') menu = Qt.QMenu(self) configDialogAction = menu.addAction("Add new property") self.connect(configDialogAction, QtCore.SIGNAL("triggered()"), self.addProperty) configDialogAction = menu.addAction("Delete property") self.connect(configDialogAction, QtCore.SIGNAL("triggered()"), self.deleteProperty) configDialogAction = menu.addAction("Edit property") self.connect(configDialogAction, QtCore.SIGNAL("triggered()"), self.editProperty) menu.addSeparator() menu.exec_(event.globalPos()) del menu
def setData(self, data): ''' sets the data object and emits a "dataChanged" signal with the data as the parameter :param data: (object) the new value for the Model's data ''' self.__data = data self.__isDataSet = True self.emit(QtCore.SIGNAL("dataChanged"), self.__data)
def __init__(self, parent=None, designMode=False): TaurusValueLineEdit.__init__(self, parent, designMode) self.setFocusPolicy(QtCore.Qt.WheelFocus) self._throttle_timer = QtCore.QTimer() self._throttle_timer.setInterval(200) self._throttle_timer.setSingleShot(True) self.connect(self._throttle_timer, QtCore.SIGNAL("timeout()"), self._writeValue) self.w_value_trigger.connect(self._updateWriteValue)
def disconnectWriter(self, writer, signalname): '''unregister a writer from this data model :param writer: (QObject) object to unregister :param signalname: (str) the signal that was registered .. seealso:: :meth:`SharedDataManager.disconnectWriter` ''' ok = self.disconnect(writer, QtCore.SIGNAL(signalname), self.setData) self.__writerSignals.remove((weakref.ref(writer), signalname))
def disconnectReader(self, slot): ''' unregister a reader :param slot: (callable) the slot to which this was connected .. seealso:: :meth:`SharedDataManager.disconnectReader`, :meth:`getData` ''' ok = self.disconnect(self, QtCore.SIGNAL("dataChanged"), slot) self.__readerSlots.remove((weakref.ref(slot.__self__), slot.__name__))
def __init__(self, contextid=None, useInputForComment=False, parent=None): QtGui.QPushButton.__init__(self, parent) self.setIconSize(Qt.QSize(30, 30)) self.setIcon(Qt.QIcon(":/devices/camera-photo.svg")) self.snapapi = SnapAPI() self.contextid = contextid self.comment = "AutoSnap" self.useInputForComment = useInputForComment QtCore.QObject.connect(self, QtCore.SIGNAL("clicked()"), self.snap) self.setToolTip("Snapshot for contextid " + str(self.contextid))
def __init__(self, parent=None, designMode=False): QtGui.QWidget.__init__(self, parent) self._command = "" self._fontSize = 7 layout = QtGui.QVBoxLayout(self) self._proc = None if not designMode: self._proc = QtCore.QProcess(self) QtCore.QObject.connect( self._proc, QtCore.SIGNAL("finished(int, QProcess::ExitStatus)"), self._commandFinished)
def connectWriter(self, writer, signalname): ''' Registers the given writer object as a writer of the data. The writer is then expected to emit a `QtCore.SIGNAL(signalname)` with the new data as the first parameter. :param writer: (QObject) object that will change the data :param signalname: (str) the signal name that will notify changes of the data .. seealso:: :meth:`connectReader`, :meth:`setData` ''' self.connect(writer, QtCore.SIGNAL(signalname), self.setData) self.__writerSignals.append((weakref.ref(writer), signalname))
def __init__(self, parent=None, designMode=False): TaurusWidget.__init__(self, parent, designMode=designMode) self._setup_ui() self._throttle_timer = QtCore.QTimer() self._throttle_timer.setInterval(200) self._throttle_timer.setSingleShot(True) self.connect(self._throttle_timer, QtCore.SIGNAL("timeout()"), self._writeValue) self._value = None self._acc_value = 0 # accumulate fast wheel events self._last_wheel = 0 # time of last wheel event
def __init__(self, parent=None): QtGui.QToolBar.__init__(self, parent) self.setIconSize(Qt.QSize(30, 30)) self.SnapApp = snapWidget() self.att_table = [] self.factory = taurus.Factory() self.refresh() self.refreshTimer = QtCore.QTimer() QtCore.QObject.connect(self.refreshTimer, QtCore.SIGNAL("timeout()"), self.refresh) self.refreshTimer.start(5000) snap = self.SnapApp.show self.addAction(Qt.QIcon(":/devices/camera-photo.svg"), "Snapshot Widget", snap) self.setMovable(True) self.setFloatable(True) self.setToolTip("Snapshot Toolbar")
def __init__(self, useInputForComment=False, useWizardForContext=False, parent=None): QtGui.QPushButton.__init__(self, parent) self.setIconSize(Qt.QSize(30, 30)) self.setIcon(Qt.QIcon(":/devices/camera-photo.svg")) self.snapapi = SnapAPI() self.contextid = None self.model = "" self.author = self.getUserName() self.name = "AutoSnap_" + time.strftime("%Y_%m_%d_%H%M%S") self.reason = "Always a good reason to create an AutoSnap" self.description = "Snap for all attributes of " + self.model self.comment = "AutoSnap" self.useInputForComment = useInputForComment self.useWizardForContext = useWizardForContext QtCore.QObject.connect(self, QtCore.SIGNAL("clicked()"), self.snap) self.setToolTip("Snapshot for device " + self.model)
def connectReader(self, slot, readOnConnect=True): ''' Registers the given slot method to receive notifications whenever the data is changed. :param slot: (callable) a method that will be called when the data changes. This slot will be the receiver of a signal which has the data as its first argument. :param readOnConnect: (bool) if True (default) the slot will be called immediately with the current value of the data if the data has been already initialized .. seealso:: :meth:`connectWriter`, :meth:`getData` ''' self.connect(self, QtCore.SIGNAL("dataChanged"), slot) if readOnConnect and self.__isDataSet: slot(self.__data) obj = getattr(slot, '__self__', slot) self.__readerSlots.append((weakref.ref(obj), slot.__name__))
def setTable(self, dev_name): """ Fills the table with the names of properties and their values for the given device. """ if dev_name is None: return # TODO: the table should be cleaned elif self.db is None: self.warning('Model must be set before calling setTable') return QtCore.QObject.disconnect(self, QtCore.SIGNAL("cellChanged(int, int)"), self.valueChanged) dev_name = str(dev_name) self.list_prop = list(self.db.get_device_property_list(dev_name, '*')) self.setRowCount(len(self.list_prop)) for i in range(0, len(self.list_prop)): elem = self.list_prop[i] self.setText(elem, i, 0) self.dictionary = self.db.get_device_property( dev_name, self.list_prop) self.debug('Getting %s properties: %s -> %s', dev_name, self.list_prop, self.dictionary) value = self.dictionary[elem] self.debug('TaurusPropsTable: property %s is type %s', elem, type(value)) USE_TABLES = False if USE_TABLES: self.setPropertyValue(value, i, 1) else: if not isinstance(value, str): # not something like an string # adding new lines in between elements in the list value = '\n'.join(str(v) for v in value) self.setText(str(value), i, 1) self.updateStyle() self.dev_name = dev_name self.setWindowTitle('%s Properties' % dev_name) self.resizeColumnsToContents() self.resizeRowsToContents()
def create_widgets_table(self, models): # Added a title to the panel self.title_widget = QtGui.QLabel() self.layout().addWidget(self.title_widget, 0, 0) self.setTitle(self.title) dct = self.create_widgets_dict(models) # Assignments modified to keep the order of labels as inserted in # properties self.rows = [r[0] for r in self.row_labels] # dct.keys() # list(set(reduce(operator.add,v.keys()) for v in dct.values())) self.columns = [c[0] for c in self.column_labels] values = [] for row in self.rows: line = [] for col in self.columns: #line.append(dct[row][col] if col in dct[row] else []) if col in dct[row]: line.append(dct[row][col]) else: line.append([]) values.append(line) # Here is where the table is created! self.table = self.build_table(values) # SET COLUMN HEADERS (self.columns) for i in range(len(self.columns)): equipment = self.columns[i] self.table.setHorizontalHeaderItem( i, QtGui.QTableWidgetItem(equipment)) # SOMEDAY THIS WILL BE ICONS # SET ROW HEADERS (self.rows) for i in range(len(self.rows)): section = self.rows[i] self.table.setVerticalHeaderItem(i, QtGui.QTableWidgetItem(section)) # table.setAutoScroll(True) # resize_mode = QtGui.QHeaderView.Stretch # table.horizontalHeader().setResizeMode(resize_mode) # table.verticalHeader().setResizeMode(resize_mode) # for row in range(len(self.rows)): # table.setRowHeight(row,5+25*sum(len(dct[self.rows[row]][col]) for col in self.columns)) # for col in range(len(self.columns)): # table.setColumnWidth(col,300) use_scroll = False # It didn't work ... it doesn't allow the table widget to resize if use_scroll: scrollable = QtGui.QScrollArea(self) scrollable.setWidget(self.table) self.layout().addWidget(scrollable, 1, 0) else: self.layout().addWidget(self.table, 1, 0) #---------------------------------------------------------------------- # SECTION CHECKBOXES self.checkboxes_frame = self.create_frame_with_gridlayout() self.rows_frame = self.create_frame_with_gridlayout() self.rows_frame.setFrameStyle(QtGui.QFrame.Box) if not self._show_row_frame: self.rows_frame.hide() self.checkboxes_frame.layout().addWidget(self.rows_frame, 0, 0) self.columns_frame = self.create_frame_with_gridlayout() self.columns_frame.setFrameStyle(QtGui.QFrame.Box) if not self._show_column_frame: self.columns_frame.hide() self.checkboxes_frame.layout().addWidget(self.columns_frame, 0, 1) layout_row = 0 layout_col = 0 # For all rows, create rows of three checkboxes in order to # show or hide the corresponding rows in the table for i in range(len(self.rows)): section = self.rows[i] checkbox = QtGui.QCheckBox(section) if checkbox.text() == 'Others': checkbox.setChecked(False) if not self._show_others: checkbox.hide() else: checkbox.setChecked(True) self.rows_frame.layout().addWidget(checkbox, layout_row, layout_col) layout_col += 1 if layout_col == 3: layout_col = 0 layout_row += 1 QtCore.QObject.connect(checkbox, QtCore.SIGNAL('toggled(bool)'), self.show_hide_rows) self.show_hide_rows() layout_row = 0 layout_col = 0 # For all self.columns, create rows of three checkboxes in order to # show or hide the corresponding columns in the table for i in range(len(self.columns)): column = self.columns[i] checkbox = QtGui.QCheckBox(column) if checkbox.text() == 'Others': checkbox.setChecked(False) if not self._show_others: checkbox.hide() else: checkbox.setChecked(True) self.columns_frame.layout().addWidget(checkbox, layout_row, layout_col) layout_col += 1 if layout_col == 3: layout_col = 0 layout_row += 1 QtCore.QObject.connect(checkbox, QtCore.SIGNAL('toggled(bool)'), self.show_hide_columns) self.show_hide_columns() self.layout().addWidget(self.checkboxes_frame, 2, 0)
def itemClicked(self, item_name): self.trace('In TaurusGrid.itemClicked(%s)' % item_name) self.setItemSelected(item_name) self.emit(QtCore.SIGNAL("itemClicked(QString)"), str(item_name))
def setupUi(self, Form, load=True): Snap_Core_Ui_Form.setupUi(self,Form) self.context = None self.snapshots = [] self.snapapi = SnapAPI() self._Form=Form Form.setWindowTitle(QtGui.QApplication.translate("Form",'!:'+str(os.getenv('TANGO_HOST')).split(':',1)[0]+' Snaps', None, QtGui.QApplication.UnicodeUTF8)) self.contextComboBox.setToolTip(QtGui.QApplication.translate("Form", "Choose a Context", None, QtGui.QApplication.UnicodeUTF8)) print 'connecting signals ...' QtCore.QObject.connect(self.contextComboBox,QtCore.SIGNAL("currentIndexChanged(int)"), self.onContextChanged) QtCore.QObject.connect(self.contextComboBox,QtCore.SIGNAL("activated(int)"), self.onContextChanged) self.contextComboBox.setMaximumWidth(250) self.comboLabel.setText(QtGui.QApplication.translate("Form", "Context:", None, QtGui.QApplication.UnicodeUTF8)) self.buttonNew.setText(QtGui.QApplication.translate("Form", "New", None, QtGui.QApplication.UnicodeUTF8)) icon_view=QtGui.QIcon(":/actions/document-new.svg") self.buttonNew.setIcon(icon_view) QtCore.QObject.connect(self.buttonNew,QtCore.SIGNAL("pressed()"), self.onNewPressed) self.buttonNew.setToolTip(QtGui.QApplication.translate("Form", "New Context", None, QtGui.QApplication.UnicodeUTF8)) self.buttonEditCtx.setText(QtGui.QApplication.translate("Form", "Edit", None, QtGui.QApplication.UnicodeUTF8)) icon_view=QtGui.QIcon(":/apps/accessories-text-editor.svg") self.buttonEditCtx.setIcon(icon_view) QtCore.QObject.connect(self.buttonEditCtx,QtCore.SIGNAL("pressed()"), self.onEditPressed) self.buttonEditCtx.setToolTip(QtGui.QApplication.translate("Form", "Edit Context", None, QtGui.QApplication.UnicodeUTF8)) print 'connected signals ...' self.filterLabel.setText(QtGui.QApplication.translate("Form", "Filter:", None, QtGui.QApplication.UnicodeUTF8)) self.filterComboBox.addItem('Name') self.filterComboBox.addItem('Reason') self.filterComboBox.addItem('Attributes') self.filterComboBox.setMaximumWidth(90) self.filterComboBox2.setEditable(True) QtCore.QObject.connect(self.filterComboBox,QtCore.SIGNAL("currentIndexChanged(int)"), self.onFilterComboChanged) refresh_icon=QtGui.QIcon(":/actions/view-refresh.svg") self.refreshButton.setIcon(refresh_icon) QtCore.QObject.connect(self.refreshButton,QtCore.SIGNAL("pressed()"), self.onRefreshPressed) self.refreshButton.setToolTip(QtGui.QApplication.translate("Form", "Refresh List", None, QtGui.QApplication.UnicodeUTF8)) self.infoLabel1_1.setText(QtGui.QApplication.translate("Form", "Author:", None, QtGui.QApplication.UnicodeUTF8)) self.infoLabel2_1.setText(QtGui.QApplication.translate("Form", "Reason:", None, QtGui.QApplication.UnicodeUTF8)) self.infoLabel3_1.setText(QtGui.QApplication.translate("Form", "Description:", None, QtGui.QApplication.UnicodeUTF8)) self.infoLabel4_1.setText(QtGui.QApplication.translate("Form", "Snapshots:", None, QtGui.QApplication.UnicodeUTF8)) self.buttonTake.setText(QtGui.QApplication.translate("Form", "Take Snapshot", None, QtGui.QApplication.UnicodeUTF8)) self.buttonTake.setToolTip(QtGui.QApplication.translate("Form", "Save Snapshot in Database", None, QtGui.QApplication.UnicodeUTF8)) icon_save=QtGui.QIcon(":/devices/camera-photo.svg") #icon_save=QtGui.QIcon(":/actions/document-save.svg")not_archived_HDB = [a for a in [t for t in csv if 'HDB' in csv[t]] if a not in last_values_HDB or last_values_HDB[a] is None] self.buttonTake.setIcon(icon_save) QtCore.QObject.connect(self.buttonTake,QtCore.SIGNAL("pressed()"), self.onSavePressed) self.buttonLoad.setText(QtGui.QApplication.translate("Form", "Load to Devices", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QObject.connect(self.buttonLoad,QtCore.SIGNAL("pressed()"), self.onLoadPressed) self.buttonLoad.setToolTip(QtGui.QApplication.translate("Form", "Load Snapshot to Devices", None, QtGui.QApplication.UnicodeUTF8)) icon_load=QtGui.QIcon(":/actions/go-jump.svg") self.buttonLoad.setIcon(icon_load) self.buttonImport.setText(QtGui.QApplication.translate("Form", "Import from CSV", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QObject.connect(self.buttonImport,QtCore.SIGNAL("pressed()"), self.onImportPressed) self.buttonImport.setToolTip(QtGui.QApplication.translate("Form", "Import from CSV File", None, QtGui.QApplication.UnicodeUTF8)) icon_csv=QtGui.QIcon(":/actions/document-open.svg") self.buttonImport.setIcon(icon_csv) self.buttonExport.setText(QtGui.QApplication.translate("Form", "Export to CSV", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QObject.connect(self.buttonExport,QtCore.SIGNAL("pressed()"), self.onExportPressed) self.buttonExport.setToolTip(QtGui.QApplication.translate("Form", "Export to CSV File", None, QtGui.QApplication.UnicodeUTF8)) icon_csv=QtGui.QIcon(":/actions/document-save-as.svg") self.buttonExport.setIcon(icon_csv) self.buttonDelSnap.setText(QtGui.QApplication.translate("Form", "Delete", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QObject.connect(self.buttonDelSnap,QtCore.SIGNAL("pressed()"), self.onDelSnapPressed) self.buttonDelSnap.setToolTip(QtGui.QApplication.translate("Form", "Delete Snapshot", None, QtGui.QApplication.UnicodeUTF8)) icon_csv=QtGui.QIcon(":/actions/edit-clear.svg") self.buttonDelSnap.setIcon(icon_csv) self.buttonEditSnap.setText(QtGui.QApplication.translate("Form", "Edit", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QObject.connect(self.buttonEditSnap,QtCore.SIGNAL("pressed()"), self.onEditSnapPressed) self.buttonEditSnap.setToolTip(QtGui.QApplication.translate("Form", "Edit Snap Comment", None, QtGui.QApplication.UnicodeUTF8)) icon_csv=QtGui.QIcon(":/apps/accessories-text-editor.svg") self.buttonEditSnap.setIcon(icon_csv) self.buttonDelCtx.setText(QtGui.QApplication.translate("Form", "Delete", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QObject.connect(self.buttonDelCtx,QtCore.SIGNAL("pressed()"), self.onDelCtxPressed) self.buttonDelCtx.setToolTip(QtGui.QApplication.translate("Form", "Delete Context", None, QtGui.QApplication.UnicodeUTF8)) icon_csv=QtGui.QIcon(":/actions/mail-mark-junk.svg") self.buttonDelCtx.setIcon(icon_csv) QtCore.QObject.connect(self.buttonClose,QtCore.SIGNAL("pressed()"), self.onClosePressed) self.tableLabel.setText(QtGui.QApplication.translate("Form", "Attribute list:", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.listWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) QtCore.QObject.connect(self.listWidget, QtCore.SIGNAL("currentItemChanged (QListWidgetItem *,QListWidgetItem *)"), self.onSnapshotChanged) QtCore.QObject.connect(self.viewComboBox,QtCore.SIGNAL("currentIndexChanged(int)"), self.changeView) #self.frame.setMaximumWidth(450) self.comp=diffWidget() self.comp.setMinimumWidth(450) QtCore.QObject.connect(self.comp._wi.diffButtonCompare,QtCore.SIGNAL("pressed()"), self.onCompareButtonPressed) self.viewComboBox.setToolTip(QtGui.QApplication.translate("Form", "Change View Mode", None, QtGui.QApplication.UnicodeUTF8)) self.comboLabel.show() self.gridLayout.addWidget(self.tableWidget) self.gridLayout.addWidget(self.taurusForm) self.gridLayout.addWidget(self.comp) if load: self.initContexts()
def onNewPressed(self): self.CtxEditForm=ContextEditWidget() QtCore.QObject.connect(self.CtxEditForm, QtCore.SIGNAL("NewContextCreated(int)"), self.refresh) self.CtxEditForm.show()
def _commandFinished(self, exitCode, exitStatus): self.emit(QtCore.SIGNAL("commandFinished(int)"), exitCode) if exitStatus == 0: self._restartTheProcess()