Beispiel #1
0
 def __init__(self, project, new, parent):
     """
     Constructor
     
     @param project reference to the project object
     @param new flag indicating the generation of a new project
     @param parent parent widget of this dialog (QWidget)
     """
     super(SpellingPropertiesDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.pwlButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.pelButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     self.project = project
     self.parent = parent
     
     self.pwlCompleter = E5FileCompleter(self.pwlEdit)
     self.pelCompleter = E5FileCompleter(self.pelEdit)
     
     from QScintilla.SpellChecker import SpellChecker
     self.spellingComboBox.addItem(self.tr("<default>"))
     self.spellingComboBox.addItems(
         sorted(SpellChecker.getAvailableLanguages()))
     
     if not new:
         self.initDialog()
     
     msh = self.minimumSizeHint()
     self.resize(max(self.width(), msh.width()), msh.height())
    def __init__(self):
        """
        Constructor
        """
        super(DebuggerPython3Page, self).__init__()
        self.setupUi(self)
        self.setObjectName("DebuggerPython3Page")

        self.interpreterButton.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.debugClientButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.interpreterCompleter = E5FileCompleter(self.interpreterEdit)
        self.debugClientCompleter = E5FileCompleter(self.debugClientEdit)

        # set initial values
        self.interpreterEdit.setText(
            Preferences.getDebugger("Python3Interpreter"))
        dct = Preferences.getDebugger("DebugClientType3")
        if dct == "standard":
            self.standardButton.setChecked(True)
        elif dct == "threaded":
            self.threadedButton.setChecked(True)
        else:
            self.customButton.setChecked(True)
        self.debugClientEdit.setText(Preferences.getDebugger("DebugClient3"))
        self.pyRedirectCheckBox.setChecked(
            Preferences.getDebugger("Python3Redirect"))
        self.pyNoEncodingCheckBox.setChecked(
            Preferences.getDebugger("Python3NoEncoding"))
        self.sourceExtensionsEdit.setText(
            Preferences.getDebugger("Python3Extensions"))
Beispiel #3
0
    def __init__(self):
        """
        Constructor
        """
        super(EditorSpellCheckingPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("EditorSpellCheckingPage")

        self.pwlButton.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.pelButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        from QScintilla.SpellChecker import SpellChecker
        languages = sorted(SpellChecker.getAvailableLanguages())
        self.defaultLanguageCombo.addItems(languages)
        if languages:
            self.errorLabel.hide()
        else:
            self.spellingFrame.setEnabled(False)

        self.pwlFileCompleter = E5FileCompleter(self.pwlEdit, showHidden=True)
        self.pelFileCompleter = E5FileCompleter(self.pelEdit, showHidden=True)

        # set initial values
        self.checkingEnabledCheckBox.setChecked(
            Preferences.getEditor("SpellCheckingEnabled"))

        self.defaultLanguageCombo.setCurrentIndex(
            self.defaultLanguageCombo.findText(
                Preferences.getEditor("SpellCheckingDefaultLanguage")))

        self.stringsOnlyCheckBox.setChecked(
            Preferences.getEditor("SpellCheckStringsOnly"))
        self.minimumWordSizeSlider.setValue(
            Preferences.getEditor("SpellCheckingMinWordSize"))

        self.initColour("SpellingMarkers",
                        self.spellingMarkerButton,
                        Preferences.getEditorColour,
                        hasAlpha=True)

        self.pwlEdit.setText(
            Preferences.getEditor("SpellCheckingPersonalWordList"))
        self.pelEdit.setText(
            Preferences.getEditor("SpellCheckingPersonalExcludeList"))

        if self.spellingFrame.isEnabled():
            self.enabledCheckBox.setChecked(
                Preferences.getEditor("AutoSpellCheckingEnabled"))
        else:
            self.enabledCheckBox.setChecked(False)  # not available
        self.chunkSizeSpinBox.setValue(
            Preferences.getEditor("AutoSpellCheckChunkSize"))
Beispiel #4
0
 def __init__(self, parent=None):
     """
     Constructor
     
     @param parent reference to the parent widget (QWidget)
     """
     super(DiffDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.file1Button.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.file2Button.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     self.file1Completer = E5FileCompleter(self.file1Edit)
     self.file2Completer = E5FileCompleter(self.file2Edit)
     
     self.diffButton = self.buttonBox.addButton(
         self.tr("Compare"), QDialogButtonBox.ActionRole)
     self.diffButton.setToolTip(
         self.tr("Press to perform the comparison of the two files"))
     self.saveButton = self.buttonBox.addButton(
         self.tr("Save"), QDialogButtonBox.ActionRole)
     self.saveButton.setToolTip(
         self.tr("Save the output to a patch file"))
     self.diffButton.setEnabled(False)
     self.saveButton.setEnabled(False)
     self.diffButton.setDefault(True)
     
     self.filename1 = ''
     self.filename2 = ''
     
     self.updateInterval = 20    # update every 20 lines
     
     font = Preferences.getEditorOtherFonts("MonospacedFont")
     self.contents.setFontFamily(font.family())
     self.contents.setFontPointSize(font.pointSize())
     
     self.cNormalFormat = self.contents.currentCharFormat()
     self.cAddedFormat = self.contents.currentCharFormat()
     self.cAddedFormat.setBackground(QBrush(QColor(190, 237, 190)))
     self.cRemovedFormat = self.contents.currentCharFormat()
     self.cRemovedFormat.setBackground(QBrush(QColor(237, 190, 190)))
     self.cReplacedFormat = self.contents.currentCharFormat()
     self.cReplacedFormat.setBackground(QBrush(QColor(190, 190, 237)))
     self.cLineNoFormat = self.contents.currentCharFormat()
     self.cLineNoFormat.setBackground(QBrush(QColor(255, 220, 168)))
     
     # connect some of our widgets explicitly
     self.file1Edit.textChanged.connect(self.__fileChanged)
     self.file2Edit.textChanged.connect(self.__fileChanged)
Beispiel #5
0
 def __init__(self, task=None, parent=None, projectOpen=False):
     """
     Constructor
     
     @param task the task object to be shown
     @param parent the parent widget (QWidget)
     @param projectOpen flag indicating status of the project (boolean)
     """
     super(TaskPropertiesDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.filenameCompleter = E5FileCompleter(self.filenameEdit)
     
     if not projectOpen:
         self.projectCheckBox.setEnabled(False)
     if task is not None:
         self.summaryEdit.setText(task.summary)
         self.descriptionEdit.setText(task.description)
         self.creationLabel.setText(
             time.strftime("%Y-%m-%d, %H:%M:%S",
                           time.localtime(task.created)))
         self.priorityCombo.setCurrentIndex(task.priority)
         self.projectCheckBox.setChecked(task._isProjectTask)
         self.completedCheckBox.setChecked(task.completed)
         self.filenameEdit.setText(task.filename)
         if task.lineno:
             self.linenoEdit.setText(str(task.lineno))
     else:
         self.projectCheckBox.setChecked(projectOpen)
Beispiel #6
0
    def __init__(self):
        """
        Constructor
        """
        super(EditorAPIsPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("EditorAPIsPage")

        self.apiFileButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.prepareApiButton.setText(self.tr("Compile APIs"))
        self.__currentAPI = None
        self.__inPreparation = False

        self.apiFileCompleter = E5FileCompleter(self.apiFileEdit)

        # set initial values
        self.pluginManager = e5App().getObject("PluginManager")
        self.apiAutoPrepareCheckBox.setChecked(
            Preferences.getEditor("AutoPrepareAPIs"))

        import QScintilla.Lexers
        self.apis = {}
        apiLanguages = sorted(
            [''] + list(QScintilla.Lexers.getSupportedLanguages().keys()))
        for lang in apiLanguages:
            if lang != "Guessed":
                self.apiLanguageComboBox.addItem(lang)
        self.currentApiLanguage = ''
        self.on_apiLanguageComboBox_activated(self.currentApiLanguage)

        for lang in apiLanguages[1:]:
            self.apis[lang] = Preferences.getEditorAPI(lang)[:]
 def __init__(self, parent=None):
     """
     Constructor
     
     @param parent reference to the parent widget (QWidget)
     """
     super(SqlConnectionDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.databaseFileButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     self.databaseFileCompleter = E5FileCompleter()
     
     self.okButton = self.buttonBox.button(QDialogButtonBox.Ok)
     
     drivers = QSqlDatabase.drivers()
     
     # remove compatibility names
     if "QMYSQL3" in drivers:
         drivers.remove("QMYSQL3")
     if "QOCI8" in drivers:
         drivers.remove("QOCI8")
     if "QODBC3" in drivers:
         drivers.remove("QODBC3")
     if "QPSQL7" in drivers:
         drivers.remove("QPSQL7")
     if "QTDS7" in drivers:
         drivers.remove("QTDS7")
     
     self.driverCombo.addItems(drivers)
     
     self.__updateDialog()
     
     msh = self.minimumSizeHint()
     self.resize(max(self.width(), msh.width()), msh.height())
Beispiel #8
0
    def __init__(self, source, parent=None, move=False):
        """
        Constructor
        
        @param source name of the source file/directory (string)
        @param parent parent widget (QWidget)
        @param move flag indicating a move operation (boolean)
        """
        super(GitCopyDialog, self).__init__(parent)
        self.setupUi(self)

        self.dirButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.source = source
        if os.path.isdir(self.source):
            self.targetCompleter = E5DirCompleter(self.targetEdit)
        else:
            self.targetCompleter = E5FileCompleter(self.targetEdit)

        if move:
            self.setWindowTitle(self.tr('Git Move'))
        else:
            self.forceCheckBox.setEnabled(False)

        self.sourceEdit.setText(source)

        self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)

        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())
Beispiel #9
0
    def __init__(self):
        """
        Constructor
        """
        super(HelpViewersPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("HelpViewersPage")

        self.customViewerSelectionButton.setIcon(
            UI.PixmapCache.getIcon("open.png"))

        self.helpViewerGroup = QButtonGroup()
        self.helpViewerGroup.addButton(self.helpBrowserButton)
        self.helpViewerGroup.addButton(self.qtAssistantButton)
        self.helpViewerGroup.addButton(self.webBrowserButton)
        self.helpViewerGroup.addButton(self.customViewerButton)

        self.customViewerCompleter = E5FileCompleter(self.customViewerEdit)

        # set initial values
        hvId = Preferences.getHelp("HelpViewerType")
        if hvId == 1:
            self.helpBrowserButton.setChecked(True)
        elif hvId == 2:
            self.qtAssistantButton.setChecked(True)
        elif hvId == 3:
            self.webBrowserButton.setChecked(True)
        else:
            self.customViewerButton.setChecked(True)
        self.customViewerEdit.setText(Preferences.getHelp("CustomViewer"))
Beispiel #10
0
 def __init__(self, project, parms=None, parent=None):
     """
     Constructor
     
     @param project reference to the project object (Project.Project)
     @param parms parameters to set in the dialog
     @param parent parent widget of this dialog
     """
     super(EricapiConfigDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.outputFileButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.ignoreDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
     for language in sorted(
             DocumentationTools.supportedExtensionsDictForApis.keys()):
         self.languagesList.addItem(language)
     
     self.ppath = project.getProjectPath()
     self.project = project
     
     self.__initializeDefaults()
     
     # get a copy of the defaults to store the user settings
     self.parameters = copy.deepcopy(self.defaults)
     
     # combine it with the values of parms
     if parms is not None:
         for key, value in list(parms.items()):
             self.parameters[key] = parms[key]
     self.parameters['outputFile'] = \
         Utilities.toNativeSeparators(self.parameters['outputFile'])
     
     self.outputFileCompleter = E5FileCompleter(self.outputFileEdit)
     self.ignoreDirCompleter = E5DirCompleter(self.ignoreDirEdit)
     
     self.recursionCheckBox.setChecked(self.parameters['useRecursion'])
     self.includePrivateCheckBox.setChecked(
         self.parameters['includePrivate'])
     self.outputFileEdit.setText(self.parameters['outputFile'])
     self.baseEdit.setText(self.parameters['basePackage'])
     self.ignoreDirsList.clear()
     for d in self.parameters['ignoreDirectories']:
         self.ignoreDirsList.addItem(d)
     self.sourceExtEdit.setText(
         ", ".join(self.parameters['sourceExtensions']))
     self.excludeFilesEdit.setText(
         ", ".join(self.parameters['ignoreFilePatterns']))
     for language in self.parameters['languages']:
         if language == "Python":
             # convert Python to the more specific Python2
             language = "Python2"
         items = self.languagesList.findItems(
             language, Qt.MatchFlags(Qt.MatchExactly))
         items and items[0].setSelected(True)
Beispiel #11
0
    def __init__(self, parent=None):
        """
        Constructor
        
        @param parent reference to the parent widget (QWidget)
        """
        super(DiffDialog, self).__init__(parent)
        self.setupUi(self)

        self.file1Button.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.file2Button.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.file1Completer = E5FileCompleter(self.file1Edit)
        self.file2Completer = E5FileCompleter(self.file2Edit)

        self.diffButton = self.buttonBox.addButton(self.tr("Compare"),
                                                   QDialogButtonBox.ActionRole)
        self.diffButton.setToolTip(
            self.tr("Press to perform the comparison of the two files"))
        self.saveButton = self.buttonBox.addButton(self.tr("Save"),
                                                   QDialogButtonBox.ActionRole)
        self.saveButton.setToolTip(self.tr("Save the output to a patch file"))
        self.diffButton.setEnabled(False)
        self.saveButton.setEnabled(False)
        self.diffButton.setDefault(True)

        self.searchWidget.attachTextEdit(self.contents)

        self.filename1 = ''
        self.filename2 = ''

        self.updateInterval = 20  # update every 20 lines

        font = Preferences.getEditorOtherFonts("MonospacedFont")
        self.contents.setFontFamily(font.family())
        self.contents.setFontPointSize(font.pointSize())

        self.highlighter = DiffHighlighter(self.contents.document())

        # connect some of our widgets explicitly
        self.file1Edit.textChanged.connect(self.__fileChanged)
        self.file2Edit.textChanged.connect(self.__fileChanged)
Beispiel #12
0
    def __init__(self, parent=None):
        """
        Constructor
        
        @param parent parent widget (QWidget)
        """
        super(SvnPropSetDialog, self).__init__(parent)
        self.setupUi(self)

        self.fileButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.propFileCompleter = E5FileCompleter(self.propFileEdit)
    def __init__(self, toollist, parent=None):
        """
        Constructor
        
        @param toollist list of configured tools
        @param parent parent widget (QWidget)
        """
        super(ToolConfigurationDialog, self).__init__(parent)
        self.setupUi(self)

        self.iconButton.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.executableButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.iconCompleter = E5FileCompleter(self.iconEdit)
        self.executableCompleter = E5FileCompleter(self.executableEdit)

        self.redirectionModes = [
            ("no", self.tr("no redirection")),
            ("show", self.tr("show output")),
            ("insert", self.tr("insert into current editor")),
            ("replaceSelection",
             self.tr("replace selection of current editor")),
        ]

        self.toollist = copy.deepcopy(toollist)
        for tool in toollist:
            self.toolsList.addItem(tool['menutext'])

        for mode in self.redirectionModes:
            self.redirectCombo.addItem(mode[1])

        if len(toollist):
            self.toolsList.setCurrentRow(0)
            self.on_toolsList_currentRowChanged(0)

        t = self.argumentsEdit.whatsThis()
        if t:
            t += Utilities.getPercentReplacementHelp()
            self.argumentsEdit.setWhatsThis(t)
Beispiel #14
0
    def __init__(self):
        """
        Constructor
        """
        super(CorbaPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("CorbaPage")

        self.idlButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.idlCompleter = E5FileCompleter(self.idlEdit)

        # set initial values
        self.idlEdit.setText(Preferences.getCorba("omniidl"))
Beispiel #15
0
    def __init__(self):
        """
        Constructor
        """
        super(HelpInterfacePage, self).__init__()
        self.setupUi(self)
        self.setObjectName("InterfacePage")

        self.styleSheetButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.styleSheetCompleter = E5FileCompleter(self.styleSheetEdit)

        # set initial values
        self.__populateStyleCombo()
        self.styleSheetEdit.setText(Preferences.getUI("StyleSheet"))
Beispiel #16
0
 def __init__(self, project, new, parent):
     """
     Constructor
     
     @param project reference to the project object
     @param new flag indicating the generation of a new project
     @param parent parent widget of this dialog (QWidget)
     """
     super(TranslationPropertiesDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.transBinPathButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.transPatternButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     self.project = project
     self.parent = parent
     
     self.transPatternCompleter = E5FileCompleter(self.transPatternEdit)
     self.transBinPathCompleter = E5DirCompleter(self.transBinPathEdit)
     self.exceptionCompleter = E5FileCompleter(self.exceptionEdit)
     
     self.initFilters()
     if not new:
         self.initDialog()
Beispiel #17
0
 def __init__(self):
     """
     Constructor
     """
     super(HelpDocumentationPage, self).__init__()
     self.setupUi(self)
     self.setObjectName("HelpDocumentationPage")
     
     self.python2DocDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.pythonDocDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.qt4DocDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.qt5DocDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.pyqt4DocDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.pyqt5DocDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.pysideDocDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     self.python2DocDirCompleter = E5FileCompleter(self.python2DocDirEdit)
     self.pythonDocDirCompleter = E5FileCompleter(self.pythonDocDirEdit)
     self.qt4DocDirCompleter = E5FileCompleter(self.qt4DocDirEdit)
     self.qt5DocDirCompleter = E5FileCompleter(self.qt5DocDirEdit)
     self.pyqt4DocDirCompleter = E5FileCompleter(self.pyqt4DocDirEdit)
     self.pyqt5DocDirCompleter = E5FileCompleter(self.pyqt5DocDirEdit)
     self.pysideDocDirCompleter = E5FileCompleter(self.pysideDocDirEdit)
     
     try:
         import PyQt5        # __IGNORE_WARNING__
     except ImportError:
         self.pyqt5Group.setEnabled(False)
     
     pyside2, pyside3 = Utilities.checkPyside()
     if pyside2 or pyside3:
         self.pysideGroup.setEnabled(True)
     else:
         self.pysideGroup.setEnabled(False)
     
     # set initial values
     self.python2DocDirEdit.setText(
         Preferences.getHelp("Python2DocDir"))
     self.pythonDocDirEdit.setText(
         Preferences.getHelp("PythonDocDir"))
     self.qt4DocDirEdit.setText(
         Preferences.getHelp("Qt4DocDir"))
     self.qt5DocDirEdit.setText(
         Preferences.getHelp("Qt5DocDir"))
     self.pyqt4DocDirEdit.setText(
         Preferences.getHelp("PyQt4DocDir"))
     self.pyqt5DocDirEdit.setText(
         Preferences.getHelp("PyQt5DocDir"))
     self.pysideDocDirEdit.setText(
         Preferences.getHelp("PySideDocDir"))
Beispiel #18
0
    def __init__(self, pyqtVariant, parent=None):
        """
        Constructor
        
        @param pyqtVariant variant of PyQt (integer; 0, 4 or 5)
        @param parent parent widget (QWidget)
        """
        super(FileDialogWizardDialog, self).__init__(parent)
        self.setupUi(self)

        self.eStartWithCompleter = E5FileCompleter(self.eStartWith)
        self.eWorkDirCompleter = E5DirCompleter(self.eWorkDir)

        self.__pyqtVariant = pyqtVariant

        self.__typeButtonsGroup = QButtonGroup(self)
        self.__typeButtonsGroup.setExclusive(True)
        self.__typeButtonsGroup.addButton(self.rOpenFile, 1)
        self.__typeButtonsGroup.addButton(self.rOpenFiles, 2)
        self.__typeButtonsGroup.addButton(self.rSaveFile, 3)
        self.__typeButtonsGroup.addButton(self.rfOpenFile, 11)
        self.__typeButtonsGroup.addButton(self.rfOpenFiles, 12)
        self.__typeButtonsGroup.addButton(self.rfSaveFile, 13)
        self.__typeButtonsGroup.addButton(self.rDirectory, 20)
        self.__typeButtonsGroup.buttonClicked[int].connect(
            self.__toggleInitialFilterAndResult)
        self.__toggleInitialFilterAndResult(1)

        self.pyqtComboBox.addItems(["PyQt4", "PyQt5"])
        self.__pyqtVariant = pyqtVariant
        if self.__pyqtVariant == 5:
            self.pyqtComboBox.setCurrentIndex(1)
        else:
            self.pyqtComboBox.setCurrentIndex(0)

        self.rSaveFile.toggled[bool].connect(self.__toggleConfirmCheckBox)
        self.rfSaveFile.toggled[bool].connect(self.__toggleConfirmCheckBox)
        self.rDirectory.toggled[bool].connect(self.__toggleGroupsAndTest)
        self.cStartWith.toggled[bool].connect(self.__toggleGroupsAndTest)
        self.cWorkDir.toggled[bool].connect(self.__toggleGroupsAndTest)
        self.cFilters.toggled[bool].connect(self.__toggleGroupsAndTest)

        self.bTest = self.buttonBox.addButton(self.tr("Test"),
                                              QDialogButtonBox.ActionRole)

        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())
Beispiel #19
0
    def __init__(self, parent=None):
        """
        Constructor
        
        @param parent reference to the parent widget (QWidget)
        """
        super(HgImportDialog, self).__init__(parent)
        self.setupUi(self)

        self.patchFileButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)

        self.__patchFileCompleter = E5FileCompleter(self.patchFileEdit)

        self.__initDateTime = QDateTime.currentDateTime()
        self.dateEdit.setDateTime(self.__initDateTime)
Beispiel #20
0
    def __init__(self):
        """
        Constructor
        """
        super(DebuggerRubyPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("DebuggerRubyPage")

        self.rubyInterpreterButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.rubyInterpreterCompleter = E5FileCompleter(
            self.rubyInterpreterEdit)

        # set initial values
        self.rubyInterpreterEdit.setText(
            Preferences.getDebugger("RubyInterpreter"))
        self.rbRedirectCheckBox.setChecked(
            Preferences.getDebugger("RubyRedirect"))
Beispiel #21
0
    def __init__(self,
                 parent=None,
                 startdir=None,
                 project=None,
                 categories=None):
        """
        Constructor
        
        @param parent parent widget of this dialog (QWidget)
        @param startdir start directory for the selection dialog (string)
        @param project dictionary containing project data
        @param categories list of already used categories (list of string)
        """
        super(AddProjectDialog, self).__init__(parent)
        self.setupUi(self)

        self.fileButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.fileCompleter = E5FileCompleter(self.filenameEdit)

        if categories:
            self.categoryComboBox.addItem("")
            self.categoryComboBox.addItems(sorted(categories))

        self.startdir = startdir
        self.uid = ""

        self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok)
        self.__okButton.setEnabled(False)

        if project is not None:
            self.setWindowTitle(self.tr("Project Properties"))

            self.nameEdit.setText(project['name'])
            self.filenameEdit.setText(project['file'])
            self.descriptionEdit.setPlainText(project['description'])
            self.masterCheckBox.setChecked(project['master'])
            index = self.categoryComboBox.findText(project['category'])
            if index == -1:
                index = 0
            self.categoryComboBox.setCurrentIndex(index)
            self.uid = project["uid"]
Beispiel #22
0
    def __init__(self, bookmarks, parent=None):
        """
        Constructor
        
        @param bookmarks list of bookmarked files (list of strings)
        @param parent parent widget (QWidget)
        """
        super(BookmarkedFilesDialog, self).__init__(parent)
        self.setupUi(self)

        self.fileButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.fileCompleter = E5FileCompleter(self.fileEdit)

        self.bookmarks = bookmarks[:]
        for bookmark in self.bookmarks:
            itm = QListWidgetItem(bookmark, self.filesList)
            if not QFileInfo(bookmark).exists():
                itm.setBackground(QColor(Qt.red))

        if len(self.bookmarks):
            self.filesList.setCurrentRow(0)
Beispiel #23
0
    def __init__(self,
                 pro,
                 parent=None,
                 filter=None,
                 name=None,
                 startdir=None):
        """
        Constructor
        
        @param pro reference to the project object
        @param parent parent widget of this dialog (QWidget)
        @param filter filter specification for the file to add (string)
        @param name name of this dialog (string)
        @param startdir start directory for the selection dialog
        """
        super(AddFileDialog, self).__init__(parent)
        if name:
            self.setObjectName(name)
        self.setupUi(self)

        self.targetDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.sourceFileButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.targetDirCompleter = E5DirCompleter(self.targetDirEdit)
        self.sourceFileCompleter = E5FileCompleter(self.sourceFileEdit)

        self.targetDirEdit.setText(pro.ppath)
        self.filter = filter
        self.ppath = pro.ppath
        self.startdir = startdir
        self.filetypes = pro.pdata["FILETYPES"]
        # save a reference to the filetypes dict

        if self.filter is not None:
            self.sourcecodeCheckBox.hide()

        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())
Beispiel #24
0
    def __init__(self):
        """
        Constructor
        """
        super(HelpAppearancePage, self).__init__()
        self.setupUi(self)
        self.setObjectName("HelpAppearancePage")

        self.styleSheetButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.styleSheetCompleter = E5FileCompleter(self.styleSheetEdit)

        self.__displayMode = None

        # set initial values
        self.standardFont = Preferences.getHelp("StandardFont")
        self.standardFontSample.setFont(self.standardFont)
        self.standardFontSample.setText("{0} {1}".format(
            self.standardFont.family(), self.standardFont.pointSize()))

        self.fixedFont = Preferences.getHelp("FixedFont")
        self.fixedFontSample.setFont(self.fixedFont)
        self.fixedFontSample.setText("{0} {1}".format(
            self.fixedFont.family(), self.fixedFont.pointSize()))

        self.initColour("SaveUrlColor", self.secureURLsColourButton,
                        Preferences.getHelp)

        self.autoLoadImagesCheckBox.setChecked(
            Preferences.getHelp("AutoLoadImages"))

        self.styleSheetEdit.setText(Preferences.getHelp("UserStyleSheet"))

        self.tabsCloseButtonCheckBox.setChecked(
            Preferences.getUI("SingleCloseButton"))
        self.warnOnMultipleCloseCheckBox.setChecked(
            Preferences.getHelp("WarnOnMultipleClose"))
Beispiel #25
0
    def __init__(self, parent=None):
        """
        Constructor
        
        @param parent reference to the parent widget (QWidget)
        """
        super(VirtualenvConfigurationDialog, self).__init__(parent)
        self.setupUi(self)

        self.targetDirectoryButton.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.extraSearchPathButton.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.pythonExecButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.__targetDirectoryCompleter = \
            E5DirCompleter(self.targetDirectoryEdit)
        self.__extraSearchPathCompleter = \
            E5DirCompleter(self.extraSearchPathEdit)
        self.__pythonExecCompleter = E5FileCompleter(self.pythonExecEdit)

        self.__versionRe = re.compile(r""".*?(\d+\.\d+\.\d+).*""")

        self.__virtualenvFound = False
        self.__pyvenvFound = False
        self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)

        self.__mandatoryStyleSheet = "QLineEdit {border: 2px solid;}"
        self.targetDirectoryEdit.setStyleSheet(self.__mandatoryStyleSheet)

        self.__setVirtualenvVersion()
        self.__setPyvenvVersion()
        if self.__virtualenvFound:
            self.virtualenvButton.setChecked(True)
        elif self.__pyvenvFound:
            self.pyvenvButton.setChecked(True)

        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())
Beispiel #26
0
    def __init__(self, project, new, parent):
        """
        Constructor
        
        @param project reference to the project object
        @param new flag indicating the generation of a new project
        @param parent parent widget of this dialog (QWidget)
        """
        super(TranslationPropertiesDialog, self).__init__(parent)
        self.setupUi(self)

        self.transPatternPicker.setMode(E5PathPickerModes.SaveFileMode)
        self.transPatternPicker.setDefaultDirectory(project.ppath)
        self.transBinPathPicker.setMode(E5PathPickerModes.DirectoryMode)
        self.transBinPathPicker.setDefaultDirectory(project.ppath)

        self.project = project
        self.parent = parent

        self.exceptionCompleter = E5FileCompleter(self.exceptionEdit)

        self.initFilters()
        if not new:
            self.initDialog()
Beispiel #27
0
    def __init__(self, files=[], parent=None):
        """
        Constructor
        
        @param files list of files to compare and their label
            (list of two tuples of two strings)
        @param parent parent widget (QWidget)
        """
        super(CompareDialog, self).__init__(parent)
        self.setupUi(self)

        self.file1Button.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.file2Button.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.file1Completer = E5FileCompleter(self.file1Edit)
        self.file2Completer = E5FileCompleter(self.file2Edit)

        self.diffButton = self.buttonBox.addButton(self.tr("Compare"),
                                                   QDialogButtonBox.ActionRole)
        self.diffButton.setToolTip(
            self.tr("Press to perform the comparison of the two files"))
        self.diffButton.setEnabled(False)
        self.diffButton.setDefault(True)

        self.firstButton.setIcon(UI.PixmapCache.getIcon("2uparrow.png"))
        self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png"))
        self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png"))
        self.lastButton.setIcon(UI.PixmapCache.getIcon("2downarrow.png"))

        self.totalLabel.setText(self.tr('Total: {0}').format(0))
        self.changedLabel.setText(self.tr('Changed: {0}').format(0))
        self.addedLabel.setText(self.tr('Added: {0}').format(0))
        self.deletedLabel.setText(self.tr('Deleted: {0}').format(0))

        self.updateInterval = 20  # update every 20 lines

        self.vsb1 = self.contents_1.verticalScrollBar()
        self.hsb1 = self.contents_1.horizontalScrollBar()
        self.vsb2 = self.contents_2.verticalScrollBar()
        self.hsb2 = self.contents_2.horizontalScrollBar()

        self.on_synchronizeCheckBox_toggled(True)

        font = Preferences.getEditorOtherFonts("MonospacedFont")
        self.contents_1.setFontFamily(font.family())
        self.contents_1.setFontPointSize(font.pointSize())
        self.contents_2.setFontFamily(font.family())
        self.contents_2.setFontPointSize(font.pointSize())
        self.fontHeight = QFontMetrics(self.contents_1.currentFont()).height()

        self.cNormalFormat = self.contents_1.currentCharFormat()
        self.cInsertedFormat = self.contents_1.currentCharFormat()
        self.cInsertedFormat.setBackground(QBrush(QColor(190, 237, 190)))
        self.cDeletedFormat = self.contents_1.currentCharFormat()
        self.cDeletedFormat.setBackground(QBrush(QColor(237, 190, 190)))
        self.cReplacedFormat = self.contents_1.currentCharFormat()
        self.cReplacedFormat.setBackground(QBrush(QColor(190, 190, 237)))

        # connect some of our widgets explicitly
        self.file1Edit.textChanged.connect(self.__fileChanged)
        self.file2Edit.textChanged.connect(self.__fileChanged)
        self.vsb1.valueChanged.connect(self.__scrollBarMoved)
        self.vsb1.valueChanged.connect(self.vsb2.setValue)
        self.vsb2.valueChanged.connect(self.vsb1.setValue)

        self.diffParas = []
        self.currentDiffPos = -1

        self.markerPattern = "\0\+|\0\^|\0\-"

        if len(files) == 2:
            self.filesGroup.hide()
            self.file1Edit.setText(files[0][1])
            self.file2Edit.setText(files[1][1])
            self.file1Label.setText(files[0][0])
            self.file2Label.setText(files[1][0])
            self.diffButton.hide()
            QTimer.singleShot(0, self.on_diffButton_clicked)
        else:
            self.file1Label.hide()
            self.file2Label.hide()
    def __init__(self, dialogVariant, parent=None):
        """
        Constructor
        
        @param dialogVariant variant of the file dialog to be generated
            (-1 = E5FileDialog, 0 = unknown, 4 = PyQt4, 5 = PyQt5)
        @type int
        @param parent parent widget
        @type QWidget
        """
        super(FileDialogWizardDialog, self).__init__(parent)
        self.setupUi(self)

        self.eStartWithCompleter = E5FileCompleter(self.eStartWith)
        self.eWorkDirCompleter = E5DirCompleter(self.eWorkDir)

        self.__dialogVariant = dialogVariant

        self.__typeButtonsGroup = QButtonGroup(self)
        self.__typeButtonsGroup.setExclusive(True)
        self.__typeButtonsGroup.addButton(self.rOpenFile, 1)
        self.__typeButtonsGroup.addButton(self.rOpenFiles, 2)
        self.__typeButtonsGroup.addButton(self.rSaveFile, 3)
        self.__typeButtonsGroup.addButton(self.rfOpenFile, 11)
        self.__typeButtonsGroup.addButton(self.rfOpenFiles, 12)
        self.__typeButtonsGroup.addButton(self.rfSaveFile, 13)
        self.__typeButtonsGroup.addButton(self.rOpenFileUrl, 21)
        self.__typeButtonsGroup.addButton(self.rOpenFileUrls, 22)
        self.__typeButtonsGroup.addButton(self.rSaveFileUrl, 23)
        self.__typeButtonsGroup.addButton(self.rDirectory, 30)
        self.__typeButtonsGroup.addButton(self.rDirectoryUrl, 31)
        self.__typeButtonsGroup.buttonClicked[int].connect(
            self.__toggleInitialFilterAndResult)
        self.__toggleInitialFilterAndResult(1)

        self.__dialogVariant = dialogVariant
        if self.__dialogVariant == -1:
            self.pyqtComboBox.addItems(["eric"])
            self.setWindowTitle(self.tr("E5FileDialog Wizard"))
            self.pyqtComboBox.setCurrentIndex(0)
            self.pyqtComboBox.setEnabled(False)
        else:
            self.pyqtComboBox.addItems(["PyQt5", "PyQt4"])
            self.setWindowTitle(self.tr("QFileDialog Wizard"))
            if self.__dialogVariant == 5:
                self.pyqtComboBox.setCurrentIndex(0)
            elif self.__dialogVariant == 4:
                self.pyqtComboBox.setCurrentIndex(1)
            else:
                self.pyqtComboBox.setCurrentIndex(0)

        self.rSaveFile.toggled[bool].connect(self.__toggleConfirmCheckBox)
        self.rfSaveFile.toggled[bool].connect(self.__toggleConfirmCheckBox)
        self.rSaveFileUrl.toggled[bool].connect(self.__toggleConfirmCheckBox)
        self.rDirectory.toggled[bool].connect(self.__toggleGroupsAndTest)
        self.rDirectoryUrl.toggled[bool].connect(self.__toggleGroupsAndTest)
        self.cStartWith.toggled[bool].connect(self.__toggleGroupsAndTest)
        self.cWorkDir.toggled[bool].connect(self.__toggleGroupsAndTest)
        self.cFilters.toggled[bool].connect(self.__toggleGroupsAndTest)

        self.bTest = self.buttonBox.addButton(self.tr("Test"),
                                              QDialogButtonBox.ActionRole)

        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())
    def __init__(self):
        """
        Constructor
        """
        super(DebuggerGeneralPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("DebuggerGeneralPage")

        t = self.execLineEdit.whatsThis()
        if t:
            t += Utilities.getPercentReplacementHelp()
            self.execLineEdit.setWhatsThis(t)

        try:
            backends = e5App().getObject("DebugServer").getSupportedLanguages()
            for backend in sorted(backends):
                self.passiveDbgBackendCombo.addItem(backend)
        except KeyError:
            self.passiveDbgGroup.setEnabled(False)

        t = self.consoleDbgEdit.whatsThis()
        if t:
            t += Utilities.getPercentReplacementHelp()
            self.consoleDbgEdit.setWhatsThis(t)

        self.consoleDbgCompleter = E5FileCompleter(self.consoleDbgEdit)
        self.dbgTranslationLocalCompleter = E5DirCompleter(
            self.dbgTranslationLocalEdit)

        # set initial values
        interfaces = []
        networkInterfaces = QNetworkInterface.allInterfaces()
        for networkInterface in networkInterfaces:
            addressEntries = networkInterface.addressEntries()
            if len(addressEntries) > 0:
                for addressEntry in addressEntries:
                    if ":" in addressEntry.ip().toString() and \
                            not socket.has_ipv6:
                        continue  # IPv6 not supported by Python
                    interfaces.append("{0} ({1})".format(
                        networkInterface.humanReadableName(),
                        addressEntry.ip().toString()))
        self.interfacesCombo.addItems(interfaces)
        interface = Preferences.getDebugger("NetworkInterface")
        if not socket.has_ipv6:
            # IPv6 not supported by Python
            self.all6InterfacesButton.setEnabled(False)
            if interface == "allv6":
                interface = "all"
        if interface == "all":
            self.allInterfacesButton.setChecked(True)
        elif interface == "allv6":
            self.all6InterfacesButton.setChecked(True)
        else:
            self.selectedInterfaceButton.setChecked(True)
            index = -1
            for i in range(len(interfaces)):
                if QRegExp(".*{0}.*".format(interface))\
                        .exactMatch(interfaces[i]):
                    index = i
                    break
            self.interfacesCombo.setCurrentIndex(index)

        self.allowedHostsList.addItems(Preferences.getDebugger("AllowedHosts"))

        self.remoteCheckBox.setChecked(
            Preferences.getDebugger("RemoteDbgEnabled"))
        self.hostLineEdit.setText(Preferences.getDebugger("RemoteHost"))
        self.execLineEdit.setText(Preferences.getDebugger("RemoteExecution"))

        if self.passiveDbgGroup.isEnabled():
            self.passiveDbgCheckBox.setChecked(
                Preferences.getDebugger("PassiveDbgEnabled"))
            self.passiveDbgPortSpinBox.setValue(
                Preferences.getDebugger("PassiveDbgPort"))
            index = self.passiveDbgBackendCombo.findText(
                Preferences.getDebugger("PassiveDbgType"))
            if index == -1:
                index = 0
            self.passiveDbgBackendCombo.setCurrentIndex(index)

        self.debugEnvironReplaceCheckBox.setChecked(
            Preferences.getDebugger("DebugEnvironmentReplace"))
        self.debugEnvironEdit.setText(
            Preferences.getDebugger("DebugEnvironment"))
        self.automaticResetCheckBox.setChecked(
            Preferences.getDebugger("AutomaticReset"))
        self.debugAutoSaveScriptsCheckBox.setChecked(
            Preferences.getDebugger("Autosave"))
        self.consoleDbgCheckBox.setChecked(
            Preferences.getDebugger("ConsoleDbgEnabled"))
        self.consoleDbgEdit.setText(
            Preferences.getDebugger("ConsoleDbgCommand"))
        self.dbgPathTranslationCheckBox.setChecked(
            Preferences.getDebugger("PathTranslation"))
        self.dbgTranslationRemoteEdit.setText(
            Preferences.getDebugger("PathTranslationRemote"))
        self.dbgTranslationLocalEdit.setText(
            Preferences.getDebugger("PathTranslationLocal"))
        self.debugThreeStateBreakPoint.setChecked(
            Preferences.getDebugger("ThreeStateBreakPoints"))
        self.dontShowClientExitCheckBox.setChecked(
            Preferences.getDebugger("SuppressClientExit"))
        self.exceptionBreakCheckBox.setChecked(
            Preferences.getDebugger("BreakAlways"))
        self.exceptionShellCheckBox.setChecked(
            Preferences.getDebugger("ShowExceptionInShell"))
        self.autoViewSourcecodeCheckBox.setChecked(
            Preferences.getDebugger("AutoViewSourceCode"))
Beispiel #30
0
    def __init__(self,
                 prog=None,
                 dbs=None,
                 ui=None,
                 fromEric=False,
                 parent=None,
                 name=None):
        """
        Constructor
        
        @param prog filename of the program to open
        @param dbs reference to the debug server object. It is an indication
            whether we were called from within the eric6 IDE
        @param ui reference to the UI object
        @param fromEric flag indicating an instantiation from within the
            eric IDE (boolean)
        @param parent parent widget of this dialog (QWidget)
        @param name name of this dialog (string)
        """
        super(UnittestDialog, self).__init__(parent)
        if name:
            self.setObjectName(name)
        self.setupUi(self)

        self.fileDialogButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        self.startButton = self.buttonBox.addButton(
            self.tr("Start"), QDialogButtonBox.ActionRole)
        self.startButton.setToolTip(self.tr("Start the selected testsuite"))
        self.startButton.setWhatsThis(
            self.tr("""<b>Start Test</b>"""
                    """<p>This button starts the selected testsuite.</p>"""))
        self.startFailedButton = self.buttonBox.addButton(
            self.tr("Rerun Failed"), QDialogButtonBox.ActionRole)
        self.startFailedButton.setToolTip(
            self.tr("Reruns failed tests of the selected testsuite"))
        self.startFailedButton.setWhatsThis(
            self.tr(
                """<b>Rerun Failed</b>"""
                """<p>This button reruns all failed tests of the selected"""
                """ testsuite.</p>"""))
        self.stopButton = self.buttonBox.addButton(self.tr("Stop"),
                                                   QDialogButtonBox.ActionRole)
        self.stopButton.setToolTip(self.tr("Stop the running unittest"))
        self.stopButton.setWhatsThis(
            self.tr("""<b>Stop Test</b>"""
                    """<p>This button stops a running unittest.</p>"""))
        self.stopButton.setEnabled(False)
        self.startButton.setDefault(True)
        self.startFailedButton.setEnabled(False)

        self.dbs = dbs
        self.__fromEric = fromEric

        self.setWindowFlags(self.windowFlags()
                            | Qt.WindowFlags(Qt.WindowContextHelpButtonHint))
        self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
        self.setWindowTitle(self.tr("Unittest"))
        if dbs:
            self.ui = ui
        else:
            self.localCheckBox.hide()
        self.__setProgressColor("green")
        self.progressLed.setDarkFactor(150)
        self.progressLed.off()

        self.testSuiteCompleter = E5FileCompleter(self.testsuiteComboBox)

        self.fileHistory = []
        self.testNameHistory = []
        self.running = False
        self.savedModulelist = None
        self.savedSysPath = sys.path
        if prog:
            self.insertProg(prog)

        self.rxPatterns = [
            self.tr("^Failure: "),
            self.tr("^Error: "),
        ]

        self.__failedTests = []

        # now connect the debug server signals if called from the eric6 IDE
        if self.dbs:
            self.dbs.utPrepared.connect(self.__UTPrepared)
            self.dbs.utFinished.connect(self.__setStoppedMode)
            self.dbs.utStartTest.connect(self.testStarted)
            self.dbs.utStopTest.connect(self.testFinished)
            self.dbs.utTestFailed.connect(self.testFailed)
            self.dbs.utTestErrored.connect(self.testErrored)
            self.dbs.utTestSkipped.connect(self.testSkipped)
            self.dbs.utTestFailedExpected.connect(self.testFailedExpected)
            self.dbs.utTestSucceededUnexpected.connect(
                self.testSucceededUnexpected)