|
@@ -22,6 +22,7 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.addons.ui_swing.dialogs.profiles;
|
24
|
24
|
|
|
25
|
+import com.dmdirc.addons.ui_swing.MainFrame;
|
25
|
26
|
import com.dmdirc.config.Identity;
|
26
|
27
|
import com.dmdirc.config.IdentityManager;
|
27
|
28
|
import com.dmdirc.addons.ui_swing.components.ListScroller;
|
|
@@ -31,7 +32,6 @@ import com.dmdirc.addons.ui_swing.components.renderers.ProfileListCellRenderer;
|
31
|
32
|
import com.dmdirc.addons.ui_swing.dialogs.NewServerDialog;
|
32
|
33
|
|
33
|
34
|
import java.awt.Dialog.ModalityType;
|
34
|
|
-import java.awt.Window;
|
35
|
35
|
import java.awt.event.ActionEvent;
|
36
|
36
|
import java.awt.event.ActionListener;
|
37
|
37
|
import java.util.ArrayList;
|
|
@@ -77,17 +77,17 @@ public final class ProfileManagerDialog extends StandardDialog implements Action
|
77
|
77
|
private int selectedIndex;
|
78
|
78
|
/** Deleted profiles. */
|
79
|
79
|
private final List<Profile> deletedProfiles;
|
80
|
|
- /** Parent window. */
|
81
|
|
- private Window parentWindow;
|
|
80
|
+ /** main frame. */
|
|
81
|
+ private MainFrame mainFrame;
|
82
|
82
|
|
83
|
83
|
/**
|
84
|
84
|
* Creates a new instance of ProfileEditorDialog.
|
85
|
85
|
*
|
86
|
|
- * @param parentWindow Parent window
|
|
86
|
+ * @param parentWindow main frame
|
87
|
87
|
*/
|
88
|
|
- private ProfileManagerDialog(final Window parentWindow) {
|
89
|
|
- super(parentWindow, ModalityType.MODELESS);
|
90
|
|
- this.parentWindow = parentWindow;
|
|
88
|
+ private ProfileManagerDialog(final MainFrame mainFrame) {
|
|
89
|
+ super(mainFrame, ModalityType.MODELESS);
|
|
90
|
+ this.mainFrame = mainFrame;
|
91
|
91
|
deletedProfiles = new ArrayList<Profile>();
|
92
|
92
|
|
93
|
93
|
initComponents();
|
|
@@ -106,13 +106,13 @@ public final class ProfileManagerDialog extends StandardDialog implements Action
|
106
|
106
|
/**
|
107
|
107
|
* Creates the dialog if one doesn't exist, and displays it.
|
108
|
108
|
*
|
109
|
|
- * @param parentWindow Parent window
|
|
109
|
+ * @param mainFrame Main frame
|
110
|
110
|
*/
|
111
|
|
- public static void showProfileManagerDialog(final Window parentWindow) {
|
112
|
|
- me = getProfileManagerDialog(parentWindow);
|
|
111
|
+ public static void showProfileManagerDialog(final MainFrame mainFrame) {
|
|
112
|
+ me = getProfileManagerDialog(mainFrame);
|
113
|
113
|
|
114
|
114
|
me.pack();
|
115
|
|
- me.setLocationRelativeTo(parentWindow);
|
|
115
|
+ me.setLocationRelativeTo(mainFrame);
|
116
|
116
|
me.setVisible(true);
|
117
|
117
|
me.requestFocusInWindow();
|
118
|
118
|
}
|
|
@@ -120,14 +120,14 @@ public final class ProfileManagerDialog extends StandardDialog implements Action
|
120
|
120
|
/**
|
121
|
121
|
* Returns the current instance of the ProfileManagerDialog.
|
122
|
122
|
*
|
123
|
|
- * @param parentWindow Parent window
|
|
123
|
+ * @param mainFrame Main frame
|
124
|
124
|
*
|
125
|
125
|
* @return The current ProfileManagerDialog instance
|
126
|
126
|
*/
|
127
|
|
- public static ProfileManagerDialog getProfileManagerDialog(final Window parentWindow) {
|
|
127
|
+ public static ProfileManagerDialog getProfileManagerDialog(final MainFrame mainFrame) {
|
128
|
128
|
synchronized (ProfileManagerDialog.class) {
|
129
|
129
|
if (me == null) {
|
130
|
|
- me = new ProfileManagerDialog(parentWindow);
|
|
130
|
+ me = new ProfileManagerDialog(mainFrame);
|
131
|
131
|
}
|
132
|
132
|
}
|
133
|
133
|
|
|
@@ -144,7 +144,7 @@ public final class ProfileManagerDialog extends StandardDialog implements Action
|
144
|
144
|
|
145
|
145
|
model = new ProfileListModel();
|
146
|
146
|
profileList = new JList(model);
|
147
|
|
- details = new ProfileDetailPanel(model, parentWindow);
|
|
147
|
+ details = new ProfileDetailPanel(model, mainFrame);
|
148
|
148
|
addButton = new JButton("Add");
|
149
|
149
|
deleteButton = new JButton("Delete");
|
150
|
150
|
infoLabel =
|
|
@@ -217,7 +217,7 @@ public final class ProfileManagerDialog extends StandardDialog implements Action
|
217
|
217
|
dispose();
|
218
|
218
|
}
|
219
|
219
|
if (NewServerDialog.isNewServerDialogShowing()) {
|
220
|
|
- NewServerDialog.getNewServerDialog(parentWindow).populateProfiles();
|
|
220
|
+ NewServerDialog.getNewServerDialog(mainFrame).populateProfiles();
|
221
|
221
|
}
|
222
|
222
|
}
|
223
|
223
|
|