diff options
author | Nicolas Roard <nicolasroard@google.com> | 2009-05-12 16:31:33 +0100 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2009-05-12 16:31:33 +0100 |
commit | 6f480422c930d5a85624f42af8f1ca2c063cb4b5 (patch) | |
tree | ba7b1de90a03ee22d4fbe6e346c90e8e0713704d /src/com/android/browser/BrowserPreferencesPage.java | |
parent | 78a98e459323f938e97789a6131beddbebb459ce (diff) | |
download | packages_apps_Browser-6f480422c930d5a85624f42af8f1ca2c063cb4b5.zip packages_apps_Browser-6f480422c930d5a85624f42af8f1ca2c063cb4b5.tar.gz packages_apps_Browser-6f480422c930d5a85624f42af8f1ca2c063cb4b5.tar.bz2 |
Make menus inactive when needed and only show possible quotas
Diffstat (limited to 'src/com/android/browser/BrowserPreferencesPage.java')
-rw-r--r-- | src/com/android/browser/BrowserPreferencesPage.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java index e093ced..c6ce8a6 100644 --- a/src/com/android/browser/BrowserPreferencesPage.java +++ b/src/com/android/browser/BrowserPreferencesPage.java @@ -70,20 +70,29 @@ public class BrowserPreferencesPage extends PreferenceActivity e = findPreference(BrowserSettings.PREF_GEARS_SETTINGS); e.setOnPreferenceClickListener(this); - PreferenceScreen s = (PreferenceScreen) + PreferenceScreen manageDatabases = (PreferenceScreen) findPreference(BrowserSettings.PREF_WEBSTORAGE_SETTINGS); + Preference clearDatabases = + findPreference(BrowserSettings.PREF_WEBSTORAGE_CLEAR_ALL); + Vector origins = WebStorage.getInstance().getOrigins(); + manageDatabases.setEnabled(false); + clearDatabases.setEnabled(false); if (origins != null) { + if (origins.size() > 0) { + manageDatabases.setEnabled(true); + clearDatabases.setEnabled(true); + } for (int i = 0; i < origins.size(); i++) { OriginSettings origin = new OriginSettings(this, (String) origins.get(i)); PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(this); origin.setScreen(screen); - origin.setRootScreen(s); + origin.setRootScreen(manageDatabases); origin.setup(); - s.addPreference(screen); + manageDatabases.addPreference(screen); } } } |