summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vdrmanager/res/values-de/preferences.xml9
-rw-r--r--vdrmanager/res/values/preferences.xml12
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/PreferencesActivity.java168
3 files changed, 20 insertions, 169 deletions
diff --git a/vdrmanager/res/values-de/preferences.xml b/vdrmanager/res/values-de/preferences.xml
index 59fb6f3..9006964 100644
--- a/vdrmanager/res/values-de/preferences.xml
+++ b/vdrmanager/res/values-de/preferences.xml
@@ -11,7 +11,7 @@
<string name="vdr_password_title">VDR Plugin Passwort</string>
<string name="vdr_password_summary">Passwort für das VDR Plugin</string>
<string name="vdr_ssl_title">Sichere Verbindung</string>
- <string name="vdr_ssl_summary">Verwende SSL für Verbindungen</string>
+ <string name="vdr_ssl_summary">Verwende SSL für Verbindungen (aktuell nicht implementiert)</string>
<!-- channel filter preferences -->
<string name="channel_filter_preferences">Kanaleinstellungen</string>
@@ -119,5 +119,12 @@
<item>Englisch</item>
<item>Deutsch</item>
</string-array>
+
+
+ <string name="streaming_password_title">Streamdev Passwort</string>
+ <string name="streaming_password_sum">Streamdev Server Passwort, gesetz mit der Option "-a \'user:pass\'". wird so aufgerufen: http://user:pass@vdr:3000. In der Regel nicht gesetzt</string>
+
+ <string name="streaming_username_title">Streamdev Benutzername</string>
+ <string name="streaming_username_sum">Streamdev Server Benutzername, gesetz mit der Option "-a \'user:pass\'". wird so http://user:pass@vdr:3000. In der Regel nicht gesetzt</string>
</resources>
diff --git a/vdrmanager/res/values/preferences.xml b/vdrmanager/res/values/preferences.xml
index f755f67..a972c53 100644
--- a/vdrmanager/res/values/preferences.xml
+++ b/vdrmanager/res/values/preferences.xml
@@ -11,7 +11,7 @@
<string name="vdr_password_title">VDR plugin password</string>
<string name="vdr_password_summary">Password for the VDR plugin</string>
<string name="vdr_ssl_title">Secure connect</string>
- <string name="vdr_ssl_summary">Use SSL for connections</string>
+ <string name="vdr_ssl_summary">Use SSL for connections (currently not supported)</string>
<!-- channel filter preferences -->
<string name="channel_filter_preferences">Channel settings</string>
@@ -135,5 +135,15 @@
<string name="vdr_timeout_key">key_vdr_timeout</string>
<string name="vdr_timeout_title">Total timeout</string>
<string name="vdr_timeout_sum">How long (in seconds) to wait for a whole I/O operation, before it gets aborted?</string>
+
+
+
+ <string name="streaming_password_title">Streamdev password</string>
+ <string name="streaming_password_sum">Set your streamdev server password. (a.e. -a \'username:password\')</string>
+ <string name="streaming_password_key">key_streaming_password</string>
+ <string name="streaming_username_title">Streamdev username</string>
+ <string name="streaming_username_sum">Set your streamdev server username. (a.e. -a \'username:password\')</string>
+ <string name="streaming_username_key">key_streaming_username</string>
+
</resources> \ No newline at end of file
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/PreferencesActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/PreferencesActivity.java
index d741004..c633b50 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/PreferencesActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/PreferencesActivity.java
@@ -20,7 +20,7 @@ import de.bjusystems.vdrmanager.R;
import de.bjusystems.vdrmanager.app.VdrManagerApp;
import de.bjusystems.vdrmanager.data.Preferences;
-public class PreferencesActivity extends PreferenceActivity implements
+public class PreferencesActivity extends BasePreferencesActivity implements
OnSharedPreferenceChangeListener, OnPreferenceChangeListener,
OnPreferenceClickListener {
//
@@ -171,171 +171,5 @@ public class PreferencesActivity extends PreferenceActivity implements
return true;
}
- private void updateSummary(Preference ep) {
- if (ep instanceof EditTextPreference) {
- updateSummary((EditTextPreference) ep);
- } else if (ep instanceof ListPreference) {
- updateSummary((ListPreference) ep);
- }
- }
-
- /**
- * If text set add it to the summary
- *
- * @param ep
- */
- private void updateSummary(EditTextPreference ep) {
- String text = ep.getText();
- if (text == null) {
- return;
- }
-
- if(isPassword(ep.getEditText())){
- text = text.replaceAll(".", "*");
- }
-
- setSummary(text, ep);
- }
-
- private boolean isPassword(EditText et){
- if((et.getInputType() & EditorInfo.TYPE_TEXT_VARIATION_PASSWORD) == EditorInfo.TYPE_TEXT_VARIATION_PASSWORD){
- return true;
- }
- return false;
- }
-
- private void setSummary(CharSequence text, DialogPreference ep){
- CharSequence sm = ep.getSummary();
- String sum;
- if (sm != null) {
- sum = ep.getSummary().toString();
- sum = substringBeforeLast(sum,
- getString(R.string.prefs_current_value)).trim();
- } else {
- sum = "";
- }
-
- if(TextUtils.isEmpty(text)){
- text = getString(R.string.prefs_current_value_not_set);
- }
-
- if (isBlank(sum)) {
- sum = getString(R.string.prefs_current_value_template, text);
- } else {
- sum = sum + " "
- + getString(R.string.prefs_current_value_template, text);
- }
- ep.setSummary(sum);
- }
- private void updateSummary(ListPreference ep) {
- CharSequence text = ep.getEntry();
-
- if (text == null) {
- return;
- }
- setSummary(text, ep);
- }
-
- /**
- * <p>
- * Gets the substring before the last occurrence of a separator. The
- * separator is not returned.
- * </p>
- *
- * <p>
- * A <code>null</code> string input will return <code>null</code>. An empty
- * ("") string input will return the empty string. An empty or
- * <code>null</code> separator will return the input string.
- * </p>
- *
- * <pre>
- * StringUtils.substringBeforeLast(null, *) = null
- * StringUtils.substringBeforeLast("", *) = ""
- * StringUtils.substringBeforeLast("abcba", "b") = "abc"
- * StringUtils.substringBeforeLast("abc", "c") = "ab"
- * StringUtils.substringBeforeLast("a", "a") = ""
- * StringUtils.substringBeforeLast("a", "z") = "a"
- * StringUtils.substringBeforeLast("a", null) = "a"
- * StringUtils.substringBeforeLast("a", "") = "a"
- * </pre>
- *
- * @param str
- * the String to get a substring from, may be null
- * @param separator
- * the String to search for, may be null
- * @return the substring before the last occurrence of the separator,
- * <code>null</code> if null String input
- * @since 2.0
- */
- public static String substringBeforeLast(String str, String separator) {
- if (isEmpty(str) || isEmpty(separator)) {
- return str;
- }
- int pos = str.lastIndexOf(separator);
- if (pos == -1) {
- return str;
- }
- return str.substring(0, pos);
- }
-
- // Empty checks
- // -----------------------------------------------------------------------
- /**
- * <p>
- * Checks if a String is empty ("") or null.
- * </p>
- *
- * <pre>
- * StringUtils.isEmpty(null) = true
- * StringUtils.isEmpty("") = true
- * StringUtils.isEmpty(" ") = false
- * StringUtils.isEmpty("bob") = false
- * StringUtils.isEmpty(" bob ") = false
- * </pre>
- *
- * <p>
- * NOTE: This method changed in Lang version 2.0. It no longer trims the
- * String. That functionality is available in isBlank().
- * </p>
- *
- * @param str
- * the String to check, may be null
- * @return <code>true</code> if the String is empty or null
- */
- public static boolean isEmpty(String str) {
- return str == null || str.length() == 0;
- }
-
- /**
- * <p>
- * Checks if a String is whitespace, empty ("") or null.
- * </p>
- *
- * <pre>
- * StringUtils.isBlank(null) = true
- * StringUtils.isBlank("") = true
- * StringUtils.isBlank(" ") = true
- * StringUtils.isBlank("bob") = false
- * StringUtils.isBlank(" bob ") = false
- * </pre>
- *
- * @param str
- * the String to check, may be null
- * @return <code>true</code> if the String is null, empty or whitespace
- * @since 2.0
- */
- public static boolean isBlank(String str) {
- int strLen;
- if (str == null || (strLen = str.length()) == 0) {
- return true;
- }
- for (int i = 0; i < strLen; i++) {
- if ((Character.isWhitespace(str.charAt(i)) == false)) {
- return false;
- }
- }
- return true;
- }
-
}