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:
Eric House 2022-05-03 08:48:44 -07:00
parent 49076c54f8
commit 03a936de74
4 changed files with 10 additions and 4 deletions

View file

@ -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 )

View file

@ -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

View file

@ -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 )

View file

@ -135,6 +135,9 @@
<!-- 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. -->
<string name="no_copy_network">Games that have already connected