Beispiel #1
0
    def _onGetBranchesReply(self, repos, reply):
        """
        Called when the list of branches is received.

        :param repos: the list of repositories
        :param reply: the reply from the server
        """
        dialog = OpenDialog(self._plugin, repos, reply.branches)
        dialog.accepted.connect(partial(self._dialogAccepted, dialog))
        dialog.exec_()
Beispiel #2
0
    def openFolder(self, path=None):
        """
            Ask the user to open a folder (directory) via
            the Open Folder dialog. Then open it in the tree,
            editor, and HTML preview windows.
        """
        if not path:
            dialog = OpenDialog()
            dialog.set_folders_only(True)
            path = dialog.getExistingDirectory(self, "Open Folder", '')

        if path:
            self.handleFileChanged(path)
Beispiel #3
0
    def openFile(self, path=None):
        """
            Ask the user to open a file via the Open File dialog.
            Then open it in the tree, editor, and HTML preview windows.
        """
        if not path:
            dialog = OpenDialog()
            dialog.set_folders_only(False)
            path = dialog.getOpenFileName(
                self, "Open File", '', "ReStructuredText Files (*.rst *.txt)")

        if path:
            file_path = Path(path[0])
            filename = file_path.name
            tree_dir = file_path.parent.absolute()
            self.handleFileChanged(tree_dir, filename)
Beispiel #4
0
    def openFolder(self, path=None):
        """
            Ask the user to open a folder (directory) via
            the Open Folder dialog. Then open it in the tree,
            editor, and HTML preview windows.
        """
        if not path:
            dialog = OpenDialog()
            dialog.set_folders_only(True)
            path = dialog.getExistingDirectory(self, "Open Folder", '')

        if path:
            self.handleFileChanged(path)  #, filename='index.rst')
            with open('./config.json', 'r') as f:
                c = json.load(f)
            c['last_folder'] = path
            with open('./config.json', 'w') as f:
                json.dump(c, f)