mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-15 08:47:56 +01:00
remove useless debug-only menuitem
This commit is contained in:
parent
a8554c22d0
commit
4b730cf0b5
10 changed files with 22 additions and 57 deletions
|
@ -813,7 +813,6 @@ class BoardDelegate(delegator: Delegator) :
|
|||
enable = netGame && (BuildConfig.DEBUG
|
||||
|| XWPrefs.getDebugEnabled(mActivity))
|
||||
Utils.setItemVisible(menu, R.id.board_menu_game_netstats, enable)
|
||||
Utils.setItemVisible(menu, R.id.board_menu_game_invites, enable)
|
||||
enable = XWPrefs.getStudyEnabled(mActivity) && null != mGi
|
||||
&& !DBUtils.studyListWords(mActivity, mGi!!.isoCode()!!).isEmpty()
|
||||
Utils.setItemVisible(menu, R.id.board_menu_study, enable)
|
||||
|
@ -867,11 +866,6 @@ class BoardDelegate(delegator: Delegator) :
|
|||
R.string.netstats_title
|
||||
)
|
||||
|
||||
R.id.board_menu_game_invites -> {
|
||||
val sentInfo = DBUtils.getInvitesFor(mActivity, mRowid)
|
||||
makeOkOnlyBuilder(sentInfo.getAsText(mActivity)).show()
|
||||
}
|
||||
|
||||
R.id.board_menu_undo_current -> cmd = JNICmd.CMD_UNDO_CUR
|
||||
R.id.board_menu_undo_last -> makeConfirmThenBuilder(
|
||||
Action.UNDO_LAST_ACTION,
|
||||
|
|
|
@ -1843,7 +1843,6 @@ class GamesListDelegate(delegator: Delegator) :
|
|||
enable = (isMultiGame
|
||||
&& (BuildConfig.DEBUG || XWPrefs.getDebugEnabled(mActivity)))
|
||||
}
|
||||
Utils.setItemVisible(menu, R.id.games_game_invites, enable)
|
||||
Utils.setItemVisible(menu, R.id.games_game_netstats, isMultiGame)
|
||||
enable = (isMultiGame && BuildConfig.NON_RELEASE
|
||||
&& summary!!.conTypes!!.contains(CommsConnType.COMMS_CONN_MQTT))
|
||||
|
@ -2036,25 +2035,6 @@ class GamesListDelegate(delegator: Delegator) :
|
|||
NetUtils.copyAndLaunchGamePage(mActivity, summary.gameID)
|
||||
}
|
||||
|
||||
R.id.games_game_invites -> {
|
||||
val summary = GameUtils.getSummary(mActivity, selRowIDs[0])!!
|
||||
var msg = summary.conTypes!!.toString(mActivity, true)
|
||||
msg = getString(R.string.invites_net_fmt, msg)
|
||||
|
||||
val info = DBUtils.getInvitesFor(
|
||||
mActivity,
|
||||
selRowIDs[0]
|
||||
)
|
||||
if (null != info) {
|
||||
msg += """
|
||||
|
||||
|
||||
${info.getAsText(mActivity)}
|
||||
""".trimIndent()
|
||||
}
|
||||
makeOkOnlyBuilder(msg).show()
|
||||
}
|
||||
|
||||
R.id.games_game_markbad -> Quarantine.markBad(selRowIDs[0])
|
||||
else -> handled = false
|
||||
}
|
||||
|
|
|
@ -104,21 +104,22 @@ internal abstract class XWExpListAdapter(childClasses: Array<Class<*>>) :
|
|||
}
|
||||
|
||||
protected fun removeChildrenOf(groupIndex: Int) {
|
||||
Assert.assertTrueNR(0 <= groupIndex)
|
||||
Assert.assertTrue(m_groupClass == m_listObjs!![groupIndex]!!.javaClass)
|
||||
val end = findGroupEnd(groupIndex)
|
||||
val nChildren = end - groupIndex - 1 // 1: don't remove parent
|
||||
val newArray = arrayOfNulls<Any>(m_listObjs!!.size - nChildren)
|
||||
System.arraycopy(m_listObjs, 0, newArray, 0, groupIndex + 1) // 1: include parent
|
||||
val nAbove = m_listObjs!!.size - (groupIndex + nChildren + 1)
|
||||
if (end < m_listObjs!!.size) {
|
||||
System.arraycopy(
|
||||
m_listObjs, end, newArray, groupIndex + 1,
|
||||
m_listObjs!!.size - end
|
||||
)
|
||||
if (0 <= groupIndex) {
|
||||
Assert.assertTrue(m_groupClass == m_listObjs!![groupIndex]!!.javaClass)
|
||||
val end = findGroupEnd(groupIndex)
|
||||
val nChildren = end - groupIndex - 1 // 1: don't remove parent
|
||||
val newArray = arrayOfNulls<Any>(m_listObjs!!.size - nChildren)
|
||||
System.arraycopy(m_listObjs, 0, newArray, 0, groupIndex + 1) // 1: include parent
|
||||
val nAbove = m_listObjs!!.size - (groupIndex + nChildren + 1)
|
||||
if (end < m_listObjs!!.size) {
|
||||
System.arraycopy(
|
||||
m_listObjs, end, newArray, groupIndex + 1,
|
||||
m_listObjs!!.size - end
|
||||
)
|
||||
}
|
||||
m_listObjs = newArray as Array<Any>
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
m_listObjs = newArray as Array<Any>
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
protected fun addChildrenOf(groupIndex: Int, children: List<Any?>) {
|
||||
|
|
|
@ -92,7 +92,5 @@
|
|||
/>
|
||||
<item android:id="@+id/board_menu_game_netstats"
|
||||
android:title="@string/board_menu_game_netstats" />
|
||||
<item android:id="@+id/board_menu_game_invites"
|
||||
android:title="@string/board_menu_game_showInvites" />
|
||||
|
||||
</menu>
|
||||
|
|
|
@ -75,8 +75,6 @@
|
|||
|
||||
<item android:id="@+id/board_menu_game_netstats"
|
||||
android:title="@string/board_menu_game_netstats" />
|
||||
<item android:id="@+id/board_menu_game_invites"
|
||||
android:title="@string/board_menu_game_showInvites" />
|
||||
|
||||
<item android:id="@+id/board_menu_game_pause"
|
||||
android:title="@string/board_menu_game_pause" />
|
||||
|
|
|
@ -39,9 +39,6 @@
|
|||
android:title="@string/list_item_deselect"
|
||||
/>
|
||||
<!-- below here: Debug only -->
|
||||
<item android:id="@+id/games_game_invites"
|
||||
android:title="@string/board_menu_game_showInvites"
|
||||
/>
|
||||
<item android:id="@+id/games_game_markbad"
|
||||
android:title="@string/list_item_markbad"
|
||||
/>
|
||||
|
|
|
@ -1780,8 +1780,6 @@
|
|||
<string name="button_refresh">Refresh</string>
|
||||
|
||||
<!-- First line of debug-only Invites list dialog -->
|
||||
<string name="invites_net_fmt">Invitations sent for game connected via
|
||||
%1$s:</string>
|
||||
<!-- -->
|
||||
<string name="connstat_succ">successful</string>
|
||||
<!-- -->
|
||||
|
@ -2235,7 +2233,6 @@
|
|||
<string name="debug_features">Enable debug features</string>
|
||||
<string name="debug_features_summary">Menuitems etc.</string>
|
||||
<string name="board_menu_game_netstats">Network stats</string>
|
||||
<string name="board_menu_game_showInvites">Show invites</string>
|
||||
<string name="netstats_title">Game network stats</string>
|
||||
<string name="mqtt_port">MQTT port</string>
|
||||
<string name="mqtt_qos">MQTT QOS</string>
|
||||
|
@ -2331,7 +2328,7 @@
|
|||
<string name="not_again_dfltname_fmt">You are using the default
|
||||
player name “%1$s”. Would you like to personalize with your own
|
||||
name before you create this game?</string>
|
||||
<string name="no_invites">This game has sent no invitations</string>
|
||||
<string name="no_invites">This game has no invitations pending.</string>
|
||||
<string name="after_restart">This change will take effect after you
|
||||
restart CrossWords.</string>
|
||||
<string name="missing_sms_perms">This game is configured to communicate
|
||||
|
|
|
@ -1821,11 +1821,11 @@ getNamesProc( MsgQueueElem* elem, void* closure )
|
|||
kplr_nameForAddress( gndp->comms->dutil, gndp->xwe, addr );
|
||||
InviteeNames* names = gndp->names;
|
||||
if ( !!name ) {
|
||||
XP_STRCAT( names->name[names->count], name );
|
||||
XP_STRCAT( names->name[names->nNames], name );
|
||||
XP_LOGFF( "copied name %s to pos %d (pos %d)", name,
|
||||
channelNo, names->count );
|
||||
channelNo, names->nNames );
|
||||
}
|
||||
++names->count;
|
||||
++names->nNames;
|
||||
}
|
||||
return FEA_OK;
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ void comms_invite( CommsCtxt* comms, XWEnv xwe, const NetLaunchInfo* nli,
|
|||
void comms_getInvited( RELCONST CommsCtxt* comms, XP_U16* nInvites );
|
||||
typedef struct _InviteeNames {
|
||||
XP_UCHAR name[4][32];
|
||||
XP_U16 count;
|
||||
XP_U16 nNames;
|
||||
} InviteeNames;
|
||||
void comms_inviteeNames( CommsCtxt* comms, XWEnv xwe, InviteeNames* names );
|
||||
|
||||
|
|
|
@ -4755,13 +4755,13 @@ server_inviteeName( const ServerCtxt* server,
|
|||
InviteeNames names = {};
|
||||
comms_inviteeNames( comms, xwe, &names );
|
||||
|
||||
if ( nameIndx < names.count ) {
|
||||
if ( nameIndx < names.nNames ) {
|
||||
XP_LOGFF( "got a match: player %d for channel %d; name: \"%s\"",
|
||||
playerPosn, nameIndx, names.name[nameIndx] );
|
||||
*bufLen = XP_SNPRINTF( buf, *bufLen, names.name[nameIndx], playerPosn );
|
||||
} else {
|
||||
XP_LOGFF( "expected %dth name but found only %d",
|
||||
nameIndx, names.count );
|
||||
nameIndx, names.nNames );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue