mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
don't show "send pending messages" menuitem when there are none
This commit is contained in:
parent
386c28e596
commit
9d174740c8
5 changed files with 8 additions and 1 deletions
|
@ -1408,6 +1408,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1getGi
|
||||||
|
|
||||||
static const SetInfo gsi_ints[] = {
|
static const SetInfo gsi_ints[] = {
|
||||||
ARR_MEMBER( GameStateInfo, visTileCount ),
|
ARR_MEMBER( GameStateInfo, visTileCount ),
|
||||||
|
ARR_MEMBER( GameStateInfo, nPendingMessages ),
|
||||||
ARR_MEMBER( GameStateInfo, trayVisState ),
|
ARR_MEMBER( GameStateInfo, trayVisState ),
|
||||||
};
|
};
|
||||||
static const SetInfo gsi_bools[] = {
|
static const SetInfo gsi_bools[] = {
|
||||||
|
|
|
@ -805,8 +805,10 @@ public class BoardActivity extends XWActivity
|
||||||
|
|
||||||
boolean enable = null != m_gi
|
boolean enable = null != m_gi
|
||||||
&& DeviceRole.SERVER_STANDALONE != m_gi.serverRole;
|
&& DeviceRole.SERVER_STANDALONE != m_gi.serverRole;
|
||||||
Utils.setItemVisible( menu, R.id.board_menu_game_resend, enable );
|
|
||||||
Utils.setItemVisible( menu, R.id.gamel_menu_checkmoves, enable );
|
Utils.setItemVisible( menu, R.id.gamel_menu_checkmoves, enable );
|
||||||
|
Utils.setItemVisible( menu, R.id.board_menu_game_resend,
|
||||||
|
enable && null != m_gsi &&
|
||||||
|
0 < m_gsi.nPendingMessages );
|
||||||
|
|
||||||
enable = enable && BuildConfig.DEBUG;
|
enable = enable && BuildConfig.DEBUG;
|
||||||
Utils.setItemVisible( menu, R.id.board_menu_game_netstats, enable );
|
Utils.setItemVisible( menu, R.id.board_menu_game_netstats, enable );
|
||||||
|
|
|
@ -104,6 +104,7 @@ public class JNIThread extends Thread {
|
||||||
public class GameStateInfo implements Cloneable {
|
public class GameStateInfo implements Cloneable {
|
||||||
public int visTileCount;
|
public int visTileCount;
|
||||||
public int trayVisState;
|
public int trayVisState;
|
||||||
|
public int nPendingMessages;
|
||||||
public boolean canHint;
|
public boolean canHint;
|
||||||
public boolean canUndo;
|
public boolean canUndo;
|
||||||
public boolean canRedo;
|
public boolean canRedo;
|
||||||
|
|
|
@ -330,6 +330,8 @@ game_getState( const XWGame* game, GameStateInfo* gsi )
|
||||||
gsi->canShuffle = board_canShuffle( board );
|
gsi->canShuffle = board_canShuffle( board );
|
||||||
gsi->canHideRack = board_canHideRack( board );
|
gsi->canHideRack = board_canHideRack( board );
|
||||||
gsi->canTrade = board_canTrade( board );
|
gsi->canTrade = board_canTrade( board );
|
||||||
|
gsi->nPendingMessages = !!game->comms ?
|
||||||
|
comms_countPendingPackets(game->comms) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -34,6 +34,7 @@ extern "C" {
|
||||||
|
|
||||||
typedef struct _GameStateInfo {
|
typedef struct _GameStateInfo {
|
||||||
XP_U16 visTileCount;
|
XP_U16 visTileCount;
|
||||||
|
XP_U16 nPendingMessages;
|
||||||
XW_TrayVisState trayVisState;
|
XW_TrayVisState trayVisState;
|
||||||
XP_Bool canHint;
|
XP_Bool canHint;
|
||||||
XP_Bool canUndo;
|
XP_Bool canUndo;
|
||||||
|
|
Loading…
Reference in a new issue