altosui: Match directories in hex file matcher
authorKeith Packard <keithp@keithp.com>
Mon, 9 Dec 2013 04:34:11 +0000 (20:34 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 9 Dec 2013 04:34:11 +0000 (20:34 -0800)
This makes it possible to navigate around the file system

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosFlashUI.java

index 7e4cddb12dd0b1cd31b42082b08467cd1c76cb2a..5ec5ea8a2bc49a645640a05d8b3d2c1e09afa0a8 100644 (file)
@@ -192,7 +192,7 @@ public class AltosFlashUI
                }
 
                public boolean accept(File file) {
                }
 
                public boolean accept(File file) {
-                       return file.getName().startsWith(head) && file.getName().endsWith(".ihx");
+                       return !file.isFile() || (file.getName().startsWith(head) && file.getName().endsWith(".ihx"));
                }
 
                public String getDescription() {
                }
 
                public String getDescription() {
@@ -225,11 +225,8 @@ public class AltosFlashUI
                
                if (!device.matchProduct(AltosLib.product_altusmetrum)) {
                        for (int i = 0; i < filters.length; i++) {
                
                if (!device.matchProduct(AltosLib.product_altusmetrum)) {
                        for (int i = 0; i < filters.length; i++) {
-                               System.out.printf ("device %s filter %d\n", device, filters[i].product);
-                               if (device != null && device.matchProduct(filters[i].product)) {
-                                       System.out.printf ("select filter %s\n", filters[i].head);
+                               if (device != null && device.matchProduct(filters[i].product))
                                        hexfile_chooser.setFileFilter(filters[i]);
                                        hexfile_chooser.setFileFilter(filters[i]);
-                               }
                        }
                }
 
                        }
                }