Added customizable download path and ability to save without FileChooser
This commit is contained in:
@ -77,6 +77,10 @@ public class Settings {
|
||||
items.putIfAbsent("enterToSend", new SettingsItem<>(true, "Enter to send", "Sends a message by pressing the enter key."));
|
||||
items.putIfAbsent("hideOnClose", new SettingsItem<>(true, "Hide on close", "Hides the chat window when it is closed."));
|
||||
items.putIfAbsent("currentTheme", new SettingsItem<>("dark", "Current Theme Name", "The name of the currently selected theme."));
|
||||
items.putIfAbsent("downloadLocation",
|
||||
new SettingsItem<>(new File(System.getProperty("user.home") + "/Downloads/"), "Download location",
|
||||
"The location where files will be saved to"));
|
||||
items.putIfAbsent("autoSaveDownloads", new SettingsItem<>(false, "Save without asking?", "Should downloads be saved without asking?"));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,6 +124,37 @@ public class Settings {
|
||||
*/
|
||||
public void setEnterToSend(boolean enterToSend) { ((SettingsItem<Boolean>) items.get("enterToSend")).set(enterToSend); }
|
||||
|
||||
/**
|
||||
* @return whether Envoy will prompt a dialogue before saving an
|
||||
* {@link envoy.data.Attachment}
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public Boolean isDownloadSavedWithoutAsking() { return (Boolean) items.get("autoSaveDownloads").get(); }
|
||||
|
||||
/**
|
||||
* Sets whether Envoy will prompt a dialogue before saving an
|
||||
* {@link envoy.data.Attachment}.
|
||||
*
|
||||
* @param autosaveDownload whether a download should be saved without asking
|
||||
* before
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public void setDownloadSavedWithoutAsking(boolean autosaveDownload) { ((SettingsItem<Boolean>) items.get("autoSaveDownloads")).set(autosaveDownload); }
|
||||
|
||||
/**
|
||||
* @return the path where downloads should be saved
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public File getDownloadLocation() { return (File) items.get("downloadLocation").get(); }
|
||||
|
||||
/**
|
||||
* Sets the path where downloads should be saved.
|
||||
*
|
||||
* @param downloadLocation the path to set
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public void setDownloadLocation(File downloadLocation) { ((SettingsItem<File>) items.get("downloadLocation")).set(downloadLocation); }
|
||||
|
||||
/**
|
||||
* @return the current on close mode.
|
||||
* @since Envoy Client v0.3-alpha
|
||||
|
Reference in New Issue
Block a user