Add: support for user-global configuration.
This commit is contained in:
@@ -2,6 +2,7 @@ package dev.photosync.ui.screen;
|
||||
|
||||
import dev.photosync.core.config.AutoCaptureSettings;
|
||||
import dev.photosync.core.config.BrowserSettings;
|
||||
import dev.photosync.core.config.ConfigLocation;
|
||||
import dev.photosync.core.config.NotificationSettings;
|
||||
import dev.photosync.core.config.PhotoSyncConfig;
|
||||
import dev.photosync.core.config.UploadSettings;
|
||||
@@ -122,6 +123,7 @@ public final class SettingsScreen extends PhotoSyncScreen {
|
||||
rows.clear();
|
||||
measuredLineHeight = -1;
|
||||
|
||||
buildStorage();
|
||||
buildConnection();
|
||||
buildUpload();
|
||||
buildAutoCapture();
|
||||
@@ -129,6 +131,24 @@ public final class SettingsScreen extends PhotoSyncScreen {
|
||||
buildBrowser();
|
||||
}
|
||||
|
||||
private void buildStorage() {
|
||||
heading("photosync.settings.section.storage");
|
||||
Toggle outsideGame = new Toggle(chrome, chrome.translate("photosync.settings.user_config_location"),
|
||||
() -> draft().location() == ConfigLocation.USER,
|
||||
value -> edit(config -> config.toBuilder()
|
||||
.location(value ? ConfigLocation.USER : ConfigLocation.INSTANCE)
|
||||
.build()));
|
||||
outsideGame.describedAs(chrome.translate("photosync.settings.user_config_location.detail",
|
||||
ui.core().locations().directory(ConfigLocation.USER)));
|
||||
rows.add(new Row("photosync.settings.user_config_location", content.add(outsideGame), true));
|
||||
control("photosync.settings.config_folder",
|
||||
new Button(chrome, chrome.translate("photosync.settings.show_folder"), this::revealConfigFolder));
|
||||
}
|
||||
|
||||
private void revealConfigFolder() {
|
||||
ui.game().reveal(ui.core().dataDirectory());
|
||||
}
|
||||
|
||||
private void buildConnection() {
|
||||
heading("photosync.settings.section.connection");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user