mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
fix invitations!
Little hack to dismiss a game when the invitations dialog was cancelled broke invitations altogether. Revert that change, and simply check on getting focus whether all players are present; if they're not, put up the "invite or wait" dialog. This is a big change, but in 10 minutes of testing I can't get the wrong thing to happen.
This commit is contained in:
parent
ee042ff3cd
commit
f488e727f8
2 changed files with 4 additions and 12 deletions
|
@ -712,6 +712,8 @@ public class BoardDelegate extends DelegateBase
|
||||||
// in case of change...
|
// in case of change...
|
||||||
setBackgroundColor();
|
setBackgroundColor();
|
||||||
setKeepScreenOn();
|
setKeepScreenOn();
|
||||||
|
} else if ( 0 < m_nMissing ) {
|
||||||
|
showDialog( DlgID.DLG_INVITE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1032,10 +1034,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
DbgUtils.logd( TAG, "BoardDelegate.dlgButtonClicked(%s, %b)",
|
DbgUtils.logd( TAG, "BoardDelegate.dlgButtonClicked(%s, %b)",
|
||||||
action.toString(), positive );
|
action.toString(), positive );
|
||||||
|
|
||||||
if ( Action.LAUNCH_INVITE_ACTION == action ) {
|
if ( Action.ENABLE_RELAY_DO_OR == action ) {
|
||||||
Assert.assertFalse( positive );
|
|
||||||
finish();
|
|
||||||
} else if ( Action.ENABLE_RELAY_DO_OR == action ) {
|
|
||||||
handled = true;
|
handled = true;
|
||||||
if ( positive ) {
|
if ( positive ) {
|
||||||
RelayService.setEnabled( m_activity, true );
|
RelayService.setEnabled( m_activity, true );
|
||||||
|
|
|
@ -802,20 +802,13 @@ public class DlgDelegate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
OnClickListener cancelClicked = new OnClickListener() {
|
|
||||||
public void onClick( DialogInterface dlg, int view ) {
|
|
||||||
m_clickCallback.dlgButtonClicked( state.m_action,
|
|
||||||
AlertDialog.BUTTON_NEGATIVE,
|
|
||||||
state.m_params );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( m_activity )
|
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( m_activity )
|
||||||
.setTitle( R.string.invite_choice_title )
|
.setTitle( R.string.invite_choice_title )
|
||||||
.setSingleChoiceItems( items.toArray( new String[items.size()] ),
|
.setSingleChoiceItems( items.toArray( new String[items.size()] ),
|
||||||
sel[0], selChanged )
|
sel[0], selChanged )
|
||||||
.setPositiveButton( android.R.string.ok, okClicked )
|
.setPositiveButton( android.R.string.ok, okClicked )
|
||||||
.setNegativeButton( android.R.string.cancel, cancelClicked );
|
.setNegativeButton( android.R.string.cancel, null );
|
||||||
|
|
||||||
return setCallbackDismissListener( builder.create(), state, dlgID );
|
return setCallbackDismissListener( builder.create(), state, dlgID );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue