mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
create MacApplicationMenu if running on Mac
This commit is contained in:
parent
2d1b5e0f1b
commit
1322018321
@ -59,12 +59,13 @@ public class Main {
|
||||
LOG.finer("Labels and Config initialized after " + (System.currentTimeMillis() - startTime));
|
||||
|
||||
MainComponent mainComponent = DaggerMainComponent.create();
|
||||
LOG.finer("ComponentRegistry initialized after " + (System.currentTimeMillis() - startTime));
|
||||
if (Platform.MAC_OS) mainComponent.createMacApplicationMenu();
|
||||
LOG.finer("Components initialized after " + (System.currentTimeMillis() - startTime));
|
||||
|
||||
processCommandLine(args, mainComponent);
|
||||
|
||||
// create the main window using dependency injection
|
||||
MainWindow mainWindow = mainComponent.getMainWindow();
|
||||
MainWindow mainWindow = mainComponent.createMainWindow();
|
||||
LOG.fine("Startup time: " + (System.currentTimeMillis() - startTime));
|
||||
|
||||
while (!mainWindow.isDisposed()) {
|
||||
@ -118,7 +119,7 @@ public class Main {
|
||||
|
||||
private static void processCommandLine(String[] args, MainComponent mainComponent) {
|
||||
if (args.length != 0) {
|
||||
CommandLineProcessor cli = mainComponent.getCommandLineProcessor();
|
||||
CommandLineProcessor cli = mainComponent.createCommandLineProcessor();
|
||||
try {
|
||||
cli.parse(args);
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ import javax.inject.Singleton;
|
||||
})
|
||||
@Singleton
|
||||
public interface MainComponent {
|
||||
MainWindow getMainWindow();
|
||||
MacApplicationMenu getMacApplicationMenu();
|
||||
CommandLineProcessor getCommandLineProcessor();
|
||||
MainWindow createMainWindow();
|
||||
MacApplicationMenu createMacApplicationMenu();
|
||||
CommandLineProcessor createCommandLineProcessor();
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ import javax.inject.Inject;
|
||||
* in order to conform better to Mac standards.
|
||||
*/
|
||||
public class MacApplicationMenu {
|
||||
|
||||
@Inject AboutDialog aboutDialog;
|
||||
@Inject PreferencesDialog preferencesDialog;
|
||||
@Inject SelectFetchersDialog selectFetchersDialog;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user