Refactor
This commit is contained in:
parent
2db3a8bb55
commit
8b73ca9d40
|
@ -188,12 +188,6 @@ public class Main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle file arguments
|
|
||||||
List<File> files = args.getFiles(false);
|
|
||||||
if (files.size() > 0) {
|
|
||||||
eventBus.post(new FileTransferable(files));
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// restore previous size and location
|
// restore previous size and location
|
||||||
restoreWindowBounds(frame, Settings.forPackage(MainFrame.class));
|
restoreWindowBounds(frame, Settings.forPackage(MainFrame.class));
|
||||||
|
@ -246,6 +240,12 @@ public class Main {
|
||||||
frame.setIconImages(ResourceManager.getApplicationIcons());
|
frame.setIconImages(ResourceManager.getApplicationIcons());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle file arguments
|
||||||
|
List<File> files = args.getFiles(false);
|
||||||
|
if (files.size() > 0) {
|
||||||
|
eventBus.post(new FileTransferable(files));
|
||||||
|
}
|
||||||
|
|
||||||
// start application
|
// start application
|
||||||
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class MacAppUtilities {
|
||||||
Application.getApplication().setOpenFileHandler(evt -> {
|
Application.getApplication().setOpenFileHandler(evt -> {
|
||||||
List<File> files = evt.getFiles();
|
List<File> files = evt.getFiles();
|
||||||
if (files.size() > 0) {
|
if (files.size() > 0) {
|
||||||
SwingUtilities.invokeLater(() -> handler.accept(evt.getFiles()));
|
SwingUtilities.invokeLater(() -> handler.accept(files));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|
Loading…
Reference in New Issue