Saves the current shortuct settings to the current item.
        
        :return     <bool> success
187939
def updateShortcut( self ):
        
        aitem = self.uiActionTREE.currentItem()
        if ( not aitem ):
            return True
        
        scut = self.uiShortcutTXT.text()
        if ( not scut ):
            aitem.setText(1, '')
            return True
            
        for i in range(self.uiActionTREE.topLevelItemCount()):
            item = self.uiActionTREE.topLevelItem(i)
            if (item != aitem and item.text(1) == scut):
                msg = '%s already is using the %s shortcut.' % (item.text(0),
                                                                scut)
                QMessageBox.critical( self,
                                      'Duplicate Shortcut',
                                      msg )
                return False
        
        # update the item
        aitem.setText(1, scut)
        return True
218567
def Persist(self, config_option):
    """"""
    if not self.writeback:
      raise RuntimeError("Attempting to write a configuration without a "
                         "writeback location.")

    writeback_raw_value = dict(self.writeback.RawData()).get(config_option)
    raw_value = None

    for parser in [self.parser] + self.secondary_config_parsers:
      if parser == self.writeback:
        continue

      config_raw_data = dict(parser.RawData())
      raw_value = config_raw_data.get(config_option)
      if raw_value is None:
        continue
      break

    if writeback_raw_value == raw_value:
      return

    if raw_value is None:
      return

    self.SetRaw(config_option, raw_value)
    self.Write()
260638
def quick_layout_save(self):
        """"""
        get = CONF.get
        set_ = CONF.set
        names = get('quick_layouts', 'names')
        order = get('quick_layouts', 'order')
        active = get('quick_layouts', 'active')

        dlg = self.dialog_layout_save(self, names)

        if dlg.exec_():
            name = dlg.combo_box.currentText()

            if name in names:
                answer = QMessageBox.warning(self, _("Warning"),
                                             _("Layout <b>%s</b> will be \
                                               overwritten. Do you want to \
                                               continue?") % name,
                                             QMessageBox.Yes | QMessageBox.No)
                index = order.index(name)
            else:
                answer = True
                if None in names:
                    index = names.index(None)
                    names[index] = name
                else:
                    index = len(names)
                    names.append(name)
                order.append(name)

            # Always make active a new layout even if it overwrites an inactive
            # layout
            if name not in active:
                active.append(name)

            if answer:
                self.save_current_window_settings('layout_{}/'.format(index),
                                                  section='quick_layouts')
                set_('quick_layouts', 'names', names)
                set_('quick_layouts', 'order', order)
                set_('quick_layouts', 'active', active)
                self.quick_layout_set_menu()
87619
def save():
    
    from .models import ModuleInfo

    logger = logging.getLogger(__name__)
    logger.info("Saving changes")

    # Save + restart
    for module in modules():
        if module.enabled:
            if module.changed:
                module.save()
                module.restart()
                module.commit()
            else:
                logger.debug('Not saving unchanged module: %s' %
                             module.verbose_name)
        else:
            logger.debug('Not saving disabled module: %s' %
                         module.verbose_name)

    # Commit
    ModuleInfo.commit()

    logger.info("Changes saved")
633967
private void saveSettings() {
        mPinViewSettings = new PinViewSettings.Builder()
                .withColorSplit(mColorSplit)
                .withColorTextPinBox(mColorTextPinBoxes)
                .withColorTextTitles(mColorTextTitles)
                .withCustomDrawablePinBox(mCustomDrawablePinBox)
                .withDeleteOnClick(isDeleteOnClick())
                .withNativePinBox(isNativePinBox())
                .withSplit(getSplit())
                .withMaskPassword(isMaskPassword())
                .withKeyboardMandatory(isKeyboardMandatory())
                .withNumberCharacters(getNumberCharacters())
                .withSizeSplit(getSizeSplit())
                .withTextSizePinBox(getTextSizePinBoxes())
                .withTextSizeTitles(getTextSizeTitles())
                .withNumberPinBoxes(getNumberPinBoxes())
                .withPinTitles(getPinTitles())
                .build();
    }
1039914
def save( self ):
        
        dataSet = self.dataSet()
        if ( not dataSet ):
            return True
        
        # lookup widgets based on the data set information
        for widget in self.findChildren(QWidget):
            prop = unwrapVariant(widget.property('dataName'))
            if prop is None:
                continue
            
            # update the data for the dataset
            value, success = projexui.widgetValue(widget)
            if not success:
                continue
                
            dataSet.setValue(prop, value)
        
        return self.plugin().save()
600608
def save_settings(self, settings_file):
        """"""
        settings = {}
        for parameter in self.parameter_maxima:
            settings[parameter] = self.__getattribute__(parameter)
        with open(settings_file, "w") as settings_file:
            simplejson.dump(settings, settings_file)
831407
def saveSettings( self, settings ):
        
        dataSet = self.dataSet()
        if ( not dataSet ):
            return False
        
        projexui.saveDataSet( settings, 
                              self.uniqueName(),
                              dataSet )
        
        return True
64816
def on_save_as(self):
        
        self.tabWidget.save_current_as()
        self._update_status_bar(self.tabWidget.current_widget())
1199864
def save(options={:validate => true})
      context = self.new_record? ? :create : :update
      return false if options[:validate] && !valid?(context)
      
      run_callbacks(context) do
        if context == :create
          key = self.class.persistence.insert(self)
        else
          key = self.class.persistence.update(self)
        end
        self.persist!
        key
      end
    end
1249615
function (evt) {
            if (evt.type === "tap") {
                var cfg = this._cfg;
                if (!cfg) {
                    // Widget already disposed
                    return true;
                }

                if ((cfg.tapToToggle || cfg.tapToMove) && this._isSwitch) {
                    // With this configuration, on tap we want to toggle the value
                    this._value = this._value >= this._switchThreshold ? 0 : 1;
                } else if (cfg.tapToMove) {
                    this._savedX = evt.detail.currentX - this._sliderDimension.x - this._sliderWidth / 2;
                    this._savedX = (this._savedX > this._railWidth) ? this._railWidth : this._savedX;
                    this._value = Math.max(this._savedX / this._railWidth, 0);
                }
                this._storeValue();
                this._setLeftPosition();
                this._updateDisplay();
            }
        }
734863
public function saveSettings()
    {
        $formValues = $this->getForm()->getValues();
        $settingStorage = $this->getSettingsStorage();

        $configValue = $formValues[self::SOURCE_RADIO_NAME];
        if ($configValue === 'list') {
            $sources = trim(str_replace("\r", '', $formValues[self::SOURCE_LIST_NAME]));
            $sources = explode("\n", $sources);
            $settingStorage->set(CspHeaderSettingsInterface::CSP_HEADER_LIST, json_encode($sources));
        }

        $settingStorage->set(CspHeaderSettingsInterface::CSP_HEADER_SETTING, $configValue);
    }
1137629
public function save()
    {
        if( is_admin() && !empty( $_POST ) ) {
            do_action('wpExpressSettingsPageBeforeSave', $this, $_POST);

            foreach( $this->fields->toArray() as $fieldName => $field ) {

                $optionName = "{$this->fieldPrefix}{$fieldName}";

                if( isset( $_POST[$fieldName] ) ) {

                    update_option($optionName, $_POST[$fieldName]);
                    // Update the field value :D
                    $this->fields($fieldName)->setValue($_POST[$fieldName]);
                }

            }

            do_action('wpExpressSettingsPageAfterSave', $this, $_POST);
        }
    }
1234741
def save
      run_callbacks(:before_save)
      run_callbacks(:before_create) unless self.is_created

      existing_items = self.class.all
      if self.new_record?
        existing_items << self
      else # update existing record
        updated_item = existing_items.find { |item| item.id == self.id }
        return false unless updated_item
        updated_item.attributes = self.attributes
      end

      raw_data = existing_items ? existing_items.map { |item| item.persisted_attributes } : []
      self.class.write_contents(raw_data) if self.valid?

      run_callbacks(:after_create) unless self.is_created
      run_callbacks(:after_save)
      true
    rescue IOError
      false
    end
269771
def update_shortcut_settings(self):
        
        self.shortcut_list_store.clear()
        shortcuts = self.gui_config_model.get_current_config_value("SHORTCUTS", use_preliminary=True, default={})
        actions = sorted(shortcuts.keys())
        for action in actions:
            keys = shortcuts[action]
            self.shortcut_list_store.append((str(action), str(keys)))
1270913
def hasUnsavedChanges(self):
        

        # Sanity check - this case shouldn't occur
        assert self._lastSavedState is not None, \
               "BUG: Please report this as it should never occur."

        # Force the current GUI values into our model in memory, but don't
        # change anything.  Don't save to file, don't even convert bad
        # values to their previous state in the gui.  Note that this can
        # leave the GUI in a half-saved state, but since we are about to exit
        # this is OK.  We only want prompting to occur if they decide to save.
        badList = self.checkSetSaveEntries(doSave=False, fleeOnBadVals=True,
                                           allowGuiChanges=False)
        if badList:
            return True

        # Then compare our data to the last known saved state.  MAKE SURE
        # the LHS is the actual dict (and not 'self') to invoke the dict
        # comparison only.
        return self._lastSavedState != self._taskParsObj
701996
def _save_settings(self):
        
        if self._autosettings_path == None: return
        
        # 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)
        
        # Create a Qt settings object
        settings = _g.QtCore.QSettings(path, _g.QtCore.QSettings.IniFormat)
        settings.clear()
        
        # Save values
        if hasattr_safe(self._window, "saveState"):
            settings.setValue('State',self._window.saveState())
        settings.setValue('Geometry', self._window.saveGeometry())