瀏覽代碼

Fixes issue 3733: SSD per profile performs dont work at all

Change-Id: I899eea7dc76109d5c98b66570a79aaa2081c061b
Reviewed-on: http://gerrit.dmdirc.com/849
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.3
Gregory Holmes 14 年之前
父節點
當前提交
0afc286c4f
共有 1 個文件被更改,包括 11 次插入7 次删除
  1. 11
    7
      src/com/dmdirc/addons/ui_swing/dialogs/serversetting/PerformPanel.java

+ 11
- 7
src/com/dmdirc/addons/ui_swing/dialogs/serversetting/PerformPanel.java 查看文件

@@ -77,6 +77,9 @@ public final class PerformPanel extends JPanel implements ActionListener {
77 77
     /** Perform text area. */
78 78
     private JTextArea textarea;
79 79
 
80
+    /** Active perform. */
81
+    private int activePerform = 0;
82
+
80 83
     /**
81 84
      * Creates a new instance of IgnoreList.
82 85
      *
@@ -84,7 +87,6 @@ public final class PerformPanel extends JPanel implements ActionListener {
84 87
      */
85 88
     public PerformPanel(final Server server) {
86 89
         super();
87
-
88 90
         this.server = server;
89 91
 
90 92
         this.setOpaque(UIUtilities.getTabbedPaneOpaque());
@@ -123,6 +125,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
123 125
         target.addActionListener(this);
124 126
     }
125 127
 
128
+
126 129
     /** Loads the perform actions. */
127 130
     private void loadPerforms() {
128 131
         serverAction = PerformWrapper.getPerformWrapper().
@@ -155,7 +158,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
155 158
         if (profileNetworkAction == null) {
156 159
             profileNetworkPerform = "";
157 160
         } else {
158
-            profileNetworkPerform = implode(profileServerAction.getResponse());
161
+            profileNetworkPerform = implode(profileNetworkAction.getResponse());
159 162
         }
160 163
     }
161 164
 
@@ -198,7 +201,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
198 201
 
199 202
     /** Stores the text currently in the textarea into the perform strings. */
200 203
     private void storeText() {
201
-        switch (target.getSelectedIndex()) {
204
+        switch (activePerform) {
202 205
             case 0:
203 206
                 networkPerform = textarea.getText();
204 207
                 break;
@@ -220,7 +223,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
220 223
     public void savePerforms() {
221 224
         storeText();
222 225
 
223
-        if (!serverPerform.isEmpty() || serverAction != null) {
226
+        if (!serverPerform.isEmpty()) {
224 227
             if (serverAction == null) {
225 228
                 serverAction = PerformWrapper.getPerformWrapper().
226 229
                         createActionForServer(server.getName());
@@ -229,7 +232,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
229 232
             serverAction.save();
230 233
         }
231 234
 
232
-        if (!networkPerform.isEmpty() || networkAction != null) {
235
+        if (!networkPerform.isEmpty()) {
233 236
             if (networkAction == null) {
234 237
                 networkAction = PerformWrapper.getPerformWrapper().
235 238
                         createActionForNetwork(server.getNetwork());
@@ -238,7 +241,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
238 241
             networkAction.save();
239 242
         }
240 243
 
241
-        if (!profileNetworkPerform.isEmpty() || profileNetworkAction != null) {
244
+        if (!profileNetworkPerform.isEmpty()) {
242 245
             if (profileNetworkAction == null) {
243 246
                 profileNetworkAction = PerformWrapper.getPerformWrapper().
244 247
                         createActionForNetwork(server.getNetwork(),
@@ -248,7 +251,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
248 251
             profileNetworkAction.save();
249 252
         }
250 253
 
251
-        if (!profileServerPerform.isEmpty() || profileServerAction != null) {
254
+        if (!profileServerPerform.isEmpty()) {
252 255
             if (profileServerAction == null) {
253 256
                 profileServerAction = PerformWrapper.getPerformWrapper().
254 257
                         createActionForServer(server.getName(),
@@ -267,6 +270,7 @@ public final class PerformPanel extends JPanel implements ActionListener {
267 270
     @Override
268 271
     public void actionPerformed(final ActionEvent e) {
269 272
         storeText();
273
+        activePerform = target.getSelectedIndex();
270 274
         populatePerform();
271 275
     }
272 276
 

Loading…
取消
儲存