def applyButton_clicked_cb(self, widget):
        """Callback executed when the user clicks on the apply button"""
        workspacePath = self.getSelectedWorkspace()
        # We verify the workspace can be loaded.
        # if it can, we stop the current GTK
        if workspacePath is None or len(workspacePath) == 0:
            self.setError(_("No workspace provided."))
        else:
            logging.debug("Create the requested workspace")
            try:
                ResourcesConfiguration.createWorkspace(workspacePath)
            except OSError as e:
                self.log.warning("Impossible to create a workspace : {0}".format(e))
                self.setError("Impossible to create a workspace here.")

                return

            (workspace, error) = (Workspace.loadWorkspace(self._selectedWorkspace))
            if workspace is not None:
                # If we managed to load the given workspace, we save it and stop the GTK
                ResourcesConfiguration.generateUserFile(self._selectedWorkspace)
                self.loadedWorkspace = workspace
                self.stop()
            else:
                self.setError(error)
    def applyButton_clicked_cb(self, widget):
        """Callback executed when the user clicks on the apply button"""
        workspacePath = self.getSelectedWorkspace()
        # We verify the workspace can be loaded.
        # if it can, we stop the current GTK
        if workspacePath is None or len(workspacePath) == 0:
            self.setError(_("No workspace provided."))
        else:
            logging.debug("Create the requested workspace")
            try:
                ResourcesConfiguration.createWorkspace(workspacePath)
            except OSError as e:
                self.log.warning(
                    "Impossible to create a workspace : {0}".format(e))
                self.setError("Impossible to create a workspace here.")

                return

            (workspace,
             error) = (Workspace.loadWorkspace(self._selectedWorkspace))
            if workspace is not None:
                # If we managed to load the given workspace, we save it and stop the GTK
                ResourcesConfiguration.generateUserFile(
                    self._selectedWorkspace)
                self.loadedWorkspace = workspace
                self.stop()
            else:
                self.setError(error)
예제 #3
0
    def currentWorkspaceHasChanged(self):
        """currentWorkspaceHasChanged:
        Execute the operations which must be done when
        the current workspace has changed :
        - Update the view,
        - Save the new workspace."""
        if self.controller.getCurrentWorkspace() is not None:
            ResourcesConfiguration.generateUserFile(self.controller.getCurrentWorkspace().getPath(), ResourcesConfiguration.extractAPIKeyDefinitionFromLocalFile())

        self.currentProjectHasChanged()
        self.updateSwitchProjectMenu(self.controller.getCurrentWorkspace().getNameOfProjects())
예제 #4
0
    def currentWorkspaceHasChanged(self):
        """currentWorkspaceHasChanged:
        Execute the operations which must be done when
        the current workspace has changed :
        - Update the view,
        - Save the new workspace."""
        if self.controller.getCurrentWorkspace() is not None:
            ResourcesConfiguration.generateUserFile(
                self.controller.getCurrentWorkspace().getPath(),
                ResourcesConfiguration.extractAPIKeyDefinitionFromLocalFile())

        self.currentProjectHasChanged()
        self.updateSwitchProjectMenu(
            self.controller.getCurrentWorkspace().getNameOfProjects())