Exemple #1
0
 def on_archiveButton_clicked(self):
     """
     Private slot to select the archive name via a file selection dialog.
     """
     type_ = self.typeComboBox.itemData(self.typeComboBox.currentIndex())
     
     archive = Utilities.fromNativeSeparators(self.archiveEdit.text())
     if not archive:
         archive = self.__projectPath
     
     if type_ == "files":
         archive = E5FileDialog.getExistingDirectory(
             self,
             self.tr("Select Archive Directory"),
             archive,
             E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     else:
         archive, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
             self,
             self.tr("Select Archive File"),
             archive,
             self.__fileFilters,
             None,
             E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
         if archive:
             ext = QFileInfo(archive).suffix()
             if not ext:
                 ex = selectedFilter.split("(*")[1].split(")")[0]
                 if ex:
                     archive += ex
     
     if archive:
         self.archiveEdit.setText(Utilities.toNativeSeparators(archive))
    def on_vcsUrlButton_clicked(self):
        """
        Private slot to display a selection dialog.
        """
        if self.protocolCombo.currentText() == "file://":
            directory = E5FileDialog.getExistingDirectory(
                self, self.tr("Select Repository-Directory"),
                self.vcsUrlEdit.text(),
                E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

            if directory:
                self.vcsUrlEdit.setText(
                    Utilities.toNativeSeparators(directory))
        else:
            from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
            dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self)
            dlg.start(self.protocolCombo.currentText() +
                      self.vcsUrlEdit.text())
            if dlg.exec_() == QDialog.Accepted:
                url = dlg.getSelectedUrl()
                if url:
                    protocol = url.split("://")[0]
                    path = url.split("://")[1]
                    self.protocolCombo.setCurrentIndex(
                        self.protocolCombo.findText(protocol + "://"))
                    self.vcsUrlEdit.setText(path)
    def on_archiveButton_clicked(self):
        """
        Private slot to select the archive name via a file selection dialog.
        """
        type_ = self.typeComboBox.itemData(self.typeComboBox.currentIndex())

        archive = Utilities.fromNativeSeparators(self.archiveEdit.text())
        if not archive:
            archive = self.__projectPath

        if type_ == "files":
            archive = E5FileDialog.getExistingDirectory(
                self, self.tr("Select Archive Directory"), archive,
                E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
        else:
            archive, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
                self, self.tr("Select Archive File"), archive,
                self.__fileFilters, None,
                E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
            if archive:
                ext = QFileInfo(archive).suffix()
                if not ext:
                    ex = selectedFilter.split("(*")[1].split(")")[0]
                    if ex:
                        archive += ex

        if archive:
            self.archiveEdit.setText(Utilities.toNativeSeparators(archive))
 def on_vcsUrlButton_clicked(self):
     """
     Private slot to display a selection dialog.
     """
     if self.protocolCombo.currentText() == "file://":
         directory = E5FileDialog.getExistingDirectory(
             self,
             self.tr("Select Repository-Directory"),
             self.vcsUrlEdit.text(),
             E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
         
         if directory:
             self.vcsUrlEdit.setText(
                 Utilities.toNativeSeparators(directory))
     else:
         from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
         dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self)
         dlg.start(
             self.protocolCombo.currentText() + self.vcsUrlEdit.text())
         if dlg.exec_() == QDialog.Accepted:
             url = dlg.getSelectedUrl()
             if url:
                 protocol = url.split("://")[0]
                 path = url.split("://")[1]
                 self.protocolCombo.setCurrentIndex(
                     self.protocolCombo.findText(protocol + "://"))
                 self.vcsUrlEdit.setText(path)
 def on_pathButton_clicked(self):
     """
     Private slot called to open a directory selection dialog.
     """
     path = E5FileDialog.getExistingDirectory(
         self, self.tr("Select source directory"),
         QDir.fromNativeSeparators(self.pathnameEdit.text()))
     if path:
         self.pathnameEdit.setText(QDir.toNativeSeparators(path))
 def on_pathButton_clicked(self):
     """
     Private slot called to open a directory selection dialog.
     """
     path = E5FileDialog.getExistingDirectory(
         self, self.tr("Select source directory"), QDir.fromNativeSeparators(self.pathnameEdit.text())
     )
     if path:
         self.pathnameEdit.setText(QDir.toNativeSeparators(path))
Exemple #7
0
    def on_iconDirectoryButton_clicked(self):
        """
        Private slot to select an icon directory.
        """
        dir = E5FileDialog.getExistingDirectory(
            None, self.tr("Select icon directory"), "",
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if dir:
            self.iconDirectoryEdit.setText(Utilities.toNativeSeparators(dir))
Exemple #8
0
 def on_exceptDirButton_clicked(self):
     """
     Private slot to select a file to exempt from translation.
     """
     texcept = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Exempt directory from translation"), self.project.ppath,
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if texcept:
         self.exceptionEdit.setText(Utilities.toNativeSeparators(texcept))
    def on_directoryButton_clicked(self):
        """
        Private slot called by pressing the export directory selection button.
        """
        dn = E5FileDialog.getExistingDirectory(
            self, self.tr("Export Patches"), self.directoryEdit.text(),
            E5FileDialog.Options(E5FileDialog.Option(0)))

        if dn:
            self.directoryEdit.setText(Utilities.toNativeSeparators(dn))
Exemple #10
0
    def on_dirSelectButton_clicked(self):
        """
        Private slot to display a directory selection dialog.
        """
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select directory"), self.dirCombo.currentText(),
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if directory:
            self.dirCombo.setEditText(Utilities.toNativeSeparators(directory))
    def on_flashDataPathButton_clicked(self):
        """
        Private slot to handle the flash data path selection.
        """
        path = E5FileDialog.getExistingDirectory(
            self, self.tr("Select Flash Cookies Data Path"),
            self.flashDataPathEdit.text(),
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if path:
            self.flashDataPathEdit.setText(Utilities.toNativeSeparators(path))
Exemple #12
0
    def on_dirButton_clicked(self):
        """
        Private method used to open a directory selection dialog.
        """
        cwd = self.ui.workdirCombo.currentText()
        d = E5FileDialog.getExistingDirectory(
            self, self.tr("Working directory"), cwd,
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if d:
            self.ui.workdirCombo.setEditText(Utilities.toNativeSeparators(d))
Exemple #13
0
    def on_qt4TransButton_clicked(self):
        """
        Private slot to handle the Qt4 translations directory selection.
        """
        dir = E5FileDialog.getExistingDirectory(
            self, self.tr("Select Qt4 Translations Directory"),
            self.qt4TransEdit.text(),
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if dir:
            self.qt4TransEdit.setText(Utilities.toNativeSeparators(dir))
    def on_directoryButton_clicked(self):
        """
        Private slot to select the shared directory via a directory selection
        dialog.
        """
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Shared Directory"), self.directoryEdit.text(),
            E5FileDialog.Options(E5FileDialog.Option(0)))

        if directory:
            self.directoryEdit.setText(Utilities.toNativeSeparators(directory))
Exemple #15
0
 def __newToplevelDir(self):
     """
     Private slot to handle the New toplevel directory popup menu entry.
     """
     dname = E5FileDialog.getExistingDirectory(
         None,
         QCoreApplication.translate('Browser', "New toplevel directory"),
         "", E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if dname:
         dname = os.path.abspath(Utilities.toNativeSeparators(dname))
         self.__model.addTopLevelDir(dname)
 def on_exceptDirButton_clicked(self):
     """
     Private slot to select a file to exempt from translation.
     """
     texcept = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Exempt directory from translation"),
         self.project.ppath,
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if texcept:
         self.exceptionEdit.setText(Utilities.toNativeSeparators(texcept))
Exemple #17
0
    def on_qtToolsDirButton_clicked(self):
        """
        Private slot to handle the Qt tools directory selection.
        """
        dir = E5FileDialog.getExistingDirectory(
            self, self.tr("Select Qt Tools Directory"),
            self.qtToolsDirEdit.text(),
            E5FileDialog.Options(E5FileDialog.DontUseNativeDialog))

        if dir:
            self.qtToolsDirEdit.setText(Utilities.toNativeSeparators(dir))
Exemple #18
0
 def on_dirButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select project directory"),
         self.dirEdit.text(),
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     
     if directory:
         self.dirEdit.setText(Utilities.toNativeSeparators(directory))
Exemple #19
0
 def on_iconDirectoryButton_clicked(self):
     """
     Private slot to select an icon directory.
     """
     dir = E5FileDialog.getExistingDirectory(
         None,
         self.tr("Select icon directory"),
         "",
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
         
     if dir:
         self.iconDirectoryEdit.setText(Utilities.toNativeSeparators(dir))
 def on_flashDataPathButton_clicked(self):
     """
     Private slot to handle the flash data path selection.
     """
     path = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select Flash Cookies Data Path"),
         self.flashDataPathEdit.text(),
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     
     if path:
         self.flashDataPathEdit.setText(Utilities.toNativeSeparators(path))
Exemple #21
0
 def on_directoryButton_clicked(self):
     """
     Private slot called by pressing the export directory selection button.
     """
     dn = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Export Patches"),
         self.directoryEdit.text(),
         E5FileDialog.Options(E5FileDialog.Option(0)))
     
     if dn:
         self.directoryEdit.setText(Utilities.toNativeSeparators(dn))
Exemple #22
0
 def on_qt4TransButton_clicked(self):
     """
     Private slot to handle the Qt4 translations directory selection.
     """
     dir = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select Qt4 Translations Directory"),
         self.qt4TransEdit.text(),
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
         
     if dir:
         self.qt4TransEdit.setText(Utilities.toNativeSeparators(dir))
Exemple #23
0
 def __newToplevelDir(self):
     """
     Private slot to handle the New toplevel directory popup menu entry.
     """
     dname = E5FileDialog.getExistingDirectory(
         None,
         QCoreApplication.translate('Browser', "New toplevel directory"),
         "",
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if dname:
         dname = os.path.abspath(Utilities.toNativeSeparators(dname))
         self.__model.addTopLevelDir(dname)
Exemple #24
0
    def on_targetDirButton_clicked(self):
        """
        Private slot to display a directory selection dialog.
        """
        startdir = self.targetDirEdit.text()
        if not startdir and self.startdir is not None:
            startdir = self.startdir
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select target directory"), startdir)

        if directory:
            self.targetDirEdit.setText(Utilities.toNativeSeparators(directory))
    def on_searchDirButton_clicked(self):
        """
        Private slot to handle the clicked signal of the search directory
        selection button.
        """
        searchDir = E5FileDialog.getExistingDirectory(
            None, self.tr("Select search directory"),
            self.searchDirEdit.text(),
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if searchDir:
            self.searchDirEdit.setText(Utilities.toNativeSeparators(searchDir))
 def on_newProjectButton_clicked(self):
     """
     Private slot to select the new project directory name via a directory
     selection dialog.
     """
     directory = Utilities.fromNativeSeparators(self.newProjectEdit.text())
     directory = E5FileDialog.getExistingDirectory(
         self, self.tr("New Project Directory"), directory,
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if directory:
         self.newProjectEdit.setText(
             Utilities.toNativeSeparators(directory))
Exemple #27
0
    def on_projectDirButton_clicked(self):
        """
        Private slot to display a directory selection dialog.
        """
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select Project Directory"),
            self.vcsProjectDirEdit.text(),
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if directory:
            self.vcsProjectDirEdit.setText(
                Utilities.toNativeSeparators(directory))
 def on_directoryButton_clicked(self):
     """
     Private slot to select the shared directory via a directory selection
     dialog.
     """
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Shared Directory"),
         self.directoryEdit.text(),
         E5FileDialog.Options(E5FileDialog.Option(0)))
     
     if directory:
         self.directoryEdit.setText(Utilities.toNativeSeparators(directory))
Exemple #29
0
    def on_vcsUrlButton_clicked(self):
        """
        Private slot to display a selection dialog.
        """
        if self.protocolCombo.currentText() == "file://":
            directory = E5FileDialog.getExistingDirectory(
                self, self.tr("Select Repository-Directory"),
                self.vcsUrlEdit.text(),
                E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

            if directory:
                self.vcsUrlEdit.setText(
                    Utilities.toNativeSeparators(directory))
Exemple #30
0
 def on_dirButton_clicked(self):
     """
     Private method used to open a directory selection dialog.
     """
     cwd = self.ui.workdirCombo.currentText()
     d = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Working directory"),
         cwd,
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
         
     if d:
         self.ui.workdirCombo.setEditText(Utilities.toNativeSeparators(d))
Exemple #31
0
 def on_sourceDirectoryButton_clicked(self):
     """
     Private slot to select the packages root directory via a
     directory selection dialog.
     """
     startDir = self.sourceDirectoryEdit.text() or self.__getStartDir()
     sourceDirectory = E5FileDialog.getExistingDirectory(
         self, self.tr("Source Directory"),
         Utilities.fromNativeSeparators(startDir),
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if sourceDirectory:
         self.sourceDirectoryEdit.setText(
             Utilities.toNativeSeparators(sourceDirectory))
Exemple #32
0
 def on_searchDirButton_clicked(self):
     """
     Private slot to handle the clicked signal of the search directory
     selection button.
     """
     searchDir = E5FileDialog.getExistingDirectory(
         None,
         self.tr("Select search directory"),
         self.searchDirEdit.text(),
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     
     if searchDir:
         self.searchDirEdit.setText(Utilities.toNativeSeparators(searchDir))
Exemple #33
0
 def on_packageDirButton_clicked(self):
     """
     Private slot to select a package directory via a directory
     selection dialog.
     """
     startDir = self.packageEdit.text()
     if not startDir:
         startDir = self.packageRootEdit.text() or self.__getStartDir()
     packageDir = E5FileDialog.getExistingDirectory(
         self, self.tr("Package Directory"),
         Utilities.fromNativeSeparators(startDir))
     if packageDir:
         self.packageEdit.setText(Utilities.toNativeSeparators(packageDir))
    def on_workspaceButton_clicked(self):
        """
        Private slot to display a directory selection dialog.
        """
        default = self.workspaceEdit.text()
        if default == "":
            default = Utilities.getHomeDir()
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select Workspace Directory"), default,
            E5FileDialog.Options(0))

        if directory:
            self.workspaceEdit.setText(Utilities.toNativeSeparators(directory))
 def on_vcsUrlButton_clicked(self):
     """
     Private slot to display a selection dialog.
     """
     if self.protocolCombo.currentText() == "file://":
         directory = E5FileDialog.getExistingDirectory(
             self,
             self.tr("Select Repository-Directory"),
             self.vcsUrlEdit.text(),
             E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
         
         if directory:
             self.vcsUrlEdit.setText(
                 Utilities.toNativeSeparators(directory))
Exemple #36
0
 def on_newProjectButton_clicked(self):
     """
     Private slot to select the new project directory name via a directory
     selection dialog.
     """
     directory = Utilities.fromNativeSeparators(self.newProjectEdit.text())
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("New Project Directory"),
         directory,
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if directory:
         self.newProjectEdit.setText(
             Utilities.toNativeSeparators(directory))
    def on_downloadDirButton_clicked(self):
        """
        Private slot to handle the directory selection via dialog.
        """
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select plugins download directory"),
            self.downloadDirEdit.text(),
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if directory:
            dn = Utilities.toNativeSeparators(directory)
            while dn.endswith(os.sep):
                dn = dn[:-1]
            self.downloadDirEdit.setText(dn)
Exemple #38
0
 def on_targetDirButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     startdir = self.targetDirEdit.text()
     if not startdir and self.startdir is not None:
         startdir = self.startdir
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select target directory"),
         startdir)
         
     if directory:
         self.targetDirEdit.setText(Utilities.toNativeSeparators(directory))
Exemple #39
0
    def on_virtualEnvPy2Button_clicked(self):
        """
        Private slot to select the virtual environment for Python 2 via a
        directory selection dialog.
        """
        vDir = self.virtualEnvPy2Edit.text()
        if not vDir:
            vDir = Utilities.getHomeDir()
        virtualEnv = E5FileDialog.getExistingDirectory(
            self, self.tr("Select Virtual Environment for Python 2"), vDir,
            E5FileDialog.Options(E5FileDialog.Option(0)))

        if virtualEnv:
            self.virtualEnvPy2Edit.setText(
                Utilities.toNativeSeparators(virtualEnv))
Exemple #40
0
 def on_extraSearchPathButton_clicked(self):
     """
     Private slot to select the extra search path via a directory
     selection dialog.
     """
     extraSearchPath = self.extraSearchPathEdit.text()
     if not extraSearchPath:
         extraSearchPath = Utilities.getHomeDir()
     extraSearchPath = Utilities.fromNativeSeparators(extraSearchPath)
     extraSearchPath = E5FileDialog.getExistingDirectory(
         self, self.tr("Extra Search Path for setuptools/pip"),
         extraSearchPath, E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if extraSearchPath:
         self.extraSearchPathEdit.setText(
             Utilities.toNativeSeparators(extraSearchPath))
    def on_transBinPathButton_clicked(self):
        """
        Private slot to display a directory selection dialog.
        """
        tbp = Utilities.fromNativeSeparators(self.transBinPathEdit.text())
        if not os.path.isabs(tbp):
            tbp = Utilities.fromNativeSeparators(
                os.path.join(self.project.ppath, tbp))
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select directory for binary translations"), tbp)

        if directory:
            self.transBinPathEdit.setText(
                self.project.getRelativePath(
                    Utilities.toNativeSeparators(directory)))
Exemple #42
0
 def on_targetDirectoryButton_clicked(self):
     """
     Private slot to select the target directory via a directory
     selection dialog.
     """
     target = self.targetDirectoryEdit.text()
     if not target:
         target = Utilities.getHomeDir()
     target = Utilities.fromNativeSeparators(target)
     target = E5FileDialog.getExistingDirectory(
         self, self.tr("Virtualenv Target Directory"), target,
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     if target:
         self.targetDirectoryEdit.setText(
             Utilities.toNativeSeparators(target))
Exemple #43
0
 def on_downloadDirButton_clicked(self):
     """
     Private slot to handle the directory selection via dialog.
     """
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select plugins download directory"),
         self.downloadDirEdit.text(),
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
         
     if directory:
         dn = Utilities.toNativeSeparators(directory)
         while dn.endswith(os.sep):
             dn = dn[:-1]
         self.downloadDirEdit.setText(dn)
Exemple #44
0
 def on_workspaceButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     default = self.workspaceEdit.text()
     if default == "":
         default = Utilities.getHomeDir()
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select Workspace Directory"),
         default,
         E5FileDialog.Options(0))
     
     if directory:
         self.workspaceEdit.setText(Utilities.toNativeSeparators(directory))
 def on_transBinPathButton_clicked(self):
     """
     Private slot to display a directory selection dialog.
     """
     tbp = Utilities.fromNativeSeparators(self.transBinPathEdit.text())
     if not os.path.isabs(tbp):
         tbp = Utilities.fromNativeSeparators(
             os.path.join(self.project.ppath, tbp))
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select directory for binary translations"),
         tbp)
     
     if directory:
         self.transBinPathEdit.setText(self.project.getRelativePath(
             Utilities.toNativeSeparators(directory)))
Exemple #46
0
    def on_dirButton_clicked(self):
        """
        Private slot to handle the button press for selecting the target via a
        selection dialog.
        """
        if os.path.isdir(self.source):
            target = E5FileDialog.getExistingDirectory(
                self, self.tr("Select target"), self.targetEdit.text(),
                E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
        else:
            target = E5FileDialog.getSaveFileName(
                self, self.tr("Select target"), self.targetEdit.text(), "",
                E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))

        if target:
            self.targetEdit.setText(Utilities.toNativeSeparators(target))
Exemple #47
0
    def __dirDialog(self, textEdit):
        """
        Private slot to display a directory selection dialog.
        
        @param textEdit field for the display of the selected directory name
            (QLineEdit)
        """
        startdir = textEdit.text()
        if not startdir and self.startdir is not None:
            startdir = self.startdir

        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select directory"), startdir)

        if directory:
            textEdit.setText(Utilities.toNativeSeparators(directory))
Exemple #48
0
 def __dirDialog(self, textEdit):
     """
     Private slot to display a directory selection dialog.
     
     @param textEdit field for the display of the selected directory name
         (QLineEdit)
     """
     startdir = textEdit.text()
     if not startdir and self.startdir is not None:
         startdir = self.startdir
     
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select directory"),
         startdir)
     
     if directory:
         textEdit.setText(Utilities.toNativeSeparators(directory))
    def on_qtHelpDirButton_clicked(self):
        """
        Private slot to select the output directory for the QtHelp files.
        
        It displays a directory selection dialog to
        select the directory the QtHelp files are written to.
        """
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select output directory for QtHelp files"),
            self.qtHelpDirEdit.text(),
            E5FileDialog.Options(E5FileDialog.ShowDirsOnly))

        if directory:
            # make it relative, if it is a subdirectory of the project path
            dn = Utilities.toNativeSeparators(directory)
            dn = self.project.getRelativePath(dn)
            while dn.endswith(os.sep):
                dn = dn[:-1]
            self.qtHelpDirEdit.setText(dn)
Exemple #50
0
    def on_chooseButton_clicked(self):
        """
        Private slot to choose the bookmarks file or directory.
        """
        if self.__selectedSource == "ie":
            path = E5FileDialog.getExistingDirectory(
                self, self.tr("Choose Directory ..."), self.__sourceDir,
                E5FileDialog.Options(E5FileDialog.Option(0)))
        else:
            if Globals.isMacPlatform():
                filter = "*{0}".format(os.path.splitext(self.__sourceFile)[1])
            else:
                filter = self.__sourceFile
            path = E5FileDialog.getOpenFileName(self,
                                                self.tr("Choose File ..."),
                                                self.__sourceDir, filter)

        if path:
            self.fileEdit.setText(Utilities.toNativeSeparators(path))
 def on_qtHelpDirButton_clicked(self):
     """
     Private slot to select the output directory for the QtHelp files.
     
     It displays a directory selection dialog to
     select the directory the QtHelp files are written to.
     """
     directory = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Select output directory for QtHelp files"),
         self.qtHelpDirEdit.text(),
         E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
         
     if directory:
         # make it relative, if it is a subdirectory of the project path
         dn = Utilities.toNativeSeparators(directory)
         dn = self.project.getRelativePath(dn)
         while dn.endswith(os.sep):
             dn = dn[:-1]
         self.qtHelpDirEdit.setText(dn)
Exemple #52
0
    def on_ignoreDirButton_clicked(self):
        """
        Private slot to select a directory to be ignored.
        
        It displays a directory selection dialog to
        select a directory to be ignored.
        """
        startDir = Utilities.fromNativeSeparators(self.ignoreDirEdit.text())
        if not startDir:
            startDir = self.ppath
        directory = E5FileDialog.getExistingDirectory(
            self, self.tr("Select directory to exclude"), startDir, E5FileDialog.Options(E5FileDialog.ShowDirsOnly)
        )

        if directory:
            # make it relative, if it is a subdirectory of the project path
            dn = Utilities.toNativeSeparators(directory)
            dn = self.project.getRelativePath(dn)
            while dn.endswith(os.sep):
                dn = dn[:-1]
            self.ignoreDirEdit.setText(dn)
Exemple #53
0
 def on_dirButton_clicked(self):
     """
     Private slot to handle the button press for selecting the target via a
     selection dialog.
     """
     if os.path.isdir(self.source):
         target = E5FileDialog.getExistingDirectory(
             self,
             self.tr("Select target"),
             self.targetEdit.text(),
             E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
     else:
         target = E5FileDialog.getSaveFileName(
             self,
             self.tr("Select target"),
             self.targetEdit.text(),
             "",
             E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
     
     if target:
         self.targetEdit.setText(Utilities.toNativeSeparators(target))
 def on_pathButton_clicked(self):
     """
     Private slot to handle the path selection via a directory selection
     dialog.
     """
     path = E5FileDialog.getExistingDirectory(
         self,
         self.tr("Add Sub-repository"),
         os.path.join(self.__projectPath, self.pathEdit.text()),
         E5FileDialog.Options(E5FileDialog.Option(0)))
     
     if path:
         path = Utilities.toNativeSeparators(path)
         if path.startswith(self.__projectPath):
             path = path.replace(self.__projectPath, "")[1:]
             self.pathEdit.setText(path)
         else:
             E5MessageBox.critical(
                 self,
                 self.tr("Add Sub-repository"),
                 self.tr("""The sub-repository path must be inside"""
                         """ the project."""))
             return
 def on_chooseButton_clicked(self):
     """
     Private slot to choose the bookmarks file or directory.
     """
     if self.__selectedSource == "ie":
         path = E5FileDialog.getExistingDirectory(
             self,
             self.tr("Choose Directory ..."),
             self.__sourceDir,
             E5FileDialog.Options(E5FileDialog.Option(0)))
     else:
         if Globals.isMacPlatform():
             filter = "*{0}".format(os.path.splitext(self.__sourceFile)[1])
         else:
             filter = self.__sourceFile
         path = E5FileDialog.getOpenFileName(
             self,
             self.tr("Choose File ..."),
             self.__sourceDir,
             filter)
     
     if path:
         self.fileEdit.setText(Utilities.toNativeSeparators(path))