|
|
@ -49,6 +49,7 @@ import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Singleton object to access all application settings, including stored servers, web search sites and RSS feeds. |
|
|
|
* Singleton object to access all application settings, including stored servers, web search sites and RSS feeds. |
|
|
|
|
|
|
|
* |
|
|
|
* @author Eric Kok |
|
|
|
* @author Eric Kok |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@EBean(scope = Scope.Singleton) |
|
|
|
@EBean(scope = Scope.Singleton) |
|
|
@ -69,6 +70,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns all available user-configured normal and seed servers |
|
|
|
* Returns all available user-configured normal and seed servers |
|
|
|
|
|
|
|
* |
|
|
|
* @return A list of all stored server settings objects |
|
|
|
* @return A list of all stored server settings objects |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<ServerSetting> getAllServerSettings() { |
|
|
|
public List<ServerSetting> getAllServerSettings() { |
|
|
@ -82,6 +84,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the order number/identifying key of the last server, normal or seedbox configured |
|
|
|
* Returns the order number/identifying key of the last server, normal or seedbox configured |
|
|
|
|
|
|
|
* |
|
|
|
* @return The zero-based order number (index) of the last stored server settings |
|
|
|
* @return The zero-based order number (index) of the last stored server settings |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getMaxOfAllServers() { |
|
|
|
public int getMaxOfAllServers() { |
|
|
@ -95,6 +98,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the server settings for either a normal or a seedbox server as the user configured. WARNING: This method |
|
|
|
* Returns the server settings for either a normal or a seedbox server as the user configured. WARNING: This method |
|
|
|
* does not check if the settings actually exist and may reply on empty default if called for a non-existing server. |
|
|
|
* does not check if the settings actually exist and may reply on empty default if called for a non-existing server. |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The order number/identifying key of the server's settings to retrieve, where the normal servers are |
|
|
|
* @param order The order number/identifying key of the server's settings to retrieve, where the normal servers are |
|
|
|
* first and the seedboxes are numbers thereafter onwards |
|
|
|
* first and the seedboxes are numbers thereafter onwards |
|
|
|
* @return The server settings object, loaded from shared preferences |
|
|
|
* @return The server settings object, loaded from shared preferences |
|
|
@ -116,6 +120,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns all available normal, user-configured servers (so no seedbox settings) |
|
|
|
* Returns all available normal, user-configured servers (so no seedbox settings) |
|
|
|
|
|
|
|
* |
|
|
|
* @return A list of all stored server settings objects |
|
|
|
* @return A list of all stored server settings objects |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<ServerSetting> getNormalServerSettings() { |
|
|
|
public List<ServerSetting> getNormalServerSettings() { |
|
|
@ -128,6 +133,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the order number/identifying key of the last normal server |
|
|
|
* Returns the order number/identifying key of the last normal server |
|
|
|
|
|
|
|
* |
|
|
|
* @return The zero-based order number (index) of the last stored normal server settings |
|
|
|
* @return The zero-based order number (index) of the last stored normal server settings |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getMaxNormalServer() { |
|
|
|
public int getMaxNormalServer() { |
|
|
@ -140,6 +146,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the user-specified server settings for a normal (non-seedbox) server. WARNING: This method does not check |
|
|
|
* Returns the user-specified server settings for a normal (non-seedbox) server. WARNING: This method does not check |
|
|
|
* if the settings actually exist and may rely on empty defaults if called for a non-existing server. |
|
|
|
* if the settings actually exist and may rely on empty defaults if called for a non-existing server. |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The order number/identifying key of the normal server's settings to retrieve |
|
|
|
* @param order The order number/identifying key of the normal server's settings to retrieve |
|
|
|
* @return The server settings object, loaded from shared preferences |
|
|
|
* @return The server settings object, loaded from shared preferences |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -198,6 +205,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Removes all settings related to a configured server. Since servers are ordered, the order of the remaining |
|
|
|
* Removes all settings related to a configured server. Since servers are ordered, the order of the remaining |
|
|
|
* servers will be updated accordingly. |
|
|
|
* servers will be updated accordingly. |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The identifying order number/key of the settings to remove |
|
|
|
* @param order The identifying order number/key of the settings to remove |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeNormalServerSettings(int order) { |
|
|
|
public void removeNormalServerSettings(int order) { |
|
|
@ -275,6 +283,7 @@ public class ApplicationSettings { |
|
|
|
* specific default server was selected, the last used server settings. As opposed to getDefaultServerKey(int), this |
|
|
|
* specific default server was selected, the last used server settings. As opposed to getDefaultServerKey(int), this |
|
|
|
* method checks whether the particular server still exists (and returns the first server if not). If no servers are |
|
|
|
* method checks whether the particular server still exists (and returns the first server if not). If no servers are |
|
|
|
* configured, null is returned. |
|
|
|
* configured, null is returned. |
|
|
|
|
|
|
|
* |
|
|
|
* @return A server settings object of the server to use by default, or null if no server is yet configured |
|
|
|
* @return A server settings object of the server to use by default, or null if no server is yet configured |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ServerSetting getDefaultServer() { |
|
|
|
public ServerSetting getDefaultServer() { |
|
|
@ -302,6 +311,7 @@ public class ApplicationSettings { |
|
|
|
* Returns the unique key of the server setting that the user selected as their default server, or code indicating |
|
|
|
* Returns the unique key of the server setting that the user selected as their default server, or code indicating |
|
|
|
* that the last used server should be selected by default; use with getDefaultServer directly. WARNING: the |
|
|
|
* that the last used server should be selected by default; use with getDefaultServer directly. WARNING: the |
|
|
|
* returned string may no longer refer to a known server setting key. |
|
|
|
* returned string may no longer refer to a known server setting key. |
|
|
|
|
|
|
|
* |
|
|
|
* @return An integer; if it is 0 or higher it represents the unique key of a configured server setting, -2 means |
|
|
|
* @return An integer; if it is 0 or higher it represents the unique key of a configured server setting, -2 means |
|
|
|
* the last used server should be selected as default instead and -1 means the last used server should be |
|
|
|
* the last used server should be selected as default instead and -1 means the last used server should be |
|
|
|
* selected by default for viewing yet it should always ask when adding a new torrent |
|
|
|
* selected by default for viewing yet it should always ask when adding a new torrent |
|
|
@ -320,6 +330,7 @@ public class ApplicationSettings { |
|
|
|
* Returns the settings of the server that was last used by the user. As opposed to getLastUsedServerKey(int), this |
|
|
|
* Returns the settings of the server that was last used by the user. As opposed to getLastUsedServerKey(int), this |
|
|
|
* method checks whether a server was already registered as being last used and check whether the server still |
|
|
|
* method checks whether a server was already registered as being last used and check whether the server still |
|
|
|
* exists. It returns the first server if that fails. If no servers are configured, null is returned. |
|
|
|
* exists. It returns the first server if that fails. If no servers are configured, null is returned. |
|
|
|
|
|
|
|
* |
|
|
|
* @return A server settings object of the last used server (or, if not known, the first server), or null if no |
|
|
|
* @return A server settings object of the last used server (or, if not known, the first server), or null if no |
|
|
|
* servers exist |
|
|
|
* servers exist |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -341,6 +352,7 @@ public class ApplicationSettings { |
|
|
|
* Returns the order number/unique key of the server that the used last used; use with getServerSettings(int) or |
|
|
|
* Returns the order number/unique key of the server that the used last used; use with getServerSettings(int) or |
|
|
|
* call getLastUsedServer directly. WARNING: the returned integer may no longer refer to a known server settings |
|
|
|
* call getLastUsedServer directly. WARNING: the returned integer may no longer refer to a known server settings |
|
|
|
* object: check the bounds. |
|
|
|
* object: check the bounds. |
|
|
|
|
|
|
|
* |
|
|
|
* @return An integer indicating the order number/key or the last used server, or -1 if it was not set |
|
|
|
* @return An integer indicating the order number/key or the last used server, or -1 if it was not set |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getLastUsedServerKey() { |
|
|
|
public int getLastUsedServerKey() { |
|
|
@ -349,6 +361,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Registers some server as being the last used by the user |
|
|
|
* Registers some server as being the last used by the user |
|
|
|
|
|
|
|
* |
|
|
|
* @param server The settings of the server that the user last used |
|
|
|
* @param server The settings of the server that the user last used |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setLastUsedServer(ServerSetting server) { |
|
|
|
public void setLastUsedServer(ServerSetting server) { |
|
|
@ -357,6 +370,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Registers the order number/unique key of some server as being last used by the user |
|
|
|
* Registers the order number/unique key of some server as being last used by the user |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The key identifying the specific server |
|
|
|
* @param order The key identifying the specific server |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setLastUsedServerKey(int order) { |
|
|
|
public void setLastUsedServerKey(int order) { |
|
|
@ -366,6 +380,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the unique code that (should) uniquely identify a navigation filter, such as a label, in the list of all |
|
|
|
* Returns the unique code that (should) uniquely identify a navigation filter, such as a label, in the list of all |
|
|
|
* available filters |
|
|
|
* available filters |
|
|
|
|
|
|
|
* |
|
|
|
* @return A code that the last used navigation filter reported as uniquely identifying itself, or null if no last |
|
|
|
* @return A code that the last used navigation filter reported as uniquely identifying itself, or null if no last |
|
|
|
* used filter is known |
|
|
|
* used filter is known |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -375,6 +390,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Registers some navigation filter as being the last used by the user |
|
|
|
* Registers some navigation filter as being the last used by the user |
|
|
|
|
|
|
|
* |
|
|
|
* @param filter The navigation filter that the user last used in the interface |
|
|
|
* @param filter The navigation filter that the user last used in the interface |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setLastUsedNavigationFilter(NavigationFilter filter) { |
|
|
|
public void setLastUsedNavigationFilter(NavigationFilter filter) { |
|
|
@ -383,6 +399,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns all available user-configured web-based (as opped to in-app) search sites |
|
|
|
* Returns all available user-configured web-based (as opped to in-app) search sites |
|
|
|
|
|
|
|
* |
|
|
|
* @return A list of all stored web search site settings objects |
|
|
|
* @return A list of all stored web search site settings objects |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<WebsearchSetting> getWebsearchSettings() { |
|
|
|
public List<WebsearchSetting> getWebsearchSettings() { |
|
|
@ -395,6 +412,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the order number/identifying key of the last web search site |
|
|
|
* Returns the order number/identifying key of the last web search site |
|
|
|
|
|
|
|
* |
|
|
|
* @return The zero-based order number (index) of the last stored web search site |
|
|
|
* @return The zero-based order number (index) of the last stored web search site |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getMaxWebsearch() { |
|
|
|
public int getMaxWebsearch() { |
|
|
@ -406,6 +424,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the user-specified web-based search site setting for a specific site |
|
|
|
* Returns the user-specified web-based search site setting for a specific site |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The order number/identifying key of the settings to retrieve |
|
|
|
* @param order The order number/identifying key of the settings to retrieve |
|
|
|
* @return The web search site settings object, loaded from shared preferences |
|
|
|
* @return The web search site settings object, loaded from shared preferences |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -421,6 +440,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Removes all settings related to a configured web-based search site. Since sites are ordered, the order of the |
|
|
|
* Removes all settings related to a configured web-based search site. Since sites are ordered, the order of the |
|
|
|
* remaining sites will be updated accordingly. |
|
|
|
* remaining sites will be updated accordingly. |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The identifying order number/key of the settings to remove |
|
|
|
* @param order The identifying order number/key of the settings to remove |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeWebsearchSettings(int order) { |
|
|
|
public void removeWebsearchSettings(int order) { |
|
|
@ -446,6 +466,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns all available user-configured RSS feeds |
|
|
|
* Returns all available user-configured RSS feeds |
|
|
|
|
|
|
|
* |
|
|
|
* @return A list of all stored RSS feed settings objects |
|
|
|
* @return A list of all stored RSS feed settings objects |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<RssfeedSetting> getRssfeedSettings() { |
|
|
|
public List<RssfeedSetting> getRssfeedSettings() { |
|
|
@ -458,6 +479,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the order number/identifying key of the last stored RSS feed |
|
|
|
* Returns the order number/identifying key of the last stored RSS feed |
|
|
|
|
|
|
|
* |
|
|
|
* @return The zero-based order number (index) of the last stored RSS feed |
|
|
|
* @return The zero-based order number (index) of the last stored RSS feed |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getMaxRssfeed() { |
|
|
|
public int getMaxRssfeed() { |
|
|
@ -469,6 +491,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the user-specified RSS feed setting for a specific feed |
|
|
|
* Returns the user-specified RSS feed setting for a specific feed |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The order number/identifying key of the settings to retrieve |
|
|
|
* @param order The order number/identifying key of the settings to retrieve |
|
|
|
* @return The RSS feed settings object, loaded from shared preferences |
|
|
|
* @return The RSS feed settings object, loaded from shared preferences |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -490,6 +513,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Removes all settings related to a configured RSS feed. Since feeds are ordered, the order of the remaining feeds |
|
|
|
* Removes all settings related to a configured RSS feed. Since feeds are ordered, the order of the remaining feeds |
|
|
|
* will be updated accordingly. |
|
|
|
* will be updated accordingly. |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The identifying order number/key of the settings to remove |
|
|
|
* @param order The identifying order number/key of the settings to remove |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeRssfeedSettings(int order) { |
|
|
|
public void removeRssfeedSettings(int order) { |
|
|
@ -528,6 +552,7 @@ public class ApplicationSettings { |
|
|
|
* the user. This is used to determine which items in an RSS feed are 'new'. Warning: any previously retrieved |
|
|
|
* the user. This is used to determine which items in an RSS feed are 'new'. Warning: any previously retrieved |
|
|
|
* {@link RssfeedSetting} object is now no longer in sync, as this will not automatically be updated in the object. |
|
|
|
* {@link RssfeedSetting} object is now no longer in sync, as this will not automatically be updated in the object. |
|
|
|
* Use {@link #getRssfeedSetting(int)} to get fresh data. |
|
|
|
* Use {@link #getRssfeedSetting(int)} to get fresh data. |
|
|
|
|
|
|
|
* |
|
|
|
* @param order The identifying order number/key of the settings of te RSS feed that was viewed |
|
|
|
* @param order The identifying order number/key of the settings of te RSS feed that was viewed |
|
|
|
* @param lastViewed The date and time that the feed was last viewed; typically now |
|
|
|
* @param lastViewed The date and time that the feed was last viewed; typically now |
|
|
|
* @param lastViewedItemUrl The url of the last item the last time that the feed was viewed |
|
|
|
* @param lastViewedItemUrl The url of the last item the last time that the feed was viewed |
|
|
@ -543,6 +568,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Registers the torrents list sort order as being last used by the user |
|
|
|
* Registers the torrents list sort order as being last used by the user |
|
|
|
|
|
|
|
* |
|
|
|
* @param currentSortOrder The sort order property the user selected last |
|
|
|
* @param currentSortOrder The sort order property the user selected last |
|
|
|
* @param currentSortAscending The sort order direction that was last used |
|
|
|
* @param currentSortAscending The sort order direction that was last used |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -556,6 +582,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the sort order property that the user last used. Use together with {@link #getLastUsedSortDescending()} |
|
|
|
* Returns the sort order property that the user last used. Use together with {@link #getLastUsedSortDescending()} |
|
|
|
* to get the full last used sort settings. |
|
|
|
* to get the full last used sort settings. |
|
|
|
|
|
|
|
* |
|
|
|
* @return The last used sort order enumeration value |
|
|
|
* @return The last used sort order enumeration value |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public TorrentsSortBy getLastUsedSortOrder() { |
|
|
|
public TorrentsSortBy getLastUsedSortOrder() { |
|
|
@ -565,6 +592,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Registers the search list sort order as being last used by the user |
|
|
|
* Registers the search list sort order as being last used by the user |
|
|
|
|
|
|
|
* |
|
|
|
* @param currentSortOrder The sort order property the user selected last |
|
|
|
* @param currentSortOrder The sort order property the user selected last |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setLastUsedSearchSortOrder(SearchSortOrder currentSortOrder) { |
|
|
|
public void setLastUsedSearchSortOrder(SearchSortOrder currentSortOrder) { |
|
|
@ -575,6 +603,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the search sort order property that the user last used. |
|
|
|
* Returns the search sort order property that the user last used. |
|
|
|
|
|
|
|
* |
|
|
|
* @return The last used sort order enumeration value |
|
|
|
* @return The last used sort order enumeration value |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public SearchSortOrder getLastUsedSearchSortOrder() { |
|
|
|
public SearchSortOrder getLastUsedSearchSortOrder() { |
|
|
@ -584,6 +613,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the sort order direction that the user last used. Use together with {@link #getLastUsedSortOrder()} to |
|
|
|
* Returns the sort order direction that the user last used. Use together with {@link #getLastUsedSortOrder()} to |
|
|
|
* get the full last used sort settings. |
|
|
|
* get the full last used sort settings. |
|
|
|
|
|
|
|
* |
|
|
|
* @return True if the last used sort direction was descending, false otherwise (i.e. the default ascending |
|
|
|
* @return True if the last used sort direction was descending, false otherwise (i.e. the default ascending |
|
|
|
* direction) |
|
|
|
* direction) |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -593,6 +623,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the list of all available in-app search sites as well as all web searches that the user configured. |
|
|
|
* Returns the list of all available in-app search sites as well as all web searches that the user configured. |
|
|
|
|
|
|
|
* |
|
|
|
* @return A list of search settings, all of which are either a {@link SearchSite} or {@link WebsearchSetting} |
|
|
|
* @return A list of search settings, all of which are either a {@link SearchSite} or {@link WebsearchSetting} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<SearchSetting> getSearchSettings() { |
|
|
|
public List<SearchSetting> getSearchSettings() { |
|
|
@ -607,6 +638,7 @@ public class ApplicationSettings { |
|
|
|
* site in the main settings. As opposed to getLastUsedSearchSiteKey(int), this method checks whether a site was |
|
|
|
* site in the main settings. As opposed to getLastUsedSearchSiteKey(int), this method checks whether a site was |
|
|
|
* already registered as being last used (or set as default) and checks whether the site still exists. It returns |
|
|
|
* already registered as being last used (or set as default) and checks whether the site still exists. It returns |
|
|
|
* the first in-app search site if that fails. |
|
|
|
* the first in-app search site if that fails. |
|
|
|
|
|
|
|
* |
|
|
|
* @return A site settings object of the last used server (or, if not known, the first server), or null if no |
|
|
|
* @return A site settings object of the last used server (or, if not known, the first server), or null if no |
|
|
|
* servers exist |
|
|
|
* servers exist |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -658,6 +690,7 @@ public class ApplicationSettings { |
|
|
|
* Returns the unique key of the site that the used last used or selected as default form the main settings; use |
|
|
|
* Returns the unique key of the site that the used last used or selected as default form the main settings; use |
|
|
|
* with getLastUsedSearchSite directly. WARNING: the returned string may no longer refer to a known web search site |
|
|
|
* with getLastUsedSearchSite directly. WARNING: the returned string may no longer refer to a known web search site |
|
|
|
* or in-app search settings object. |
|
|
|
* or in-app search settings object. |
|
|
|
|
|
|
|
* |
|
|
|
* @return A string indicating the key of the last used search site, or null if no site was yet used or set as |
|
|
|
* @return A string indicating the key of the last used search site, or null if no site was yet used or set as |
|
|
|
* default |
|
|
|
* default |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -667,6 +700,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Registers the unique key of some web search or in-app search site as being last used by the user |
|
|
|
* Registers the unique key of some web search or in-app search site as being last used by the user |
|
|
|
|
|
|
|
* |
|
|
|
* @param site The site settings to register as being last used |
|
|
|
* @param site The site settings to register as being last used |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setLastUsedSearchSite(SearchSetting site) { |
|
|
|
public void setLastUsedSearchSite(SearchSetting site) { |
|
|
@ -675,6 +709,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the statistics of this server as it was last seen by the background server checker service. |
|
|
|
* Returns the statistics of this server as it was last seen by the background server checker service. |
|
|
|
|
|
|
|
* |
|
|
|
* @param server The server for which to retrieved the statistics from the stored preferences |
|
|
|
* @param server The server for which to retrieved the statistics from the stored preferences |
|
|
|
* @return A JSON array of JSON objects, each which represent a since torrent |
|
|
|
* @return A JSON array of JSON objects, each which represent a since torrent |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -692,6 +727,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Stores the now-last seen statistics of the supplied server by the background server checker service to the |
|
|
|
* Stores the now-last seen statistics of the supplied server by the background server checker service to the |
|
|
|
* internal stored preferences. |
|
|
|
* internal stored preferences. |
|
|
|
|
|
|
|
* |
|
|
|
* @param server The server to which the statistics apply to |
|
|
|
* @param server The server to which the statistics apply to |
|
|
|
* @param lastStats A JSON array of JSON objects that each represent a single seen torrent |
|
|
|
* @param lastStats A JSON array of JSON objects that each represent a single seen torrent |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -701,6 +737,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the user configuration for some specific app widget, if the widget is known at all. |
|
|
|
* Returns the user configuration for some specific app widget, if the widget is known at all. |
|
|
|
|
|
|
|
* |
|
|
|
* @param appWidgetId The unique ID of the app widget to retrieve settings for, as supplied by the AppWidgetManager |
|
|
|
* @param appWidgetId The unique ID of the app widget to retrieve settings for, as supplied by the AppWidgetManager |
|
|
|
* @return A widget configuration object, or null if no settings were stored for the widget ID |
|
|
|
* @return A widget configuration object, or null if no settings were stored for the widget ID |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -720,6 +757,7 @@ public class ApplicationSettings { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Stores the user settings for some specific app widget. Existing settings for the supplied app widget ID will be |
|
|
|
* Stores the user settings for some specific app widget. Existing settings for the supplied app widget ID will be |
|
|
|
* overridden. |
|
|
|
* overridden. |
|
|
|
|
|
|
|
* |
|
|
|
* @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager |
|
|
|
* @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager |
|
|
|
* @param settings A widget configuration object, which may not be null |
|
|
|
* @param settings A widget configuration object, which may not be null |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -738,6 +776,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Remove the setting for some specific app widget. |
|
|
|
* Remove the setting for some specific app widget. |
|
|
|
|
|
|
|
* |
|
|
|
* @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager |
|
|
|
* @param appWidgetId The unique ID of the app widget to store settings for, as supplied by the AppWidgetManager |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeWidgetConfig(int appWidgetId) { |
|
|
|
public void removeWidgetConfig(int appWidgetId) { |
|
|
@ -753,6 +792,7 @@ public class ApplicationSettings { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Trims away whitespace around a string, or returns null if str is null |
|
|
|
* Trims away whitespace around a string, or returns null if str is null |
|
|
|
|
|
|
|
* |
|
|
|
* @param str The string to trim, or null |
|
|
|
* @param str The string to trim, or null |
|
|
|
* @return The trimmed string, or null if str is null |
|
|
|
* @return The trimmed string, or null if str is null |
|
|
|
*/ |
|
|
|
*/ |
|
|
|