summaryrefslogtreecommitdiff
path: root/vdrmanager
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2011-10-11 01:00:41 +0200
committerlado <herrlado@gmail.com>2011-10-11 01:00:41 +0200
commit43129e282df79662d81442a179604aee32b5235d (patch)
treebec1f206af87a0421a67b3a578519aa69d2d775c /vdrmanager
parentf261af148861a578adc35eebe5b7778a04a68769 (diff)
downloadvdr-manager-43129e282df79662d81442a179604aee32b5235d.tar.gz
vdr-manager-43129e282df79662d81442a179604aee32b5235d.tar.bz2
backbutton option, enable disable quitting the app
Diffstat (limited to 'vdrmanager')
-rw-r--r--vdrmanager/res/values/preferences.xml5
-rw-r--r--vdrmanager/res/xml/preferences.xml6
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java17
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java14
4 files changed, 40 insertions, 2 deletions
diff --git a/vdrmanager/res/values/preferences.xml b/vdrmanager/res/values/preferences.xml
index 3a3402f..16737ef 100644
--- a/vdrmanager/res/values/preferences.xml
+++ b/vdrmanager/res/values/preferences.xml
@@ -76,6 +76,9 @@
<string name="gui_channels_show_channel_numbers_key">key_channels_show_channel_numbers</string>
<string name="gui_channels_show_channel_numbers_title">Show channel numbers</string>
<string name="gui_channels_show_channel_numbers_summary">Show channel numbers in the channel list.</string>
-
+ <string name="qui_quit_on_back_key">key_gui_quit_on_back</string>
+ <string name="gui_quit_on_back_title">Quit on back button</string>
+ <string name="gui_quit_on_back_summary_on">Back button quits the VDR-Manager</string>
+ <string name="gui_quit_on_back_summary_off">Back button does not quit VDR-Manager</string>
</resources>
diff --git a/vdrmanager/res/xml/preferences.xml b/vdrmanager/res/xml/preferences.xml
index a8578b2..1f54c26 100644
--- a/vdrmanager/res/xml/preferences.xml
+++ b/vdrmanager/res/xml/preferences.xml
@@ -78,6 +78,12 @@
android:title="@string/gui_enable_24h_format_title"
android:summaryOn="@string/gui_enable_24h_format_summary_on"
android:summaryOff="@string/gui_enable_24h_format_summary_off" />
+
+ <CheckBoxPreference android:key="@string/qui_quit_on_back_key"
+ android:title="@string/gui_quit_on_back_title"
+ android:summaryOn="@string/gui_quit_on_back_summary_on"
+ android:summaryOff="@string/gui_quit_on_back_summary_off"
+ android:defaultValue="true" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/livetv">
<EditTextPreference android:key="streamingport"
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java
index 0f1b731..c415465 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java
@@ -105,6 +105,11 @@ public class Preferences {
* Remux command Parameter
*/
private String remuxParameter;
+
+ /**
+ * Quits the app on back button
+ */
+ private boolean quiteOnBackButton = true;
/** Properties singleton */
private static Preferences thePrefs;
@@ -396,6 +401,16 @@ public class Preferences {
return remuxParameter;
}
+
+ /**
+ * getter
+ *
+ * @return
+ */
+ public boolean isQuiteOnBackButton() {
+ return quiteOnBackButton;
+ }
+
/**
* Gets the previous loaded preferences
@@ -481,6 +496,8 @@ public class Preferences {
prefs.remuxParameter = getString(context, R.string.key_remux_parameter, "");
+ prefs.quiteOnBackButton = getBoolean(context, R.string.qui_quit_on_back_key, true);
+
thePrefs = prefs;
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java
index bc55f3c..8aa4107 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java
@@ -49,7 +49,7 @@ public class VdrManagerActivity extends Activity implements OnClickListener {
inflater.inflate(R.menu.main_menu, menu);
return true;
}
-
+
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
@@ -73,6 +73,9 @@ public class VdrManagerActivity extends Activity implements OnClickListener {
@Override
public void onBackPressed() {
+ if(Preferences.get().isQuiteOnBackButton()){
+ super.onBackPressed();
+ }
}
public void startActivity(Class<?> clazz) {
@@ -107,4 +110,13 @@ public class VdrManagerActivity extends Activity implements OnClickListener {
}
}
+
+ @Override
+ public boolean onSearchRequested() {
+ Bundle appData = new Bundle();
+ //appData.putBoolean(SearchableActivity.JARGON, true);
+ startSearch(null, false, appData, false);
+ return true;
+
+ }
}