mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
show a toast when hint can't find anything, on the principle that user
should see some response to every action. Conflicts: xwords4/android/XWords4/archive/R.java
This commit is contained in:
parent
fa00eef151
commit
0bb51e8b93
8 changed files with 29 additions and 2 deletions
|
@ -2529,4 +2529,6 @@
|
|||
<string name="not_again_comms_bt">Use Bluetooth to play against a
|
||||
nearby device that\'s \"paired\" with yours.</string>
|
||||
|
||||
<string name="str_no_hint_found">Cannot find any moves</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -2178,4 +2178,5 @@
|
|||
i.e. yreve reirrac ni eht dlrow tpecxe Nozirev dna Tnirps.</string>
|
||||
<string name="not_again_comms_bt">Esu Htooteulb ot yalp tsniaga a
|
||||
ybraen ecived taht\'s \"deriap\" htiw sruoy.</string>
|
||||
<string name="str_no_hint_found">Tonnac dnif yna sevom</string>
|
||||
</resources>
|
||||
|
|
|
@ -2178,4 +2178,5 @@
|
|||
I.E. EVERY CARRIER IN THE WORLD EXCEPT VERIZON AND SPRINT.</string>
|
||||
<string name="not_again_comms_bt">USE BLUETOOTH TO PLAY AGAINST A
|
||||
NEARBY DEVICE THAT\'S \"PAIRED\" WITH YOURS.</string>
|
||||
<string name="str_no_hint_found">CANNOT FIND ANY MOVES</string>
|
||||
</resources>
|
||||
|
|
|
@ -1719,6 +1719,7 @@ public class BoardDelegate extends DelegateBase
|
|||
public void userError( int code )
|
||||
{
|
||||
int resid = 0;
|
||||
boolean asToast = false;
|
||||
switch( code ) {
|
||||
case UtilCtxt.ERR_TILES_NOT_IN_LINE:
|
||||
resid = R.string.str_tiles_not_in_line;
|
||||
|
@ -1764,10 +1765,23 @@ public class BoardDelegate extends DelegateBase
|
|||
case ERR_REG_SERVER_SANS_REMOTE:
|
||||
resid = R.string.str_reg_server_sans_remote;
|
||||
break;
|
||||
case ERR_NO_HINT_FOUND:
|
||||
resid = R.string.str_no_hint_found;
|
||||
asToast = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( resid != 0 ) {
|
||||
nonBlockingDialog( DlgID.DLG_OKONLY, getString( resid ) );
|
||||
if ( asToast ) {
|
||||
final int residf = resid;
|
||||
runOnUiThread( new Runnable() {
|
||||
public void run() {
|
||||
showToast( residf );
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
nonBlockingDialog( DlgID.DLG_OKONLY, getString( resid ) );
|
||||
}
|
||||
}
|
||||
} // userError
|
||||
|
||||
|
|
|
@ -125,7 +125,9 @@ public interface UtilCtxt {
|
|||
static final int ERR_NO_EMPTY_TRADE = 13;
|
||||
static final int ERR_CANT_UNDO_TILEASSIGN = 14;
|
||||
static final int ERR_CANT_HINT_WHILE_DISABLED = 15;
|
||||
static final int ERR_RELAY_BASE = 16;
|
||||
static final int ERR_NO_HINT_FOUND = 16;
|
||||
|
||||
static final int ERR_RELAY_BASE = 17;
|
||||
void userError( int id );
|
||||
|
||||
void informMove( String expl, String words );
|
||||
|
|
|
@ -2121,6 +2121,8 @@ board_requestHint( BoardCtxt* board,
|
|||
}
|
||||
setArrowVisible( board, wasVisible );
|
||||
}
|
||||
} else {
|
||||
util_userError( board->util, ERR_NO_HINT_FOUND );
|
||||
}
|
||||
}
|
||||
return result || redraw;
|
||||
|
|
|
@ -58,6 +58,7 @@ typedef enum {
|
|||
/* ERR_NOT_YOUR_TURN_TO_MOVE, */
|
||||
ERR_CANT_UNDO_TILEASSIGN,
|
||||
ERR_CANT_HINT_WHILE_DISABLED,
|
||||
ERR_NO_HINT_FOUND, /* not really an error... */
|
||||
|
||||
ERR_RELAY_BASE,
|
||||
ERR_RELAY_END = ERR_RELAY_BASE + XWRELAY_ERROR_LASTERR
|
||||
|
|
|
@ -492,6 +492,10 @@ linux_getErrString( UtilErrID id, XP_Bool* silent )
|
|||
message = "No tiles selected; trade cancelled.";
|
||||
break;
|
||||
|
||||
case ERR_NO_HINT_FOUND:
|
||||
message = "Unable to suggest any moves.";
|
||||
break;
|
||||
|
||||
case ERR_CANT_UNDO_TILEASSIGN:
|
||||
message = "Tile assignment can't be undone.";
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue