|
|
@ -16,11 +16,11 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.transdroid.core.app.settings; |
|
|
|
package org.transdroid.core.app.settings; |
|
|
|
|
|
|
|
|
|
|
|
import java.security.InvalidParameterException; |
|
|
|
import android.content.Context; |
|
|
|
import java.util.ArrayList; |
|
|
|
import android.content.SharedPreferences; |
|
|
|
import java.util.Collections; |
|
|
|
import android.content.SharedPreferences.Editor; |
|
|
|
import java.util.Date; |
|
|
|
import android.preference.PreferenceManager; |
|
|
|
import java.util.List; |
|
|
|
import android.text.TextUtils; |
|
|
|
|
|
|
|
|
|
|
|
import org.androidannotations.annotations.Bean; |
|
|
|
import org.androidannotations.annotations.Bean; |
|
|
|
import org.androidannotations.annotations.EBean; |
|
|
|
import org.androidannotations.annotations.EBean; |
|
|
@ -29,6 +29,7 @@ import org.androidannotations.annotations.RootContext; |
|
|
|
import org.json.JSONArray; |
|
|
|
import org.json.JSONArray; |
|
|
|
import org.json.JSONException; |
|
|
|
import org.json.JSONException; |
|
|
|
import org.transdroid.core.app.search.SearchHelper; |
|
|
|
import org.transdroid.core.app.search.SearchHelper; |
|
|
|
|
|
|
|
import org.transdroid.core.app.search.SearchHelper.SearchSortOrder; |
|
|
|
import org.transdroid.core.app.search.SearchSite; |
|
|
|
import org.transdroid.core.app.search.SearchSite; |
|
|
|
import org.transdroid.core.gui.navigation.NavigationFilter; |
|
|
|
import org.transdroid.core.gui.navigation.NavigationFilter; |
|
|
|
import org.transdroid.core.gui.navigation.StatusType; |
|
|
|
import org.transdroid.core.gui.navigation.StatusType; |
|
|
@ -39,11 +40,11 @@ import org.transdroid.daemon.Daemon; |
|
|
|
import org.transdroid.daemon.OS; |
|
|
|
import org.transdroid.daemon.OS; |
|
|
|
import org.transdroid.daemon.TorrentsSortBy; |
|
|
|
import org.transdroid.daemon.TorrentsSortBy; |
|
|
|
|
|
|
|
|
|
|
|
import android.content.Context; |
|
|
|
import java.security.InvalidParameterException; |
|
|
|
import android.content.SharedPreferences; |
|
|
|
import java.util.ArrayList; |
|
|
|
import android.content.SharedPreferences.Editor; |
|
|
|
import java.util.Collections; |
|
|
|
import android.preference.PreferenceManager; |
|
|
|
import java.util.Date; |
|
|
|
import android.text.TextUtils; |
|
|
|
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. |
|
|
@ -558,6 +559,24 @@ public class ApplicationSettings { |
|
|
|
.getStatus(prefs.getInt("system_lastusedsortorder", TorrentsSortBy.Alphanumeric.getCode())); |
|
|
|
.getStatus(prefs.getInt("system_lastusedsortorder", TorrentsSortBy.Alphanumeric.getCode())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Registers the search list sort order as being last used by the user |
|
|
|
|
|
|
|
* @param currentSortOrder The sort order property the user selected last |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void setLastUsedSearchSortOrder(SearchSortOrder currentSortOrder) { |
|
|
|
|
|
|
|
Editor edit = prefs.edit(); |
|
|
|
|
|
|
|
edit.putInt("system_lastusedsearchsortorder", currentSortOrder.ordinal()); |
|
|
|
|
|
|
|
edit.apply(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the search sort order property that the user last used. |
|
|
|
|
|
|
|
* @return The last used sort order enumeration value |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public SearchSortOrder getLastUsedSearchSortOrder() { |
|
|
|
|
|
|
|
return SearchSortOrder.values()[(prefs.getInt("system_lastusedsearchsortorder", SearchSortOrder.BySeeders.ordinal()))]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 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. |
|
|
|