mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
add unquash menuitem to netstat menu (debug only)
This commit is contained in:
parent
cbae3665ca
commit
a48cd6e82e
6 changed files with 19 additions and 5 deletions
|
@ -1534,6 +1534,9 @@ public class BoardDelegate extends DelegateBase
|
||||||
popup.getMenu().removeItem( R.id.netstat_menu_traffic );
|
popup.getMenu().removeItem( R.id.netstat_menu_traffic );
|
||||||
popup.getMenu().removeItem( R.id.netstat_peers );
|
popup.getMenu().removeItem( R.id.netstat_peers );
|
||||||
}
|
}
|
||||||
|
if ( !m_summary.quashed ) {
|
||||||
|
popup.getMenu().removeItem( R.id.netstat_unquash );
|
||||||
|
}
|
||||||
|
|
||||||
popup.setOnMenuItemClickListener( new PopupMenu
|
popup.setOnMenuItemClickListener( new PopupMenu
|
||||||
.OnMenuItemClickListener() {
|
.OnMenuItemClickListener() {
|
||||||
|
@ -1553,6 +1556,9 @@ public class BoardDelegate extends DelegateBase
|
||||||
case R.id.netstat_peers:
|
case R.id.netstat_peers:
|
||||||
showDialogFragment( DlgID.MQTT_PEERS );
|
showDialogFragment( DlgID.MQTT_PEERS );
|
||||||
break;
|
break;
|
||||||
|
case R.id.netstat_unquash:
|
||||||
|
XwJNI.comms_setQuashed( m_jniGamePtr, false );
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
handled = false;
|
handled = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1458,7 +1458,7 @@ public class GameUtils {
|
||||||
for ( long rowid: rowids ) {
|
for ( long rowid: rowids ) {
|
||||||
try ( JNIThread thread = JNIThread.getRetained( rowid ) ) {
|
try ( JNIThread thread = JNIThread.getRetained( rowid ) ) {
|
||||||
if ( null != thread ) {
|
if ( null != thread ) {
|
||||||
XwJNI.comms_setQuashed( thread.getGamePtr() );
|
XwJNI.comms_setQuashed( thread.getGamePtr(), true );
|
||||||
// JNIThread saves automatically on release
|
// JNIThread saves automatically on release
|
||||||
} else {
|
} else {
|
||||||
try ( GameLock lock = GameLock.lock( rowid, 300 ) ) {
|
try ( GameLock lock = GameLock.lock( rowid, 300 ) ) {
|
||||||
|
@ -1466,7 +1466,7 @@ public class GameUtils {
|
||||||
CurGameInfo gi = new CurGameInfo( context );
|
CurGameInfo gi = new CurGameInfo( context );
|
||||||
try ( GamePtr gamePtr = loadMakeGame( context, gi, lock ) ) {
|
try ( GamePtr gamePtr = loadMakeGame( context, gi, lock ) ) {
|
||||||
if ( null != gamePtr ) {
|
if ( null != gamePtr ) {
|
||||||
if ( XwJNI.comms_setQuashed( gamePtr ) ) {
|
if ( XwJNI.comms_setQuashed( gamePtr, true ) ) {
|
||||||
saveGame( context, gamePtr, gi, lock, false );
|
saveGame( context, gamePtr, gi, lock, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,7 +560,7 @@ public class XwJNI {
|
||||||
public static native CommsAddrRec comms_getHostAddr( GamePtr gamePtr );
|
public static native CommsAddrRec comms_getHostAddr( GamePtr gamePtr );
|
||||||
public static native CommsAddrRec[] comms_getAddrs( GamePtr gamePtr );
|
public static native CommsAddrRec[] comms_getAddrs( GamePtr gamePtr );
|
||||||
public static native void comms_dropHostAddr( GamePtr gamePtr, CommsConnType typ );
|
public static native void comms_dropHostAddr( GamePtr gamePtr, CommsConnType typ );
|
||||||
public static native boolean comms_setQuashed( GamePtr gamePtr );
|
public static native boolean comms_setQuashed( GamePtr gamePtr, boolean quashed );
|
||||||
public static native int comms_resendAll( GamePtr gamePtr, boolean force,
|
public static native int comms_resendAll( GamePtr gamePtr, boolean force,
|
||||||
CommsConnType filter,
|
CommsConnType filter,
|
||||||
boolean andAck );
|
boolean andAck );
|
||||||
|
|
|
@ -13,4 +13,7 @@
|
||||||
<item android:id="@+id/netstat_peers"
|
<item android:id="@+id/netstat_peers"
|
||||||
android:title="@string/menu_about_peers"
|
android:title="@string/menu_about_peers"
|
||||||
/>
|
/>
|
||||||
|
<item android:id="@+id/netstat_unquash"
|
||||||
|
android:title="@string/menu_unquash"
|
||||||
|
/>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
<string name="no_peers_info">Peers information not available</string>
|
<string name="no_peers_info">Peers information not available</string>
|
||||||
<string name="button_refresh">Refresh</string>
|
<string name="button_refresh">Refresh</string>
|
||||||
|
|
||||||
|
<!-- In Known Players display, a checkbox to sort players by when
|
||||||
|
their most recent game started instead of by name -->
|
||||||
<string name="sort_by_date_label">Sort by date</string>
|
<string name="sort_by_date_label">Sort by date</string>
|
||||||
|
|
||||||
|
<!-- Debug-only: menu to remove quashed marking from a game (in case
|
||||||
|
the quashing was accidental) -->
|
||||||
|
<string name="menu_unquash">Unquash</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2695,13 +2695,13 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1dropHostAddr
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL
|
JNIEXPORT jboolean JNICALL
|
||||||
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1setQuashed
|
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1setQuashed
|
||||||
( JNIEnv* env, jclass C, GamePtrType gamePtr )
|
( JNIEnv* env, jclass C, GamePtrType gamePtr, jboolean jQuashed )
|
||||||
{
|
{
|
||||||
jboolean result = false;
|
jboolean result = false;
|
||||||
XWJNI_START(gamePtr);
|
XWJNI_START(gamePtr);
|
||||||
XP_ASSERT( !!state->game.comms );
|
XP_ASSERT( !!state->game.comms );
|
||||||
if ( NULL != state->game.comms ) {
|
if ( NULL != state->game.comms ) {
|
||||||
result = comms_setQuashed( state->game.comms, env, XP_TRUE );
|
result = comms_setQuashed( state->game.comms, env, jQuashed );
|
||||||
}
|
}
|
||||||
XWJNI_END();
|
XWJNI_END();
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue