def __init__(self,dbcur,parent=None): super(SearchDialog,self).__init__(parent) uis.loadDialog('search',self) self.setWindowTitle('Fast File Find') self.cursor=dbcur self.dsize=None self.loadedLastSize=False self.searchTerm.setFocus(QtCore.Qt.OtherFocusReason) self.searchButton.clicked.connect(self.searchPressed) self.resetButton.clicked.connect(self.resetPressed) headers=['Name','Path','Size','Date'] c=[] self.results=SearchResults(c,headers) self.resultsList.setModel(self.results) self.resultsList.setSortingEnabled(True) self.resultsList.doubleClicked.connect(self.itemDoubleClick) self.resultsList.clicked.connect(self.itemClick) sm=self.resultsList.selectionModel() if sm is not None: sm.selectionChanged.connect(self.selChanged) else: print("No selection model") self.smallButton.clicked.connect(self.smallButtonPressed) self.largeButton.clicked.connect(self.largeButtonPressed) self.recentButton.clicked.connect(self.recentButtonPressed) self.dateType.currentIndexChanged.connect(self.dateTypeChanged) self.sizeType.currentIndexChanged.connect(self.sizeTypeChanged) self.raiseTimer=QtCore.QTimer(self) self.raiseTimer.timeout.connect(self.raiseWindow) self.raiseTimer.start(200)
def __init__(self,parent=None): super(GeneralSettingsDialog,self).__init__(parent) uis.loadDialog('general_settings',self) s=QtCore.QSettings() self.diffCmd.setText(s.value('diff').toString()) xterm=QtCore.Qt.Checked if s.value('xterm').toString()=='True' else QtCore.Qt.Unchecked self.runInXTerm.setCheckState(xterm)
def __init__(self,parent=None): super(EditorSettingsDialog,self).__init__(parent) uis.loadDialog('editor_settings',self) s=QtCore.QSettings() self.indentSpaces.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('\d+'))) self.indentSpaces.setText(s.value('indent','2').toString()) self.clangCB.setCheckState(QtCore.Qt.Checked if s.value('clangCompletion',True).toBool() else QtCore.Qt.Unchecked)
def __init__(self, dbcur, parent=None): super(SearchDialog, self).__init__(parent) uis.loadDialog('search', self) self.setWindowTitle('Fast File Find') self.cursor = dbcur self.dsize = None self.loadedLastSize = False self.searchTerm.setFocus(QtCore.Qt.OtherFocusReason) self.searchButton.clicked.connect(self.searchPressed) self.resetButton.clicked.connect(self.resetPressed) headers = ['Name', 'Path', 'Size', 'Date'] c = [] self.results = SearchResults(c, headers) self.resultsList.setModel(self.results) self.resultsList.setSortingEnabled(True) self.resultsList.doubleClicked.connect(self.itemDoubleClick) self.resultsList.clicked.connect(self.itemClick) sm = self.resultsList.selectionModel() if sm is not None: sm.selectionChanged.connect(self.selChanged) else: print("No selection model") self.smallButton.clicked.connect(self.smallButtonPressed) self.largeButton.clicked.connect(self.largeButtonPressed) self.recentButton.clicked.connect(self.recentButtonPressed) self.dateType.currentIndexChanged.connect(self.dateTypeChanged) self.sizeType.currentIndexChanged.connect(self.sizeTypeChanged)
def __init__(self, dlgName, props, parent=None): super(WizardDialog, self).__init__(parent) self.nextDialog = None self.props = props uis.loadDialog(dlgName, self) self.cancelButton.clicked.connect(self.reject) self.nextButton.clicked.connect(self.accept) self.settings = None
def __init__(self, parent=None): super(EditorSettingsDialog, self).__init__(parent) uis.loadDialog('editor_settings', self) s = QtCore.QSettings() self.indentSpaces.setValidator( QtGui.QRegExpValidator(QtCore.QRegExp('\d+'))) self.indentSpaces.setText(s.value('indent', '2').toString()) self.clangCB.setCheckState(QtCore.Qt.Checked if s.value( 'clangCompletion', True).toBool() else QtCore.Qt.Unchecked)
def __init__(self, parent=None): super(GeneralSettingsDialog, self).__init__(parent) uis.loadDialog('general_settings', self) s = QtCore.QSettings() self.sortFilesCB.setCheckState(QtCore.Qt.Checked if s.value( 'sortFiles', True).toBool() else QtCore.Qt.Unchecked) self.customPrinters.setCheckState(QtCore.Qt.Checked if s.value( 'customPrinters', True).toBool() else QtCore.Qt.Unchecked) self.clearCacheButton.clicked.connect(self.clearCache)
def __init__(self, parent=None): super(AddDependDialog, self).__init__(parent) if len(allPackages) == 0: loadPackageList() uis.loadDialog('adddep', self) self.filterEdit.textChanged.connect(self.filterChanged) self.filterEdit.setFocus(QtCore.Qt.OtherFocusReason) self.pkgList.addItems(allPackages) self.pkgList.itemSelectionChanged.connect(self.selChanged) self.selection = []
def __init__(self,parent=None): super(PluginsDialog,self).__init__(parent) uis.loadDialog('plugins',self) s=QtCore.QSettings() self.dir=s.value('pluginsDir','').toString() self.pluginsDirectory.setText(self.dir) self.dirBrowse.clicked.connect(self.browsePluginsDir) self.pluginsTable.setColumnCount(2); self.pluginsTable.setHorizontalHeaderItem(0,QtGui.QTableWidgetItem('Plugin')) self.pluginsTable.setHorizontalHeaderItem(1,QtGui.QTableWidgetItem('Shortcut')) self.updatePlugins() self.pluginsTable.resizeRowsToContents()
def __init__(self, libs, parent=None): super(DependenciesDialog, self).__init__(parent) uis.loadDialog('deps', self) buttonNames = ['ok', 'cancel', 'add', 'remove', 'up', 'down'] for name in buttonNames: button = getattr(self, name + 'Button') handler = getattr(self, name + 'Pressed') button.clicked.connect(handler) self.libs = [] self.depsList.clear() for lib in libs: if len(lib.strip()) > 0: self.depsList.addItem(QtGui.QListWidgetItem(lib))
def __init__(self,libs,parent=None): super(DependenciesDialog,self).__init__(parent) uis.loadDialog('deps',self) buttonNames=['ok','cancel','add','remove','up','down'] for name in buttonNames: button=getattr(self,name+'Button') handler=getattr(self,name+'Pressed') button.clicked.connect(handler) self.libs=[] self.depsList.clear() for lib in libs: if len(lib.strip())>0: self.depsList.addItem(QtGui.QListWidgetItem(lib))
def __init__(self,parent=None): super(TemplatesDialog,self).__init__(parent) uis.loadDialog('templates',self) s=QtCore.QSettings() self.dir=s.value('tmplDir','').toString() self.tmplDir.setText(self.dir) self.updateTemplates() self.templatesList.itemSelectionChanged.connect(self.selChanged) self.curEdit='' self.codeEdit.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap) self.addButton.clicked.connect(self.addClicked) self.delButton.clicked.connect(self.delClicked) self.macrosButton.clicked.connect(self.macrosClicked) self.tmplDirBrowseButton.clicked.connect(self.browseTmplDir)
def __init__(self, parent=None): super(TemplatesDialog, self).__init__(parent) uis.loadDialog('templates', self) s = QtCore.QSettings() self.dir = s.value('tmplDir', '').toString() self.tmplDir.setText(self.dir) self.updateTemplates() self.templatesList.itemSelectionChanged.connect(self.selChanged) self.curEdit = '' self.codeEdit.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap) self.addButton.clicked.connect(self.addClicked) self.delButton.clicked.connect(self.delClicked) self.macrosButton.clicked.connect(self.macrosClicked) self.tmplDirBrowseButton.clicked.connect(self.browseTmplDir)
def __init__(self,parent=None): super(CaptureDialog,self).__init__(parent) uis.loadDialog('capture_dialog',self) self.setWindowIcon(QtGui.QIcon('icon.png')) self.closeButton.clicked.connect(self.reject) self.selectWinButton.clicked.connect(self.selectWindow) self.selectDirButton.clicked.connect(self.selectDirectory) self.captureButton.clicked.connect(self.capture) self.winid='' self.counter=0 s=QtCore.QSettings() self.directory=str(s.value('dir','').toString()) check(self.frameCB,s.value('frame',False).toBool()) self.frameCB.stateChanged.connect(self.frameCBChanged) self.dirEdit.setText(self.directory)
def __init__(self, parent=None): super(CaptureDialog, self).__init__(parent) uis.loadDialog('capture_dialog', self) self.setWindowIcon(QtGui.QIcon('icon.png')) self.closeButton.clicked.connect(self.reject) self.selectWinButton.clicked.connect(self.selectWindow) self.selectDirButton.clicked.connect(self.selectDirectory) self.captureButton.clicked.connect(self.capture) self.winid = '' self.counter = 0 s = QtCore.QSettings() self.directory = str(s.value('dir', '').toString()) check(self.frameCB, s.value('frame', False).toBool()) self.frameCB.stateChanged.connect(self.frameCBChanged) self.dirEdit.setText(self.directory)
def __init__(self, parent=None): super(FindDialog, self).__init__(parent) uis.loadDialog('find_replace', self) self.findButton.clicked.connect(self.accept) self.cancelButton.clicked.connect(self.reject) self.replaceButton.clicked.connect(self.replace) s = QtCore.QSettings() check(self.caseCB, s.value('find_case', False).toBool()) check(self.backCB, s.value('find_back', False).toBool()) check(self.wordsCB, s.value('find_words', False).toBool()) check(self.allCB, s.value('find_all', False).toBool()) self.findEdit.setText(s.value('find_text', '').toString()) self.replaceEdit.setText(s.value('find_replace_text', '').toString()) self.findEdit.setFocus(QtCore.Qt.OtherFocusReason) self.replaceClicked = False
def __init__(self,parent=None): super(FindDialog,self).__init__(parent) uis.loadDialog('find_replace',self) self.findButton.clicked.connect(self.accept) self.cancelButton.clicked.connect(self.reject) self.replaceButton.clicked.connect(self.replace) s=QtCore.QSettings() check(self.caseCB,s.value('find_case',False).toBool()) check(self.backCB,s.value('find_back',False).toBool()) check(self.wordsCB,s.value('find_words',False).toBool()) check(self.allCB,s.value('find_all',False).toBool()) self.findEdit.setText(s.value('find_text','').toString()) self.replaceEdit.setText(s.value('find_replace_text','').toString()) self.findEdit.setFocus(QtCore.Qt.OtherFocusReason) self.replaceClicked=False
def __init__(self,parent=None): super(MacrosHelpDialog,self).__init__(parent) uis.loadDialog('macros_help',self) helpData={ '${SELECTION}':'Substitute for the text selected in the editor when the template is activated', '${FILEPATH}':'Substitute for the full path of the current editor file', '${FILEBASE}':'Substitute for the current editor file name without an extension' } self.macrosTable.setRowCount(len(helpData)) self.macrosTable.setColumnCount(2) row=0 for m in helpData: self.macrosTable.setItem(row,0,QtGui.QTableWidgetItem(m)) self.macrosTable.setItem(row,1,QtGui.QTableWidgetItem(helpData.get(m))) row=row+1 self.macrosTable.setHorizontalHeaderItem(0,QtGui.QTableWidgetItem('Macro')) self.macrosTable.setHorizontalHeaderItem(1,QtGui.QTableWidgetItem('Description')) self.macrosTable.resizeRowsToContents()
def __init__(self,mainwin,table,parent=None): super(ToolsDialog,self).__init__(parent) uis.loadDialog('tools',self) self.mainWindow=mainwin self.root=mainwin.root self.table=table self.autoCommitCB.stateChanged.connect(self.toggledAutoCommit) s=QtCore.QSettings() state=s.value('auto_commit',QtCore.Qt.Unchecked).toInt() self.autoCommitCB.setCheckState(state[0]) self.selectAllButton.clicked.connect(self.selectAllClicked) self.selectNoneButton.clicked.connect(self.selectNoneClicked) self.groupCommentButton.clicked.connect(self.groupCommentClicked) self.groupCommentButton.setDisabled(True) self.commitButton.clicked.connect(self.commitClicked) self.commitButton.setDisabled(True) self.pushButton.clicked.connect(self.pushClicked) self.table.cellChanged.connect(self.tableCellChanged) self.updating=False
def __init__(self,shortcut,parent=None): super(ShortcutDialog,self).__init__(parent) uis.loadDialog('shortcut',self) keys=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') keys.extend('F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12'.split(',')) for k in keys: self.keyCB.addItem(k) self.shortcut=shortcut s=shortcut.split('+') for p in s: if p=='Ctrl': check(self.ctrlCB,True) if p=='Alt': check(self.altCB,True) if p=='Meta': check(self.metaCB,True) if p=='Shift': check(self.shiftCB,True) index=self.keyCB.findText(s[-1]) self.keyCB.setCurrentIndex(index) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject)
def editDebugSettings(self): item = self.currentItem() path = item.data(0, DirectoryRole).toString() mkPath = os.path.join(path, "mk.cfg") props = Properties(mkPath) d = uis.loadDialog("debug_settings") d.cwdEdit.setText(props.get("DEBUG_CWD")) d.paramsEdit.setText(props.get("DEBUG_PARAMS")) d.browseDirButton.clicked.connect(lambda: utils.browseDirectory(d.cwdEdit)) if d.exec_(): props.assign("DEBUG_CWD", d.cwdEdit.text()) props.assign("DEBUG_PARAMS", d.paramsEdit.text()) self.debug = (d.cwdEdit.text(), d.paramsEdit.text()) props.save(mkPath)
def __init__(self, mainwin, startPath, parent=None): super(BuildSettingsDialog, self).__init__(parent) self.mainWindow = mainwin uis.loadDialog('build_settings', self) s = QtCore.QSettings() check(self.parallelCB, s.value('parallel_make', False).toBool()) check(self.symscanCB, s.value('symbol_scan', True).toBool()) self.tabWidget.clear() self.tabs = [] for t in tabs: desc = tabs.get(t) dlg = SettingsTabDialog() dlg.addWidgets(desc, self) self.tabs.append((t, dlg)) for (name, tab) in self.tabs: self.tabWidget.addTab(tab, name) self.workspaceItem = QtGui.QTreeWidgetItem(['Workspace']) self.mainWindow.workspaceTree.addProjectsToTree(self.workspaceItem) self.workspaceDir = self.workspaceItem.data(0, DirectoryRole).toString() self.projTree.addTopLevelItem(self.workspaceItem) self.workspaceItem.setExpanded(True) self.projTree.itemSelectionChanged.connect(self.selectionChanged) self.closeButton.clicked.connect(self.closeClicked) self.resetButton.clicked.connect(self.resetClicked) self.prevPath = '' firstItem = None if startPath == self.workspaceDir: firstItem = self.workspaceItem else: firstItem = self.findItem(self.workspaceItem, startPath) if not firstItem: firstItem = self.workspaceItem self.projTree.setCurrentItem(firstItem) self.projTree.scrollToItem(firstItem) dir = firstItem.data(0, DirectoryRole).toString() self.prevPath = os.path.join(dir, 'mk.cfg')
def editDebugSettings(self): item = self.currentItem() path = item.data(0, DirectoryRole).toString() mkPath = os.path.join(path, "mk.cfg") props = Properties(mkPath) d = uis.loadDialog('debug_settings') d.cwdEdit.setText(props.get("DEBUG_CWD")) d.paramsEdit.setText(props.get("DEBUG_PARAMS")) d.browseDirButton.clicked.connect( lambda: utils.browseDirectory(d.cwdEdit)) if d.exec_(): props.assign('DEBUG_CWD', d.cwdEdit.text()) props.assign('DEBUG_PARAMS', d.paramsEdit.text()) self.debug = (d.cwdEdit.text(), d.paramsEdit.text()) props.save(mkPath)
def __init__(self, parent=None): super(MacrosHelpDialog, self).__init__(parent) uis.loadDialog('macros_help', self) helpData = { '${SELECTION}': 'Substitute for the text selected in the editor when the template is activated', '${FILEPATH}': 'Substitute for the full path of the current editor file', '${FILEBASE}': 'Substitute for the current editor file name without an extension' } self.macrosTable.setRowCount(len(helpData)) self.macrosTable.setColumnCount(2) row = 0 for m in helpData: self.macrosTable.setItem(row, 0, QtGui.QTableWidgetItem(m)) self.macrosTable.setItem(row, 1, QtGui.QTableWidgetItem(helpData.get(m))) row = row + 1 self.macrosTable.setHorizontalHeaderItem( 0, QtGui.QTableWidgetItem('Macro')) self.macrosTable.setHorizontalHeaderItem( 1, QtGui.QTableWidgetItem('Description')) self.macrosTable.resizeRowsToContents()
def __init__(self, mainwin, startPath, parent=None): super(BuildSettingsDialog, self).__init__(parent) self.mainWindow = mainwin uis.loadDialog("build_settings", self) s = QtCore.QSettings() check(self.parallelCB, s.value("parallel_make", False).toBool()) check(self.symscanCB, s.value("symbol_scan", True).toBool()) self.tabWidget.clear() self.tabs = [] for t in tabs: desc = tabs.get(t) dlg = SettingsTabDialog() dlg.addWidgets(desc, self) self.tabs.append((t, dlg)) for (name, tab) in self.tabs: self.tabWidget.addTab(tab, name) self.workspaceItem = QtGui.QTreeWidgetItem(["Workspace"]) self.mainWindow.workspaceTree.addProjectsToTree(self.workspaceItem) self.workspaceDir = self.workspaceItem.data(0, DirectoryRole).toString() self.projTree.addTopLevelItem(self.workspaceItem) self.workspaceItem.setExpanded(True) self.projTree.itemSelectionChanged.connect(self.selectionChanged) self.closeButton.clicked.connect(self.closeClicked) self.resetButton.clicked.connect(self.resetClicked) self.prevPath = "" firstItem = None if startPath == self.workspaceDir: firstItem = self.workspaceItem else: firstItem = self.findItem(self.workspaceItem, startPath) if not firstItem: firstItem = self.workspaceItem self.projTree.setCurrentItem(firstItem) self.projTree.scrollToItem(firstItem) dir = firstItem.data(0, DirectoryRole).toString() self.prevPath = os.path.join(dir, "mk.cfg")
def __init__(self, parent=None): super(BreakpointDialog, self).__init__(parent) uis.loadDialog('breakpoint', self)
def __init__(self,parent=None): super(GeneralSettingsDialog,self).__init__(parent) uis.loadDialog('general_settings',self) s=QtCore.QSettings() self.sortFilesCB.setCheckState(QtCore.Qt.Checked if s.value('sortFiles',True).toBool() else QtCore.Qt.Unchecked) self.clearCacheButton.clicked.connect(self.clearCache)
def __init__(self,parent=None): super(BreakpointDialog,self).__init__(parent) uis.loadDialog('breakpoint',self)