remove Id keyword
[jSite2.git] / src / net / pterodactylus / jsite / gui / ConfigurationDialog.java
index 00c0776..a8d212c 100644 (file)
@@ -20,6 +20,7 @@ import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JComponent;
 import javax.swing.JDialog;
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JSpinner;
 import javax.swing.JTabbedPane;
@@ -39,7 +40,6 @@ import net.pterodactylus.util.swing.SwingUtils;
  * The configuration dialog.
  * 
  * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
- * @version $Id$
  */
 public class ConfigurationDialog extends JDialog implements I18nable {
 
@@ -268,6 +268,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
                        LookAndFeelWrapper lookAndFeelWrapper = (LookAndFeelWrapper) customLAFComboBox.getItemAt(lookAndFeelIndex);
                        if (lookAndFeelWrapper.getClassName().equals(lookAndFeel)) {
                                customLAFComboBox.setSelectedIndex(lookAndFeelIndex);
+                               customLAFComboBox.setEnabled(true);
                                useCustomLAFCheckBox.setSelected(true);
                                break;
                        }
@@ -441,7 +442,7 @@ public class ConfigurationDialog extends JDialog implements I18nable {
                        lookAndFeelWrappers.add(new LookAndFeelWrapper(lookAndFeelInfo.getClassName(), lookAndFeelInfo.getName()));
                }
                customLAFComboBox = new JComboBox(lookAndFeelWrappers.toArray(new LookAndFeelWrapper[0]));
-               interfaceTweaksConfigPanel.add(customLAFComboBox, new GridBagConstraints(1, 4, 2, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0));
+               interfaceTweaksConfigPanel.add(customLAFComboBox, new GridBagConstraints(1, 4, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0));
 
                interfaceTweaksConfigPanel.add(new JPanel(), new GridBagConstraints(0, 5, 3, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
 
@@ -456,6 +457,18 @@ public class ConfigurationDialog extends JDialog implements I18nable {
         * Called when the “okay” button is clicked.
         */
        private void actionOkay() {
+               if (useCustomControlFontCheckBox.isSelected()) {
+                       if (controlFontList.getSelectedItem() == null) {
+                               JOptionPane.showMessageDialog(this, I18n.get("configurationDialog.error.noControlFontSelected.message"), I18n.get("configurationDialog.error.noControlFontSelected.title"), JOptionPane.ERROR_MESSAGE);
+                               return;
+                       }
+               }
+               if (useCustomUserFontCheckBox.isSelected()) {
+                       if (userFontList.getSelectedItem() == null) {
+                               JOptionPane.showMessageDialog(this, I18n.get("configurationDialog.error.noUserFontSelected.message"), I18n.get("configurationDialog.error.noUserFontSelected.title"), JOptionPane.ERROR_MESSAGE);
+                               return;
+                       }
+               }
                cancelled = false;
                setVisible(false);
        }
@@ -478,10 +491,12 @@ public class ConfigurationDialog extends JDialog implements I18nable {
        public void updateI18n() {
                okayAction.updateI18n();
                cancelAction.updateI18n();
+               advancedModeAction.updateI18n();
                restartRequiredLabel.updateI18n();
                antialiasAction.updateI18n();
                useCustomControlFontAction.updateI18n();
                useCustomUserFontAction.updateI18n();
+               useCustomLAFAction.updateI18n();
                SwingUtils.repackCentered(this);
        }
 
@@ -489,7 +504,6 @@ public class ConfigurationDialog extends JDialog implements I18nable {
         * Wrapper around class name and name of a {@link LookAndFeel}.
         * 
         * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
-        * @version $Id$
         */
        private static class LookAndFeelWrapper {