Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 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 = []
Exemplo n.º 9
0
 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()
Exemplo n.º 10
0
 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))
Exemplo n.º 11
0
 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))
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 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)
Exemplo n.º 14
0
 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)
Exemplo n.º 15
0
 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)
Exemplo n.º 16
0
 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
Exemplo n.º 17
0
 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
Exemplo n.º 18
0
 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()
Exemplo n.º 19
0
 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
Exemplo n.º 20
0
 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)
Exemplo n.º 21
0
 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)
Exemplo n.º 22
0
 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')
Exemplo n.º 23
0
 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)
Exemplo n.º 24
0
 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()
Exemplo n.º 25
0
 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")
Exemplo n.º 26
0
 def __init__(self, parent=None):
     super(BreakpointDialog, self).__init__(parent)
     uis.loadDialog('breakpoint', self)
Exemplo n.º 27
0
 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)
Exemplo n.º 28
0
 def __init__(self,parent=None):
     super(BreakpointDialog,self).__init__(parent)
     uis.loadDialog('breakpoint',self)