From 783f370fd4e888b7419717ba259a2fa15f85fd96 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Wed, 16 Jan 2013 14:18:08 +0100 Subject: [PATCH] Filter list dialog added. (Thanks Tom Briden\!) --- android/res/layout/dialog_set_filter.xml | 14 +++++ android/res/values/strings.xml | 6 ++- .../org/transdroid/gui/TorrentsFragment.java | 54 ++++++++++++++++++- 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 android/res/layout/dialog_set_filter.xml diff --git a/android/res/layout/dialog_set_filter.xml b/android/res/layout/dialog_set_filter.xml new file mode 100644 index 00000000..972fdc52 --- /dev/null +++ b/android/res/layout/dialog_set_filter.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 0f75c56b..f8dbf110 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -19,6 +19,8 @@ Torrent server No servers have been configured yet +Reset + All labels Unlabeled New label @@ -42,7 +44,7 @@ Stop all Start all Filter list -Sort by (resort to reverse order) +Sort listSort by (resort to reverse order) Name Status Date done @@ -63,6 +65,7 @@ Force start Set label Set download location +Set list filter Set as default Default site set to Move up @@ -418,4 +421,5 @@ Black Transparent + diff --git a/android/src/org/transdroid/gui/TorrentsFragment.java b/android/src/org/transdroid/gui/TorrentsFragment.java index 125beccc..423ef092 100644 --- a/android/src/org/transdroid/gui/TorrentsFragment.java +++ b/android/src/org/transdroid/gui/TorrentsFragment.java @@ -142,6 +142,7 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou private static final int DIALOG_SETDOWNLOADLOCATION = 6; private static final int DIALOG_REFRESH_INTERVAL = 7; private static final int DIALOG_INSTALLBARCODESCANNER = 8; + private static final int DIALOG_FILTER = 9; private static final int MENU_ADD_ID = 1; private static final int MENU_BARCODE_ID = 2; @@ -183,6 +184,8 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou private static final int MENU_REMOVE_DATA_ID = 47; private static final int MENU_SETLABEL_ID = 48; private static final int MENU_SETDOWNLOADLOCATION_ID = 49; + + private static final int MENU_FILTER_ID = 60; protected boolean useTabletInterface; private Handler handler; @@ -206,6 +209,7 @@ public class TorrentsFragment extends Fragment implements IDaemonCallback, OnTou private String activeLabel = null; private boolean inAlternativeMode = false; // Whether the server is in alternative (speed) mode (i.e. Transmission's Turtle Mode) protected boolean ignoreFirstListNavigation = true; + private String activeFilter = null; private List allTorrents; private List