summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2012-01-25 00:35:11 +0100
committerlado <herrlado@gmail.com>2012-01-25 00:35:11 +0100
commit1cb716ecb5bc0750715dc6bc9e069b84a1823b31 (patch)
tree70fa6ef0cddfaeb466a228e085e799228800e308
parentd9efb2dae533bffc8e4aa57e28118c97072ad923 (diff)
downloadvdr-manager-1cb716ecb5bc0750715dc6bc9e069b84a1823b31.tar.gz
vdr-manager-1cb716ecb5bc0750715dc6bc9e069b84a1823b31.tar.bz2
beter handling of recent channels
-rw-r--r--vdrmanager/res/drawable-hdpi/ic_menu_recent_history.pngbin0 -> 2171 bytes
-rw-r--r--vdrmanager/res/drawable-mdpi/ic_menu_recent_history.pngbin0 -> 1293 bytes
-rw-r--r--vdrmanager/res/drawable-xhdpi/ic_menu_recent_history.pngbin0 -> 3001 bytes
-rw-r--r--vdrmanager/res/values/strings.xml5
-rw-r--r--vdrmanager/res/xml/preferences.xml9
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java10
6 files changed, 22 insertions, 2 deletions
diff --git a/vdrmanager/res/drawable-hdpi/ic_menu_recent_history.png b/vdrmanager/res/drawable-hdpi/ic_menu_recent_history.png
new file mode 100644
index 0000000..4101434
--- /dev/null
+++ b/vdrmanager/res/drawable-hdpi/ic_menu_recent_history.png
Binary files differ
diff --git a/vdrmanager/res/drawable-mdpi/ic_menu_recent_history.png b/vdrmanager/res/drawable-mdpi/ic_menu_recent_history.png
new file mode 100644
index 0000000..e5f8e2d
--- /dev/null
+++ b/vdrmanager/res/drawable-mdpi/ic_menu_recent_history.png
Binary files differ
diff --git a/vdrmanager/res/drawable-xhdpi/ic_menu_recent_history.png b/vdrmanager/res/drawable-xhdpi/ic_menu_recent_history.png
new file mode 100644
index 0000000..fc5e1fc
--- /dev/null
+++ b/vdrmanager/res/drawable-xhdpi/ic_menu_recent_history.png
Binary files differ
diff --git a/vdrmanager/res/values/strings.xml b/vdrmanager/res/values/strings.xml
index 58a2a33..20efafe 100644
--- a/vdrmanager/res/values/strings.xml
+++ b/vdrmanager/res/values/strings.xml
@@ -304,6 +304,7 @@
<string name="recording_item_menu_delete">Delete</string>
<string name="recording_item_menu_stream">Stream</string>
<string name="recent_channels">Recent channels</string>
- <string name="recent_channels_no_history">No history…</string>
-
+ <string name="recent_channels_no_history">No history…</string>
+ <string name="gui_max_recent_channels_title">Max. recent channels</string>
+ <string name="gui_max_recent_channels_summary">How many channels should be kept in the recent channels?</string>
</resources> \ No newline at end of file
diff --git a/vdrmanager/res/xml/preferences.xml b/vdrmanager/res/xml/preferences.xml
index c92b1fa..8a819dd 100644
--- a/vdrmanager/res/xml/preferences.xml
+++ b/vdrmanager/res/xml/preferences.xml
@@ -20,12 +20,21 @@
android:summary="@string/gui_channels_show_channel_numbers_summary"
android:title="@string/gui_channels_show_channel_numbers_title" />
+
+ <EditTextPreference android:defaultValue="10"
+ android:key="@string/gui_max_recent_channels_key" android:inputType="number"
+ android:summary="@string/gui_max_recent_channels_summary"
+ android:title="@string/gui_max_recent_channels_title" />
+
+
<CheckBoxPreference android:key="@string/gui_enable_24h_format_key"
android:defaultValue="true"
android:summaryOff="@string/gui_enable_24h_format_summary_off"
android:summaryOn="@string/gui_enable_24h_format_summary_on"
android:title="@string/gui_enable_24h_format_title" />
+
+
<CheckBoxPreference android:defaultValue="true"
android:key="@string/qui_show_imdb_button_key" android:summaryOff="@string/qui_show_imdb_button_summary_off"
android:summaryOn="@string/qui_show_imdb_button_summary_on"
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
index 766bb4d..4fca878 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
@@ -264,6 +264,12 @@ public class ChannelListActivity extends
return true;
}
+ if(Preferences.get().getMaxRecentChannels() <= 0){
+ RECENT.clear();
+ say(R.string.recent_channels_no_history);
+ return true;
+ }
+
new AlertDialog.Builder(this)
.setAdapter(getRecentAdapter(), new DialogInterface.OnClickListener() {
@@ -370,6 +376,10 @@ public class ChannelListActivity extends
@Override
protected Void doInBackground(Void... arg0) {
+ int max = Preferences.get().getMaxRecentChannels();
+ if(max <= 0){
+ return null;
+ }
Iterator<Channel> i = RECENT.iterator();
while (i.hasNext()) {
Channel c = i.next();