X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/844790057b6519bc6e90f49c139335a97aade4c8..178c94e6e295dd7a8d210ac91ab4a44370c114ad:/src/com/owncloud/android/ui/activity/Preferences.java diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 8840eee9..a677533d 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -51,7 +51,6 @@ import com.owncloud.android.R; import com.owncloud.android.authentication.AccountUtils; import com.owncloud.android.authentication.AuthenticatorActivity; import com.owncloud.android.db.DbHandler; -import com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.ui.LongClickableCheckBoxPreference; import com.owncloud.android.utils.DisplayUtils; @@ -69,7 +68,6 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa private DbHandler mDbHandler; private CheckBoxPreference pCode; - private CheckBoxPreference pSaveLocation; private Preference pAboutApp; private PreferenceCategory mAccountsPrefCategory = null; @@ -106,7 +104,7 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa if (obj != null && obj instanceof LongClickableCheckBoxPreference) { mShowContextMenu = true; - mAccountName = obj.toString(); + mAccountName = ((LongClickableCheckBoxPreference) obj).getKey(); Preferences.this.openContextMenu(listView); @@ -116,7 +114,18 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa return false; } }); - + + // Load package info + String temp; + try { + PackageInfo pkg = getPackageManager().getPackageInfo(getPackageName(), 0); + temp = pkg.versionName; + } catch (NameNotFoundException e) { + temp = ""; + Log_OC.e(TAG, "Error while showing about dialog", e); + } + final String appVersion = temp; + // Register context menu for list of preferences. registerForContextMenu(getListView()); @@ -136,24 +145,6 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa } - pSaveLocation = (CheckBoxPreferenceWithLongTitle) findPreference("save_last_upload_location"); - if(pSaveLocation != null){ - pSaveLocation.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - //The saved path is removed when the preference is turned off - if( newValue instanceof Boolean && !(Boolean) newValue) { - SharedPreferences.Editor appPrefs = PreferenceManager - .getDefaultSharedPreferences(getApplicationContext()).edit(); - appPrefs.remove("last_upload_path"); - appPrefs.commit(); - } - return true; - } - }); - } - - PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference("more"); boolean helpEnabled = getResources().getBoolean(R.bool.help_enabled); @@ -223,7 +214,7 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa @Override public boolean onPreferenceClick(Preference preference) { String feedbackMail =(String) getText(R.string.mail_feedback); - String feedback =(String) getText(R.string.prefs_feedback); + String feedback =(String) getText(R.string.prefs_feedback) + " - android v" + appVersion; Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, feedback); @@ -277,13 +268,7 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa pAboutApp = (Preference) findPreference("about_app"); if (pAboutApp != null) { pAboutApp.setTitle(String.format(getString(R.string.about_android), getString(R.string.app_name))); - PackageInfo pkg; - try { - pkg = getPackageManager().getPackageInfo(getPackageName(), 0); - pAboutApp.setSummary(String.format(getString(R.string.about_version), pkg.versionName)); - } catch (NameNotFoundException e) { - Log_OC.e(TAG, "Error while showing about dialog", e); - } + pAboutApp.setSummary(String.format(getString(R.string.about_version), appVersion)); } } @@ -426,7 +411,8 @@ public class Preferences extends SherlockPreferenceActivity implements AccountMa for (Account a : accounts) { LongClickableCheckBoxPreference accountPreference = new LongClickableCheckBoxPreference(this); accountPreference.setKey(a.name); - accountPreference.setTitle(a.name); + // Handle internationalized domain names + accountPreference.setTitle(DisplayUtils.convertIdn(a.name, false)); mAccountsPrefCategory.addPreference(accountPreference); // Check the current account that is being used