def __init__(self): super(FTPWindow, self).__init__() #setup UI from Qt Designer. self.setupUi(self) ### Start of new button set for listrak revamp ### #opens file dialog to choose file self.btn_open_dmc.clicked.connect(self.btn_open_dmc_clicked) self.btn_open_cc.clicked.connect(self.btn_open_cc_clicked) #starts the import into the database of the chosen file from above (btn_match) self.btn_import.clicked.connect(self.btn_import_clicked) self.btn_process_cc.clicked.connect(self.btn_process_cc_clicked) #add Daves autoscale tool to the webview. self.wv_autoscale.load(QUrl('http://inkpixi:4000/autoscale.php')) self.actionExit.triggered.connect(qApp.instance().exit) self.cb_garments.addItem('-- Select --') garments = self.get_garments() self.cb_garments.addItems(garments) #self.cb_garments.currentIndexChanged.connect(self.get_top_fifty_start) self.btn_top_fifty.clicked.connect(self.get_top_fifty_start) now = datetime.now() from_now = now - timedelta(days=90) self.de_from.setDate(from_now) self.de_to.setDate(now)
def __init__(self): super(FTPWindow, self).__init__() #connect to FTP server. self.connect_ftp() #setup UI from Qt Designer. self.setupUi(self) #display welcome from ftp server. #self.lbl_connection.setText(self.ftp.getwelcome()) #get a list of files for James to choose from and put them in #a combo box. files = self.get_file_list() self.cb_files.addItems(files) self.cb_upd_files.addItems(files) self.cb_cross_files.addItems(files) #setup a auto completer to choose campaign files from. campaigns = self.get_campaigns() camp_completer = QCompleter(campaigns) camp_completer.setCompletionMode(QCompleter.InlineCompletion) camp_completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion) camp_completer.setCaseSensitivity(Qt.CaseInsensitive) #we have to styple this here instead of Qt Designer, becuase for some reason there is no way #to style the popup using css. camp_completer.popup().setStyleSheet( """selection-background-color: #ffaa00; background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); border-style: solid; border: 1px solid #1e1e1e; border-radius: 5;""") self.le_campaign.setCompleter(camp_completer) #connect the button signals with the appropriate slots. self.btn_dl_match.clicked.connect(self.btn_download_clicked) self.btn_match.clicked.connect(self.btn_match_clicked) self.btn_dl_update.clicked.connect(self.btn_download_clicked) self.btn_dl_cc.clicked.connect(self.btn_download_clicked) self.btn_google.clicked.connect(self.btn_google_clicked) self.actionExit.triggered.connect(qApp.instance().exit) max_date = self.get_last_google_import() self.start_dt = max_date + timedelta(days=1) self.end_dt = datetime.now() - timedelta(days=1) #self.de_ga_start.setDateTime(datetime.now() - timedelta(days=13)) self.de_ga_start.setDateTime(self.start_dt) self.de_ga_end.setDateTime(self.end_dt) self.de_ga_start.dateChanged.connect(self.date_changed) self.de_ga_end.dateChanged.connect(self.date_changed) self.btn_view_ga_tbl.clicked.connect(self.view_table)
def __init__(self): super(FTPWindow, self).__init__() #setup UI from Qt Designer. self.setupUi(self) #setup a auto completer to choose campaign files from. campaigns = self.get_campaigns() camp_completer = QCompleter(campaigns) camp_completer.setCompletionMode(QCompleter.InlineCompletion) camp_completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion) camp_completer.setCaseSensitivity(Qt.CaseInsensitive) #we have to style this here instead of Qt Designer, because for some reason there is no way #to style the popup using css. camp_completer.popup().setStyleSheet("""selection-background-color: #ffaa00; background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #565656, stop: 0.1 #525252, stop: 0.5 #4e4e4e, stop: 0.9 #4a4a4a, stop: 1 #464646); border-style: solid; border: 1px solid #1e1e1e; border-radius: 5;""") self.le_campaign.setCompleter(camp_completer) #connect the button signals with the appropriate slots. self.btn_dl_match.clicked.connect(self.btn_download_clicked) #self.btn_match.clicked.connect(self.btn_match_clicked) self.btn_dl_update.clicked.connect(self.btn_download_clicked) self.btn_dl_cc.clicked.connect(self.btn_download_clicked) ### Start of new button set for listrak revamp ### #opens file dialog to choose file self.btn_match.clicked.connect(self.btn_match_clicked) #starts the import into the database of the chosen file from above (btn_match) self.btn_import.clicked.connect(self.btn_import_clicked) #add Daves autoscale tool to the webview. self.wv_autoscale.load(QUrl('http://inkpixi:4000/autoscale.php')) self.actionExit.triggered.connect(qApp.instance().exit) self.cb_garments.addItem('-- Select --') garments = self.get_garments() self.cb_garments.addItems(garments) #self.cb_garments.currentIndexChanged.connect(self.get_top_fifty_start) self.btn_top_fifty.clicked.connect(self.get_top_fifty_start) now = datetime.now() from_now = now - timedelta(days=90) self.de_from.setDate(from_now) self.de_to.setDate(now)
def createActions(self): #Menubar granola goes here, it's cunchy and suite. self.exitAction = QAction(QIcon('icon/exit.png'), '&Exit', self) self.exitAction.setShortcut('Ctrl+Q') self.exitAction.setStatusTip('Exit Application') self.exitAction.triggered.connect(qApp.instance().exit) self.queueAction = QAction(QIcon('icon/btn-queue1.png'), '&View Next Queue', self) self.queueAction.setShortcut('F1') self.queueAction.setStatusTip('View Next Queue') self.queueAction.triggered.connect(BrotherLogic.btnNextQueue_Click) self.loadAction = QAction(QIcon('icon/load.png'), '&Load Queue', self) self.loadAction.setShortcut('F2') self.loadAction.setStatusTip('Load Next queue into database.') self.loadAction.triggered.connect(self.btnLoadQueue_Click) self.printAction = QAction(QIcon('icon/print-shirt.png'), '&Print', self) self.printAction.setShortcut('F3') self.printAction.setStatusTip('Print from queue server.') self.printAction.triggered.connect(self.btnPrint_Click) self.sourceAction = QAction(QIcon('icon/print-source.png'), 'Print &Source', self) self.sourceAction.setShortcut('F4') self.sourceAction.setStatusTip('Print from art server source.') self.sourceAction.triggered.connect(self.btnPrintSource_Click) self.finishAction = QAction(QIcon('icon/finish-queue.png'), 'Add queue to finished', self) self.finishAction.setShortcut('F5') self.finishAction.setStatusTip('Add queue to database as printed.') self.finishAction.triggered.connect(self.btnFinishQueue_Click) self.killAction = QAction(QIcon('icon/kill-arp.png'), '&Kill ARP', self) self.killAction.setShortcut('F6') self.killAction.setStatusTip('Kill artwork for recreation.') self.killAction.triggered.connect(self.btnKillArp_Click) self.blankAction = QAction(QIcon("icon/out-of-stock.png"), "&Out of stock", self) self.blankAction.setShortcut('F7') self.blankAction.setStatusTip("Add item to blank out of stock") self.blankAction.triggered.connect(self.btnBlankStock_Click)
def uninstall(self): qApp.instance().removeEventFilter(self)
def install(self): qApp.instance().installEventFilter(self)
def uninstall(self): self._plugin.logger.debug("Uninstalling the event filter") qApp.instance().removeEventFilter(self)
def install(self): self._plugin.logger.debug("Installing the event filter") qApp.instance().installEventFilter(self)
def guiSet(self, trees=None, data=None): """ Initialize GUI with default parameters. """ self.lastClickedTree = None self.lastAlignment = {} self.windows = {} # Windows stored as { windex : MDISubWindow } self.windex = 0 # Acts as identifier for tracking alignments (max 2.1 billion) self.sequences = {} # Stored as {WindowID:[SeqRecord(s)] } self.titles = [ ] # maintains a list of sequence titles to confirm uniqueness #self.mainLogger.debug("guiSet took took %f seconds" % float(time.perf_counter() - self.start)) # Load default options for windows (from parameters file if saved) # if PARAMETERS FILE: # params = FROMFILE # print(qApp.instance().defFont.family()) self.default_params = { 'ruler': True, 'colors': True, 'fontsize': 10, 'theme': 'Default', 'font': qApp.instance().defFont, 'byconsv': False, 'tabbed': False, 'darkmode': False, 'dssp': False, } self.params = self.default_params.copy() if sys.platform in ['darwin']: self.params['fontsize'] = 12 # print(self.params['font'].family()) self.optionsPane.setParams(self.params) # This is fired upon loading a saved workspace. if trees: self.mainLogger.info("Loading saved workspace!") self.bioModel, self.projectModel = trees self.sequences, self.titles, self.windex = data self.windex = int(self.windex) self.bioRoot = self.bioModel.invisibleRootItem().child( 0) # TODO: ELIMINATE USE OF ROOT. Use InvsRoot self.projectRoot = self.projectModel.invisibleRootItem().child(0) self.windows = {} self.rebuildTrees() else: self.bioRoot = QStandardItem("Folder") self.bioModel = widgets.ItemModel(self.windows, seqTree=True) self.bioRoot.setData("Folder") self.bioModel.appendRow(self.bioRoot) self.projectRoot = QStandardItem("Folder") self.projectModel = widgets.ItemModel(self.windows) self.projectModel.appendRow(self.projectRoot) self.mainLogger.debug("After Tree Setup") self.bioTree.setModel(self.bioModel) self.projectTree.setModel(self.projectModel) self.bioModel.setHorizontalHeaderLabels(["Sequences"]) self.projectModel.setHorizontalHeaderLabels(["Alignments"]) for node in utilities.iterTreeView(self.bioModel.invisibleRootItem()): self.bioTree.setExpanded(node.index(), True) for node in utilities.iterTreeView( self.projectModel.invisibleRootItem()): self.projectTree.setExpanded(node.index(), True) # self.installEventFilter(self) del trees, data, node
def _uninstall_our_icon(self): """ Uninstall our icon from the about dialog. """ qApp.instance().removeEventFilter(self._eventFilter)
def _install_our_icon(self): """ Install our icon into the about dialog. """ qApp.instance().installEventFilter(self._eventFilter)