Procházet zdrojové kódy

display blocking is broken, handle properly.

StadardQuestion dialog only tells you about one result.

Fixes issue 3964

Change-Id: I247c3bc8ffc5a2050eec6ba797e3ea1cf606eca7
Reviewed-on: http://gerrit.dmdirc.com/1382
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.4
Greg Holmes před 14 roky
rodič
revize
699f84d508

+ 11
- 6
src/com/dmdirc/addons/ui_swing/components/SwingSearchBar.java Zobrazit soubor

@@ -271,25 +271,30 @@ public final class SwingSearchBar extends JPanel implements ActionListener,
271 271
                  /**{@inheritDoc} */
272 272
                  @Override
273 273
                  public boolean save() {
274
+                     textPane.setScrollBarPosition(result.getEndLine());
275
+                     textPane.setSelectedTexT(result);
276
+                     validator.setValidates(true);
277
+                     searchBox.checkError();
274 278
                      return true;
275 279
                  }
276 280
 
281
+                 /**{@inheritDoc} */
277 282
                  @Override
278 283
                  public void cancelled() {
279
-                     //Continue
284
+                     validator.setValidates(true);
285
+                     searchBox.checkError();
280 286
                  }
281 287
             };
282
-            dialog.displayBlocking();
283
-            foundText = dialog.getResult();
288
+            dialog.display();
289
+            return;
284 290
         } else {
285 291
             //found, select and return found
286 292
             textPane.setScrollBarPosition(result.getEndLine());
287 293
             textPane.setSelectedTexT(result);
288 294
             foundText = true;
295
+            validator.setValidates(foundText);
296
+            searchBox.checkError();
289 297
         }
290
-
291
-        validator.setValidates(foundText);
292
-        searchBox.checkError();
293 298
     }
294 299
 
295 300
     /**

+ 3
- 1
src/com/dmdirc/addons/ui_swing/dialogs/StandardQuestionDialog.java Zobrazit soubor

@@ -125,7 +125,9 @@ public abstract class StandardQuestionDialog extends StandardDialog {
125 125
             /** {@inheritDoc} */
126 126
             @Override
127 127
             public void windowClosed(WindowEvent e) {
128
-                cancelled();
128
+                if (!result) {
129
+                    cancelled();
130
+                }
129 131
             }
130 132
         });
131 133
     }

Načítá se…
Zrušit
Uložit