def create_new_project(self): """Create new project.""" self.unmaximize() active_project = self.current_active_project dlg = ProjectDialog(self, project_types=self.get_project_types()) result = dlg.exec_() data = dlg.project_data root_path = data.get("root_path", None) project_type = data.get("project_type", EmptyProject.ID) if result: # A project was not open before if active_project is None: if self.get_option('visible_if_project_open'): self.show_explorer() else: # We are switching projects. # TODO: Don't emit sig_project_closed when we support # multiple workspaces. self.sig_project_closed.emit(active_project.root_path) self._create_project(root_path, project_type_id=project_type) self.sig_pythonpath_changed.emit() self.restart_consoles() dlg.close()
def create_new_project(self): """Create new project""" active_project = self.current_active_project dlg = ProjectDialog(self) dlg.sig_project_creation_requested.connect(self._create_project) dlg.sig_project_creation_requested.connect(self.sig_project_created) if dlg.exec_(): if (active_project is None and self.get_option('visible_if_project_open')): self.show_explorer() self.sig_pythonpath_changed.emit() self.restart_consoles()
def create_new_project(self): """Create new project""" self.switch_to_plugin() active_project = self.current_active_project dlg = ProjectDialog(self) dlg.sig_project_creation_requested.connect(self._create_project) dlg.sig_project_creation_requested.connect(self.sig_project_created) if dlg.exec_(): if (active_project is None and self.get_option('visible_if_project_open')): self.show_explorer() self.sig_pythonpath_changed.emit() self.restart_consoles()
def create_new_project(self): """Create new project.""" self.unmaximize() dlg = ProjectDialog(self.get_widget(), project_types=self.get_project_types()) result = dlg.exec_() data = dlg.project_data root_path = data.get("root_path", None) project_type = data.get("project_type", EmptyProject.ID) if result: self._create_project(root_path, project_type_id=project_type) dlg.close()
def create_new_project(self): """Create new project""" self.unmaximize() active_project = self.current_active_project dlg = ProjectDialog(self) dlg.sig_project_creation_requested.connect(self._create_project) dlg.sig_project_creation_requested.connect(self.sig_project_created) if dlg.exec_(): # A project was not open before if active_project is None: if self.get_option('visible_if_project_open'): self.show_explorer() else: # We are switching projects. # TODO: Don't emit sig_project_closed when we support # multiple workspaces. self.sig_project_closed.emit(active_project.root_path) self.sig_pythonpath_changed.emit() self.restart_consoles()