When pressing "Reset" button the state label will be updated accordingly
This commit is contained in:
parent
c65a800515
commit
f2b289f8c5
1
.gitignore
vendored
1
.gitignore
vendored
@ -160,3 +160,4 @@ $RECYCLE.BIN/
|
|||||||
/test.json
|
/test.json
|
||||||
/steam_api.md5
|
/steam_api.md5
|
||||||
/src/main/java/util/env/Default.java
|
/src/main/java/util/env/Default.java
|
||||||
|
/src/main/java/GetListOfDlc.java
|
||||||
|
@ -68,11 +68,7 @@ public class Controller {
|
|||||||
//retrieveDlcList_button.setDisable(true); // WIP
|
//retrieveDlcList_button.setDisable(true); // WIP
|
||||||
generate_tooltips();
|
generate_tooltips();
|
||||||
fix_dlc_textarea_prompt_text();
|
fix_dlc_textarea_prompt_text();
|
||||||
try {
|
reset(true);
|
||||||
read();
|
|
||||||
} catch (NullPointerException e) {
|
|
||||||
System.err.println("Can't fill out fields, no configuration file set!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void read() {
|
private void read() {
|
||||||
@ -114,12 +110,23 @@ public class Controller {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset() {
|
private void reset(boolean silent) {
|
||||||
|
if (silent) {
|
||||||
|
state_label.setText("");
|
||||||
|
} else {
|
||||||
|
state_label.setText("Resetting fields...");
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
config.read();
|
config.read();
|
||||||
read();
|
read();
|
||||||
|
if (!silent) {
|
||||||
|
state_label.setText("Successfully reset all fields!");
|
||||||
|
}
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
System.err.println("Can't fill out fields, no configuration file set!");
|
System.err.println("Can't fill out fields, no configuration file set!");
|
||||||
|
if (!silent) {
|
||||||
|
state_label.setText("Could not reset fields, no configuration file set!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +224,7 @@ public class Controller {
|
|||||||
config.setConfig(file.getParent() + "\\cream_api.ini");
|
config.setConfig(file.getParent() + "\\cream_api.ini");
|
||||||
path_textfield.setText(file.getParent());
|
path_textfield.setText(file.getParent());
|
||||||
steamApiPathString = file.getAbsolutePath();
|
steamApiPathString = file.getAbsolutePath();
|
||||||
reset();
|
reset(true);
|
||||||
} catch (ConfigurationException | IOException e) {
|
} catch (ConfigurationException | IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -261,4 +268,8 @@ public class Controller {
|
|||||||
path_button.setDisable(b);
|
path_button.setDisable(b);
|
||||||
retrieveDlcList_button.setDisable(b);
|
retrieveDlcList_button.setDisable(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetFromButton() {
|
||||||
|
reset(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,6 @@
|
|||||||
<JFXTextArea fx:id="dlc_textarea" promptText="List of DLC..." GridPane.columnSpan="2147483647" GridPane.rowIndex="6" />
|
<JFXTextArea fx:id="dlc_textarea" promptText="List of DLC..." GridPane.columnSpan="2147483647" GridPane.rowIndex="6" />
|
||||||
<JFXButton fx:id="retrieveDlcList_button" maxHeight="1.7976931348623157E308" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onAction="#getDlcList" ripplerFill="BLACK" style="-fx-background-color: #ddd;" text="Get DLCs for AppID" GridPane.rowIndex="7" />
|
<JFXButton fx:id="retrieveDlcList_button" maxHeight="1.7976931348623157E308" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onAction="#getDlcList" ripplerFill="BLACK" style="-fx-background-color: #ddd;" text="Get DLCs for AppID" GridPane.rowIndex="7" />
|
||||||
<JFXButton fx:id="save_button" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" onAction="#save" ripplerFill="BLACK" style="-fx-background-color: #ddd;" text="Save" GridPane.columnIndex="1" GridPane.rowIndex="7" />
|
<JFXButton fx:id="save_button" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" onAction="#save" ripplerFill="BLACK" style="-fx-background-color: #ddd;" text="Save" GridPane.columnIndex="1" GridPane.rowIndex="7" />
|
||||||
<JFXButton fx:id="reset_button" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" onAction="#reset" ripplerFill="BLACK" style="-fx-background-color: #ddd;" text="Reset" GridPane.columnIndex="2" GridPane.rowIndex="7" />
|
<JFXButton fx:id="reset_button" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" onAction="#resetFromButton" ripplerFill="BLACK" style="-fx-background-color: #ddd;" text="Reset" GridPane.columnIndex="2" GridPane.rowIndex="7" />
|
||||||
<Label fx:id="state_label" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" GridPane.columnSpan="2147483647" GridPane.rowIndex="8" />
|
<Label fx:id="state_label" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" GridPane.columnSpan="2147483647" GridPane.rowIndex="8" />
|
||||||
</GridPane>
|
</GridPane>
|
||||||
|
Loading…
Reference in New Issue
Block a user