mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy
Conflicts: xwords4/common/comms.c
This commit is contained in:
commit
4cd15a9c6a
6 changed files with 52 additions and 7 deletions
|
@ -1185,6 +1185,17 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1transportFailed
|
|||
XWJNI_END();
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1isConnected
|
||||
( JNIEnv* env, jclass C, jint gamePtr )
|
||||
{
|
||||
jboolean result;
|
||||
XWJNI_START();
|
||||
result = NULL != state->game.comms && comms_isConnected( state->game.comms );
|
||||
XWJNI_END();
|
||||
return result;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_eehouse_android_xw4_jni_XwJNI_server_1endGame
|
||||
( JNIEnv* env, jclass C, jint gamePtr )
|
||||
|
@ -1206,3 +1217,4 @@ Java_org_eehouse_android_xw4_jni_XwJNI_server_1sendChat
|
|||
(*env)->ReleaseStringUTFChars( env, jmsg, msg );
|
||||
XWJNI_END();
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
android:autoText="false"
|
||||
android:capitalize="none"
|
||||
android:gravity="fill_horizontal"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
/>
|
||||
|
||||
|
@ -88,6 +89,7 @@
|
|||
android:capitalize="none"
|
||||
android:gravity="fill_horizontal"
|
||||
android:password="true"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -204,6 +204,7 @@ public class XwJNI {
|
|||
public static native void comms_resendAll( int gamePtr );
|
||||
public static native void comms_transportFailed( int gamePtr );
|
||||
public static native boolean comms_canChat( int gamePtr );
|
||||
public static native boolean comms_isConnected( int gamePtr );
|
||||
|
||||
// Dicts
|
||||
public static native boolean dict_tilesAreSame( int dictPtr1, int dictPtr2 );
|
||||
|
|
|
@ -796,7 +796,6 @@ comms_getInitialAddr( CommsAddrRec* addr
|
|||
}
|
||||
addr->u.ip_relay.seeksPublicRoom = XP_FALSE;
|
||||
addr->u.ip_relay.advertiseRoom = XP_FALSE;
|
||||
|
||||
#elif defined PLATFORM_PALM
|
||||
/* default values; default is still IR where there's a choice, at least on
|
||||
Palm... */
|
||||
|
@ -1660,6 +1659,20 @@ comms_canChat( const CommsCtxt* const comms )
|
|||
return canChat;
|
||||
}
|
||||
|
||||
XP_Bool
|
||||
comms_isConnected( const CommsCtxt* const comms )
|
||||
{
|
||||
XP_Bool result = XP_FALSE;
|
||||
switch ( comms->addr.conType ) {
|
||||
case COMMS_CONN_RELAY:
|
||||
result = 0 != comms->r.connName[0];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef COMMS_HEARTBEAT
|
||||
static void
|
||||
sendEmptyMsg( CommsCtxt* comms, AddressRecord* rec )
|
||||
|
|
|
@ -186,6 +186,7 @@ XP_Bool comms_checkIncomingStream( CommsCtxt* comms, XWStreamCtxt* stream,
|
|||
XP_Bool comms_checkComplete( const CommsAddrRec* const addr );
|
||||
|
||||
XP_Bool comms_canChat( const CommsCtxt* comms );
|
||||
XP_Bool comms_isConnected( const CommsCtxt* const comms );
|
||||
|
||||
# ifdef DEBUG
|
||||
void comms_getStats( CommsCtxt* comms, XWStreamCtxt* stream );
|
||||
|
|
|
@ -24,13 +24,29 @@
|
|||
gchar*
|
||||
gtkGetChatMessage( GtkAppGlobals* XP_UNUSED(globals) )
|
||||
{
|
||||
/* GtkWidget* dlg = gtk_message_dialog_new( NULL, /\* parent *\/ */
|
||||
/* GTK_MESSAGE_QUESTION, */
|
||||
/* GTK_DIALOG_MODAL, */
|
||||
/* buttons, "%s", message ); */
|
||||
gchar* result = NULL;
|
||||
GtkWidget* dialog = gtk_dialog_new_with_buttons( "message text", NULL, //GtkWindow *parent,
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_STOCK_OK,
|
||||
GTK_RESPONSE_ACCEPT,
|
||||
NULL );
|
||||
|
||||
gchar* msg = g_strdup( "Hello world" );
|
||||
return msg;
|
||||
GtkWidget* entry = gtk_entry_new();
|
||||
|
||||
gtk_container_add( GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG (dialog))),
|
||||
entry );
|
||||
gtk_widget_show_all( dialog );
|
||||
gtk_dialog_run( GTK_DIALOG (dialog) );
|
||||
|
||||
const char* text = gtk_entry_get_text( GTK_ENTRY(entry) );
|
||||
|
||||
if ( 0 != text[0] ) {
|
||||
result = g_strdup( text );
|
||||
}
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
LOG_RETURNF( "%s", result );
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue