优化代码
This commit is contained in:
parent
38206f10c0
commit
3169905ae9
|
@ -204,7 +204,7 @@ public class SettingWindowController {
|
|||
// 是否开机自启
|
||||
selfStartingGroup.selectedToggleProperty()
|
||||
.addListener((observable, oldValue, newValue) -> {
|
||||
basicConfiguration.setSelfStarting(Boolean.parseBoolean((String) newValue.getUserData()));
|
||||
basicConfiguration.setAutoStart(Boolean.parseBoolean((String) newValue.getUserData()));
|
||||
AutoStartFile.toggleExists();
|
||||
});
|
||||
// 是否透明
|
||||
|
@ -231,7 +231,7 @@ public class SettingWindowController {
|
|||
|
||||
private void initBasicConfiguration() {
|
||||
// 是否开机自启
|
||||
if (basicConfiguration.getSelfStarting()) {
|
||||
if (basicConfiguration.getAutoStart()) {
|
||||
selfStartingBtn.setSelected(true);
|
||||
} else {
|
||||
notSelfStartingBtn.setSelected(true);
|
||||
|
|
|
@ -6,13 +6,13 @@ package org.rococy.roomit.domain;
|
|||
*/
|
||||
public class BasicConfiguration {
|
||||
|
||||
private Boolean selfStarting;
|
||||
private Boolean autoStart;
|
||||
|
||||
public Boolean getSelfStarting() {
|
||||
return selfStarting;
|
||||
public Boolean getAutoStart() {
|
||||
return autoStart;
|
||||
}
|
||||
|
||||
public void setSelfStarting(Boolean selfStarting) {
|
||||
this.selfStarting = selfStarting;
|
||||
public void setAutoStart(Boolean autoStart) {
|
||||
this.autoStart = autoStart;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class AutoStartFile {
|
|||
private static final BasicConfiguration BASIC_CONFIGURATION = ConfigurationManager.getBasicConfiguration();
|
||||
|
||||
public static void toggleExists() {
|
||||
if (BASIC_CONFIGURATION.getSelfStarting()) {
|
||||
if (BASIC_CONFIGURATION.getAutoStart()) {
|
||||
generate();
|
||||
} else {
|
||||
delete();
|
||||
|
|
Loading…
Reference in New Issue