From d18ac741b7c92a0f0f46e55d570b575a02c86166 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 13 Jun 2011 18:17:37 -0700 Subject: [PATCH 1/4] add new debug pref for redirecting host so it and relay can live on different machines. --- xwords4/android/XWords4/res/values/common_rsrc.xml | 12 ++++++++++++ xwords4/android/XWords4/res/values/strings.xml | 8 -------- xwords4/android/XWords4/res/xml/xwprefs.xml | 5 +++++ .../src/org/eehouse/android/xw4/NetLaunchInfo.java | 2 +- .../src/org/eehouse/android/xw4/PrefsActivity.java | 1 + .../src/org/eehouse/android/xw4/jni/CommonPrefs.java | 5 +++++ 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/xwords4/android/XWords4/res/values/common_rsrc.xml b/xwords4/android/XWords4/res/values/common_rsrc.xml index 717ef8300..9f6ae2a55 100644 --- a/xwords4/android/XWords4/res/values/common_rsrc.xml +++ b/xwords4/android/XWords4/res/values/common_rsrc.xml @@ -28,6 +28,7 @@ key_clr_crosshairs key_relay_host + key_redir_host key_relay_port2 key_proxy_port key_sms_port @@ -70,11 +71,22 @@ eehouse.org + http://eehouse.org/and_dicts_hh 4.4 beta 28 //%1$s/redir.php + + For debugging + You should never need these... + Relay host + Invite redirect host + Dictionary download URL + Enable logging + Relay game port + Relay device port + diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 7a241aeb5..19631177b 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -328,14 +328,6 @@ Crosshairs color Board background - For debugging - You should never need these... - Relay address - Dictionary download URL - Enable logging - Relay game port - Relay device port - key_player Internet/Relay SMS (broken) diff --git a/xwords4/android/XWords4/res/xml/xwprefs.xml b/xwords4/android/XWords4/res/xml/xwprefs.xml index d0bf412f2..702711be1 100644 --- a/xwords4/android/XWords4/res/xml/xwprefs.xml +++ b/xwords4/android/XWords4/res/xml/xwprefs.xml @@ -247,6 +247,11 @@ android:defaultValue="10998" android:numeric="decimal" /> + + diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java index 09b5a01dd..68f68b5a8 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java @@ -42,7 +42,7 @@ public class NetLaunchInfo { ub.scheme( "http" ); String format = context.getString( R.string.game_url_pathf ); ub.path( String.format( format, - CommonPrefs.getDefaultRelayHost( context ) ) ); + CommonPrefs.getDefaultRedirHost( context ) ) ); ub.appendQueryParameter( "lang", String.format("%d", lang ) ); ub.appendQueryParameter( "np", String.format( "%d", nPlayers ) ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java index 198f2425e..93f147cf4 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java @@ -115,6 +115,7 @@ public class PrefsActivity extends PreferenceActivity addPreferencesFromResource( R.xml.xwprefs ); int[] textKeyIds = { R.string.key_relay_host, + R.string.key_redir_host, R.string.key_relay_port, R.string.key_proxy_port, R.string.key_dict_host, diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java index 6b75edd49..9ab71b910 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommonPrefs.java @@ -138,6 +138,11 @@ public class CommonPrefs { return getString( context, R.string.key_relay_host ); } + public static String getDefaultRedirHost( Context context ) + { + return getString( context, R.string.key_redir_host ); + } + public static int getDefaultRelayPort( Context context ) { String val = getString( context, R.string.key_relay_port ); From a3180213087f129fb94a541c2190cb913acec81f Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 13 Jun 2011 18:26:12 -0700 Subject: [PATCH 2/4] title that won't surprise on upgrade --- xwords4/android/XWords4/res/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 19631177b..aae1d88c0 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -562,9 +562,9 @@ Unable to download. Do you have a web browser installed? - New player welcome + Welcome Thanks for installing - Crosswords! Feel free to enter your name here. It will be used + Crosswords! Feel free to enter your name here. It will be used when creating new games. (You can change it later in the \"New game default\" section of Settings.) From d470a1c1e0aca9b8a98dc7e5b503815026904367 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 13 Jun 2011 18:47:42 -0700 Subject: [PATCH 3/4] add a newbie-info for new-from menuitem. Still need one for reset. --- xwords4/android/XWords4/res/values/common_rsrc.xml | 1 + xwords4/android/XWords4/res/values/strings.xml | 4 ++++ .../src/org/eehouse/android/xw4/GamesList.java | 13 +++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/res/values/common_rsrc.xml b/xwords4/android/XWords4/res/values/common_rsrc.xml index 9f6ae2a55..6890b471c 100644 --- a/xwords4/android/XWords4/res/values/common_rsrc.xml +++ b/xwords4/android/XWords4/res/values/common_rsrc.xml @@ -68,6 +68,7 @@ key_notagain_dicts key_notagain_arrow key_notagain_turnchanged + key_notagain_newfrom eehouse.org diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index aae1d88c0..a873304b0 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -524,6 +524,10 @@ the scoreboard to get details about that player\'s most recent move. + Create a new ready-to-play game + using all the settings from this one. That is, treat this game + as a template. + To start a basic networked two-player game in %s: diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index f10429685..1a546389b 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -468,8 +468,17 @@ public class GamesList extends XWListActivity break; case R.id.list_item_new_from: - String newName = GameUtils.dupeGame( this, path ); - invalPath = newName; + Runnable proc = new Runnable() { + public void run() { + String newName = + GameUtils.dupeGame( GamesList.this, path ); + if ( null != m_adapter ) { + m_adapter.inval( newName ); + } + } + }; + showNotAgainDlgThen( R.string.not_again_newfrom, + R.string.key_notagain_newfrom, proc ); break; case R.id.list_item_copy: From 7a5549cc435ed7cae1ed56bc818464bec3100ada Mon Sep 17 00:00:00 2001 From: Andy2 Date: Tue, 14 Jun 2011 05:38:37 -0700 Subject: [PATCH 4/4] set selectAllOnFocus on player name edit. Can't figure out how to force focus to that field though.... --- xwords4/android/XWords4/res/layout/player_edit.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/xwords4/android/XWords4/res/layout/player_edit.xml b/xwords4/android/XWords4/res/layout/player_edit.xml index 97c7dc043..29a5863a9 100644 --- a/xwords4/android/XWords4/res/layout/player_edit.xml +++ b/xwords4/android/XWords4/res/layout/player_edit.xml @@ -53,6 +53,7 @@ android:scrollHorizontally="true" android:autoText="false" android:capitalize="words" + android:selectAllOnFocus="true" android:gravity="fill_horizontal" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceMedium"