to strings and added print config

This commit is contained in:
aj 2019-05-13 07:56:11 +01:00
parent 0371080b00
commit 7a6b9e34c3
4 changed files with 16 additions and 1 deletions

View File

@ -65,7 +65,7 @@ public class Config {
String string = "config:"; String string = "config:";
for(ConfigVariable i: variables) { for(ConfigVariable i: variables) {
string += " " + i.getKey() + " " + i.getValue(); string += " " + i.toString();
} }
return string; return string;

View File

@ -62,5 +62,14 @@ public class ConfigVariable {
public List<VariableListener> getListeners() { public List<VariableListener> getListeners() {
return listeners; return listeners;
} }
@Override
public String toString() {
String string = getKey() + ": " + getValue();
if(isTemporary())
string += " (temp)";
return string;
}
} }

View File

@ -356,6 +356,11 @@ public class RootController {
} }
} }
@FXML
protected void handlePrintConfig(ActionEvent event) {
System.out.println(FmFramework.getSessionConfig());
}
@FXML @FXML
protected void handleScrobble(ActionEvent event) throws IOException { protected void handleScrobble(ActionEvent event) throws IOException {

View File

@ -36,6 +36,7 @@
<MenuItem fx:id="menuItemScrobble" mnemonicParsing="false" onAction="#handleScrobble" text="scrobble" /> <MenuItem fx:id="menuItemScrobble" mnemonicParsing="false" onAction="#handleScrobble" text="scrobble" />
<MenuItem fx:id="menuItemOpenConsole" mnemonicParsing="false" onAction="#handleOpenConsole" text="open console" /> <MenuItem fx:id="menuItemOpenConsole" mnemonicParsing="false" onAction="#handleOpenConsole" text="open console" />
<MenuItem mnemonicParsing="false" onAction="#handleChangeUsername" text="set username" /> <MenuItem mnemonicParsing="false" onAction="#handleChangeUsername" text="set username" />
<MenuItem fx:id="menuItemPrintConfig" mnemonicParsing="false" onAction="#handlePrintConfig" text="print config" />
</items> </items>
</Menu> </Menu>
</menus> </menus>