Save configuration: opened projects & tree widget state.

        Also save whether dock widget is visible if a project is open.
348820
def save_config(self):
        
        self.set_option('recent_projects', self.recent_projects)
        self.set_option('expanded_state',
                        self.explorer.treewidget.get_expanded_state())
        self.set_option('scrollbar_position',
                        self.explorer.treewidget.get_scrollbar_position())
        if self.current_active_project and self.dockwidget:
            self.set_option('visible_if_project_open',
                            self.dockwidget.isVisible())
381654
def save_config(self, config_path=None):
        """"""
        if config_path is None:
            config_path = self.config_path
        else:
            self.config_path = config_path

        with open(config_path, 'w') as f:
            self.config.write(f)
116080
private boolean askToSave() {
        if (mainFrame.isProjectChanged()) {
            int response = JOptionPane.showConfirmDialog(mainFrame, L10N.getLocalString("dlg.save_current_changes",
                    "The current project has been changed, Save current changes?"), L10N.getLocalString("dlg.save_changes",
                            "Save Changes?"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);

            if (response == JOptionPane.YES_OPTION) {
                if (mainFrame.getSaveFile() != null) {
                    save();
                } else {
                    saveAs();
                }
            } else if (response == JOptionPane.CANCEL_OPTION)
            {
                return true;
                // IF no, do nothing.
            }
        }
        return false;
    }
531078
def save_visible_toolbars(self):
        """"""
        toolbars = []
        for toolbar in self.visible_toolbars:
            toolbars.append(toolbar.objectName())
        CONF.set('main', 'last_visible_toolbars', toolbars)
912931
def save_config(self):
        """"""
        for option, value in list(self.explorer.get_options().items()):
            self.set_option(option, value)
        self.set_option('expanded_state',
                        self.explorer.treewidget.get_expanded_state())
        self.set_option('scrollbar_position',
                        self.explorer.treewidget.get_scrollbar_position())
74798
def restore_initial_state(self):
        """"""
        self.list.clear()
        self.is_visible = False
        widgets = self.widgets_by_path

        if not self.edit.clicked_outside:
            for path in self.initial_cursors:
                cursor = self.initial_cursors[path]
                if path in widgets:
                    self.set_editor_cursor(widgets[path], cursor)

            if self.initial_widget in self.paths_by_widget:
                index = self.paths.index(self.initial_path)
                self.sig_goto_file.emit(index)
590946
def save(self):
		
		with open(self.configuration_file, 'w') as file_h:
			file_h.write(self._serializer('dumps', self._storage))
1271358
def register_plugin(self):
        """"""
        main = self.main
        main.add_dockwidget(self)

        #if getattr(main.projectexplorer, 'sig_project_closed', False):
        #    pe = main.projectexplorer
        #    pe.condamanager = self
        #    pe.sig_project_closed.connect(self.project_closed)
        #    pe.sig_project_loaded.connect(self.project_loaded)
        #    self.sig_worker_ready.connect(self._after_load)
        #    self.sig_environment_created.connect(pe.sig_environment_created)

        self.sig_channels_updated.connect(self._save_channel_settings)
746492
def save_option(self, path, section, option, value):
        
        config = ConfigParser.SafeConfigParser()
        config.read(path)
        if not config.has_section(section):
            config.add_section(section)
        config.set(section, option, value)
        fp = open(path, 'w')
        config.write(fp)
        fp.close()
        if not self.has_section(section):
            self.add_section(section)
        self.set(section, option, value)
1149950
@SuppressWarnings("static-method")
	protected boolean saveProjectSpecificOptions(IProject project, boolean useSpecificOptions) {
		if (project != null) {
			try {
				project.setPersistentProperty(
						qualify(PROPERTY_NAME_HAS_PROJECT_SPECIFIC),
						Boolean.toString(useSpecificOptions));
				return true;
			} catch (CoreException e) {
				SARLEclipsePlugin.getDefault().log(e);
			}
		}
		return false;
	}
1162062
def saveSettings(self):
        
        try:
            self.saveProfile()
        except Exception as ex:
            # Continue, even if saving the settings fails.
            logger.warn(ex)
            if DEBUGGING:
                raise
        finally:
            self._settingsSaved = True
710914
def save(self):
        
        if not os.path.exists(self.paths.virt()):
            os.makedirs(self.paths.virt())

        self._save_metadata()
        self.virt_env.save()
1252907
def save(self):
        """"""
        try:
            os.makedirs(os.path.dirname(self._configfile))
        except:
            pass

        with open(self._configfile, 'w') as f:
            self._config.write(f)
827799
def post_visible_setup(self):
        """"""
        self.restore_scrollbar_position.emit()

        # [Workaround for Issue 880]
        # QDockWidget objects are not painted if restored as floating
        # windows, so we must dock them before showing the mainwindow,
        # then set them again as floating windows here.
        for widget in self.floating_dockwidgets:
            widget.setFloating(True)

        # In MacOS X 10.7 our app is not displayed after initialized (I don't
        # know why because this doesn't happen when started from the terminal),
        # so we need to resort to this hack to make it appear.
        if running_in_mac_app():
            idx = __file__.index(MAC_APP_NAME)
            app_path = __file__[:idx]
            subprocess.call(['open', app_path + MAC_APP_NAME])

        # Server to maintain just one Spyder instance and open files in it if
        # the user tries to start other instances with
        # $ spyder foo.py
        if (CONF.get('main', 'single_instance') and not self.new_instance
                and self.open_files_server):
            t = threading.Thread(target=self.start_open_files_server)
            t.setDaemon(True)
            t.start()

            # Connect the window to the signal emmited by the previous server
            # when it gets a client connected to it
            self.sig_open_external_file.connect(self.open_external_file)

        # Create Plugins and toolbars submenus
        self.create_plugins_menu()
        self.create_toolbars_menu()

        # Update toolbar visibility status
        self.toolbars_visible = CONF.get('main', 'toolbars_visible')
        self.load_last_visible_toolbars()

        # Update lock status
        self.lock_interface_action.setChecked(self.interface_locked)

        # Hide Internal Console so that people don't use it instead of
        # the External or IPython ones
        if self.console.dockwidget.isVisible() and DEV is None:
            self.console.toggle_view_action.setChecked(False)
            self.console.dockwidget.hide()

        # Show Help and Consoles by default
        plugins_to_show = [self.ipyconsole]
        if self.help is not None:
            plugins_to_show.append(self.help)
        for plugin in plugins_to_show:
            if plugin.dockwidget.isVisible():
                plugin.dockwidget.raise_()

        # Show history file if no console is visible
        if not self.ipyconsole.isvisible:
            self.historylog.add_history(get_conf_path('history.py'))

        if self.open_project:
            self.projects.open_project(self.open_project)
        else:
            # Load last project if a project was active when Spyder
            # was closed
            self.projects.reopen_last_project()

            # If no project is active, load last session
            if self.projects.get_active_project() is None:
                self.editor.setup_open_files()

        # Check for spyder updates
        if DEV is None and CONF.get('main', 'check_updates_on_startup'):
            self.give_updates_feedback = False
            self.check_updates(startup=True)

        # Show dialog with missing dependencies
        self.report_missing_dependencies()

        # Raise the menuBar to the top of the main window widget's stack
        # (Fixes issue 3887)
        self.menuBar().raise_()
        self.is_setting_up = False
493531
def save(self, *args, **kwargs):
        
        if 'node' not in self.shortcuts:
            self.shortcuts['node'] = self.device.node

        if 'user' not in self.shortcuts and self.device.node.user:
            self.shortcuts['user'] = self.device.node.user

        if 'layer' not in self.shortcuts and 'nodeshot.core.layers' in settings.INSTALLED_APPS:
            self.shortcuts['layer'] = self.device.node.layer

        super(Interface, self).save(*args, **kwargs)
168384
def show_explorer(self):
        """"""
        if self.dockwidget is not None:
            if self.dockwidget.isHidden():
                self.dockwidget.show()
            self.dockwidget.raise_()
            self.dockwidget.update()
191484
def save_gui_settings(self, *a):
        
        
        # only if we're supposed to!
        if self._autosettings_path:

            # Get the gui settings directory
            gui_settings_dir = _os.path.join(_cwd, 'egg_settings')

            # make sure the directory exists
            if not _os.path.exists(gui_settings_dir): _os.mkdir(gui_settings_dir)

            # make a path with a sub-directory
            path = _os.path.join(gui_settings_dir, self._autosettings_path)
            
            # for saving header info
            d = _d.databox()

            # add all the controls settings
            for x in self._autosettings_controls: self._store_gui_setting(d, x)

            # save the file
            d.save_file(path, force_overwrite=True)