Exemplo n.º 1
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))
    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))
Exemplo n.º 3
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))
Exemplo n.º 4
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_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 + os.sep):
                path = path.replace(self.__projectPath + os.sep, "")
                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