mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
add advanced pref to hold dict download url; use it.
This commit is contained in:
parent
27f65ba39d
commit
97569ae6d0
4 changed files with 17 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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, "" );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue