private void saveSettings() {
    String[] resolution = ((String) view.getCmbResolution().getSelectedItem()).split("x");
    if (resolution.length == 2) {
      settings.setWidth(Integer.parseInt(resolution[0]));
      settings.setHeight(Integer.parseInt(resolution[1]));
    } else {
      log.fine("Bad resolution format, reverting to previously saved");
      view.getCmbResolution().setSelectedItem(settings.getWidth() + "x" + settings.getHeight());
    }
    String framerate = (String) view.getCmbFramerate().getSelectedItem();
    settings.setFramerate(Integer.parseInt(framerate));
    settings.setHud(Key.Hud.getAllowedValues().get(view.getCmbHud().getSelectedIndex()));
    settings.setViewmodelSwitch(Key.ViewmodelSwitch.getAllowedValues().get(
        view.getCmbViewmodel().getSelectedIndex()));
    settings.setViewmodelFov((int) view.getSpinnerViewmodelFov().getValue());
    settings
        .setDxlevel(Key.DxLevel.getAllowedValues().get(view.getCmbQuality().getSelectedIndex()));
    settings.setMotionBlur(view.getEnableMotionBlur().isSelected());
    settings.setCombattext(!view.getDisableCombatText().isSelected());
    settings.setCrosshair(!view.getDisableCrosshair().isSelected());
    settings.setCrosshairSwitch(!view.getDisableCrosshairSwitch().isSelected());
    settings.setHitsounds(!view.getDisableHitSounds().isSelected());
    settings.setVoice(!view.getDisableVoiceChat().isSelected());
    settings.setSkybox((String) view.getCmbSkybox().getSelectedItem());
    Path tfpath = settings.getTfPath();
    List<String> selected = new ArrayList<>();
    for (CustomPath cp : customPaths.getList()) {
      Path path = cp.getPath();
      if (!cp.getContents().contains(PathContents.READONLY) && cp.isSelected()) {
        String key = (path.startsWith(tfpath) ? "tf*" : "");
        key += path.getFileName().toString();
        selected.add(key);
      }
    }
    settings.setCustomResources(selected);
    settings.setHudMinmode(view.getUseHudMinmode().isSelected());
    settings
        .setBoolean(Key.DeleteBackupsWhenRestoring, view.getChckbxmntmBackupMode().isSelected());
    settings.setBoolean(Key.InstallFonts, view.getInstallFonts().isSelected());
    settings.setBoolean(Key.CopyUserConfig, view.getCopyUserConfig().isSelected());
    if (view.getSourceLaunch().isSelected()) {
      settings.setString(Key.LaunchMode, "hl2");
    } else if (view.getSteamLaunch().isSelected()) {
      settings.setString(Key.LaunchMode, "steam");      
    } else if (view.getHlaeLaunch().isSelected()) {
      settings.setString(Key.LaunchMode, "hlae");            
    }
    settings.setHudPlayerModel(view.getUsePlayerModel().isSelected());
    settings.setString(Key.SourceRecorderVideoFormat, view.getCmbSourceVideoFormat()
        .getSelectedItem().toString().toLowerCase());
    settings.setInt(Key.SourceRecorderJpegQuality, (int) view.getSpinnerJpegQuality().getValue());
    if (customSettings != null) {
      settings.setCustomSettings(customSettings.getTextArea().getText());
      settings.setInt(Key.CustomSettingsDialogWidth, customSettings.getWidth());
      settings.setInt(Key.CustomSettingsDialogHeight, customSettings.getHeight());
    }
    settings.save();
    log.fine("Settings saved");
  }