* refactor
This commit is contained in:
parent
83463e09e3
commit
7ecb4cb146
|
@ -53,7 +53,7 @@ import net.filebot.cli.ArgumentProcessor;
|
||||||
import net.filebot.cli.CmdlineOperations;
|
import net.filebot.cli.CmdlineOperations;
|
||||||
import net.filebot.format.ExpressionFormat;
|
import net.filebot.format.ExpressionFormat;
|
||||||
import net.filebot.gio.GVFS;
|
import net.filebot.gio.GVFS;
|
||||||
import net.filebot.mac.MacAppHelper;
|
import net.filebot.mac.MacAppUtilities;
|
||||||
import net.filebot.ui.MainFrame;
|
import net.filebot.ui.MainFrame;
|
||||||
import net.filebot.ui.PanelBuilder;
|
import net.filebot.ui.PanelBuilder;
|
||||||
import net.filebot.ui.SinglePanelFrame;
|
import net.filebot.ui.SinglePanelFrame;
|
||||||
|
@ -284,7 +284,7 @@ public class Main {
|
||||||
|
|
||||||
// window settings
|
// window settings
|
||||||
if (Settings.isMacSandbox()) {
|
if (Settings.isMacSandbox()) {
|
||||||
MacAppHelper.setWindowCanFullScreen(frame);
|
MacAppUtilities.setWindowCanFullScreen(frame);
|
||||||
}
|
}
|
||||||
frame.setLocationByPlatform(true);
|
frame.setLocationByPlatform(true);
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,9 @@ import java.lang.reflect.Method;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import net.filebot.Main;
|
|
||||||
import ca.weblite.objc.Client;
|
import ca.weblite.objc.Client;
|
||||||
|
|
||||||
public class MacAppHelper {
|
public class MacAppUtilities {
|
||||||
|
|
||||||
private static Client _objc;
|
private static Client _objc;
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@ public class MacAppHelper {
|
||||||
Method setWindowCanFullScreen = fullScreenUtilities.getMethod("setWindowCanFullScreen", new Class<?>[] { Window.class, boolean.class });
|
Method setWindowCanFullScreen = fullScreenUtilities.getMethod("setWindowCanFullScreen", new Class<?>[] { Window.class, boolean.class });
|
||||||
setWindowCanFullScreen.invoke(null, window, true);
|
setWindowCanFullScreen.invoke(null, window, true);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
Logger.getLogger(Main.class.getName()).log(Level.WARNING, "setWindowCanFullScreen not supported: " + t);
|
Logger.getLogger(MacAppUtilities.class.getName()).log(Level.WARNING, "setWindowCanFullScreen not supported: " + t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +47,7 @@ public class MacAppHelper {
|
||||||
Method requestForeground = application.getMethod("requestForeground", new Class<?>[] { boolean.class });
|
Method requestForeground = application.getMethod("requestForeground", new Class<?>[] { boolean.class });
|
||||||
requestForeground.invoke(instance, true);
|
requestForeground.invoke(instance, true);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
Logger.getLogger(Main.class.getName()).log(Level.WARNING, "requestForeground not supported: " + t);
|
Logger.getLogger(MacAppUtilities.class.getName()).log(Level.WARNING, "requestForeground not supported: " + t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -43,7 +43,7 @@ import net.filebot.Analytics;
|
||||||
import net.filebot.ResourceManager;
|
import net.filebot.ResourceManager;
|
||||||
import net.filebot.Settings;
|
import net.filebot.Settings;
|
||||||
import net.filebot.cli.GroovyPad;
|
import net.filebot.cli.GroovyPad;
|
||||||
import net.filebot.mac.MacAppHelper;
|
import net.filebot.mac.MacAppUtilities;
|
||||||
import net.filebot.ui.analyze.AnalyzePanelBuilder;
|
import net.filebot.ui.analyze.AnalyzePanelBuilder;
|
||||||
import net.filebot.ui.episodelist.EpisodeListPanelBuilder;
|
import net.filebot.ui.episodelist.EpisodeListPanelBuilder;
|
||||||
import net.filebot.ui.list.ListPanelBuilder;
|
import net.filebot.ui.list.ListPanelBuilder;
|
||||||
|
@ -143,7 +143,7 @@ public class MainFrame extends JFrame {
|
||||||
pad.setModalExclusionType(ModalExclusionType.TOOLKIT_EXCLUDE);
|
pad.setModalExclusionType(ModalExclusionType.TOOLKIT_EXCLUDE);
|
||||||
|
|
||||||
if (Settings.isMacSandbox()) {
|
if (Settings.isMacSandbox()) {
|
||||||
MacAppHelper.setWindowCanFullScreen(pad);
|
MacAppUtilities.setWindowCanFullScreen(pad);
|
||||||
}
|
}
|
||||||
pad.setLocationByPlatform(true);
|
pad.setLocationByPlatform(true);
|
||||||
pad.setVisible(true);
|
pad.setVisible(true);
|
||||||
|
@ -234,7 +234,7 @@ public class MainFrame extends JFrame {
|
||||||
|
|
||||||
// bring window to front when on dnd
|
// bring window to front when on dnd
|
||||||
if (Settings.isMacSandbox()) {
|
if (Settings.isMacSandbox()) {
|
||||||
MacAppHelper.requestForeground();
|
MacAppUtilities.requestForeground();
|
||||||
} else {
|
} else {
|
||||||
SwingUtilities.getWindowAncestor(((DropTarget) dtde.getSource()).getComponent()).toFront();
|
SwingUtilities.getWindowAncestor(((DropTarget) dtde.getSource()).getComponent()).toFront();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue