Bladeren bron

Hack prefs dialog into working.

For the minute this means the prefs dialog no longer
saves state, it also means there may be some layout
changes with the height loss and parenting change for
sub dialogs launched from preferences settings.

Change-Id: I9c46e6f03920866022cfe063c500f9523a11db6e
Reviewed-on: http://gerrit.dmdirc.com/3071
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8
Greg Holmes 10 jaren geleden
bovenliggende
commit
e46d8e694f

+ 0
- 14
src/com/dmdirc/addons/ui_swing/SwingController.java Bestand weergeven

@@ -33,14 +33,12 @@ import com.dmdirc.addons.ui_swing.commands.ServerSettings;
33 33
 import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
34 34
 import com.dmdirc.addons.ui_swing.components.statusbar.SwingStatusBar;
35 35
 import com.dmdirc.addons.ui_swing.dialogs.error.ErrorListDialog;
36
-import com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog;
37 36
 import com.dmdirc.addons.ui_swing.injection.SwingModule;
38 37
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
39 38
 import com.dmdirc.config.prefs.PreferencesCategory;
40 39
 import com.dmdirc.config.prefs.PreferencesDialogModel;
41 40
 import com.dmdirc.config.prefs.PreferencesSetting;
42 41
 import com.dmdirc.config.prefs.PreferencesType;
43
-import com.dmdirc.interfaces.CommandController;
44 42
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
45 43
 import com.dmdirc.interfaces.config.ConfigProvider;
46 44
 import com.dmdirc.interfaces.config.IdentityController;
@@ -54,7 +52,6 @@ import com.dmdirc.plugins.PluginInfo;
54 52
 import com.dmdirc.plugins.PluginManager;
55 53
 import com.dmdirc.plugins.implementations.BaseCommandPlugin;
56 54
 import com.dmdirc.ui.IconManager;
57
-import com.dmdirc.ui.core.util.URLHandler;
58 55
 import com.dmdirc.ui.messages.ColourManager;
59 56
 import com.dmdirc.updater.Version;
60 57
 import com.dmdirc.util.URLBuilder;
@@ -473,17 +470,6 @@ public class SwingController extends BaseCommandPlugin implements UIController {
473 470
                 UIManager.getFont("TextPane.font").getSize());
474 471
     }
475 472
 
476
-    /**
477
-     * Returns the preferences dialog instance creating if required.
478
-     *
479
-     * @return Swing prefs dialog
480
-     * @deprecated Inject the relevant dialog manager instead.
481
-     */
482
-    @Deprecated
483
-    public SwingPreferencesDialog getPrefsDialog() {
484
-        return swingManager.getPrefsDialogProvider().get();
485
-    }
486
-
487 473
     /** {@inheritDoc} */
488 474
     @Override
489 475
     public void showConfig(final PreferencesDialogModel manager) {

+ 0
- 12
src/com/dmdirc/addons/ui_swing/SwingManager.java Bestand weergeven

@@ -29,11 +29,9 @@ import com.dmdirc.addons.ui_swing.components.statusbar.FeedbackNag;
29 29
 import com.dmdirc.addons.ui_swing.components.statusbar.SwingStatusBar;
30 30
 import com.dmdirc.addons.ui_swing.dialogs.DialogKeyListener;
31 31
 import com.dmdirc.addons.ui_swing.dialogs.channelsetting.ChannelSettingsDialog;
32
-import com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog;
33 32
 import com.dmdirc.addons.ui_swing.dialogs.serversetting.ServerSettingsDialog;
34 33
 import com.dmdirc.addons.ui_swing.dialogs.url.URLDialogFactory;
35 34
 import com.dmdirc.addons.ui_swing.framemanager.ctrltab.CtrlTabWindowManager;
36
-import com.dmdirc.addons.ui_swing.injection.DialogProvider;
37 35
 import com.dmdirc.addons.ui_swing.injection.KeyedDialogProvider;
38 36
 import com.dmdirc.addons.ui_swing.wizard.firstrun.FirstRunWizardExecutor;
39 37
 import com.dmdirc.ui.WindowManager;
@@ -76,8 +74,6 @@ public class SwingManager {
76 74
     /** Provider of first run executors. */
77 75
     private final Provider<FirstRunWizardExecutor> firstRunExecutor;
78 76
 
79
-    /** Provider of prefs dialogs. */
80
-    private final DialogProvider<SwingPreferencesDialog> prefsDialogProvider;
81 77
     /** Provider of server settings dialogs. */
82 78
     private final KeyedDialogProvider<Server, ServerSettingsDialog> serverSettingsDialogProvider;
83 79
     /** Provider of channel settings dialogs. */
@@ -102,7 +98,6 @@ public class SwingManager {
102 98
      * @param ctrlTabManager The window manager that handles ctrl+tab behaviour.
103 99
      * @param dialogKeyListener The key listener that supports dialogs.
104 100
      * @param firstRunExecutor A provider of first run executors.
105
-     * @param prefsDialogProvider Provider of prefs dialogs.
106 101
      * @param serverSettingsDialogProvider Provider of server settings dialogs.
107 102
      * @param channelSettingsDialogProvider Provider of channel settings dialogs.
108 103
      * @param feedbackNagProvider Provider of feedback nags.
@@ -120,7 +115,6 @@ public class SwingManager {
120 115
             final CtrlTabWindowManager ctrlTabManager,
121 116
             final DialogKeyListener dialogKeyListener,
122 117
             final Provider<FirstRunWizardExecutor> firstRunExecutor,
123
-            final DialogProvider<SwingPreferencesDialog> prefsDialogProvider,
124 118
             final KeyedDialogProvider<Server, ServerSettingsDialog> serverSettingsDialogProvider,
125 119
             final KeyedDialogProvider<Channel, ChannelSettingsDialog> channelSettingsDialogProvider,
126 120
             final Provider<FeedbackNag> feedbackNagProvider,
@@ -132,7 +126,6 @@ public class SwingManager {
132 126
         this.statusBarManager = statusBarManager;
133 127
         this.dialogKeyListener = dialogKeyListener;
134 128
         this.firstRunExecutor = firstRunExecutor;
135
-        this.prefsDialogProvider = prefsDialogProvider;
136 129
         this.serverSettingsDialogProvider = serverSettingsDialogProvider;
137 130
         this.channelSettingsDialogProvider = channelSettingsDialogProvider;
138 131
         this.feedbackNagProvider = feedbackNagProvider;
@@ -178,11 +171,6 @@ public class SwingManager {
178 171
         return firstRunExecutor.get();
179 172
     }
180 173
 
181
-    @Deprecated
182
-    public DialogProvider<SwingPreferencesDialog> getPrefsDialogProvider() {
183
-        return prefsDialogProvider;
184
-    }
185
-
186 174
     @Deprecated
187 175
     public KeyedDialogProvider<Server, ServerSettingsDialog> getServerSettingsDialogProvider() {
188 176
         return serverSettingsDialogProvider;

+ 2
- 10
src/com/dmdirc/addons/ui_swing/components/addonpanel/AddonPanel.java Bestand weergeven

@@ -28,7 +28,6 @@ import com.dmdirc.addons.ui_swing.components.addonbrowser.BrowserWindow;
28 28
 import com.dmdirc.addons.ui_swing.components.addonbrowser.DataLoaderWorkerFactory;
29 29
 import com.dmdirc.addons.ui_swing.components.renderers.AddonCellRenderer;
30 30
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
31
-import com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog;
32 31
 import com.dmdirc.config.prefs.PreferencesInterface;
33 32
 
34 33
 import java.awt.Window;
@@ -57,8 +56,6 @@ public abstract class AddonPanel extends JPanel implements AddonToggleListener,
57 56
     private static final long serialVersionUID = 3;
58 57
     /** List of addons. */
59 58
     protected JTable addonList;
60
-    /** The prefs dialog that contains this panel. */
61
-    private final SwingPreferencesDialog prefsDialog;
62 59
     /** Parent Window. */
63 60
     private final Window parentWindow;
64 61
     /** The factory to use to produce data loader workers. */
@@ -78,17 +75,12 @@ public abstract class AddonPanel extends JPanel implements AddonToggleListener,
78 75
      * Creates a new instance of AddonPanel
79 76
      *
80 77
      * @param parentWindow Parent window
81
-     * @param prefsDialog The prefs dialog that contains this panel
82 78
      * @param workerFactory The factory to use to produce data loader workers.
83 79
      */
84
-    public AddonPanel(
85
-            final Window parentWindow,
86
-            final SwingPreferencesDialog prefsDialog,
87
-            final DataLoaderWorkerFactory workerFactory) {
80
+    public AddonPanel(final Window parentWindow, final DataLoaderWorkerFactory workerFactory) {
88 81
         super();
89 82
 
90 83
         this.parentWindow = parentWindow;
91
-        this.prefsDialog = prefsDialog;
92 84
         this.workerFactory = workerFactory;
93 85
 
94 86
         initComponents();
@@ -164,7 +156,7 @@ public abstract class AddonPanel extends JPanel implements AddonToggleListener,
164 156
 
165 157
     /** Lays out the dialog. */
166 158
     private void layoutComponents() {
167
-        setLayout(new MigLayout("ins 0, fill, hmax " + prefsDialog.getPanelHeight()));
159
+        setLayout(new MigLayout("ins 0, fill, hmax 500"));
168 160
         add(blurbLabel, "wrap 5, growx, pushx");
169 161
         add(getMoreLabel, "wrap 5, right");
170 162
         add(scrollPane, "wrap 5, grow, push");

+ 1
- 4
src/com/dmdirc/addons/ui_swing/components/addonpanel/PluginPanel.java Bestand weergeven

@@ -29,7 +29,6 @@ import com.dmdirc.actions.CoreActionType;
29 29
 import com.dmdirc.addons.ui_swing.MainFrame;
30 30
 import com.dmdirc.addons.ui_swing.UIUtilities;
31 31
 import com.dmdirc.addons.ui_swing.components.addonbrowser.DataLoaderWorkerFactory;
32
-import com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog;
33 32
 import com.dmdirc.interfaces.ActionListener;
34 33
 import com.dmdirc.interfaces.actions.ActionType;
35 34
 import com.dmdirc.interfaces.config.ConfigProvider;
@@ -73,7 +72,6 @@ public class PluginPanel extends AddonPanel implements ActionListener {
73 72
      *
74 73
      * @param parentWindow Parent window
75 74
      * @param pluginManager Manager to retrieve plugins from.
76
-     * @param prefsDialog The prefs dialog that contains this panel
77 75
      * @param workerFactory Factory to use to create data workers.
78 76
      * @param iconManager Manager to use to retrieve addon-related icons.
79 77
      * @param updateManager Manager to use to retrieve update information.
@@ -83,12 +81,11 @@ public class PluginPanel extends AddonPanel implements ActionListener {
83 81
     public PluginPanel(
84 82
             final MainFrame parentWindow,
85 83
             final PluginManager pluginManager,
86
-            final SwingPreferencesDialog prefsDialog,
87 84
             final DataLoaderWorkerFactory workerFactory,
88 85
             @GlobalConfig final IconManager iconManager,
89 86
             final CachingUpdateManager updateManager,
90 87
             @UserConfig final ConfigProvider userConfig) {
91
-        super(parentWindow, prefsDialog, workerFactory);
88
+        super(parentWindow, workerFactory);
92 89
         this.pluginManager = pluginManager;
93 90
         this.iconManager = iconManager;
94 91
         this.updateManager = updateManager;

+ 1
- 4
src/com/dmdirc/addons/ui_swing/components/addonpanel/ThemePanel.java Bestand weergeven

@@ -27,7 +27,6 @@ import com.dmdirc.ClientModule.UserConfig;
27 27
 import com.dmdirc.addons.ui_swing.MainFrame;
28 28
 import com.dmdirc.addons.ui_swing.UIUtilities;
29 29
 import com.dmdirc.addons.ui_swing.components.addonbrowser.DataLoaderWorkerFactory;
30
-import com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog;
31 30
 import com.dmdirc.interfaces.config.ConfigProvider;
32 31
 import com.dmdirc.ui.IconManager;
33 32
 import com.dmdirc.ui.themes.Theme;
@@ -69,7 +68,6 @@ public class ThemePanel extends AddonPanel {
69 68
      *
70 69
      * @param parentWindow Parent window
71 70
      * @param themeManager Manager to retrieve themes from.
72
-     * @param prefsDialog The prefs dialog that contains this panel
73 71
      * @param workerFactory Factory to use to create data workers.
74 72
      * @param iconManager Manager to use to retrieve addon-related icons.
75 73
      * @param updateManager Manager to use to retrieve update information.
@@ -79,12 +77,11 @@ public class ThemePanel extends AddonPanel {
79 77
     public ThemePanel(
80 78
             final MainFrame parentWindow,
81 79
             final ThemeManager themeManager,
82
-            final SwingPreferencesDialog prefsDialog,
83 80
             final DataLoaderWorkerFactory workerFactory,
84 81
             @GlobalConfig final IconManager iconManager,
85 82
             final CachingUpdateManager updateManager,
86 83
             @UserConfig final ConfigProvider userConfig) {
87
-        super(parentWindow, prefsDialog, workerFactory);
84
+        super(parentWindow, workerFactory);
88 85
         this.themeManager = themeManager;
89 86
         this.iconManager = iconManager;
90 87
         this.updateManager = updateManager;

+ 2
- 31
src/com/dmdirc/addons/ui_swing/dialogs/prefs/CategoryPanel.java Bestand weergeven

@@ -33,7 +33,6 @@ import com.dmdirc.config.prefs.PreferencesCategory;
33 33
 import com.dmdirc.ui.IconManager;
34 34
 
35 35
 import java.awt.Component;
36
-import java.awt.Window;
37 36
 import java.util.Collections;
38 37
 import java.util.HashMap;
39 38
 import java.util.Map;
@@ -45,8 +44,6 @@ import javax.swing.JScrollPane;
45 44
 import javax.swing.ScrollPaneConstants;
46 45
 import javax.swing.SwingUtilities;
47 46
 
48
-import net.miginfocom.layout.ComponentWrapper;
49
-import net.miginfocom.layout.LayoutCallback;
50 47
 import net.miginfocom.swing.MigLayout;
51 48
 
52 49
 /**
@@ -58,8 +55,6 @@ public class CategoryPanel extends JPanel {
58 55
     private static final long serialVersionUID = -3268284364607758509L;
59 56
     /** Active preferences category. */
60 57
     private PreferencesCategory category;
61
-    /** Parent window. */
62
-    private final SwingPreferencesDialog parent;
63 58
     /** Title label. */
64 59
     private final TitlePanel title;
65 60
     /** Tooltip display area. */
@@ -89,9 +84,8 @@ public class CategoryPanel extends JPanel {
89 84
     @Inject
90 85
     public CategoryPanel(
91 86
             final PrefsComponentFactory factory,
92
-            @GlobalConfig final IconManager iconManager,
93
-            final SwingPreferencesDialog parent) {
94
-        this(factory, parent, iconManager, null);
87
+            @GlobalConfig final IconManager iconManager) {
88
+        this(factory, iconManager, null);
95 89
     }
96 90
 
97 91
     /**
@@ -103,11 +97,9 @@ public class CategoryPanel extends JPanel {
103 97
      * @param category Initial category
104 98
      */
105 99
     public CategoryPanel(final PrefsComponentFactory factory,
106
-            final SwingPreferencesDialog parent,
107 100
             final IconManager iconManager,
108 101
             final PreferencesCategory category) {
109 102
         super(new MigLayout("fillx, wrap, ins 0"));
110
-        this.parent = parent;
111 103
         this.factory = factory;
112 104
 
113 105
         panels = Collections.synchronizedMap(
@@ -138,27 +130,6 @@ public class CategoryPanel extends JPanel {
138 130
 
139 131
         panels.put(null, loading);
140 132
         setCategory(category);
141
-        ((MigLayout) getLayout()).addLayoutCallback(new LayoutCallback() {
142
-
143
-            /** {@inheritDoc} */
144
-            @Override
145
-            public void correctBounds(final ComponentWrapper cw) {
146
-                if (cw.getComponent() == scrollPane) {
147
-                    final int newSize = Math.max(parent.getPanelHeight(),
148
-                            scrollPane.getViewport().getExtentSize().height);
149
-                    parent.setPanelHeight((int) (newSize * 0.95));
150
-                }
151
-            }
152
-        });
153
-    }
154
-
155
-    /**
156
-     * Returns this categrory panel's parent window.
157
-     *
158
-     * @return Parent window
159
-     */
160
-    protected Window getParentWindow() {
161
-        return parent;
162 133
     }
163 134
 
164 135
     /**

+ 8
- 22
src/com/dmdirc/addons/ui_swing/dialogs/prefs/PrefsCategoryLoader.java Bestand weergeven

@@ -26,9 +26,6 @@ import com.dmdirc.addons.ui_swing.Apple;
26 26
 import com.dmdirc.addons.ui_swing.PrefsComponentFactory;
27 27
 import com.dmdirc.addons.ui_swing.UIUtilities;
28 28
 import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
29
-import com.dmdirc.addons.ui_swing.components.colours.ColourChooser;
30
-import com.dmdirc.addons.ui_swing.components.colours.OptionalColourChooser;
31
-import com.dmdirc.addons.ui_swing.components.durationeditor.DurationDisplay;
32 29
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
33 30
 import com.dmdirc.config.prefs.PreferencesCategory;
34 31
 import com.dmdirc.config.prefs.PreferencesSetting;
@@ -197,34 +194,23 @@ public class PrefsCategoryLoader extends LoggingSwingWorker<JPanel, Object> {
197 194
 
198 195
         final TextLabel label = new TextLabel(setting.getTitle() + ": ", false);
199 196
 
200
-
201 197
         final JComponent option = UIUtilities.invokeAndWait(
202 198
                 new Callable<JComponent>() {
203 199
 
204
-            /** {@inheritDoc} */
205
-            @Override
206
-            public JComponent call() {
207
-                JComponent option = factory.getComponent(setting);
208
-                option.setToolTipText(null);
209
-                return option;
210
-            }
211
-        });
200
+                    /** {@inheritDoc} */
201
+                    @Override
202
+                    public JComponent call() {
203
+                        JComponent option = factory.getComponent(setting);
204
+                        option.setToolTipText(null);
205
+                        return option;
206
+                    }
207
+                });
212 208
 
213 209
         categoryPanel.getToolTipPanel().registerTooltipHandler(label,
214 210
                 getTooltipText(setting, categoryPanel));
215 211
         categoryPanel.getToolTipPanel().registerTooltipHandler(option,
216 212
                 getTooltipText(setting, categoryPanel));
217 213
 
218
-
219
-        if (option instanceof DurationDisplay) {
220
-            ((DurationDisplay) option).setWindow(categoryPanel.getParentWindow());
221
-        } else if (option instanceof ColourChooser) {
222
-            ((ColourChooser) option).setWindow(categoryPanel.getParentWindow());
223
-        } else if (option instanceof OptionalColourChooser) {
224
-            ((OptionalColourChooser) option).setWindow(categoryPanel.
225
-                    getParentWindow());
226
-        }
227
-
228 214
         if (setting.getType() != PreferencesType.LABEL) {
229 215
             if (Apple.isAppleUI()) {
230 216
                 panel.add(label, "align right, wmax 40%");

+ 12
- 34
src/com/dmdirc/addons/ui_swing/dialogs/prefs/SwingPreferencesDialog.java Bestand weergeven

@@ -19,10 +19,10 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
-
23 22
 package com.dmdirc.addons.ui_swing.dialogs.prefs;
24 23
 
25
-import com.dmdirc.addons.ui_swing.SwingController;
24
+import com.dmdirc.ClientModule.GlobalConfig;
25
+import com.dmdirc.addons.ui_swing.MainFrame;
26 26
 import com.dmdirc.addons.ui_swing.UIUtilities;
27 27
 import com.dmdirc.addons.ui_swing.components.ListScroller;
28 28
 import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
@@ -34,6 +34,7 @@ import com.dmdirc.config.prefs.PreferencesCategory;
34 34
 import com.dmdirc.config.prefs.PreferencesDialogModel;
35 35
 import com.dmdirc.logger.ErrorLevel;
36 36
 import com.dmdirc.logger.Logger;
37
+import com.dmdirc.ui.IconManager;
37 38
 
38 39
 import java.awt.event.ActionEvent;
39 40
 import java.awt.event.ActionListener;
@@ -75,31 +76,31 @@ public final class SwingPreferencesDialog extends StandardDialog implements
75 76
     private final LoggingSwingWorker<PreferencesDialogModel, Void> worker;
76 77
     /** Panel size. */
77 78
     private int panelSize = 500;
78
-    /** Swing controller. */
79
-    @Deprecated
80
-    private final SwingController controller;
81 79
     /** The provider to use for restart dialogs. */
82 80
     private final DialogProvider<SwingRestartDialog> restartDialogProvider;
83 81
     /** The provider to use to produce a category panel. */
84 82
     private final Provider<CategoryPanel> categoryPanelProvider;
83
+    /** Icon manager to retrieve icons from. */
84
+    private final IconManager iconManager;
85 85
 
86 86
     /**
87 87
      * Creates a new instance of SwingPreferencesDialog.
88 88
      *
89
-     * @param controller The controller which owns this preferences window.
89
+     * @param mainFrame Main frame to parent dialogs on.
90
+     * @param iconManager Icon manager used to retrieve images
90 91
      * @param restartDialogProvider The provider to use for restart dialogs.
91 92
      * @param dialogModelProvider The provider to use to get a dialog model.
92 93
      * @param categoryPanelProvider The provider to use to produce a category panel.
93 94
      */
94 95
     @Inject
95 96
     public SwingPreferencesDialog(
96
-            final SwingController controller,
97
+            final MainFrame mainFrame, @GlobalConfig final IconManager iconManager,
97 98
             @ForSettings final DialogProvider<SwingRestartDialog> restartDialogProvider,
98 99
             final Provider<PreferencesDialogModel> dialogModelProvider,
99 100
             final Provider<CategoryPanel> categoryPanelProvider) {
100
-        super(controller.getMainFrame(), ModalityType.MODELESS);
101
+        super(mainFrame, ModalityType.MODELESS);
101 102
 
102
-        this.controller = controller;
103
+        this.iconManager = iconManager;
103 104
         this.restartDialogProvider = restartDialogProvider;
104 105
         this.categoryPanelProvider = categoryPanelProvider;
105 106
 
@@ -149,8 +150,7 @@ public final class SwingPreferencesDialog extends StandardDialog implements
149 150
         mainPanel.setCategory(null);
150 151
 
151 152
         final int count = countCategories(manager.getCategories());
152
-        tabList.setCellRenderer(new PreferencesListCellRenderer(
153
-                controller.getIconManager(), count));
153
+        tabList.setCellRenderer(new PreferencesListCellRenderer(iconManager, count));
154 154
 
155 155
         addCategories(manager.getCategories());
156 156
     }
@@ -207,7 +207,7 @@ public final class SwingPreferencesDialog extends StandardDialog implements
207 207
                     addCategories(category.getSubcats());
208 208
                 }
209 209
                 tabList.addListSelectionListener(SwingPreferencesDialog.this);
210
-                restoreActiveCategory();
210
+                tabList.setSelectedIndex(0);
211 211
             }
212 212
         });
213 213
         mainPanel.setWaiting(false);
@@ -247,12 +247,6 @@ public final class SwingPreferencesDialog extends StandardDialog implements
247 247
         mainPanel.setCategory(null);
248 248
 
249 249
         if (actionEvent != null && getOkButton().equals(actionEvent.getSource())) {
250
-            if (tabList.getSelectedIndex() > -1) {
251
-                final PreferencesCategory node = (PreferencesCategory) tabList.
252
-                        getSelectedValue();
253
-                controller.getGlobalIdentity().setOption("dialogstate",
254
-                        "preferences", node.getPath());
255
-            }
256 250
             saveOptions();
257 251
         }
258 252
 
@@ -323,22 +317,6 @@ public final class SwingPreferencesDialog extends StandardDialog implements
323 317
         }
324 318
     }
325 319
 
326
-    private void restoreActiveCategory() {
327
-        final String oldCategoryPath = controller.getGlobalConfig().
328
-                getOption("dialogstate", "preferences");
329
-        final DefaultListModel model = (DefaultListModel) tabList.getModel();
330
-        int indexToSelect = 0;
331
-        for (int i = 0; i < model.getSize(); i++) {
332
-            final PreferencesCategory category =
333
-                    (PreferencesCategory) model.get(i);
334
-            if (oldCategoryPath.equals(category.getPath())) {
335
-                indexToSelect = i;
336
-                break;
337
-            }
338
-        }
339
-        tabList.setSelectedIndex(indexToSelect);
340
-    }
341
-
342 320
     /**
343 321
      * Gets the maximum panel size.
344 322
      *

+ 1
- 6
src/com/dmdirc/addons/ui_swing/dialogs/prefs/UpdateConfigPanel.java Bestand weergeven

@@ -74,8 +74,6 @@ public class UpdateConfigPanel extends JPanel implements ActionListener,
74 74
     private JButton checkNow;
75 75
     /** Update channel. */
76 76
     private JComboBox updateChannel;
77
-    /** The prefs dialog that will be hosting the panel. */
78
-    private final SwingPreferencesDialog prefsDialog;
79 77
     /** The configuration to write settings changes to. */
80 78
     private final ConfigProvider userConfig;
81 79
     /** The configuration to read global settings from. */
@@ -88,7 +86,6 @@ public class UpdateConfigPanel extends JPanel implements ActionListener,
88 86
     /**
89 87
      * Instantiates a new update config panel.
90 88
      *
91
-     * @param prefsDialog The prefs dialog that will be hosting the panel.
92 89
      * @param userConfig The configuration to write settings changes to.
93 90
      * @param globalConfig The configuration to read global settings from.
94 91
      * @param updateManager The manager to read update information from.
@@ -96,12 +93,10 @@ public class UpdateConfigPanel extends JPanel implements ActionListener,
96 93
      */
97 94
     @Inject
98 95
     public UpdateConfigPanel(
99
-            final SwingPreferencesDialog prefsDialog,
100 96
             @UserConfig final ConfigProvider userConfig,
101 97
             @GlobalConfig final AggregateConfigProvider globalConfig,
102 98
             final CachingUpdateManager updateManager,
103 99
             final IdentityController identityController) {
104
-        this.prefsDialog = prefsDialog;
105 100
         this.userConfig = userConfig;
106 101
         this.globalConfig = globalConfig;
107 102
         this.updateManager = updateManager;
@@ -166,7 +161,7 @@ public class UpdateConfigPanel extends JPanel implements ActionListener,
166 161
      * Lays out the components.
167 162
      */
168 163
     private void layoutComponents() {
169
-        setLayout(new MigLayout("fill, ins 0, hmax " + prefsDialog.getPanelHeight()));
164
+        setLayout(new MigLayout("fill, ins 0, hmax 500"));
170 165
 
171 166
         add(new JLabel("Update checking:"), "split");
172 167
         add(enable, "growx");

Laden…
Annuleren
Opslaan