private void refreshLanguage() { hideJunkMessagesCheckBox.setText(language.getString("Options.junk.hideJunkMessages")); markJunkIdentityBadCheckBox.setText(language.getString("Options.junk.markJunkIdentityBad")); stopBoardUpdatesWhenDosedCheckBox.setText( language.getString("Options.junk.stopBoardUpdatesWhenDosed")); LinvalidSubsequentMessagesThreshold.setText( language.getString("Options.junk.invalidSubsequentMessagesThreshold")); }
/** Load the settings of this panel */ private void loadSettings() { hideJunkMessagesCheckBox.setSelected( settings.getBoolValue(SettingsClass.JUNK_HIDE_JUNK_MESSAGES)); markJunkIdentityBadCheckBox.setSelected( settings.getBoolValue(SettingsClass.JUNK_MARK_JUNK_IDENTITY_BAD)); stopBoardUpdatesWhenDosedCheckBox.setSelected( settings.getBoolValue(SettingsClass.DOS_STOP_BOARD_UPDATES_WHEN_DOSED)); TfInvalidSubsequentMessagesThreshold.setText( "" + settings.getIntValue(SettingsClass.DOS_INVALID_SUBSEQUENT_MSGS_THRESHOLD)); }
/** Save the settings of this panel */ private void saveSettings() { settings.setValue(SettingsClass.JUNK_HIDE_JUNK_MESSAGES, hideJunkMessagesCheckBox.isSelected()); settings.setValue( SettingsClass.JUNK_MARK_JUNK_IDENTITY_BAD, markJunkIdentityBadCheckBox.isSelected()); settings.setValue( SettingsClass.DOS_STOP_BOARD_UPDATES_WHEN_DOSED, stopBoardUpdatesWhenDosedCheckBox.isSelected()); settings.setValue( SettingsClass.DOS_INVALID_SUBSEQUENT_MSGS_THRESHOLD, TfInvalidSubsequentMessagesThreshold.getText()); }
private void initialize() { setName("JunkPanel"); setLayout(new GridBagLayout()); refreshLanguage(); // Adds all of the components final GridBagConstraints constraints = new GridBagConstraints(); constraints.anchor = GridBagConstraints.WEST; final Insets insets5555 = new Insets(5, 5, 5, 5); constraints.insets = insets5555; constraints.weightx = 1.0; constraints.gridwidth = 1; constraints.gridy = 0; constraints.insets = insets5555; constraints.gridx = 0; add(hideJunkMessagesCheckBox, constraints); constraints.gridy++; add(markJunkIdentityBadCheckBox, constraints); constraints.gridy++; constraints.fill = GridBagConstraints.HORIZONTAL; { final JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL); add(separator, constraints); } constraints.fill = GridBagConstraints.NONE; constraints.gridy++; add(stopBoardUpdatesWhenDosedCheckBox, constraints); constraints.gridy++; { final JPanel subPanel = new JPanel(new GridBagLayout()); final GridBagConstraints subConstraints = new GridBagConstraints(); subConstraints.insets = new Insets(0, 10, 0, 10); subConstraints.anchor = GridBagConstraints.WEST; subConstraints.gridx = 0; subPanel.add(LinvalidSubsequentMessagesThreshold, subConstraints); subConstraints.gridx = 1; subPanel.add(TfInvalidSubsequentMessagesThreshold, subConstraints); add(subPanel, constraints); } // glue constraints.gridy++; constraints.gridx = 0; constraints.fill = GridBagConstraints.BOTH; constraints.weightx = 1; constraints.weighty = 1; add(new JLabel(""), constraints); // Add listeners stopBoardUpdatesWhenDosedCheckBox.addActionListener(listener); }
private void refreshLanguage() { uploadPrioLabel.setText(language.getString("Options.news.1.messageUploadPriority") + " (2)"); downloadPrioLabel.setText( language.getString("Options.news.1.messageDownloadPriority") + " (2)"); useOneConnectionForMessagesCheckBox.setText( language.getString("Options.news.1.useOneConnectionForMessages")); displayDaysLabel.setText(language.getString("Options.news.1.numberOfDaysToDisplay") + " (15)"); downloadDaysLabel.setText( language.getString("Options.news.1.numberOfDaysToDownloadBackwards") + " (5)"); messageBaseLabel.setText(language.getString("Options.news.1.messageBase") + " (news)"); alwaysDownloadBackloadCheckBox.setText( language.getString("Options.news.1.alwaysDownloadBackload")); alwaysDownloadBackloadCheckBox.setToolTipText( language.getString("Options.news.1.alwaysDownloadBackload.tooltip")); final String minutes = language.getString("Options.common.minutes"); minimumIntervalLabel.setText( language.getString("Options.news.3.minimumUpdateInterval") + " (" + minutes + ") (45)"); concurrentUpdatesLabel.setText( language.getString("Options.news.3.numberOfConcurrentlyUpdatingBoards") + " (6)"); automaticBoardUpdateCheckBox.setText(language.getString("Options.news.3.automaticBoardUpdate")); storeSentMessagesCheckBox.setText(language.getString("Options.news.1.storeSentMessages")); silentlyRetryCheckBox.setText(language.getString("Options.news.3.silentlyRetryFailedMessages")); final String off = language.getString("Options.common.off"); altEditCheckBox.setText( language.getString("Options.miscellaneous.useEditorForWritingMessages") + " (" + off + ")"); }
/** 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)); }
/** 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()); }
private void refreshStopOnDosState() { final boolean stopOnDos = stopBoardUpdatesWhenDosedCheckBox.isSelected(); LinvalidSubsequentMessagesThreshold.setEnabled(stopOnDos); TfInvalidSubsequentMessagesThreshold.setEnabled(stopOnDos); }
private void altEditChanged() { altEditTextField.setEnabled(altEditCheckBox.isSelected()); }
private void refreshUpdateState() { MiscToolkit.setContainerEnabled(getUpdatePanel(), automaticBoardUpdateCheckBox.isSelected()); }
private void initialize() { setName("NewsPanel"); setLayout(new GridBagLayout()); refreshLanguage(); // We create the components new TextComponentClipboardMenu(uploadPrioTextField, language); new TextComponentClipboardMenu(downloadPrioTextField, language); new TextComponentClipboardMenu(displayDaysTextField, language); new TextComponentClipboardMenu(downloadDaysTextField, language); new TextComponentClipboardMenu(messageBaseTextField, language); new TextComponentClipboardMenu(minimumIntervalTextField, language); new TextComponentClipboardMenu(concurrentUpdatesTextField, language); new TextComponentClipboardMenu(altEditTextField, language); // Adds all of the components final GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; constraints.weighty = 0.0; constraints.weightx = 0; constraints.insets = new Insets(0, 5, 5, 5); constraints.gridy = 0; constraints.gridx = 0; add(displayDaysLabel, constraints); constraints.gridx = 1; add(displayDaysTextField, constraints); constraints.gridx = 0; constraints.gridy++; add(downloadDaysLabel, constraints); constraints.gridx = 1; add(downloadDaysTextField, constraints); constraints.gridx = 0; constraints.gridy++; constraints.gridwidth = 2; add(alwaysDownloadBackloadCheckBox, constraints); constraints.gridwidth = 1; constraints.gridx = 0; constraints.gridy++; add(messageBaseLabel, constraints); constraints.gridx = 1; add(messageBaseTextField, constraints); constraints.gridy++; constraints.gridx = 0; add(uploadPrioLabel, constraints); constraints.gridx = 1; add(uploadPrioTextField, constraints); constraints.gridy++; constraints.gridx = 0; add(downloadPrioLabel, constraints); constraints.gridx = 1; add(downloadPrioTextField, constraints); constraints.gridx = 0; constraints.gridwidth = 2; constraints.gridy++; add(automaticBoardUpdateCheckBox, constraints); constraints.gridy++; add(getUpdatePanel(), constraints); constraints.gridy++; add(useOneConnectionForMessagesCheckBox, constraints); constraints.gridy++; add(storeSentMessagesCheckBox, constraints); constraints.gridy++; add(silentlyRetryCheckBox, constraints); constraints.gridwidth = 1; constraints.insets = new Insets(0, 5, 0, 5); constraints.gridy++; constraints.gridx = 0; add(altEditCheckBox, constraints); constraints.gridx = 1; constraints.weightx = 1; constraints.fill = GridBagConstraints.HORIZONTAL; add(altEditTextField, constraints); constraints.weightx = 0; constraints.fill = GridBagConstraints.NONE; // glue constraints.gridy++; constraints.gridx = 0; constraints.gridwidth = 2; constraints.fill = GridBagConstraints.BOTH; constraints.weightx = 1; constraints.weighty = 1; add(new JLabel(""), constraints); // Add listeners automaticBoardUpdateCheckBox.addActionListener(listener); altEditCheckBox.addChangeListener(listener); }