Add mp.update.check property to disable update checking.
This commit is contained in:
parent
1e8a832cba
commit
a8bb434ded
@ -6,7 +6,7 @@
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<logger name="com.lyndir" level="${log.level:-INFO}" />
|
||||
<logger name="com.lyndir" level="${mp.log.level:-INFO}" />
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.lyndir.masterpassword;
|
||||
|
||||
import com.lyndir.lhunath.opal.system.util.ConversionUtils;
|
||||
|
||||
|
||||
/**
|
||||
* @author lhunath, 2014-08-31
|
||||
*/
|
||||
public class Config {
|
||||
|
||||
private static final Config instance = new Config();
|
||||
|
||||
public static Config get() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public boolean checkForUpdates() {
|
||||
return ConversionUtils.toBoolean( System.getProperty( "mp.update.check" ) ).or( true );
|
||||
}
|
||||
}
|
@ -48,6 +48,20 @@ public class GUI implements UnlockFrame.SignInCallback {
|
||||
public static void main(final String[] args)
|
||||
throws IOException {
|
||||
|
||||
if (Config.get().checkForUpdates())
|
||||
checkUpdate();
|
||||
|
||||
GUI gui;
|
||||
try {
|
||||
gui = TypeUtils.newInstance( AppleGUI.class );
|
||||
}
|
||||
catch (NoClassDefFoundError e) {
|
||||
gui = new GUI();
|
||||
}
|
||||
gui.open();
|
||||
}
|
||||
|
||||
private static void checkUpdate() {
|
||||
try {
|
||||
Enumeration<URL> manifestURLs = Thread.currentThread().getContextClassLoader().getResources( JarFile.MANIFEST_NAME );
|
||||
while (manifestURLs.hasMoreElements()) {
|
||||
@ -74,15 +88,6 @@ public class GUI implements UnlockFrame.SignInCallback {
|
||||
catch (IOException e) {
|
||||
logger.wrn( e, "Couldn't check for version update." );
|
||||
}
|
||||
|
||||
GUI gui;
|
||||
try {
|
||||
gui = TypeUtils.newInstance( AppleGUI.class );
|
||||
}
|
||||
catch (NoClassDefFoundError e) {
|
||||
gui = new GUI();
|
||||
}
|
||||
gui.open();
|
||||
}
|
||||
|
||||
void open() {
|
||||
|
@ -6,7 +6,7 @@
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<logger name="com.lyndir" level="${log.level:-INFO}" />
|
||||
<logger name="com.lyndir" level="${mp.log.level:-INFO}" />
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
|
Loading…
Reference in New Issue
Block a user