WifiSettings: revise and add support for editing EAP networks.

Use arrays.xml to store translations for enumerations;
avoid race conditions happened when pop up menu or dialog;
avoid saving configurations with networks disabled;
use the same layout for all the dialogs;
support editing EAP networks;
only unlock keystore before connecting;
and many bug fixes I cannot remember.

The number of lines in the new code is about 1/3 of the old one,
and it improves the readability a lot!
diff --git a/res/xml/wifi_settings2.xml b/res/xml/wifi_settings2.xml
new file mode 100644
index 0000000..35f1173
--- /dev/null
+++ b/res/xml/wifi_settings2.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+        android:title="@string/wifi_settings_category">
+
+    <CheckBoxPreference
+            android:key="enable_wifi"
+            android:title="@string/wifi"
+            android:summary="@string/wifi_quick_toggle_summary"
+            android:persistent="false" />
+
+    <CheckBoxPreference
+            android:key="notify_open_networks"
+            android:dependency="enable_wifi"
+            android:title="@string/wifi_notify_open_networks"
+            android:summary="@string/wifi_notify_open_networks_summary"
+            android:persistent="false" />
+
+    <com.android.settings.ProgressCategory
+            android:key="access_points"
+            android:dependency="enable_wifi"
+            android:title="@string/wifi_access_points"
+            android:persistent="false" />
+
+    <Preference
+            android:key="add_network"
+            android:dependency="enable_wifi"
+            android:title="@string/wifi_add_network"
+            android:persistent="false" />
+
+</PreferenceScreen>