From 9a88af8e4103483f7eda54f4bf61280017c1e817 Mon Sep 17 00:00:00 2001 From: lado Date: Fri, 4 Nov 2011 01:32:49 +0100 Subject: streamdev auth --- vdrmanager/res/values-de/preferences.xml | 9 +- vdrmanager/res/values/preferences.xml | 12 +- .../vdrmanager/gui/PreferencesActivity.java | 168 +-------------------- 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 @@ VDR Plugin Passwort Passwort für das VDR Plugin Sichere Verbindung - Verwende SSL für Verbindungen + Verwende SSL für Verbindungen (aktuell nicht implementiert) Kanaleinstellungen @@ -119,5 +119,12 @@ Englisch Deutsch + + + Streamdev Passwort + Streamdev Server Passwort, gesetz mit der Option "-a \'user:pass\'". wird so aufgerufen: http://user:pass@vdr:3000. In der Regel nicht gesetzt + + Streamdev Benutzername + Streamdev Server Benutzername, gesetz mit der Option "-a \'user:pass\'". wird so http://user:pass@vdr:3000. In der Regel nicht gesetzt 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 @@ VDR plugin password Password for the VDR plugin Secure connect - Use SSL for connections + Use SSL for connections (currently not supported) Channel settings @@ -135,5 +135,15 @@ key_vdr_timeout Total timeout How long (in seconds) to wait for a whole I/O operation, before it gets aborted? + + + + Streamdev password + Set your streamdev server password. (a.e. -a \'username:password\') + key_streaming_password + Streamdev username + Set your streamdev server username. (a.e. -a \'username:password\') + key_streaming_username + \ 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); - } - - /** - *

- * Gets the substring before the last occurrence of a separator. The - * separator is not returned. - *

- * - *

- * A null string input will return null. An empty - * ("") string input will return the empty string. An empty or - * null separator will return the input string. - *

- * - *
-	 * 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"
-	 * 
- * - * @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, - * null 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 - // ----------------------------------------------------------------------- - /** - *

- * Checks if a String is empty ("") or null. - *

- * - *
-	 * StringUtils.isEmpty(null)      = true
-	 * StringUtils.isEmpty("")        = true
-	 * StringUtils.isEmpty(" ")       = false
-	 * StringUtils.isEmpty("bob")     = false
-	 * StringUtils.isEmpty("  bob  ") = false
-	 * 
- * - *

- * NOTE: This method changed in Lang version 2.0. It no longer trims the - * String. That functionality is available in isBlank(). - *

- * - * @param str - * the String to check, may be null - * @return true if the String is empty or null - */ - public static boolean isEmpty(String str) { - return str == null || str.length() == 0; - } - - /** - *

- * Checks if a String is whitespace, empty ("") or null. - *

- * - *
-	 * StringUtils.isBlank(null)      = true
-	 * StringUtils.isBlank("")        = true
-	 * StringUtils.isBlank(" ")       = true
-	 * StringUtils.isBlank("bob")     = false
-	 * StringUtils.isBlank("  bob  ") = false
-	 * 
- * - * @param str - * the String to check, may be null - * @return true 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; - } - } -- cgit v1.2.3