diff --git a/resources/disklist.png b/resources/disklist.png index 95634ba..48e2555 100644 Binary files a/resources/disklist.png and b/resources/disklist.png differ diff --git a/src/com/bytezone/diskbrowser/duplicates/DisksWindow.java b/src/com/bytezone/diskbrowser/duplicates/DisksWindow.java index a857dd1..7d3404c 100644 --- a/src/com/bytezone/diskbrowser/duplicates/DisksWindow.java +++ b/src/com/bytezone/diskbrowser/duplicates/DisksWindow.java @@ -120,7 +120,7 @@ public class DisksWindow extends JFrame } }); - scrollPane.setPreferredSize (new Dimension (1200, 700)); + scrollPane.setPreferredSize (new Dimension (1200, 693)); setDefaultCloseOperation (HIDE_ON_CLOSE); deleteWindow = new DeleteWindow (rootFolderData); diff --git a/src/com/bytezone/diskbrowser/gui/AbstractSaveAction.java b/src/com/bytezone/diskbrowser/gui/AbstractSaveAction.java index 548cd1c..0ee9a6d 100644 --- a/src/com/bytezone/diskbrowser/gui/AbstractSaveAction.java +++ b/src/com/bytezone/diskbrowser/gui/AbstractSaveAction.java @@ -43,55 +43,26 @@ public abstract class AbstractSaveAction extends DefaultAction void saveBuffer (byte[] buffer) // ---------------------------------------------------------------------------------// { - if (fileChooser.showSaveDialog (null) == JFileChooser.APPROVE_OPTION) + if (fileChooser.showSaveDialog (null) != JFileChooser.APPROVE_OPTION) + return; + + File file = fileChooser.getSelectedFile (); + try { - File file = fileChooser.getSelectedFile (); - try - { - Files.write (file.toPath (), buffer, StandardOpenOption.CREATE_NEW); - JOptionPane.showMessageDialog (null, - String.format ("File %s saved", file.getName ())); - } - catch (FileAlreadyExistsException e) - { - JOptionPane.showMessageDialog (null, - "File " + file.getName () + " already exists", "Failed", - JOptionPane.ERROR_MESSAGE); - } - catch (IOException e) - { - e.printStackTrace (); - JOptionPane.showMessageDialog (null, "File failed to save - " + e.getMessage (), - "Failed", JOptionPane.ERROR_MESSAGE); - } + Files.write (file.toPath (), buffer, StandardOpenOption.CREATE_NEW); + JOptionPane.showMessageDialog (null, + String.format ("File %s saved", file.getName ())); + } + catch (FileAlreadyExistsException e) + { + JOptionPane.showMessageDialog (null, "File " + file.getName () + " already exists", + "Failed", JOptionPane.ERROR_MESSAGE); + } + catch (IOException e) + { + e.printStackTrace (); + JOptionPane.showMessageDialog (null, "File failed to save - " + e.getMessage (), + "Failed", JOptionPane.ERROR_MESSAGE); } } - - // ---------------------------------------------------------------------------------// - // void saveFile (Path sourcePath) - // // ---------------------------------------------------------------------------------// - // { - // if (fileChooser.showSaveDialog (null) == JFileChooser.APPROVE_OPTION) - // { - // File file = fileChooser.getSelectedFile (); - // try - // { - // Files.copy (sourcePath, file.toPath ()); - // JOptionPane.showMessageDialog (null, - // String.format ("File %s saved", file.getName ())); - // } - // catch (FileAlreadyExistsException e) - // { - // JOptionPane.showMessageDialog (null, - // "File " + file.getName () + " already exists", "Failed", - // JOptionPane.ERROR_MESSAGE); - // } - // catch (IOException e) - // { - // e.printStackTrace (); - // JOptionPane.showMessageDialog (null, "File failed to save - " + e.getMessage (), - // "Failed", JOptionPane.ERROR_MESSAGE); - // } - // } - // } } diff --git a/src/com/bytezone/diskbrowser/gui/SaveDiskAction.java b/src/com/bytezone/diskbrowser/gui/SaveDiskAction.java index 9dd9eaf..707fa1b 100644 --- a/src/com/bytezone/diskbrowser/gui/SaveDiskAction.java +++ b/src/com/bytezone/diskbrowser/gui/SaveDiskAction.java @@ -40,11 +40,10 @@ class SaveDiskAction extends AbstractSaveAction implements DiskSelectionListener String suffix = blocks <= 560 ? ".dsk" : ".hdv"; setSelectedFile (new File (formattedDisk.getName () + suffix)); - // saveFile (disk.getFile ().toPath ()); saveBuffer (appleDisk.getBuffer ()); } else - System.out.println ("Not an AppleDisk"); + System.out.println ("Not an AppleDisk"); // impossible } // ---------------------------------------------------------------------------------// diff --git a/src/com/bytezone/diskbrowser/utilities/Utility.java b/src/com/bytezone/diskbrowser/utilities/Utility.java index 8020f30..8d71c37 100644 --- a/src/com/bytezone/diskbrowser/utilities/Utility.java +++ b/src/com/bytezone/diskbrowser/utilities/Utility.java @@ -34,7 +34,7 @@ public final class Utility public static final byte ASCII_CARET = 0x5E; private static final List suffixes = Arrays.asList ("po", "dsk", "do", "hdv", - "2mg", "v2d", "d13", "sdk", "shk", "bxy", "bny", "woz", "img", "dimg"); + "2mg", "d13", "sdk", "shk", "bxy", "bny", "woz", "img", "dimg"); // ---------------------------------------------------------------------------------// private Utility ()