mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
show the giving up message as a dialog rather than a toast
This commit is contained in:
parent
eecc609eae
commit
7a21d4c151
2 changed files with 10 additions and 3 deletions
|
@ -1872,8 +1872,8 @@
|
|||
|
||||
<string name="bt_resendf">Bluetooth send to %1$s failed; retry %3$d in
|
||||
%2$d seconds.</string>
|
||||
<string name="bt_failf">Giving up on %1$s: Bluetooth send failed
|
||||
too many times.</string>
|
||||
<string name="bt_failf">Bluetooth sends to %1$s have failed too many
|
||||
times. Re-open the game to try again.</string>
|
||||
<string name="button_invite">Invite</string>
|
||||
|
||||
|
||||
|
|
|
@ -289,6 +289,7 @@ public class DlgDelegate {
|
|||
public void eventOccurred( BTService.BTEvent event, final Object ... args )
|
||||
{
|
||||
String msg = null;
|
||||
boolean asToast = true;
|
||||
switch( event ) {
|
||||
case BAD_PROTO:
|
||||
msg = Utils.format( m_activity, R.string.bt_bad_protof,
|
||||
|
@ -301,6 +302,7 @@ public class DlgDelegate {
|
|||
case MESSAGE_FAILOUT:
|
||||
msg = Utils.format( m_activity, R.string.bt_failf,
|
||||
(String)args[0] );
|
||||
asToast = false;
|
||||
break;
|
||||
default:
|
||||
DbgUtils.logf( "eventOccurred: unhandled event %s", event.toString() );
|
||||
|
@ -308,9 +310,14 @@ public class DlgDelegate {
|
|||
|
||||
if ( null != msg ) {
|
||||
final String fmsg = msg;
|
||||
final boolean asDlg = !asToast;
|
||||
post( new Runnable() {
|
||||
public void run() {
|
||||
DbgUtils.showf( m_activity, fmsg );
|
||||
if ( asDlg ) {
|
||||
showOKOnlyDialog( fmsg, 0 );
|
||||
} else {
|
||||
DbgUtils.showf( m_activity, fmsg );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue