Exemplo n.º 1
0
  /** Save the settings of this panel */
  private void saveSettings() {
    settings.setValue(
        SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_UPLOAD, uploadPrioTextField.getText());
    settings.setValue(
        SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_DOWNLOAD, downloadPrioTextField.getText());
    settings.setValue(
        SettingsClass.FCP2_USE_ONE_CONNECTION_FOR_MESSAGES,
        useOneConnectionForMessagesCheckBox.isSelected());

    settings.setValue(SettingsClass.MAX_MESSAGE_DISPLAY, displayDaysTextField.getText());
    settings.setValue(SettingsClass.MAX_MESSAGE_DOWNLOAD, downloadDaysTextField.getText());
    settings.setValue(
        SettingsClass.MESSAGE_BASE, messageBaseTextField.getText().trim().toLowerCase());
    settings.setValue(
        SettingsClass.ALWAYS_DOWNLOAD_MESSAGES_BACKLOAD,
        alwaysDownloadBackloadCheckBox.isSelected());

    settings.setValue(
        SettingsClass.BOARD_AUTOUPDATE_CONCURRENT_UPDATES, concurrentUpdatesTextField.getText());
    settings.setValue(
        SettingsClass.BOARD_AUTOUPDATE_MIN_INTERVAL, minimumIntervalTextField.getText());

    // settings.setValue(SettingsClass.BOARD_AUTOUPDATE_ENABLED,
    // automaticBoardUpdateCheckBox.isSelected());
    // we change setting in MainFrame, this is auto-saved during frostSettings.save()
    MainFrame.getInstance()
        .setAutomaticBoardUpdateEnabled(automaticBoardUpdateCheckBox.isSelected());

    settings.setValue(
        SettingsClass.STORAGE_STORE_SENT_MESSAGES, storeSentMessagesCheckBox.isSelected());
    settings.setValue(SettingsClass.SILENTLY_RETRY_MESSAGES, silentlyRetryCheckBox.isSelected());

    settings.setValue(SettingsClass.ALTERNATE_EDITOR_ENABLED, altEditCheckBox.isSelected());
    settings.setValue(SettingsClass.ALTERNATE_EDITOR_COMMAND, altEditTextField.getText());
  }
Exemplo n.º 2
0
  /** Load the settings of this panel */
  private void loadSettings() {
    uploadPrioTextField.setText(settings.getValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_UPLOAD));
    downloadPrioTextField.setText(
        settings.getValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_DOWNLOAD));
    useOneConnectionForMessagesCheckBox.setSelected(
        settings.getBoolValue(SettingsClass.FCP2_USE_ONE_CONNECTION_FOR_MESSAGES));

    displayDaysTextField.setText(settings.getValue(SettingsClass.MAX_MESSAGE_DISPLAY));
    downloadDaysTextField.setText(settings.getValue(SettingsClass.MAX_MESSAGE_DOWNLOAD));
    messageBaseTextField.setText(settings.getValue(SettingsClass.MESSAGE_BASE));
    alwaysDownloadBackloadCheckBox.setSelected(
        settings.getBoolValue(SettingsClass.ALWAYS_DOWNLOAD_MESSAGES_BACKLOAD));

    minimumIntervalTextField.setText(
        settings.getValue(SettingsClass.BOARD_AUTOUPDATE_MIN_INTERVAL));
    concurrentUpdatesTextField.setText(
        settings.getValue(SettingsClass.BOARD_AUTOUPDATE_CONCURRENT_UPDATES));

    // this setting is in MainFrame
    automaticBoardUpdateCheckBox.setSelected(
        MainFrame.getInstance().isAutomaticBoardUpdateEnabled());
    refreshUpdateState();

    storeSentMessagesCheckBox.setSelected(
        settings.getBoolValue(SettingsClass.STORAGE_STORE_SENT_MESSAGES));
    silentlyRetryCheckBox.setSelected(settings.getBoolValue(SettingsClass.SILENTLY_RETRY_MESSAGES));

    altEditCheckBox.setSelected(settings.getBoolValue(SettingsClass.ALTERNATE_EDITOR_ENABLED));
    altEditTextField.setEnabled(altEditCheckBox.isSelected());
    altEditTextField.setText(settings.getValue(SettingsClass.ALTERNATE_EDITOR_COMMAND));
  }
Exemplo n.º 3
0
  private void loadWindowState() {
    // load size, location and state of window
    int lastHeight = Core.frostSettings.getIntValue("helpBrowser.lastFrameHeight");
    int lastWidth = Core.frostSettings.getIntValue("helpBrowser.lastFrameWidth");
    final int lastPosX = Core.frostSettings.getIntValue("helpBrowser.lastFramePosX");
    final int lastPosY = Core.frostSettings.getIntValue("helpBrowser.lastFramePosY");
    final boolean lastMaximized = Core.frostSettings.getBoolValue("helpBrowser.lastFrameMaximized");

    if (lastHeight <= 0 || lastWidth <= 0) {
      // first call
      setSize(780, 550);
      setLocationRelativeTo(MainFrame.getInstance());
      return;
    }

    final Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();

    if (lastWidth < 100) {
      lastWidth = 780;
    }
    if (lastHeight < 100) {
      lastHeight = 550;
    }

    if ((lastPosX + lastWidth) > scrSize.width) {
      setSize(780, 550);
      setLocationRelativeTo(MainFrame.getInstance());
      return;
    }

    if ((lastPosY + lastHeight) > scrSize.height) {
      setSize(780, 550);
      setLocationRelativeTo(MainFrame.getInstance());
      return;
    }

    setBounds(lastPosX, lastPosY, lastWidth, lastHeight);

    if (lastMaximized) {
      setExtendedState(getExtendedState() | Frame.MAXIMIZED_BOTH);
    }
  }