mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
have "show traffic" action copy game URL to clipboard
Useful when using emulator to get to a large-screen view of things
This commit is contained in:
parent
49076c54f8
commit
03a936de74
4 changed files with 10 additions and 4 deletions
|
@ -461,7 +461,7 @@ public abstract class DelegateBase implements DlgClickNotify,
|
|||
lstnr = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick( DialogInterface dlg, int whichButton ) {
|
||||
NetUtils.showGamePage( m_activity, gameID );
|
||||
NetUtils.copyAndLaunchGamePage( m_activity, gameID );
|
||||
}
|
||||
};
|
||||
} else if ( conTypes.contains( CommsConnType.COMMS_CONN_RELAY )
|
||||
|
|
|
@ -2137,7 +2137,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
|
||||
case R.id.games_game_relaypage:
|
||||
GameSummary summary = GameUtils.getSummary( m_activity, selRowIDs[0] );
|
||||
NetUtils.showGamePage( m_activity, summary.gameID );
|
||||
NetUtils.copyAndLaunchGamePage( m_activity, summary.gameID );
|
||||
break;
|
||||
|
||||
// DEBUG only
|
||||
|
|
|
@ -125,7 +125,7 @@ public class NetUtils {
|
|||
}
|
||||
}
|
||||
|
||||
static void showGamePage( Context context, int gameID )
|
||||
static void copyAndLaunchGamePage( Context context, int gameID )
|
||||
{
|
||||
// Requires a login, so only of use to me right now....
|
||||
String host = XWPrefs.getPrefsString( context, R.string.key_mqtt_host );
|
||||
|
@ -135,6 +135,9 @@ public class NetUtils {
|
|||
if ( null != intent.resolveActivity( context.getPackageManager() ) ) {
|
||||
context.startActivity( intent );
|
||||
}
|
||||
|
||||
Utils.stringToClip( context, url );
|
||||
Utils.showToast( context, R.string.relaypage_url_copied );
|
||||
}
|
||||
|
||||
public static byte[][][] queryRelay( Context context, String[] ids )
|
||||
|
|
|
@ -135,8 +135,11 @@
|
|||
<!-- Debug-only menuitem that shows mqtt broker's awareness of
|
||||
devices in game -->
|
||||
<string name="list_item_relaypage">Game traffic…</string>
|
||||
<!-- Debug only: shown when game-view url copied to clipboard as
|
||||
part of "show traffic" action -->
|
||||
<string name="relaypage_url_copied">Game URL copied to clipboard</string>
|
||||
<!-- If you try to copy a networked game you get this error
|
||||
message. -->
|
||||
message. -->
|
||||
<string name="no_copy_network">Games that have already connected
|
||||
to the relay cannot be copied. Use “New from” for a
|
||||
ready-to-play copy with all the same settings.</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue