Display settings frame on first start
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@71 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
de0f622378
commit
a91a0e159d
|
@ -183,6 +183,11 @@ public class DavGatewayTray {
|
||||||
} catch (AWTException e) {
|
} catch (AWTException e) {
|
||||||
System.err.println(e);
|
System.err.println(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// display settings frame on first start
|
||||||
|
if (Settings.isFirstStart()) {
|
||||||
|
settingsFrame.setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (NoClassDefFoundError e) {
|
} catch (NoClassDefFoundError e) {
|
||||||
|
|
|
@ -15,10 +15,15 @@ public class Settings {
|
||||||
|
|
||||||
private static final Properties SETTINGS = new Properties();
|
private static final Properties SETTINGS = new Properties();
|
||||||
private static String configFilePath;
|
private static String configFilePath;
|
||||||
|
private static boolean isFirstStart;
|
||||||
|
|
||||||
public static synchronized void setConfigFilePath(String value) {
|
public static synchronized void setConfigFilePath(String value) {
|
||||||
configFilePath = value;
|
configFilePath = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isFirstStart() {
|
||||||
|
return isFirstStart;
|
||||||
|
}
|
||||||
|
|
||||||
public static synchronized void load() {
|
public static synchronized void load() {
|
||||||
FileReader fileReader = null;
|
FileReader fileReader = null;
|
||||||
|
@ -32,9 +37,12 @@ public class Settings {
|
||||||
fileReader = new FileReader(configFile);
|
fileReader = new FileReader(configFile);
|
||||||
SETTINGS.load(fileReader);
|
SETTINGS.load(fileReader);
|
||||||
} else {
|
} else {
|
||||||
|
isFirstStart = true;
|
||||||
|
|
||||||
|
// first start : set default values, ports above 1024 for linux
|
||||||
SETTINGS.put("davmail.url", "http://exchangeServer/exchange/");
|
SETTINGS.put("davmail.url", "http://exchangeServer/exchange/");
|
||||||
SETTINGS.put("davmail.popPort", "110");
|
SETTINGS.put("davmail.popPort", "1110");
|
||||||
SETTINGS.put("davmail.smtpPort", "25");
|
SETTINGS.put("davmail.smtpPort", "1025");
|
||||||
SETTINGS.put("davmail.keepDelay", "30");
|
SETTINGS.put("davmail.keepDelay", "30");
|
||||||
SETTINGS.put("davmail.enableProxy", "false");
|
SETTINGS.put("davmail.enableProxy", "false");
|
||||||
SETTINGS.put("davmail.proxyHost", "");
|
SETTINGS.put("davmail.proxyHost", "");
|
||||||
|
|
Loading…
Reference in New Issue