'show network' option takes priority over 'reset'

These are debug-build-only, but useful for my debugging!
This commit is contained in:
Eric House 2021-07-24 12:27:04 -07:00
parent 15cc0dfac5
commit fb1088b9a8
2 changed files with 20 additions and 15 deletions

View file

@ -450,12 +450,23 @@ public abstract class DelegateBase implements DlgClickNotify,
.setPositiveButton( android.R.string.ok, null );
if ( BuildConfig.NON_RELEASE && null != conTypes ) {
if ( conTypes.contains( CommsConnType.COMMS_CONN_RELAY )
|| conTypes.contains( CommsConnType.COMMS_CONN_P2P ) ) {
OnClickListener lstnr = new OnClickListener() {
OnClickListener lstnr = null;
int buttonTxt = 0;
if ( conTypes.contains( CommsConnType.COMMS_CONN_MQTT ) ) {
buttonTxt = R.string.list_item_relaypage;
final int gameID = summary.gameID;
lstnr = new OnClickListener() {
@Override
public void onClick( DialogInterface dlg,
int whichButton ) {
public void onClick( DialogInterface dlg, int whichButton ) {
NetUtils.showGamePage( m_activity, gameID );
}
};
} else if ( conTypes.contains( CommsConnType.COMMS_CONN_RELAY )
|| conTypes.contains( CommsConnType.COMMS_CONN_P2P ) ) {
buttonTxt = R.string.button_reconnect;
lstnr = new OnClickListener() {
@Override
public void onClick( DialogInterface dlg, int buttn ) {
NetStateCache.reset( m_activity );
if ( conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) {
RelayService.reset( getActivity() );
@ -465,16 +476,9 @@ public abstract class DelegateBase implements DlgClickNotify,
}
}
};
ab.setNegativeButton( R.string.button_reconnect, lstnr );
} else if ( conTypes.contains( CommsConnType.COMMS_CONN_MQTT ) ) {
final int gameID = summary.gameID;
OnClickListener lstnr = new OnClickListener() {
@Override
public void onClick( DialogInterface dlg, int whichButton ) {
NetUtils.showGamePage( m_activity, gameID );
}
};
ab.setNegativeButton( R.string.list_item_relaypage, lstnr );
if ( null != lstnr ) {
ab.setNegativeButton( buttonTxt, lstnr );
}
}
dialog = ab.create();

View file

@ -2043,6 +2043,7 @@
<string name="confirm_delete">Are you sure you want to delete the
current game? \n\n(This action cannot be undone.)</string>
<string name="duplicate_group_name_fmt">The group “%1$s” already exists.</string>
<!-- only for debug builds: button to force game to reconnect to legacy relay -->
<string name="button_reconnect">Reconnect</string>
<string name="square_tiles">Square rack tiles</string>
<string name="square_tiles_summary">Even if they can be taller</string>