things to be done when gui closes, like save the settings
545534
def closeEvent(self, event):
        

        self.script_thread.quit()
        self.read_probes.quit()
        if self.config_filename:
            fname = self.config_filename
            self.save_config(fname)

        event.accept()

        print('\n\n======================================================')
        print('================= Closing B26 Python LAB =============')
        print('======================================================\n\n')
404395
def _resetWidgets(self):
        
        self._filenameLineEdit.setText('')
        self._encodingComboBox.setCurrentIndex(0)
        self._delimiterBox.reset()
        self._headerCheckBox.setChecked(False)
        self._statusBar.showMessage('')
        self._previewTableView.setModel(None)
        self._datatypeTableView.setModel(None)
10384
def _store_gui_setting(self, databox, name):
        
        try:    databox.insert_header(name, eval(name + ".get_value()"))
        except: print("ERROR: Could not store gui setting "+repr(name))
727628
def save_current_window_settings(self, prefix, section='main',
                                     none_state=False):
        """"""
        win_size = self.window_size
        prefs_size = self.prefs_dialog_size

        CONF.set(section, prefix+'size', (win_size.width(), win_size.height()))
        CONF.set(section, prefix+'prefs_dialog_size',
                 (prefs_size.width(), prefs_size.height()))
        CONF.set(section, prefix+'is_maximized', self.isMaximized())
        CONF.set(section, prefix+'is_fullscreen', self.isFullScreen())
        pos = self.window_position
        CONF.set(section, prefix+'position', (pos.x(), pos.y()))
        self.maximize_dockwidget(restore=True)# Restore non-maximized layout
        if none_state:
            CONF.set(section, prefix + 'state', None)
        else:
            qba = self.saveState()
            CONF.set(section, prefix + 'state', qbytearray_to_str(qba))
        CONF.set(section, prefix+'statusbar',
                    not self.statusBar().isHidden())
895644
def save_state(self):
        """"""
        set_setting('lastSourceDir', self.source_directory.text())
        set_setting('lastOutputDir', self.output_directory.text())
        set_setting(
            'useDefaultOutputDir', self.scenario_directory_radio.isChecked())
346904
def saveSettings(self, settings):
        
        # save order data
        settings.setValue('headerState', wrapVariant(str(self.header().saveState().toBase64())))
        settings.setValue('sortColumn', wrapVariant(str(self.sortColumn())))
        settings.setValue('sortOrder', wrapVariant(str(int(self.sortOrder()))))
        settings.setValue('sortingEnabled', wrapVariant(str(self.isSortingEnabled())))
962874
def saveSettings(self):
        """"""
        self.settings.beginGroup('mainwindow')
        self.settings.setValue('geometry', self.saveGeometry())
        self.settings.setValue('windowstate', self.saveState())
        self.settings.setValue('path_to_ramp_file', self.path_to_ramp_file)
        self.settings.setValue('path_to_load_mot_file',
                               self.path_to_load_mot_file)
        self.settings.endGroup()
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())
233524
void shutdown() {
        runnableProcessor.shutdown();
        if (cursor != null) {
            cursor.shutdown();
        }
        if (screen != null) {
            screen.shutdown();
        }
    }
915856
def closing_plugin(self, cancelable=False):
        """"""
        state = self.splitter.saveState()
        self.set_option('splitter_state', qbytearray_to_str(state))
        filenames = []
        editorstack = self.editorstacks[0]

        active_project_path = None
        if self.projects is not None:
             active_project_path = self.projects.get_active_project_path()
        if not active_project_path:
            self.set_open_filenames()
        else:
            self.projects.set_project_filenames(
                [finfo.filename for finfo in editorstack.data])

        self.set_option('layout_settings',
                        self.editorsplitter.get_layout_settings())
        self.set_option('windows_layout_settings',
                    [win.get_layout_settings() for win in self.editorwindows])
#        self.set_option('filenames', filenames)
        self.set_option('recent_files', self.recent_files)

        # Stop autosave timer before closing windows
        self.autosave.stop_autosave_timer()

        try:
            if not editorstack.save_if_changed(cancelable) and cancelable:
                return False
            else:
                for win in self.editorwindows[:]:
                    win.close()
                return True
        except IndexError:
            return True
369338
def _resetWidgets(self):
        
        self._filenameLineEdit.setText('')
        self._encodingComboBox.setCurrentIndex(self._idx)
        self._delimiterBox.reset()
        self._headerCheckBox.setChecked(False)
        self._statusBar.showMessage('')
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())
69049
def _set_save_states(self):
        """"""

        wx.BeginBusyCursor()
        self.saving = True
        self.grid.Disable()
1347079
protected void closeDialog() {
		if (m_CustomEditor instanceof Container) {
			Dialog dlg = PropertyDialog.getParentDialog((Container) m_CustomEditor);
			if (dlg != null)
				dlg.setVisible(false);
		}
	}
1220090
private void setupComponents() {
		cancelButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});

		finishButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				JOptionPane.showMessageDialog(getContentPane(), "Wizard finished!");
				dispose();
			}
		});

		cancelButton.setMnemonic(KeyEvent.VK_C);
		previousButton.setMnemonic(KeyEvent.VK_P);
		nextButton.setMnemonic(KeyEvent.VK_N);
		finishButton.setMnemonic(KeyEvent.VK_F);

		wizardPageContainer.addContainerListener(new MinimumSizeAdjuster());
	}
787988
public void clear() {
        getElement().clear();
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIAction(UIActions.CLEARED);
        }
    }
65316
function() {
			this.writeDebug('closeDirections');

			// Close directions callback
			if (this.settings.callbackCloseDirections) {
				this.settings.callbackCloseDirections.call(this);
			}

			// Remove the close icon, remove the directions, add the list back
			this.reset();

			if ((olat) && (olng)) {
				if (this.countFilters() === 0) {
					this.settings.mapSettings.zoom = originalZoom;
				}
				else {
					this.settings.mapSettings.zoom = 0;
				}
				this.processForm(null);
			}

			$(document).off('click.'+pluginName, '.' + this.settings.locationList + ' .bh-sl-close-icon');
		}