-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
97 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
package cn.reddragon.eportal; | ||
|
||
import cn.reddragon.eportal.config.ConfigManager; | ||
import cn.reddragon.eportal.utils.Authenticator; | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
EPortal.main(args); | ||
Thread.currentThread().setName("EPortal Main"); | ||
EPortal.askThread.setDaemon(true); | ||
Authenticator.checkOnline(); | ||
try { | ||
if (Authenticator.online) { | ||
Authenticator.updateUserIndex(); | ||
} | ||
} catch (NullPointerException e) { | ||
EPortal.logger.error("启动时出错!", e); | ||
System.exit(0); | ||
} | ||
EPortal.launch(); | ||
ConfigManager.saveConfigs(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/cn/reddragon/eportal/config/configs/AutoReconnectConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cn.reddragon.eportal.config.configs; | ||
|
||
import cn.reddragon.eportal.EPortal; | ||
import cn.reddragon.eportal.config.AbstractConfig; | ||
import com.google.gson.JsonElement; | ||
import com.google.gson.JsonPrimitive; | ||
import javafx.scene.control.CheckMenuItem; | ||
|
||
public class AutoReconnectConfig extends AbstractConfig { | ||
public AutoReconnectConfig() { | ||
super("AutoReconnect"); | ||
} | ||
|
||
public static boolean getAutoReconnect() { | ||
return ((CheckMenuItem) EPortal.controller.menuBar.getMenus().get(0).getItems().get(0)).isSelected(); | ||
} | ||
|
||
@Override | ||
public JsonElement toJson() { | ||
return new JsonPrimitive(getAutoReconnect()); | ||
} | ||
|
||
@Override | ||
public void fromJson(JsonElement element) { | ||
((CheckMenuItem) EPortal.controller.menuBar.getMenus().get(0).getItems().get(0)).setSelected(element.getAsBoolean()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters