added a language setting to change the language directly

This commit is contained in:
Thialfihar
2010-07-18 07:19:57 +00:00
parent c3600ee679
commit a34adb09a4
8 changed files with 244 additions and 3 deletions

View File

@@ -23,6 +23,16 @@ public class Preferences {
mSharedPreferences = context.getSharedPreferences("APG.main", Context.MODE_PRIVATE);
}
public String getLanguage() {
return mSharedPreferences.getString(Constants.pref.language, "");
}
public void setLanguage(String value) {
SharedPreferences.Editor editor = mSharedPreferences.edit();
editor.putString(Constants.pref.language, value);
editor.commit();
}
public int getPassPhraseCacheTtl() {
int ttl = mSharedPreferences.getInt(Constants.pref.pass_phrase_cache_ttl, 180);
// fix the value if it was set to "never" in previous versions, which currently is not