mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Refactor AUMID
This commit is contained in:
parent
da26c42c01
commit
a76f0012df
@ -121,11 +121,6 @@ public class Main {
|
|||||||
configureLicense(f);
|
configureLicense(f);
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
// set AUMID manually for legacy processes
|
|
||||||
if (isWindowsApp()) {
|
|
||||||
WinAppUtilities.setAppUserModelID(getApplicationName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int status = new ArgumentProcessor().run(args);
|
int status = new ArgumentProcessor().run(args);
|
||||||
@ -256,13 +251,8 @@ public class Main {
|
|||||||
});
|
});
|
||||||
} else if (isWindowsApp()) {
|
} else if (isWindowsApp()) {
|
||||||
// Windows-specific configuration
|
// Windows-specific configuration
|
||||||
WinAppUtilities.initializeApplication();
|
WinAppUtilities.initializeApplication(isUWP() ? null : getApplicationName());
|
||||||
frame.setIconImages(ResourceManager.getApplicationIconImages());
|
frame.setIconImages(ResourceManager.getApplicationIconImages());
|
||||||
|
|
||||||
// set AUMID manually for legacy processes
|
|
||||||
if (!isUWP()) {
|
|
||||||
WinAppUtilities.setAppUserModelID(getApplicationName());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// generic Linux / FreeBSD / Solaris configuration
|
// generic Linux / FreeBSD / Solaris configuration
|
||||||
frame.setIconImages(ResourceManager.getApplicationIconImages());
|
frame.setIconImages(ResourceManager.getApplicationIconImages());
|
||||||
|
@ -15,9 +15,9 @@ import com.sun.jna.ptr.PointerByReference;
|
|||||||
|
|
||||||
public class WinAppUtilities {
|
public class WinAppUtilities {
|
||||||
|
|
||||||
public static void setAppUserModelID(String appID) {
|
public static void setAppUserModelID(String aumid) {
|
||||||
try {
|
try {
|
||||||
Shell32.INSTANCE.SetCurrentProcessExplicitAppUserModelID(new WString(appID));
|
Shell32.INSTANCE.SetCurrentProcessExplicitAppUserModelID(new WString(aumid));
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
debug.log(Level.WARNING, t.getMessage(), t);
|
debug.log(Level.WARNING, t.getMessage(), t);
|
||||||
}
|
}
|
||||||
@ -35,7 +35,11 @@ public class WinAppUtilities {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initializeApplication() {
|
public static void initializeApplication(String aumid) {
|
||||||
|
if (aumid != null) {
|
||||||
|
setAppUserModelID(aumid);
|
||||||
|
}
|
||||||
|
|
||||||
// improved UI defaults
|
// improved UI defaults
|
||||||
UIManager.put("TitledBorder.border", createCompoundBorder(createLineBorder(new Color(0xD7D7D7), 1, true), createCompoundBorder(createMatteBorder(6, 5, 6, 5, new Color(0xE5E5E5)), createEmptyBorder(0, 2, 0, 2))));
|
UIManager.put("TitledBorder.border", createCompoundBorder(createLineBorder(new Color(0xD7D7D7), 1, true), createCompoundBorder(createMatteBorder(6, 5, 6, 5, new Color(0xE5E5E5)), createEmptyBorder(0, 2, 0, 2))));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user