class BrowserBrick(BaseComponents.BlissWidget): def __init__(self, *args): BaseComponents.BlissWidget.__init__(self, *args) #map displayed string in the history list -> actual file path self.history_map = dict() self.layout = QVBoxLayout(self) self.defineSlot('load_file', ()) self.defineSlot('login_changed', ()) self.addProperty('mnemonic', 'string', '') self.addProperty('history', 'string', '', hidden=True) self.addProperty('sessions ttl (in days)', 'integer', '30') #make sure the history property is a pickled dict try: hist = pickle.loads(self.getProperty('history').getValue()) except: # EOFError if the string is empty but let's not count on it self.getProperty('history').setValue(pickle.dumps(dict())) # maybe defer that for later self.cleanup_history() self.main_layout = QSplitter(self) self.main_layout.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)) # left part of the splitter self.history_box = QVBox(self.main_layout) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) self.sort_order = True self.sort_col = None self.history = QTable(self.history_box) self.history.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding)) self.history.setSelectionMode(QTable.SingleRow) self.history.setNumCols(3) self.history.verticalHeader().hide() self.history.setLeftMargin(0) self.history.setSorting(False) QObject.connect(self.history, SIGNAL('currentChanged(int,int)'), self.history_changed) #by default sorting only sorts the columns and not whole rows. #let's reimplement that QObject.connect(self.history.horizontalHeader(), SIGNAL('clicked(int)'), self.sort_column) header = self.history.horizontalHeader() header.setLabel(0, 'Time and date') header.setLabel(1, 'Prefix') header.setLabel(2, 'Run number') self.clear_history_button = QPushButton('Clear history', self.history_box) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) QObject.connect(self.clear_history_button, SIGNAL('clicked()'), self.clear_history) # Right part of the splitter self.browser_box = QWidget(self.main_layout) QVBoxLayout(self.browser_box) self.browser_box.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.top_layout = QHBoxLayout(self.browser_box) self.back_button = QToolButton(self.browser_box) self.back_button.setIconSet(QIconSet(Icons.load('Left2'))) self.back_button.setTextLabel('Back') self.back_button.setUsesTextLabel(True) self.back_button.setTextPosition(QToolButton.BelowIcon) self.back_button.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.forward_button = QToolButton(self.browser_box) self.forward_button.setIconSet(QIconSet(Icons.load('Right2'))) self.forward_button.setTextLabel('Forward') self.forward_button.setUsesTextLabel(True) self.forward_button.setTextPosition(QToolButton.BelowIcon) self.forward_button.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.top_layout.addWidget(self.back_button) self.top_layout.addWidget(self.forward_button) self.browser_box.layout().addLayout(self.top_layout) self.browser = QTextBrowser(self.browser_box) self.browser.setReadOnly(True) self.browser_box.layout().addWidget(self.browser) self.layout.addWidget(self.main_layout) #initially disabled self.forward_button.setEnabled(False) self.back_button.setEnabled(False) #connections QObject.connect(self.browser, SIGNAL('backwardAvailable(bool)'), self.back_button.setEnabled) QObject.connect(self.browser, SIGNAL('forwardAvailable(bool)'), self.forward_button.setEnabled) QObject.connect(self.back_button, SIGNAL('clicked()'), self.browser.backward) QObject.connect(self.forward_button, SIGNAL('clicked()'), self.browser.forward) self.edna = None # resize the splitter to something like 1/4-3/4 # width = self.main_layout.width() # left = width / 4.0 # right = width - left # logging.debug('setting splitter sizes to %d and %d', left, right) # self.main_layout.setSizes([left, right]) def sort_column(self, col_number): logging.debug('%s: sorting with column %d', self, col_number) if col_number == self.sort_column: # switch the sort order self.sort_order = self.sort_order ^ True else: self.sort_order = True #else, ascending self.sort_column = col_number self.history.sortColumn(col_number, self.sort_order, True) # put the right decoration on the header label if self.sort_order: direction = Qt.Ascending else: direction = Qt.Descending self.history.horizontalHeader().setSortIndicator(col_number, direction) def load_file(self, path): if self.browser.mimeSourceFactory().data(path) == None: self.browser.setText('<center>FILE NOT FOUND</center>') else: self.browser.setSource(abspath(path)) def history_changed(self, row, col): logging.debug('history elem selected: %d:%d', row, col) index = (str(self.history.text(row,0)), str(self.history.text(row,1)), str(self.history.text(row,2))) try: path = self.history_map[index] self.load_file(path) except KeyError as e: # can happen when qt sends us the signal with # null data and we get the key ("","","") pass def new_html(self, html_path, image_prefix, run_number): logging.getLogger().debug('got a new html page: %s, prefix: %r, run number: %s', html_path, image_prefix, run_number) # prepend the time and date to the path we just got so # the history is more readable time_string = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) index = (time_string, str(image_prefix), str(run_number)) self.history_map[index] = html_path # synchronize the history prop if self.current_user is not None: whole_history = pickle.loads(self.getProperty('history').getValue()) whole_history[self.current_user] = self.history_map self.getProperty('history').setValue(pickle.dumps(whole_history)) self.history.insertRows(self.history.numRows()) logging.debug('numRows() is %d', self.history.numRows()) rows = self.history.numRows() - 1 self.history.setText(rows, 0, QString(time_string)) self.history.setText(rows, 1, QString(str(image_prefix))) self.history.setText(rows, 2, QString(str(run_number))) logging.debug('numRows() is %d', self.history.numRows()) self.load_file(html_path) def clear_history(self): self.history_map.clear() self.history.setNumRows(0) def propertyChanged(self, prop, oldval, newval): if prop == 'mnemonic': logging.getLogger().debug('BrowserBrick: using edna object %s', newval) if self.edna is not None: self.disconnect(self.edna, PYSIGNAL('newEDNAHTML'), self.new_html) self.edna = self.getHardwareObject(newval) logging.getLogger().debug('edna object is now: %s', self.edna) self.connect(self.edna, PYSIGNAL('newEDNAHTML'), self.new_html) def run(self): pass def login_changed(self, session_id,prop_code=None,prop_number=None,prop_id=None,expiration_time=0): logging.debug('BrowserBrick::login_changed: login changed to %r', session_id) if session_id is None: # user logged out logging.debug('user logged out') self.current_user = None else: self.current_user = (prop_code, prop_number) logging.debug('current user is now %r', self.current_user) self.clear_all() self.fill_history_for(self.current_user) def clear_all(self): self.clear_history() self.browser.setText('') def fill_history_for(self, user): if user is None: return logging.debug('loading history for user %s', user) whole_history = pickle.loads(self.getProperty('history').getValue()) try: self.history_map = whole_history[user] except KeyError: #user has no history yet self.history_map = dict() for k,v in self.history_map.items(): self.history.insertRows(self.history.numRows()) logging.debug('numRows() is %d', self.history.numRows()) rows = self.history.numRows() - 1 self.history.setText(rows, 0, k[0]) self.history.setText(rows, 1, k[1]) self.history.setText(rows, 2, k[2]) def cleanup_history(self): histories = pickle.loads(self.getProperty('history').getValue()) sessions_ttl = self.getProperty('sessions ttl (in days)').getValue() limit_date = datetime.now() - timedelta(sessions_ttl) #we're mutating the dict so do not use iteritems() just to be sure for user in list(histories.keys()): history = histories[user] #get the keys where the date is more recent than the limit date valid_keys = [x for x in list(history.keys()) if datetime.strptime(x[0], '%Y-%m-%d %H:%M:%S') > limit_date] #NB: old format was "%a, %d %b %Y %H:%M:%S" if len(valid_keys) != len(history): # some entries are too old, copy only the ones that are recent enough new_hist = dict((k,history[k]) for k in valid_keys) logging.debug('BrowserBrick: removed %d entries from saved history for user %s', len(history) - len(valid_keys), user) histories[user] = new_hist self.getProperty('history').setValue(pickle.dumps(histories))
class QtResultBrowseUi(QDialog): def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) if not name: self.setName("QtResultBrowseUi") QtResultBrowseUiLayout = QGridLayout(self,1,1,11,6,"QtResultBrowseUiLayout") self.splitter5 = QSplitter(self,"splitter5") self.splitter5.setOrientation(QSplitter.Vertical) self.splitter4 = QSplitter(self.splitter5,"splitter4") self.splitter4.setOrientation(QSplitter.Horizontal) self.tblValues = QTable(self.splitter4,"tblValues") self.tblValues.setSizePolicy(QSizePolicy(QSizePolicy.Minimum,QSizePolicy.Expanding,0,0,self.tblValues.sizePolicy().hasHeightForWidth())) tblValues_font = QFont(self.tblValues.font()) tblValues_font.setFamily("Lucida Sans Typewriter") self.tblValues.setFont(tblValues_font) self.tblValues.setResizePolicy(QTable.Default) self.tblValues.setNumRows(23) self.tblValues.setNumCols(7) self.tblValues.setSorting(0) self.tabWidget2 = QTabWidget(self.splitter4,"tabWidget2") self.tab = QWidget(self.tabWidget2,"tab") tabLayout = QGridLayout(self.tab,1,1,11,6,"tabLayout") self.tblDetails = QTable(self.tab,"tblDetails") tblDetails_font = QFont(self.tblDetails.font()) tblDetails_font.setFamily("Lucida Sans Typewriter") self.tblDetails.setFont(tblDetails_font) self.tblDetails.setNumRows(3) self.tblDetails.setNumCols(3) tabLayout.addWidget(self.tblDetails,0,0) self.tabWidget2.insertTab(self.tab,QString.fromLatin1("")) self.TabPage = QWidget(self.tabWidget2,"TabPage") TabPageLayout = QGridLayout(self.TabPage,1,1,11,6,"TabPageLayout") self.txtPointSummary = QTextEdit(self.TabPage,"txtPointSummary") txtPointSummary_font = QFont(self.txtPointSummary.font()) txtPointSummary_font.setFamily("Lucida Sans Typewriter") self.txtPointSummary.setFont(txtPointSummary_font) self.txtPointSummary.setWordWrap(QTextEdit.NoWrap) TabPageLayout.addWidget(self.txtPointSummary,0,0) self.tabWidget2.insertTab(self.TabPage,QString.fromLatin1("")) self.tab_2 = QWidget(self.tabWidget2,"tab_2") tabLayout_2 = QVBoxLayout(self.tab_2,11,6,"tabLayout_2") self.txtNetlist = QTextEdit(self.tab_2,"txtNetlist") txtNetlist_font = QFont(self.txtNetlist.font()) txtNetlist_font.setFamily("Lucida Sans Typewriter") self.txtNetlist.setFont(txtNetlist_font) self.txtNetlist.setWordWrap(QTextEdit.NoWrap) tabLayout_2.addWidget(self.txtNetlist) layout3 = QHBoxLayout(None,0,6,"layout3") self.chkBlockInfo = QCheckBox(self.tab_2,"chkBlockInfo") layout3.addWidget(self.chkBlockInfo) self.chkInfoString = QCheckBox(self.tab_2,"chkInfoString") layout3.addWidget(self.chkInfoString) tabLayout_2.addLayout(layout3) self.tabWidget2.insertTab(self.tab_2,QString.fromLatin1("")) self.TabPage_2 = QWidget(self.tabWidget2,"TabPage_2") TabPageLayout_2 = QVBoxLayout(self.TabPage_2,11,6,"TabPageLayout_2") self.txtIndString = QTextEdit(self.TabPage_2,"txtIndString") txtIndString_font = QFont(self.txtIndString.font()) txtIndString_font.setFamily("Lucida Sans Typewriter") self.txtIndString.setFont(txtIndString_font) self.txtIndString.setWordWrap(QTextEdit.WidgetWidth) self.txtIndString.setWrapPolicy(QTextEdit.AtWordBoundary) TabPageLayout_2.addWidget(self.txtIndString) self.tabWidget2.insertTab(self.TabPage_2,QString.fromLatin1("")) self.TabPage_3 = QWidget(self.tabWidget2,"TabPage_3") TabPageLayout_3 = QVBoxLayout(self.TabPage_3,11,6,"TabPageLayout_3") self.matplotlibWidget1 = MatplotlibWidget(self.TabPage_3,"matplotlibWidget1") self.matplotlibWidget1.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Preferred,0,0,self.matplotlibWidget1.sizePolicy().hasHeightForWidth())) TabPageLayout_3.addWidget(self.matplotlibWidget1) self.groupBox3 = QGroupBox(self.TabPage_3,"groupBox3") self.groupBox3.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Maximum,0,0,self.groupBox3.sizePolicy().hasHeightForWidth())) self.groupBox3.setColumnLayout(0,Qt.Vertical) self.groupBox3.layout().setSpacing(6) self.groupBox3.layout().setMargin(11) groupBox3Layout = QGridLayout(self.groupBox3.layout()) groupBox3Layout.setAlignment(Qt.AlignTop) layout10 = QGridLayout(None,1,1,0,6,"layout10") self.textLabel1_2 = QLabel(self.groupBox3,"textLabel1_2") self.textLabel1_2.setSizePolicy(QSizePolicy(QSizePolicy.Maximum,QSizePolicy.Preferred,0,0,self.textLabel1_2.sizePolicy().hasHeightForWidth())) layout10.addWidget(self.textLabel1_2,1,0) self.cmbXAxis = QComboBox(0,self.groupBox3,"cmbXAxis") layout10.addWidget(self.cmbXAxis,0,1) self.textLabel1 = QLabel(self.groupBox3,"textLabel1") self.textLabel1.setSizePolicy(QSizePolicy(QSizePolicy.Maximum,QSizePolicy.Preferred,0,0,self.textLabel1.sizePolicy().hasHeightForWidth())) layout10.addWidget(self.textLabel1,0,0) self.cmbYAxis = QComboBox(0,self.groupBox3,"cmbYAxis") layout10.addWidget(self.cmbYAxis,1,1) groupBox3Layout.addMultiCellLayout(layout10,0,0,0,1) layout21 = QVBoxLayout(None,0,6,"layout21") layout19 = QHBoxLayout(None,0,6,"layout19") self.chkHoldPlot = QCheckBox(self.groupBox3,"chkHoldPlot") layout19.addWidget(self.chkHoldPlot) self.txtPlotFormatString = QLineEdit(self.groupBox3,"txtPlotFormatString") layout19.addWidget(self.txtPlotFormatString) layout21.addLayout(layout19) layout18 = QHBoxLayout(None,0,6,"layout18") self.chkTopoPlot = QCheckBox(self.groupBox3,"chkTopoPlot") layout18.addWidget(self.chkTopoPlot) layout15 = QHBoxLayout(None,0,6,"layout15") self.txtTopoMask = QLineEdit(self.groupBox3,"txtTopoMask") layout15.addWidget(self.txtTopoMask) self.txtTopoFilter = QLineEdit(self.groupBox3,"txtTopoFilter") layout15.addWidget(self.txtTopoFilter) layout18.addLayout(layout15) layout21.addLayout(layout18) layout17 = QHBoxLayout(None,0,6,"layout17") self.chkClustering = QCheckBox(self.groupBox3,"chkClustering") layout17.addWidget(self.chkClustering) self.chkFrontOnly = QCheckBox(self.groupBox3,"chkFrontOnly") layout17.addWidget(self.chkFrontOnly) self.chkNonFront = QCheckBox(self.groupBox3,"chkNonFront") layout17.addWidget(self.chkNonFront) layout21.addLayout(layout17) groupBox3Layout.addLayout(layout21,1,0) layout20 = QVBoxLayout(None,0,6,"layout20") self.btnUpdatePlot = QPushButton(self.groupBox3,"btnUpdatePlot") layout20.addWidget(self.btnUpdatePlot) self.btnClearPlot = QPushButton(self.groupBox3,"btnClearPlot") layout20.addWidget(self.btnClearPlot) self.btnSaveData = QPushButton(self.groupBox3,"btnSaveData") layout20.addWidget(self.btnSaveData) groupBox3Layout.addLayout(layout20,1,1) TabPageLayout_3.addWidget(self.groupBox3) self.tabWidget2.insertTab(self.TabPage_3,QString.fromLatin1("")) self.splitter4_2 = QSplitter(self.splitter5,"splitter4_2") self.splitter4_2.setOrientation(QSplitter.Horizontal) LayoutWidget = QWidget(self.splitter4_2,"layout20") layout20_2 = QVBoxLayout(LayoutWidget,11,6,"layout20_2") layout16 = QHBoxLayout(None,0,6,"layout16") self.btnSort = QPushButton(LayoutWidget,"btnSort") layout16.addWidget(self.btnSort) spacer4 = QSpacerItem(161,21,QSizePolicy.Expanding,QSizePolicy.Minimum) layout16.addItem(spacer4) layout20_2.addLayout(layout16) layout19_2 = QHBoxLayout(None,0,6,"layout19_2") self.btnIndEdit = QPushButton(LayoutWidget,"btnIndEdit") layout19_2.addWidget(self.btnIndEdit) spacer4_2 = QSpacerItem(250,21,QSizePolicy.Expanding,QSizePolicy.Minimum) layout19_2.addItem(spacer4_2) self.btnSheetSaveAs = QPushButton(LayoutWidget,"btnSheetSaveAs") layout19_2.addWidget(self.btnSheetSaveAs) self.btnIndSaveAs = QPushButton(LayoutWidget,"btnIndSaveAs") layout19_2.addWidget(self.btnIndSaveAs) layout20_2.addLayout(layout19_2) spacer5 = QSpacerItem(20,106,QSizePolicy.Minimum,QSizePolicy.Expanding) layout20_2.addItem(spacer5) self.groupBox3_2 = QGroupBox(LayoutWidget,"groupBox3_2") self.groupBox3_2.setColumnLayout(0,Qt.Vertical) self.groupBox3_2.layout().setSpacing(6) self.groupBox3_2.layout().setMargin(11) groupBox3_2Layout = QVBoxLayout(self.groupBox3_2.layout()) groupBox3_2Layout.setAlignment(Qt.AlignTop) layout14 = QHBoxLayout(None,0,6,"layout14") self.chkNondom = QCheckBox(self.groupBox3_2,"chkNondom") self.chkNondom.setChecked(1) layout14.addWidget(self.chkNondom) self.chkFeasible = QCheckBox(self.groupBox3_2,"chkFeasible") self.chkFeasible.setChecked(1) layout14.addWidget(self.chkFeasible) groupBox3_2Layout.addLayout(layout14) layout20_3 = QHBoxLayout(None,0,6,"layout20_3") self.chkAgeLayer = QCheckBox(self.groupBox3_2,"chkAgeLayer") layout20_3.addWidget(self.chkAgeLayer) self.chkAddLowerLayer = QCheckBox(self.groupBox3_2,"chkAddLowerLayer") layout20_3.addWidget(self.chkAddLowerLayer) self.spinAgeLayer = QSpinBox(self.groupBox3_2,"spinAgeLayer") layout20_3.addWidget(self.spinAgeLayer) groupBox3_2Layout.addLayout(layout20_3) layout20_4 = QHBoxLayout(None,0,6,"layout20_4") self.textLabel1_3 = QLabel(self.groupBox3_2,"textLabel1_3") layout20_4.addWidget(self.textLabel1_3) self.txtListTopoFilter = QLineEdit(self.groupBox3_2,"txtListTopoFilter") layout20_4.addWidget(self.txtListTopoFilter) self.btnUpdateListTopoFilter = QPushButton(self.groupBox3_2,"btnUpdateListTopoFilter") layout20_4.addWidget(self.btnUpdateListTopoFilter) groupBox3_2Layout.addLayout(layout20_4) layout20_2.addWidget(self.groupBox3_2) LayoutWidget_2 = QWidget(self.splitter4_2,"layout17") layout17_2 = QHBoxLayout(LayoutWidget_2,11,6,"layout17_2") layout16_2 = QVBoxLayout(None,0,6,"layout16_2") self.btnUpdate = QPushButton(LayoutWidget_2,"btnUpdate") layout16_2.addWidget(self.btnUpdate) spacer3 = QSpacerItem(20,110,QSizePolicy.Minimum,QSizePolicy.Expanding) layout16_2.addItem(spacer3) self.btnCloseAll = QPushButton(LayoutWidget_2,"btnCloseAll") layout16_2.addWidget(self.btnCloseAll) self.btnClose = QPushButton(LayoutWidget_2,"btnClose") layout16_2.addWidget(self.btnClose) self.btnSave = QPushButton(LayoutWidget_2,"btnSave") layout16_2.addWidget(self.btnSave) self.btnLoad = QPushButton(LayoutWidget_2,"btnLoad") self.btnLoad.setDefault(1) layout16_2.addWidget(self.btnLoad) layout17_2.addLayout(layout16_2) layout12 = QVBoxLayout(None,0,6,"layout12") self.lstOpenStates = QListBox(LayoutWidget_2,"lstOpenStates") layout12.addWidget(self.lstOpenStates) layout11 = QHBoxLayout(None,0,6,"layout11") self.textLabel2 = QLabel(LayoutWidget_2,"textLabel2") layout11.addWidget(self.textLabel2) self.txtFilename = QLineEdit(LayoutWidget_2,"txtFilename") self.txtFilename.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,0,0,self.txtFilename.sizePolicy().hasHeightForWidth())) layout11.addWidget(self.txtFilename) self.btnOpenFile = QPushButton(LayoutWidget_2,"btnOpenFile") self.btnOpenFile.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.btnOpenFile.sizePolicy().hasHeightForWidth())) self.btnOpenFile.setMaximumSize(QSize(30,32767)) layout11.addWidget(self.btnOpenFile) layout12.addLayout(layout11) layout17_2.addLayout(layout12) QtResultBrowseUiLayout.addWidget(self.splitter5,0,0) self.languageChange() self.resize(QSize(1299,877).expandedTo(self.minimumSizeHint())) self.clearWState(Qt.WState_Polished) def languageChange(self): self.setCaption(self.__tr("Form1")) self.tabWidget2.changeTab(self.tab,self.__tr("Point")) self.tabWidget2.changeTab(self.TabPage,self.__tr("PointSummary")) self.chkBlockInfo.setText(self.__tr("Block Info")) self.chkInfoString.setText(self.__tr("Info String")) self.tabWidget2.changeTab(self.tab_2,self.__tr("Netlist")) self.tabWidget2.changeTab(self.TabPage_2,self.__tr("Ind")) self.groupBox3.setTitle(self.__tr("Options")) self.textLabel1_2.setText(self.__tr("Y-Axis")) self.textLabel1.setText(self.__tr("X-Axis")) self.chkHoldPlot.setText(self.__tr("Hold plots")) self.txtPlotFormatString.setText(self.__tr(".")) QToolTip.add(self.txtPlotFormatString,self.__tr("Format string")) self.chkTopoPlot.setText(self.__tr("Topo plot")) QToolTip.add(self.txtTopoMask,self.__tr("topo mask")) QToolTip.add(self.txtTopoFilter,self.__tr("topo filter")) self.chkClustering.setText(self.__tr("Show clustering")) self.chkFrontOnly.setText(self.__tr("Front only")) self.chkNonFront.setText(self.__tr("Non-front")) self.btnUpdatePlot.setText(self.__tr("Plot")) self.btnClearPlot.setText(self.__tr("Clear Plot")) self.btnSaveData.setText(self.__tr("Save data")) self.tabWidget2.changeTab(self.TabPage_3,self.__tr("Plot")) self.btnSort.setText(self.__tr("Sort")) self.btnIndEdit.setText(self.__tr("Edit Ind")) self.btnSheetSaveAs.setText(self.__tr("Save Sheet as")) self.btnIndSaveAs.setText(self.__tr("Save Ind As")) self.groupBox3_2.setTitle(self.__tr("Set selection")) self.chkNondom.setText(self.__tr("Non dominated only")) self.chkFeasible.setText(self.__tr("Feasible only")) self.chkAgeLayer.setText(self.__tr("Age layer")) self.chkAddLowerLayer.setText(self.__tr("Include one lower layer")) self.textLabel1_3.setText(self.__tr("Topology filter")) QToolTip.add(self.txtListTopoFilter,self.__tr("topo filter")) self.btnUpdateListTopoFilter.setText(self.__tr("Update")) self.btnUpdate.setText(self.__tr("update")) self.btnCloseAll.setText(self.__tr("Close all")) self.btnClose.setText(self.__tr("Close")) self.btnSave.setText(self.__tr("Save")) self.btnLoad.setText(self.__tr("Load")) self.textLabel2.setText(self.__tr("Filename:")) self.btnOpenFile.setText(self.__tr("...")) def __tr(self,s,c = None): return qApp.translate("QtResultBrowseUi",s,c)
class BrowserBrick(BaseComponents.BlissWidget): def __init__(self, *args): BaseComponents.BlissWidget.__init__(self, *args) #map displayed string in the history list -> actual file path self.history_map = dict() self.layout = QVBoxLayout(self) self.defineSlot('load_file', ()) self.defineSlot('login_changed', ()) self.addProperty('mnemonic', 'string', '') self.addProperty('history', 'string', '', hidden=True) self.addProperty('sessions ttl (in days)', 'integer', '30') #make sure the history property is a pickled dict try: hist = pickle.loads(self.getProperty('history').getValue()) except: # EOFError if the string is empty but let's not count on it self.getProperty('history').setValue(pickle.dumps(dict())) # maybe defer that for later self.cleanup_history() self.main_layout = QSplitter(self) self.main_layout.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)) # left part of the splitter self.history_box = QVBox(self.main_layout) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) self.sort_order = True self.sort_col = None self.history = QTable(self.history_box) self.history.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding)) self.history.setSelectionMode(QTable.SingleRow) self.history.setNumCols(3) self.history.verticalHeader().hide() self.history.setLeftMargin(0) self.history.setSorting(False) QObject.connect(self.history, SIGNAL('currentChanged(int,int)'), self.history_changed) #by default sorting only sorts the columns and not whole rows. #let's reimplement that QObject.connect(self.history.horizontalHeader(), SIGNAL('clicked(int)'), self.sort_column) header = self.history.horizontalHeader() header.setLabel(0, 'Time and date') header.setLabel(1, 'Prefix') header.setLabel(2, 'Run number') self.clear_history_button = QPushButton('Clear history', self.history_box) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) QObject.connect(self.clear_history_button, SIGNAL('clicked()'), self.clear_history) # Right part of the splitter self.browser_box = QWidget(self.main_layout) QVBoxLayout(self.browser_box) self.browser_box.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.top_layout = QHBoxLayout(self.browser_box) self.back_button = QToolButton(self.browser_box) self.back_button.setIconSet(QIconSet(Icons.load('Left2'))) self.back_button.setTextLabel('Back') self.back_button.setUsesTextLabel(True) self.back_button.setTextPosition(QToolButton.BelowIcon) self.back_button.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.forward_button = QToolButton(self.browser_box) self.forward_button.setIconSet(QIconSet(Icons.load('Right2'))) self.forward_button.setTextLabel('Forward') self.forward_button.setUsesTextLabel(True) self.forward_button.setTextPosition(QToolButton.BelowIcon) self.forward_button.setSizePolicy(QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.top_layout.addWidget(self.back_button) self.top_layout.addWidget(self.forward_button) self.browser_box.layout().addLayout(self.top_layout) self.browser = QTextBrowser(self.browser_box) self.browser.setReadOnly(True) self.browser_box.layout().addWidget(self.browser) self.layout.addWidget(self.main_layout) #initially disabled self.forward_button.setEnabled(False) self.back_button.setEnabled(False) #connections QObject.connect(self.browser, SIGNAL('backwardAvailable(bool)'), self.back_button.setEnabled) QObject.connect(self.browser, SIGNAL('forwardAvailable(bool)'), self.forward_button.setEnabled) QObject.connect(self.back_button, SIGNAL('clicked()'), self.browser.backward) QObject.connect(self.forward_button, SIGNAL('clicked()'), self.browser.forward) self.edna = None # resize the splitter to something like 1/4-3/4 # width = self.main_layout.width() # left = width / 4.0 # right = width - left # logging.debug('setting splitter sizes to %d and %d', left, right) # self.main_layout.setSizes([left, right]) def sort_column(self, col_number): logging.debug('%s: sorting with column %d', self, col_number) if col_number == self.sort_column: # switch the sort order self.sort_order = self.sort_order ^ True else: self.sort_order = True #else, ascending self.sort_column = col_number self.history.sortColumn(col_number, self.sort_order, True) # put the right decoration on the header label if self.sort_order: direction = Qt.Ascending else: direction = Qt.Descending self.history.horizontalHeader().setSortIndicator(col_number, direction) def load_file(self, path): if self.browser.mimeSourceFactory().data(path) == None: self.browser.setText('<center>FILE NOT FOUND</center>') else: self.browser.setSource(abspath(path)) def history_changed(self, row, col): logging.debug('history elem selected: %d:%d', row, col) index = (str(self.history.text(row,0)), str(self.history.text(row,1)), str(self.history.text(row,2))) try: path = self.history_map[index] self.load_file(path) except KeyError, e: # can happen when qt sends us the signal with # null data and we get the key ("","","") pass
class BrowserBrick(BaseComponents.BlissWidget): def __init__(self, *args): BaseComponents.BlissWidget.__init__(self, *args) #map displayed string in the history list -> actual file path self.history_map = dict() self.layout = QVBoxLayout(self) self.defineSlot('load_file', ()) self.defineSlot('login_changed', ()) self.addProperty('mnemonic', 'string', '') self.addProperty('history', 'string', '', hidden=True) self.addProperty('sessions ttl (in days)', 'integer', '30') #make sure the history property is a pickled dict try: hist = pickle.loads(self.getProperty('history').getValue()) except: # EOFError if the string is empty but let's not count on it self.getProperty('history').setValue(pickle.dumps(dict())) # maybe defer that for later self.cleanup_history() self.main_layout = QSplitter(self) self.main_layout.setSizePolicy( QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)) # left part of the splitter self.history_box = QVBox(self.main_layout) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) self.sort_order = True self.sort_col = None self.history = QTable(self.history_box) self.history.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding)) self.history.setSelectionMode(QTable.SingleRow) self.history.setNumCols(3) self.history.verticalHeader().hide() self.history.setLeftMargin(0) self.history.setSorting(False) QObject.connect(self.history, SIGNAL('currentChanged(int,int)'), self.history_changed) #by default sorting only sorts the columns and not whole rows. #let's reimplement that QObject.connect(self.history.horizontalHeader(), SIGNAL('clicked(int)'), self.sort_column) header = self.history.horizontalHeader() header.setLabel(0, 'Time and date') header.setLabel(1, 'Prefix') header.setLabel(2, 'Run number') self.clear_history_button = QPushButton('Clear history', self.history_box) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) QObject.connect(self.clear_history_button, SIGNAL('clicked()'), self.clear_history) # Right part of the splitter self.browser_box = QWidget(self.main_layout) QVBoxLayout(self.browser_box) self.browser_box.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.top_layout = QHBoxLayout(self.browser_box) self.back_button = QToolButton(self.browser_box) self.back_button.setIconSet(QIconSet(Icons.load('Left2'))) self.back_button.setTextLabel('Back') self.back_button.setUsesTextLabel(True) self.back_button.setTextPosition(QToolButton.BelowIcon) self.back_button.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.forward_button = QToolButton(self.browser_box) self.forward_button.setIconSet(QIconSet(Icons.load('Right2'))) self.forward_button.setTextLabel('Forward') self.forward_button.setUsesTextLabel(True) self.forward_button.setTextPosition(QToolButton.BelowIcon) self.forward_button.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.top_layout.addWidget(self.back_button) self.top_layout.addWidget(self.forward_button) self.browser_box.layout().addLayout(self.top_layout) self.browser = QTextBrowser(self.browser_box) self.browser.setReadOnly(True) self.browser_box.layout().addWidget(self.browser) self.layout.addWidget(self.main_layout) #initially disabled self.forward_button.setEnabled(False) self.back_button.setEnabled(False) #connections QObject.connect(self.browser, SIGNAL('backwardAvailable(bool)'), self.back_button.setEnabled) QObject.connect(self.browser, SIGNAL('forwardAvailable(bool)'), self.forward_button.setEnabled) QObject.connect(self.back_button, SIGNAL('clicked()'), self.browser.backward) QObject.connect(self.forward_button, SIGNAL('clicked()'), self.browser.forward) self.edna = None # resize the splitter to something like 1/4-3/4 # width = self.main_layout.width() # left = width / 4.0 # right = width - left # logging.debug('setting splitter sizes to %d and %d', left, right) # self.main_layout.setSizes([left, right]) def sort_column(self, col_number): logging.debug('%s: sorting with column %d', self, col_number) if col_number == self.sort_column: # switch the sort order self.sort_order = self.sort_order ^ True else: self.sort_order = True #else, ascending self.sort_column = col_number self.history.sortColumn(col_number, self.sort_order, True) # put the right decoration on the header label if self.sort_order: direction = Qt.Ascending else: direction = Qt.Descending self.history.horizontalHeader().setSortIndicator(col_number, direction) def load_file(self, path): if self.browser.mimeSourceFactory().data(path) == None: self.browser.setText('<center>FILE NOT FOUND</center>') else: self.browser.setSource(abspath(path)) def history_changed(self, row, col): logging.debug('history elem selected: %d:%d', row, col) index = (str(self.history.text(row, 0)), str(self.history.text(row, 1)), str(self.history.text(row, 2))) try: path = self.history_map[index] self.load_file(path) except KeyError, e: # can happen when qt sends us the signal with # null data and we get the key ("","","") pass
class BrowserBrick(BaseComponents.BlissWidget): def __init__(self, *args): BaseComponents.BlissWidget.__init__(self, *args) # map displayed string in the history list -> actual file path self.history_map = dict() self.layout = QVBoxLayout(self) self.defineSlot("load_file", ()) self.defineSlot("login_changed", ()) self.addProperty("mnemonic", "string", "") self.addProperty("history", "string", "", hidden=True) self.addProperty("sessions ttl (in days)", "integer", "30") # make sure the history property is a pickled dict try: hist = pickle.loads(self.getProperty("history").getValue()) except BaseException: # EOFError if the string is empty but let's not count on it self.getProperty("history").setValue(pickle.dumps(dict())) # maybe defer that for later self.cleanup_history() self.main_layout = QSplitter(self) self.main_layout.setSizePolicy( QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)) # left part of the splitter self.history_box = QVBox(self.main_layout) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) self.sort_order = True self.sort_col = None self.history = QTable(self.history_box) self.history.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding)) self.history.setSelectionMode(QTable.SingleRow) self.history.setNumCols(3) self.history.verticalHeader().hide() self.history.setLeftMargin(0) self.history.setSorting(False) QObject.connect(self.history, SIGNAL("currentChanged(int,int)"), self.history_changed) # by default sorting only sorts the columns and not whole rows. # let's reimplement that QObject.connect(self.history.horizontalHeader(), SIGNAL("clicked(int)"), self.sort_column) header = self.history.horizontalHeader() header.setLabel(0, "Time and date") header.setLabel(1, "Prefix") header.setLabel(2, "Run number") self.clear_history_button = QPushButton("Clear history", self.history_box) self.history_box.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) QObject.connect(self.clear_history_button, SIGNAL("clicked()"), self.clear_history) # Right part of the splitter self.browser_box = QWidget(self.main_layout) QVBoxLayout(self.browser_box) self.browser_box.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.top_layout = QHBoxLayout(self.browser_box) self.back_button = QToolButton(self.browser_box) self.back_button.setIconSet(QIconSet(Icons.load("Left2"))) self.back_button.setTextLabel("Back") self.back_button.setUsesTextLabel(True) self.back_button.setTextPosition(QToolButton.BelowIcon) self.back_button.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.forward_button = QToolButton(self.browser_box) self.forward_button.setIconSet(QIconSet(Icons.load("Right2"))) self.forward_button.setTextLabel("Forward") self.forward_button.setUsesTextLabel(True) self.forward_button.setTextPosition(QToolButton.BelowIcon) self.forward_button.setSizePolicy( QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)) self.top_layout.addWidget(self.back_button) self.top_layout.addWidget(self.forward_button) self.browser_box.layout().addLayout(self.top_layout) self.browser = QTextBrowser(self.browser_box) self.browser.setReadOnly(True) self.browser_box.layout().addWidget(self.browser) self.layout.addWidget(self.main_layout) # initially disabled self.forward_button.setEnabled(False) self.back_button.setEnabled(False) # connections QObject.connect(self.browser, SIGNAL("backwardAvailable(bool)"), self.back_button.setEnabled) QObject.connect( self.browser, SIGNAL("forwardAvailable(bool)"), self.forward_button.setEnabled, ) QObject.connect(self.back_button, SIGNAL("clicked()"), self.browser.backward) QObject.connect(self.forward_button, SIGNAL("clicked()"), self.browser.forward) self.edna = None # resize the splitter to something like 1/4-3/4 # width = self.main_layout.width() # left = width / 4.0 # right = width - left # logging.debug('setting splitter sizes to %d and %d', left, right) # self.main_layout.setSizes([left, right]) def sort_column(self, col_number): logging.debug("%s: sorting with column %d", self, col_number) if col_number == self.sort_column: # switch the sort order self.sort_order = self.sort_order ^ True else: self.sort_order = True # else, ascending self.sort_column = col_number self.history.sortColumn(col_number, self.sort_order, True) # put the right decoration on the header label if self.sort_order: direction = Qt.Ascending else: direction = Qt.Descending self.history.horizontalHeader().setSortIndicator(col_number, direction) def load_file(self, path): if self.browser.mimeSourceFactory().data(path) is None: self.browser.setText("<center>FILE NOT FOUND</center>") else: self.browser.setSource(abspath(path)) def history_changed(self, row, col): logging.debug("history elem selected: %d:%d", row, col) index = ( str(self.history.text(row, 0)), str(self.history.text(row, 1)), str(self.history.text(row, 2)), ) try: path = self.history_map[index] self.load_file(path) except KeyError as e: # can happen when qt sends us the signal with # null data and we get the key ("","","") pass def new_html(self, html_path, image_prefix, run_number): logging.getLogger().debug( "got a new html page: %s, prefix: %r, run number: %s", html_path, image_prefix, run_number, ) # prepend the time and date to the path we just got so # the history is more readable time_string = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) index = (time_string, str(image_prefix), str(run_number)) self.history_map[index] = html_path # synchronize the history prop if self.current_user is not None: whole_history = pickle.loads( self.getProperty("history").getValue()) whole_history[self.current_user] = self.history_map self.getProperty("history").setValue(pickle.dumps(whole_history)) self.history.insertRows(self.history.numRows()) logging.debug("numRows() is %d", self.history.numRows()) rows = self.history.numRows() - 1 self.history.setText(rows, 0, QString(time_string)) self.history.setText(rows, 1, QString(str(image_prefix))) self.history.setText(rows, 2, QString(str(run_number))) logging.debug("numRows() is %d", self.history.numRows()) self.load_file(html_path) def clear_history(self): self.history_map.clear() self.history.setNumRows(0) def propertyChanged(self, prop, oldval, newval): if prop == "mnemonic": logging.getLogger().debug("BrowserBrick: using edna object %s", newval) if self.edna is not None: self.disconnect(self.edna, PYSIGNAL("newEDNAHTML"), self.new_html) self.edna = self.getHardwareObject(newval) logging.getLogger().debug("edna object is now: %s", self.edna) self.connect(self.edna, PYSIGNAL("newEDNAHTML"), self.new_html) def run(self): pass def login_changed( self, session_id, prop_code=None, prop_number=None, prop_id=None, expiration_time=0, ): logging.debug("BrowserBrick::login_changed: login changed to %r", session_id) if session_id is None: # user logged out logging.debug("user logged out") self.current_user = None else: self.current_user = (prop_code, prop_number) logging.debug("current user is now %r", self.current_user) self.clear_all() self.fill_history_for(self.current_user) def clear_all(self): self.clear_history() self.browser.setText("") def fill_history_for(self, user): if user is None: return logging.debug("loading history for user %s", user) whole_history = pickle.loads(self.getProperty("history").getValue()) try: self.history_map = whole_history[user] except KeyError: # user has no history yet self.history_map = dict() for k, v in self.history_map.iteritems(): self.history.insertRows(self.history.numRows()) logging.debug("numRows() is %d", self.history.numRows()) rows = self.history.numRows() - 1 self.history.setText(rows, 0, k[0]) self.history.setText(rows, 1, k[1]) self.history.setText(rows, 2, k[2]) def cleanup_history(self): histories = pickle.loads(self.getProperty("history").getValue()) sessions_ttl = self.getProperty("sessions ttl (in days)").getValue() limit_date = datetime.now() - timedelta(sessions_ttl) # we're mutating the dict so do not use iteritems() just to be sure for user in histories.keys(): history = histories[user] # get the keys where the date is more recent than the limit date valid_keys = [ x for x in history.keys() if datetime.strptime(x[0], "%Y-%m-%d %H:%M:%S") > limit_date ] # NB: old format was "%a, %d %b %Y %H:%M:%S" if len(valid_keys) != len(history): # some entries are too old, copy only the ones that are recent enough new_hist = dict((k, history[k]) for k in valid_keys) logging.debug( "BrowserBrick: removed %d entries from saved history for user %s", len(history) - len(valid_keys), user, ) histories[user] = new_hist self.getProperty("history").setValue(pickle.dumps(histories))
class roamprofile(QWidget): def __init__(self,parent = None,name = None,fl = 0): QWidget.__init__(self,parent,name,fl) if not name: self.setName("roamprofile") self.setFocusPolicy(QWidget.TabFocus) roamprofileLayout = QGridLayout(self,1,1,11,6,"roamprofileLayout") self.textLabel1_2 = QLabel(self,"textLabel1_2") roamprofileLayout.addWidget(self.textLabel1_2,0,0) self.clientgroupListBox = QListBox(self,"clientgroupListBox") self.clientgroupListBox.setSizePolicy(QSizePolicy(5,7,0,0,self.clientgroupListBox.sizePolicy().hasHeightForWidth())) roamprofileLayout.addWidget(self.clientgroupListBox,1,0) self.roamProfileTabWidget = QTabWidget(self,"roamProfileTabWidget") self.tab = QWidget(self.roamProfileTabWidget,"tab") tabLayout = QGridLayout(self.tab,1,1,11,6,"tabLayout") layout36 = QHBoxLayout(None,0,6,"layout36") layout35 = QGridLayout(None,1,1,0,6,"layout35") layout7 = QVBoxLayout(None,0,6,"layout7") spacer6_2 = QSpacerItem(20,20,QSizePolicy.Minimum,QSizePolicy.Expanding) layout7.addItem(spacer6_2) layout6 = QVBoxLayout(None,0,6,"layout6") self.moveSelectedToolButton = QToolButton(self.tab,"moveSelectedToolButton") self.moveSelectedToolButton.setEnabled(1) self.moveSelectedToolButton.setFocusPolicy(QToolButton.TabFocus) self.moveSelectedToolButton.setIconSet(QIconSet()) layout6.addWidget(self.moveSelectedToolButton) self.moveAllToolButton = QToolButton(self.tab,"moveAllToolButton") self.moveAllToolButton.setEnabled(1) self.moveAllToolButton.setFocusPolicy(QToolButton.TabFocus) self.moveAllToolButton.setIconSet(QIconSet()) layout6.addWidget(self.moveAllToolButton) layout7.addLayout(layout6) spacer5_2 = QSpacerItem(20,20,QSizePolicy.Minimum,QSizePolicy.Expanding) layout7.addItem(spacer5_2) layout35.addLayout(layout7,1,1) layout8 = QHBoxLayout(None,0,6,"layout8") layout35.addLayout(layout8,0,0) self.availablePortListView = QListView(self.tab,"availablePortListView") self.availablePortListView.addColumn(self.__tr("Available Port List")) layout35.addWidget(self.availablePortListView,1,0) layout36.addLayout(layout35) layout33 = QVBoxLayout(None,0,6,"layout33") self.selectedPortListLabel = QLabel(self.tab,"selectedPortListLabel") layout33.addWidget(self.selectedPortListLabel) layout32 = QHBoxLayout(None,0,6,"layout32") self.selectedPortList = QListBox(self.tab,"selectedPortList") layout32.addWidget(self.selectedPortList) layout12 = QVBoxLayout(None,0,6,"layout12") spacer8 = QSpacerItem(20,30,QSizePolicy.Minimum,QSizePolicy.Expanding) layout12.addItem(spacer8) layout11 = QVBoxLayout(None,0,6,"layout11") self.upToolButton = QToolButton(self.tab,"upToolButton") self.upToolButton.setFocusPolicy(QToolButton.TabFocus) self.upToolButton.setIconSet(QIconSet()) layout11.addWidget(self.upToolButton) self.downToolButton = QToolButton(self.tab,"downToolButton") self.downToolButton.setFocusPolicy(QToolButton.TabFocus) self.downToolButton.setIconSet(QIconSet()) layout11.addWidget(self.downToolButton) self.deleteSelectedToolButton = QToolButton(self.tab,"deleteSelectedToolButton") self.deleteSelectedToolButton.setFocusPolicy(QToolButton.TabFocus) self.deleteSelectedToolButton.setIconSet(QIconSet()) layout11.addWidget(self.deleteSelectedToolButton) self.deleteAllToolButton = QToolButton(self.tab,"deleteAllToolButton") self.deleteAllToolButton.setFocusPolicy(QToolButton.TabFocus) self.deleteAllToolButton.setIconSet(QIconSet()) layout11.addWidget(self.deleteAllToolButton) layout12.addLayout(layout11) spacer7_2 = QSpacerItem(20,30,QSizePolicy.Minimum,QSizePolicy.Expanding) layout12.addItem(spacer7_2) layout32.addLayout(layout12) layout33.addLayout(layout32) layout36.addLayout(layout33) tabLayout.addLayout(layout36,0,0) self.tabWidget3 = QTabWidget(self.tab,"tabWidget3") self.time = QWidget(self.tabWidget3,"time") timeLayout = QHBoxLayout(self.time,11,6,"timeLayout") layout18 = QVBoxLayout(None,0,6,"layout18") self.dwellTimeButtonGroup = QButtonGroup(self.time,"dwellTimeButtonGroup") self.dwellTimeButtonGroup.setEnabled(1) self.dwellTimeButtonGroup.setColumnLayout(0,Qt.Vertical) self.dwellTimeButtonGroup.layout().setSpacing(6) self.dwellTimeButtonGroup.layout().setMargin(11) dwellTimeButtonGroupLayout = QGridLayout(self.dwellTimeButtonGroup.layout()) dwellTimeButtonGroupLayout.setAlignment(Qt.AlignTop) self.customDwellTimeRadioButton = QRadioButton(self.dwellTimeButtonGroup,"customDwellTimeRadioButton") self.customDwellTimeRadioButton.setEnabled(0) self.dwellTimeButtonGroup.insert( self.customDwellTimeRadioButton,1) dwellTimeButtonGroupLayout.addWidget(self.customDwellTimeRadioButton,1,0) self.fixedDwellTimeRadioButton = QRadioButton(self.dwellTimeButtonGroup,"fixedDwellTimeRadioButton") self.fixedDwellTimeRadioButton.setChecked(1) self.dwellTimeButtonGroup.insert( self.fixedDwellTimeRadioButton,0) dwellTimeButtonGroupLayout.addWidget(self.fixedDwellTimeRadioButton,0,0) self.fixedTimeSpinBox = QSpinBox(self.dwellTimeButtonGroup,"fixedTimeSpinBox") self.fixedTimeSpinBox.setMaxValue(100000) self.fixedTimeSpinBox.setMinValue(1) dwellTimeButtonGroupLayout.addWidget(self.fixedTimeSpinBox,0,1) self.customDwellOptionsGroupBox = QGroupBox(self.dwellTimeButtonGroup,"customDwellOptionsGroupBox") self.customDwellOptionsGroupBox.setEnabled(0) self.customDwellOptionsGroupBox.setColumnLayout(0,Qt.Vertical) self.customDwellOptionsGroupBox.layout().setSpacing(6) self.customDwellOptionsGroupBox.layout().setMargin(11) customDwellOptionsGroupBoxLayout = QGridLayout(self.customDwellOptionsGroupBox.layout()) customDwellOptionsGroupBoxLayout.setAlignment(Qt.AlignTop) self.endDwellLabel = QLabel(self.customDwellOptionsGroupBox,"endDwellLabel") self.endDwellLabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) customDwellOptionsGroupBoxLayout.addWidget(self.endDwellLabel,1,0) self.dwellChangeLabel = QLabel(self.customDwellOptionsGroupBox,"dwellChangeLabel") self.dwellChangeLabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) customDwellOptionsGroupBoxLayout.addWidget(self.dwellChangeLabel,2,0) self.startDwellLabel = QLabel(self.customDwellOptionsGroupBox,"startDwellLabel") self.startDwellLabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) customDwellOptionsGroupBoxLayout.addWidget(self.startDwellLabel,0,0) self.changeStepSpinBox = QSpinBox(self.customDwellOptionsGroupBox,"changeStepSpinBox") self.changeStepSpinBox.setMaxValue(80) self.changeStepSpinBox.setMinValue(-80) customDwellOptionsGroupBoxLayout.addWidget(self.changeStepSpinBox,2,1) self.startDwellSpinBox = QSpinBox(self.customDwellOptionsGroupBox,"startDwellSpinBox") self.startDwellSpinBox.setMaxValue(80) customDwellOptionsGroupBoxLayout.addWidget(self.startDwellSpinBox,0,1) self.endDwellSpinBox = QSpinBox(self.customDwellOptionsGroupBox,"endDwellSpinBox") self.endDwellSpinBox.setMaxValue(80) customDwellOptionsGroupBoxLayout.addWidget(self.endDwellSpinBox,1,1) self.comboBox5 = QComboBox(0,self.customDwellOptionsGroupBox,"comboBox5") customDwellOptionsGroupBoxLayout.addWidget(self.comboBox5,0,2) self.comboBox6 = QComboBox(0,self.customDwellOptionsGroupBox,"comboBox6") customDwellOptionsGroupBoxLayout.addWidget(self.comboBox6,1,2) dwellTimeButtonGroupLayout.addMultiCellWidget(self.customDwellOptionsGroupBox,2,2,0,1) layout18.addWidget(self.dwellTimeButtonGroup) spacer8_2_2 = QSpacerItem(20,20,QSizePolicy.Minimum,QSizePolicy.Expanding) layout18.addItem(spacer8_2_2) timeLayout.addLayout(layout18) layout19 = QVBoxLayout(None,0,6,"layout19") self.repeatButtonGroup = QButtonGroup(self.time,"repeatButtonGroup") self.repeatButtonGroup.setColumnLayout(0,Qt.Vertical) self.repeatButtonGroup.layout().setSpacing(6) self.repeatButtonGroup.layout().setMargin(11) repeatButtonGroupLayout = QGridLayout(self.repeatButtonGroup.layout()) repeatButtonGroupLayout.setAlignment(Qt.AlignTop) self.repeatCountSpinBox = QSpinBox(self.repeatButtonGroup,"repeatCountSpinBox") self.repeatCountSpinBox.setMaxValue(1000000) repeatButtonGroupLayout.addWidget(self.repeatCountSpinBox,0,3) self.durationRadioButton = QRadioButton(self.repeatButtonGroup,"durationRadioButton") self.durationRadioButton.setFocusPolicy(QRadioButton.NoFocus) self.repeatButtonGroup.insert( self.durationRadioButton,2) repeatButtonGroupLayout.addWidget(self.durationRadioButton,1,0) self.durationSpinBox = QSpinBox(self.repeatButtonGroup,"durationSpinBox") self.durationSpinBox.setMaxValue(1000000) self.durationSpinBox.setMinValue(1) repeatButtonGroupLayout.addWidget(self.durationSpinBox,1,1) self.timeUnitComboBox = QComboBox(0,self.repeatButtonGroup,"timeUnitComboBox") repeatButtonGroupLayout.addMultiCellWidget(self.timeUnitComboBox,1,1,2,3) self.repeatCountRadioButton = QRadioButton(self.repeatButtonGroup,"repeatCountRadioButton") self.repeatCountRadioButton.setChecked(1) self.repeatButtonGroup.insert( self.repeatCountRadioButton,1) repeatButtonGroupLayout.addMultiCellWidget(self.repeatCountRadioButton,0,0,0,2) layout19.addWidget(self.repeatButtonGroup) spacer8_2 = QSpacerItem(20,31,QSizePolicy.Minimum,QSizePolicy.Expanding) layout19.addItem(spacer8_2) timeLayout.addLayout(layout19) self.tabWidget3.insertTab(self.time,QString("")) self.distribution = QWidget(self.tabWidget3,"distribution") distributionLayout = QGridLayout(self.distribution,1,1,11,6,"distributionLayout") self.clientDistButtonGroup = QButtonGroup(self.distribution,"clientDistButtonGroup") self.clientDistButtonGroup.setColumnLayout(0,Qt.Vertical) self.clientDistButtonGroup.layout().setSpacing(6) self.clientDistButtonGroup.layout().setMargin(11) clientDistButtonGroupLayout = QGridLayout(self.clientDistButtonGroup.layout()) clientDistButtonGroupLayout.setAlignment(Qt.AlignTop) self.clientDistRadio1 = QRadioButton(self.clientDistButtonGroup,"clientDistRadio1") self.clientDistRadio1.setChecked(1) self.clientDistButtonGroup.insert( self.clientDistRadio1,1) clientDistButtonGroupLayout.addWidget(self.clientDistRadio1,0,0) self.clientDistRadio2 = QRadioButton(self.clientDistButtonGroup,"clientDistRadio2") self.clientDistButtonGroup.insert( self.clientDistRadio2,2) clientDistButtonGroupLayout.addWidget(self.clientDistRadio2,1,0) distributionLayout.addWidget(self.clientDistButtonGroup,0,1) self.timeDistButtonGroup = QButtonGroup(self.distribution,"timeDistButtonGroup") self.timeDistButtonGroup.setColumnLayout(0,Qt.Vertical) self.timeDistButtonGroup.layout().setSpacing(6) self.timeDistButtonGroup.layout().setMargin(11) timeDistButtonGroupLayout = QGridLayout(self.timeDistButtonGroup.layout()) timeDistButtonGroupLayout.setAlignment(Qt.AlignTop) self.timeDistRadio1 = QRadioButton(self.timeDistButtonGroup,"timeDistRadio1") self.timeDistRadio1.setChecked(1) self.timeDistButtonGroup.insert( self.timeDistRadio1,1) timeDistButtonGroupLayout.addWidget(self.timeDistRadio1,0,0) self.timeDistRadio2 = QRadioButton(self.timeDistButtonGroup,"timeDistRadio2") self.timeDistRadio2.setChecked(0) self.timeDistButtonGroup.insert( self.timeDistRadio2,2) timeDistButtonGroupLayout.addWidget(self.timeDistRadio2,1,0) distributionLayout.addWidget(self.timeDistButtonGroup,0,0) spacer7_3 = QSpacerItem(20,41,QSizePolicy.Minimum,QSizePolicy.Expanding) distributionLayout.addMultiCell(spacer7_3,1,1,0,1) self.tabWidget3.insertTab(self.distribution,QString("")) self.power = QWidget(self.tabWidget3,"power") powerLayout = QGridLayout(self.power,1,1,11,6,"powerLayout") self.powerProfileGroupBox = QGroupBox(self.power,"powerProfileGroupBox") self.powerProfileGroupBox.setEnabled(1) self.powerProfileGroupBox.setFocusPolicy(QGroupBox.TabFocus) self.powerProfileGroupBox.setCheckable(1) self.powerProfileGroupBox.setChecked(0) self.powerProfileGroupBox.setColumnLayout(0,Qt.Vertical) self.powerProfileGroupBox.layout().setSpacing(6) self.powerProfileGroupBox.layout().setMargin(11) powerProfileGroupBoxLayout = QGridLayout(self.powerProfileGroupBox.layout()) powerProfileGroupBoxLayout.setAlignment(Qt.AlignTop) self.srcStartPrwSpinBox = QSpinBox(self.powerProfileGroupBox,"srcStartPrwSpinBox") self.srcStartPrwSpinBox.setMaxValue(-6) self.srcStartPrwSpinBox.setMinValue(-42) powerProfileGroupBoxLayout.addWidget(self.srcStartPrwSpinBox,0,1) self.srcEndPwrSpinBox = QSpinBox(self.powerProfileGroupBox,"srcEndPwrSpinBox") self.srcEndPwrSpinBox.setMaxValue(-6) self.srcEndPwrSpinBox.setMinValue(-42) powerProfileGroupBoxLayout.addWidget(self.srcEndPwrSpinBox,1,1) self.srcChangeStepSpinBox = QSpinBox(self.powerProfileGroupBox,"srcChangeStepSpinBox") self.srcChangeStepSpinBox.setMaxValue(20) self.srcChangeStepSpinBox.setMinValue(1) powerProfileGroupBoxLayout.addWidget(self.srcChangeStepSpinBox,2,1) self.endTxPowerALabel = QLabel(self.powerProfileGroupBox,"endTxPowerALabel") self.endTxPowerALabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.endTxPowerALabel,1,0) self.startTxPowerALabel = QLabel(self.powerProfileGroupBox,"startTxPowerALabel") self.startTxPowerALabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.startTxPowerALabel,0,0) self.changeStepALabel = QLabel(self.powerProfileGroupBox,"changeStepALabel") self.changeStepALabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.changeStepALabel,2,0) self.destStartPwrSpinBox = QSpinBox(self.powerProfileGroupBox,"destStartPwrSpinBox") self.destStartPwrSpinBox.setMaxValue(-6) self.destStartPwrSpinBox.setMinValue(-42) powerProfileGroupBoxLayout.addWidget(self.destStartPwrSpinBox,0,3) self.destEndPwrSpinBox = QSpinBox(self.powerProfileGroupBox,"destEndPwrSpinBox") self.destEndPwrSpinBox.setMaxValue(-6) self.destEndPwrSpinBox.setMinValue(-42) powerProfileGroupBoxLayout.addWidget(self.destEndPwrSpinBox,1,3) self.destChangeStepSpinBox = QSpinBox(self.powerProfileGroupBox,"destChangeStepSpinBox") self.destChangeStepSpinBox.setMaxValue(20) self.destChangeStepSpinBox.setMinValue(1) powerProfileGroupBoxLayout.addWidget(self.destChangeStepSpinBox,2,3) self.destChangeIntSpinBox = QSpinBox(self.powerProfileGroupBox,"destChangeIntSpinBox") self.destChangeIntSpinBox.setMaxValue(100000) self.destChangeIntSpinBox.setMinValue(1000) self.destChangeIntSpinBox.setLineStep(100) powerProfileGroupBoxLayout.addWidget(self.destChangeIntSpinBox,3,3) self.startTxPowerBLabel = QLabel(self.powerProfileGroupBox,"startTxPowerBLabel") self.startTxPowerBLabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.startTxPowerBLabel,0,2) self.endTxPowerbLabel = QLabel(self.powerProfileGroupBox,"endTxPowerbLabel") self.endTxPowerbLabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.endTxPowerbLabel,1,2) self.changeStepBLabel = QLabel(self.powerProfileGroupBox,"changeStepBLabel") self.changeStepBLabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.changeStepBLabel,2,2) self.changeIntBLabel = QLabel(self.powerProfileGroupBox,"changeIntBLabel") self.changeIntBLabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.changeIntBLabel,3,2) self.changeIntALabel = QLabel(self.powerProfileGroupBox,"changeIntALabel") self.changeIntALabel.setAlignment(QLabel.AlignVCenter | QLabel.AlignRight) powerProfileGroupBoxLayout.addWidget(self.changeIntALabel,3,0) self.srcChangeIntSpinBox = QSpinBox(self.powerProfileGroupBox,"srcChangeIntSpinBox") self.srcChangeIntSpinBox.setMaxValue(1000000) self.srcChangeIntSpinBox.setMinValue(1000) self.srcChangeIntSpinBox.setLineStep(100) powerProfileGroupBoxLayout.addWidget(self.srcChangeIntSpinBox,3,1) powerLayout.addWidget(self.powerProfileGroupBox,0,0) spacer10 = QSpacerItem(51,21,QSizePolicy.Expanding,QSizePolicy.Minimum) powerLayout.addItem(spacer10,0,1) spacer11 = QSpacerItem(20,21,QSizePolicy.Minimum,QSizePolicy.Expanding) powerLayout.addItem(spacer11,1,0) self.tabWidget3.insertTab(self.power,QString("")) self.flows = QWidget(self.tabWidget3,"flows") flowsLayout = QVBoxLayout(self.flows,11,6,"flowsLayout") layout21 = QHBoxLayout(None,0,6,"layout21") self.flowParametersButtonGroup = QButtonGroup(self.flows,"flowParametersButtonGroup") self.flowParametersButtonGroup.setEnabled(1) self.flowParametersButtonGroup.setColumnLayout(0,Qt.Vertical) self.flowParametersButtonGroup.layout().setSpacing(6) self.flowParametersButtonGroup.layout().setMargin(11) flowParametersButtonGroupLayout = QGridLayout(self.flowParametersButtonGroup.layout()) flowParametersButtonGroupLayout.setAlignment(Qt.AlignTop) self.textLabel2_2 = QLabel(self.flowParametersButtonGroup,"textLabel2_2") flowParametersButtonGroupLayout.addWidget(self.textLabel2_2,0,0) self.flowPacketSizeSpinBox = QSpinBox(self.flowParametersButtonGroup,"flowPacketSizeSpinBox") self.flowPacketSizeSpinBox.setMaxValue(1518) self.flowPacketSizeSpinBox.setMinValue(88) self.flowPacketSizeSpinBox.setValue(256) flowParametersButtonGroupLayout.addWidget(self.flowPacketSizeSpinBox,0,1) self.textLabel3 = QLabel(self.flowParametersButtonGroup,"textLabel3") flowParametersButtonGroupLayout.addWidget(self.textLabel3,1,0) self.flowRateSpinBox = QSpinBox(self.flowParametersButtonGroup,"flowRateSpinBox") self.flowRateSpinBox.setMaxValue(10000) self.flowRateSpinBox.setMinValue(1) self.flowRateSpinBox.setValue(100) flowParametersButtonGroupLayout.addWidget(self.flowRateSpinBox,1,1) layout21.addWidget(self.flowParametersButtonGroup) self.learningFramesGroupBox = QGroupBox(self.flows,"learningFramesGroupBox") self.learningFramesGroupBox.setFocusPolicy(QGroupBox.TabFocus) self.learningFramesGroupBox.setCheckable(1) self.learningFramesGroupBox.setColumnLayout(0,Qt.Vertical) self.learningFramesGroupBox.layout().setSpacing(6) self.learningFramesGroupBox.layout().setMargin(11) learningFramesGroupBoxLayout = QGridLayout(self.learningFramesGroupBox.layout()) learningFramesGroupBoxLayout.setAlignment(Qt.AlignTop) self.textLabel4 = QLabel(self.learningFramesGroupBox,"textLabel4") learningFramesGroupBoxLayout.addWidget(self.textLabel4,0,0) self.learnDestIpComboBox = QComboBox(0,self.learningFramesGroupBox,"learnDestIpComboBox") self.learnDestIpComboBox.setEditable(1) self.learnDestIpComboBox.setSizeLimit(1) learningFramesGroupBoxLayout.addWidget(self.learnDestIpComboBox,0,1) self.learnDestMacComboBox = QComboBox(0,self.learningFramesGroupBox,"learnDestMacComboBox") self.learnDestMacComboBox.setEditable(1) self.learnDestMacComboBox.setSizeLimit(1) learningFramesGroupBoxLayout.addWidget(self.learnDestMacComboBox,1,1) self.textLabel6 = QLabel(self.learningFramesGroupBox,"textLabel6") learningFramesGroupBoxLayout.addWidget(self.textLabel6,1,0) self.learningPacketRateSpinBox = QSpinBox(self.learningFramesGroupBox,"learningPacketRateSpinBox") self.learningPacketRateSpinBox.setMaxValue(100) self.learningPacketRateSpinBox.setMinValue(10) self.learningPacketRateSpinBox.setValue(100) learningFramesGroupBoxLayout.addWidget(self.learningPacketRateSpinBox,2,1) self.textLabel5 = QLabel(self.learningFramesGroupBox,"textLabel5") learningFramesGroupBoxLayout.addWidget(self.textLabel5,2,0) layout21.addWidget(self.learningFramesGroupBox) flowsLayout.addLayout(layout21) spacer13 = QSpacerItem(20,31,QSizePolicy.Minimum,QSizePolicy.Expanding) flowsLayout.addItem(spacer13) self.tabWidget3.insertTab(self.flows,QString("")) self.options = QWidget(self.tabWidget3,"options") optionsLayout = QGridLayout(self.options,1,1,11,6,"optionsLayout") layout210 = QGridLayout(None,1,1,0,6,"layout210") layout209 = QGridLayout(None,1,1,0,6,"layout209") self.fastRoamingButtonGroup = QButtonGroup(self.options,"fastRoamingButtonGroup") self.fastRoamingButtonGroup.setColumnLayout(0,Qt.Vertical) self.fastRoamingButtonGroup.layout().setSpacing(6) self.fastRoamingButtonGroup.layout().setMargin(11) fastRoamingButtonGroupLayout = QGridLayout(self.fastRoamingButtonGroup.layout()) fastRoamingButtonGroupLayout.setAlignment(Qt.AlignTop) self.pmkidCheckBox = QCheckBox(self.fastRoamingButtonGroup,"pmkidCheckBox") fastRoamingButtonGroupLayout.addWidget(self.pmkidCheckBox,0,0) self.preauthCheckBox = QCheckBox(self.fastRoamingButtonGroup,"preauthCheckBox") self.preauthCheckBox.setEnabled(1) fastRoamingButtonGroupLayout.addWidget(self.preauthCheckBox,1,0) layout209.addWidget(self.fastRoamingButtonGroup,0,1) self.additionalOptionsButtonGroup = QButtonGroup(self.options,"additionalOptionsButtonGroup") self.additionalOptionsButtonGroup.setColumnLayout(0,Qt.Vertical) self.additionalOptionsButtonGroup.layout().setSpacing(6) self.additionalOptionsButtonGroup.layout().setMargin(11) additionalOptionsButtonGroupLayout = QGridLayout(self.additionalOptionsButtonGroup.layout()) additionalOptionsButtonGroupLayout.setAlignment(Qt.AlignTop) self.disassociateCheckBox = QCheckBox(self.additionalOptionsButtonGroup,"disassociateCheckBox") self.additionalOptionsButtonGroup.insert( self.disassociateCheckBox,1) additionalOptionsButtonGroupLayout.addWidget(self.disassociateCheckBox,0,0) self.deauthCheckBox = QCheckBox(self.additionalOptionsButtonGroup,"deauthCheckBox") self.additionalOptionsButtonGroup.insert( self.deauthCheckBox,2) additionalOptionsButtonGroupLayout.addWidget(self.deauthCheckBox,1,0) self.reassocCheckBox = QCheckBox(self.additionalOptionsButtonGroup,"reassocCheckBox") self.additionalOptionsButtonGroup.insert( self.reassocCheckBox,3) additionalOptionsButtonGroupLayout.addWidget(self.reassocCheckBox,2,0) self.renewDhcpCheckBox = QCheckBox(self.additionalOptionsButtonGroup,"renewDhcpCheckBox") self.additionalOptionsButtonGroup.insert( self.renewDhcpCheckBox,4) additionalOptionsButtonGroupLayout.addWidget(self.renewDhcpCheckBox,3,0) self.renewDhcpOnConnCheckBox = QCheckBox(self.additionalOptionsButtonGroup,"renewDhcpOnConnCheckBox") self.additionalOptionsButtonGroup.insert( self.renewDhcpOnConnCheckBox,5) additionalOptionsButtonGroupLayout.addWidget(self.renewDhcpOnConnCheckBox,4,0) layout209.addWidget(self.additionalOptionsButtonGroup,0,0) layout210.addLayout(layout209,0,0) spacer12 = QSpacerItem(20,50,QSizePolicy.Minimum,QSizePolicy.Expanding) layout210.addItem(spacer12,1,0) optionsLayout.addLayout(layout210,0,0) self.tabWidget3.insertTab(self.options,QString("")) tabLayout.addWidget(self.tabWidget3,1,0) self.roamProfileTabWidget.insertTab(self.tab,QString("")) self.TabPage = QWidget(self.roamProfileTabWidget,"TabPage") TabPageLayout = QGridLayout(self.TabPage,1,1,11,6,"TabPageLayout") self.roamStepsGroupBox = QGroupBox(self.TabPage,"roamStepsGroupBox") self.roamStepsGroupBox.setFrameShape(QGroupBox.NoFrame) self.roamStepsGroupBox.setColumnLayout(0,Qt.Vertical) self.roamStepsGroupBox.layout().setSpacing(6) self.roamStepsGroupBox.layout().setMargin(0) roamStepsGroupBoxLayout = QGridLayout(self.roamStepsGroupBox.layout()) roamStepsGroupBoxLayout.setAlignment(Qt.AlignTop) self.roamStepsTable = QTable(self.roamStepsGroupBox,"roamStepsTable") self.roamStepsTable.setNumCols(self.roamStepsTable.numCols() + 1) self.roamStepsTable.horizontalHeader().setLabel(self.roamStepsTable.numCols() - 1,self.__tr("Client Name")) self.roamStepsTable.setNumCols(self.roamStepsTable.numCols() + 1) self.roamStepsTable.horizontalHeader().setLabel(self.roamStepsTable.numCols() - 1,self.__tr("SrcPort Name, BSSID")) self.roamStepsTable.setNumCols(self.roamStepsTable.numCols() + 1) self.roamStepsTable.horizontalHeader().setLabel(self.roamStepsTable.numCols() - 1,self.__tr("DestPort Name,BSSID")) self.roamStepsTable.setNumCols(self.roamStepsTable.numCols() + 1) self.roamStepsTable.horizontalHeader().setLabel(self.roamStepsTable.numCols() - 1,self.__tr("Roam EventTime(secs)")) self.roamStepsTable.setNumRows(self.roamStepsTable.numRows() + 1) self.roamStepsTable.verticalHeader().setLabel(self.roamStepsTable.numRows() - 1,self.__tr("0")) self.roamStepsTable.setSizePolicy(QSizePolicy(7,7,0,0,self.roamStepsTable.sizePolicy().hasHeightForWidth())) self.roamStepsTable.setResizePolicy(QTable.Default) self.roamStepsTable.setNumRows(1) self.roamStepsTable.setNumCols(4) roamStepsGroupBoxLayout.addWidget(self.roamStepsTable,0,0) layout31 = QHBoxLayout(None,0,6,"layout31") layout23 = QHBoxLayout(None,0,6,"layout23") self.textLabel1_3 = QLabel(self.roamStepsGroupBox,"textLabel1_3") layout23.addWidget(self.textLabel1_3) self.numRoamsLineEdit = QLineEdit(self.roamStepsGroupBox,"numRoamsLineEdit") self.numRoamsLineEdit.setEnabled(0) layout23.addWidget(self.numRoamsLineEdit) layout31.addLayout(layout23) layout24 = QHBoxLayout(None,0,6,"layout24") self.textLabel2_3 = QLabel(self.roamStepsGroupBox,"textLabel2_3") layout24.addWidget(self.textLabel2_3) self.avgRoamsLineEdit = QLineEdit(self.roamStepsGroupBox,"avgRoamsLineEdit") self.avgRoamsLineEdit.setEnabled(0) layout24.addWidget(self.avgRoamsLineEdit) layout31.addLayout(layout24) layout25 = QHBoxLayout(None,0,6,"layout25") self.textLabel3_2 = QLabel(self.roamStepsGroupBox,"textLabel3_2") layout25.addWidget(self.textLabel3_2) self.numClientsLineEdit = QLineEdit(self.roamStepsGroupBox,"numClientsLineEdit") self.numClientsLineEdit.setEnabled(0) self.numClientsLineEdit.setFrameShape(QLineEdit.LineEditPanel) self.numClientsLineEdit.setFrameShadow(QLineEdit.Sunken) layout25.addWidget(self.numClientsLineEdit) layout31.addLayout(layout25) layout30 = QHBoxLayout(None,0,6,"layout30") self.autoUpdateCheckBox = QCheckBox(self.roamStepsGroupBox,"autoUpdateCheckBox") self.autoUpdateCheckBox.setFocusPolicy(QCheckBox.TabFocus) layout30.addWidget(self.autoUpdateCheckBox) self.applyPushButton = QPushButton(self.roamStepsGroupBox,"applyPushButton") self.applyPushButton.setFocusPolicy(QPushButton.TabFocus) layout30.addWidget(self.applyPushButton) layout31.addLayout(layout30) roamStepsGroupBoxLayout.addLayout(layout31,1,0) TabPageLayout.addWidget(self.roamStepsGroupBox,0,0) self.roamProfileTabWidget.insertTab(self.TabPage,QString("")) roamprofileLayout.addWidget(self.roamProfileTabWidget,1,1) self.languageChange() self.resize(QSize(846,537).expandedTo(self.minimumSizeHint())) self.clearWState(Qt.WState_Polished) self.setTabOrder(self.clientgroupListBox,self.roamProfileTabWidget) self.setTabOrder(self.roamProfileTabWidget,self.availablePortListView) self.setTabOrder(self.availablePortListView,self.moveSelectedToolButton) self.setTabOrder(self.moveSelectedToolButton,self.moveAllToolButton) self.setTabOrder(self.moveAllToolButton,self.selectedPortList) self.setTabOrder(self.selectedPortList,self.upToolButton) self.setTabOrder(self.upToolButton,self.downToolButton) self.setTabOrder(self.downToolButton,self.deleteSelectedToolButton) self.setTabOrder(self.deleteSelectedToolButton,self.deleteAllToolButton) self.setTabOrder(self.deleteAllToolButton,self.tabWidget3) self.setTabOrder(self.tabWidget3,self.timeDistRadio1) self.setTabOrder(self.timeDistRadio1,self.clientDistRadio1) self.setTabOrder(self.clientDistRadio1,self.fixedDwellTimeRadioButton) self.setTabOrder(self.fixedDwellTimeRadioButton,self.fixedTimeSpinBox) self.setTabOrder(self.fixedTimeSpinBox,self.startDwellSpinBox) self.setTabOrder(self.startDwellSpinBox,self.comboBox5) self.setTabOrder(self.comboBox5,self.endDwellSpinBox) self.setTabOrder(self.endDwellSpinBox,self.comboBox6) self.setTabOrder(self.comboBox6,self.changeStepSpinBox) self.setTabOrder(self.changeStepSpinBox,self.repeatCountRadioButton) self.setTabOrder(self.repeatCountRadioButton,self.repeatCountSpinBox) self.setTabOrder(self.repeatCountSpinBox,self.durationRadioButton) self.setTabOrder(self.durationRadioButton,self.durationSpinBox) self.setTabOrder(self.durationSpinBox,self.timeUnitComboBox) self.setTabOrder(self.timeUnitComboBox,self.numRoamsLineEdit) self.setTabOrder(self.numRoamsLineEdit,self.avgRoamsLineEdit) self.setTabOrder(self.avgRoamsLineEdit,self.numClientsLineEdit) self.setTabOrder(self.numClientsLineEdit,self.autoUpdateCheckBox) self.setTabOrder(self.autoUpdateCheckBox,self.applyPushButton) self.setTabOrder(self.applyPushButton,self.roamStepsTable) def languageChange(self): self.setCaption(self.__tr("Roam Profile")) self.textLabel1_2.setText(self.__tr("Client Group List")) self.moveSelectedToolButton.setText(self.__tr("Add >")) QToolTip.add(self.moveSelectedToolButton,self.__tr("Select")) self.moveAllToolButton.setText(self.__tr("Add All >>")) QToolTip.add(self.moveAllToolButton,self.__tr("Select All")) self.availablePortListView.header().setLabel(0,self.__tr("Available Port List")) self.selectedPortListLabel.setText(self.__tr("Selected Roam Sequence")) self.upToolButton.setText(self.__tr("Move Up")) QToolTip.add(self.upToolButton,self.__tr("Move Up")) self.downToolButton.setText(self.__tr("Move Down")) QToolTip.add(self.downToolButton,self.__tr("Move Down")) self.deleteSelectedToolButton.setText(self.__tr("Delete")) QToolTip.add(self.deleteSelectedToolButton,self.__tr("Delete")) self.deleteAllToolButton.setText(self.__tr("Delete All")) QToolTip.add(self.deleteAllToolButton,self.__tr("Delete All")) self.dwellTimeButtonGroup.setTitle(self.__tr("Dwell Time")) self.customDwellTimeRadioButton.setText(self.__tr("Custom")) self.fixedDwellTimeRadioButton.setText(self.__tr("Fixed Time")) self.fixedTimeSpinBox.setSuffix(self.__tr(" secs")) self.customDwellOptionsGroupBox.setTitle(self.__tr("Custom Options")) self.endDwellLabel.setText(self.__tr("End Dwell Time:")) self.dwellChangeLabel.setText(self.__tr("Change Step:")) self.startDwellLabel.setText(self.__tr("Start Dwell Time:")) self.startDwellSpinBox.setSuffix(QString.null) self.endDwellSpinBox.setSuffix(QString.null) self.comboBox5.clear() self.comboBox5.insertItem(self.__tr("msecs")) self.comboBox5.insertItem(self.__tr("secs")) self.comboBox6.clear() self.comboBox6.insertItem(self.__tr("msecs")) self.comboBox6.insertItem(self.__tr("secs")) self.repeatButtonGroup.setTitle(self.__tr("Total Roaming Duration")) self.durationRadioButton.setText(self.__tr("Time")) self.timeUnitComboBox.clear() self.timeUnitComboBox.insertItem(self.__tr("secs")) self.timeUnitComboBox.insertItem(self.__tr("mins")) self.timeUnitComboBox.insertItem(self.__tr("hrs")) self.repeatCountRadioButton.setText(self.__tr("Repeat Roam Sequence")) self.tabWidget3.changeTab(self.time,self.__tr("Duration")) self.clientDistButtonGroup.setTitle(self.__tr("Client Distribution")) self.clientDistRadio1.setText(self.__tr("All clients start from same AP")) self.clientDistRadio2.setText(self.__tr("Clients distibuted among APs")) self.timeDistButtonGroup.setTitle(self.__tr("Time Distribution")) self.timeDistRadio1.setText(self.__tr("All Client roam at same time")) self.timeDistRadio2.setText(self.__tr("Even Time Distribution")) self.tabWidget3.changeTab(self.distribution,self.__tr("Distribution")) self.powerProfileGroupBox.setTitle(self.__tr("Power Profile")) self.srcStartPrwSpinBox.setPrefix(self.__tr("Max ")) self.srcStartPrwSpinBox.setSuffix(self.__tr(" dB")) self.srcStartPrwSpinBox.setSpecialValueText(self.__tr("Max")) self.srcEndPwrSpinBox.setPrefix(self.__tr("Max ")) self.srcEndPwrSpinBox.setSuffix(self.__tr(" dB")) self.srcEndPwrSpinBox.setSpecialValueText(self.__tr("Max")) self.srcChangeStepSpinBox.setSuffix(self.__tr(" dB")) self.endTxPowerALabel.setText(self.__tr("Src Ap End Tx Power:")) self.startTxPowerALabel.setText(self.__tr("Src AP Start Tx Power:")) self.changeStepALabel.setText(self.__tr("Src AP Change Step:")) self.destStartPwrSpinBox.setPrefix(self.__tr("Max ")) self.destStartPwrSpinBox.setSuffix(self.__tr(" dB")) self.destStartPwrSpinBox.setSpecialValueText(self.__tr("Max")) self.destEndPwrSpinBox.setPrefix(self.__tr("Max ")) self.destEndPwrSpinBox.setSuffix(self.__tr(" dB")) self.destEndPwrSpinBox.setSpecialValueText(self.__tr("Max")) self.destChangeStepSpinBox.setSuffix(self.__tr(" dB")) self.destChangeIntSpinBox.setSuffix(self.__tr(" mSec")) self.startTxPowerBLabel.setText(self.__tr("Dst AP Start Tx Power:")) self.endTxPowerbLabel.setText(self.__tr("Dst AP End Tx Power:")) self.changeStepBLabel.setText(self.__tr("Dst AP Change Step:")) self.changeIntBLabel.setText(self.__tr("Dst AP Change Int:")) self.changeIntALabel.setText(self.__tr("Src AP Change Int:")) self.srcChangeIntSpinBox.setSuffix(self.__tr(" mSec")) self.tabWidget3.changeTab(self.power,self.__tr("Power")) self.flowParametersButtonGroup.setTitle(self.__tr("Flow Parameters")) self.textLabel2_2.setText(self.__tr("Packet Size")) self.textLabel3.setText(self.__tr("Flow Rate (Per Client)")) self.flowRateSpinBox.setSuffix(self.__tr(" pps")) self.learningFramesGroupBox.setTitle(self.__tr("Learning Frames")) self.textLabel4.setText(self.__tr("Dest IP address")) self.textLabel6.setText(self.__tr("Dest MAC Address")) self.learningPacketRateSpinBox.setSuffix(self.__tr(" fps")) self.textLabel5.setText(self.__tr("Learning Frame Rate")) self.tabWidget3.changeTab(self.flows,self.__tr("Flows")) self.fastRoamingButtonGroup.setTitle(self.__tr("Fast Roaming Options")) self.pmkidCheckBox.setText(self.__tr("PMKID Caching Enabled")) self.preauthCheckBox.setText(self.__tr("Pre-authentication Enabled")) self.additionalOptionsButtonGroup.setTitle(self.__tr("Client Options")) self.disassociateCheckBox.setText(self.__tr("Disassociate Client before Roam")) self.deauthCheckBox.setText(self.__tr("Deauth Client before Roam")) self.reassocCheckBox.setText(self.__tr("Re-Associate with New AP")) self.renewDhcpCheckBox.setText(self.__tr("Renew DHCP on Roam")) QToolTip.add(self.renewDhcpCheckBox,QString.null) self.renewDhcpOnConnCheckBox.setText(self.__tr("Renew DHCP on Reconnect")) QToolTip.add(self.renewDhcpOnConnCheckBox,QString.null) self.tabWidget3.changeTab(self.options,self.__tr("Options")) self.roamProfileTabWidget.changeTab(self.tab,self.__tr("Port Selection")) self.roamStepsGroupBox.setTitle(QString.null) self.roamStepsTable.horizontalHeader().setLabel(0,self.__tr("Client Name")) self.roamStepsTable.horizontalHeader().setLabel(1,self.__tr("SrcPort Name, BSSID")) self.roamStepsTable.horizontalHeader().setLabel(2,self.__tr("DestPort Name,BSSID")) self.roamStepsTable.horizontalHeader().setLabel(3,self.__tr("Roam EventTime(secs)")) self.roamStepsTable.verticalHeader().setLabel(0,self.__tr("0")) self.textLabel1_3.setText(self.__tr("Number of Roams:")) self.textLabel2_3.setText(self.__tr("Number of Roams/sec:")) self.textLabel3_2.setText(self.__tr("Number of Clients:")) self.autoUpdateCheckBox.setText(self.__tr("Auto Update")) self.applyPushButton.setText(self.__tr("Update")) self.roamProfileTabWidget.changeTab(self.TabPage,self.__tr("Roam Schedule")) def __tr(self,s,c = None): return qApp.translate("roamprofile",s,c)