优化代码

This commit is contained in:
yang 2022-10-16 09:03:37 +08:00
parent 38206f10c0
commit 3169905ae9
3 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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();