Add a link from Latin IME to the dictionary pack.

The link only shows up if the dictionary pack is installed.

Bug: 1752028
Change-Id: I4af0a0a63324c155609710064a25df0deeb82b4d
main
Jean Chalard 2011-06-24 20:17:38 +09:00
parent 2442e77985
commit 4f3d5d3733
3 changed files with 22 additions and 0 deletions

View File

@ -66,6 +66,9 @@
<!-- Option to enable auto capitalization of sentences --> <!-- Option to enable auto capitalization of sentences -->
<string name="auto_cap">Auto-capitalization</string> <string name="auto_cap">Auto-capitalization</string>
<!-- Option to configure dictionaries -->
<string name="configure_dictionaries_title">Configure dictionaries</string>
<!-- Option to enable quick fixes --> <!-- Option to enable quick fixes -->
<string name="quick_fixes">Quick fixes</string> <string name="quick_fixes">Quick fixes</string>
<!-- Description for quick fixes --> <!-- Description for quick fixes -->

View File

@ -68,6 +68,14 @@
<PreferenceCategory <PreferenceCategory
android:title="@string/correction_category" android:title="@string/correction_category"
android:key="correction_settings"> android:key="correction_settings">
<PreferenceScreen
android:key="configure_dictionaries_key"
android:title="@string/configure_dictionaries_title">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.google.android.inputmethod.latin.dictionarypack"
android:targetClass="com.google.android.inputmethod.latin.dictionarypack.DictionarySettings" />
</PreferenceScreen>
<CheckBoxPreference <CheckBoxPreference
android:key="quick_fixes" android:key="quick_fixes"
android:title="@string/quick_fixes" android:title="@string/quick_fixes"

View File

@ -25,6 +25,7 @@ import com.android.inputmethod.compat.VibratorCompatWrapper;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.backup.BackupManager; import android.app.backup.BackupManager;
import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
@ -65,6 +66,7 @@ public class Settings extends PreferenceActivity
public static final String PREF_SELECTED_LANGUAGES = "selected_languages"; public static final String PREF_SELECTED_LANGUAGES = "selected_languages";
public static final String PREF_SUBTYPES = "subtype_settings"; public static final String PREF_SUBTYPES = "subtype_settings";
public static final String PREF_CONFIGURE_DICTIONARIES_KEY = "configure_dictionaries_key";
public static final String PREF_CORRECTION_SETTINGS_KEY = "correction_settings"; public static final String PREF_CORRECTION_SETTINGS_KEY = "correction_settings";
public static final String PREF_QUICK_FIXES = "quick_fixes"; public static final String PREF_QUICK_FIXES = "quick_fixes";
public static final String PREF_SHOW_SUGGESTIONS_SETTING = "show_suggestions_setting"; public static final String PREF_SHOW_SUGGESTIONS_SETTING = "show_suggestions_setting";
@ -424,6 +426,15 @@ public class Settings extends PreferenceActivity
} }
mKeyPreviewPopupDismissDelay.setEnabled( mKeyPreviewPopupDismissDelay.setEnabled(
Settings.Values.isKeyPreviewPopupEnabled(prefs, res)); Settings.Values.isKeyPreviewPopupEnabled(prefs, res));
final PreferenceScreen dictionaryLink =
(PreferenceScreen) findPreference(PREF_CONFIGURE_DICTIONARIES_KEY);
final Intent intent = dictionaryLink.getIntent();
final int number = getPackageManager().queryIntentActivities(intent, 0).size();
if (0 >= number) {
textCorrectionGroup.removePreference(dictionaryLink);
}
} }
@Override @Override