add advanced pref to hold dict download url; use it.

This commit is contained in:
eehouse 2010-04-08 04:12:08 +00:00
parent 27f65ba39d
commit 97569ae6d0
4 changed files with 17 additions and 1 deletions

View file

@ -212,6 +212,7 @@
<string name="focus">Focus color</string>
<string name="advanced">Advanced</string>
<string name="relay_host">Relay address</string>
<string name="dict_host">Dictionary download URL</string>
<string name="relay_port">Relay port</string>
<string name="sms_port">SMS port</string>
@ -292,6 +293,7 @@
<string name="key_relay_host">key_relay_host</string>
<string name="key_relay_port">key_relay_port</string>
<string name="key_sms_port">key_sms_port</string>
<string name="key_dict_host">key_dict_host</string>
<string name="key_anti_alias">key_anti_alias</string>
<string name="key_subpixel">key_subpixel</string>

View file

@ -101,5 +101,9 @@
android:defaultValue="5432"
android:numeric="decimal"
/>
<EditTextPreference android:key="@string/key_dict_host"
android:title="@string/dict_host"
android:defaultValue="@string/dict_url"
/>
</PreferenceScreen>
</PreferenceScreen>

View file

@ -356,7 +356,8 @@ public class Utils {
public static Intent mkDownloadActivity( Context context )
{
Uri uri = Uri.parse( context.getString( R.string.dict_url ));
String dict_url = CommonPrefs.getDefaultDictURL();
Uri uri = Uri.parse( dict_url );
Intent intent = new Intent( Intent.ACTION_VIEW, uri );
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
return intent;

View file

@ -146,4 +146,13 @@ public class CommonPrefs {
result = Integer.decode( val );
return result;
}
public static String getDefaultDictURL()
{
SharedPreferences sp =
PreferenceManager.getDefaultSharedPreferences( s_context );
String key = s_context.getString( R.string.key_dict_host );
return sp.getString( key, "" );
}
}