mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
Instead of warning user on failure to connect via BT, add preference
to allow user to confirm before every attempt. Users will learn to set this when T650s are in the mix. Save a new preference, and up the stream version. Up beta version. Add the preference both to the prefs dialog and to the bluetooth connection (for guest) dialog, with both impacting the same field in gamePrefs.
This commit is contained in:
parent
d482a9d57b
commit
c8bbfc5432
11 changed files with 139 additions and 75 deletions
|
@ -392,6 +392,12 @@ gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
|
|||
gi->allowHintRect = XP_FALSE;
|
||||
}
|
||||
|
||||
if ( strVersion >= STREAM_VERS_BLUETOOTH ) {
|
||||
gi->confirmBTConnect = stream_getBits( stream, 1 );
|
||||
} else {
|
||||
gi->confirmBTConnect = XP_TRUE; /* safe given all the 650s out there. */
|
||||
}
|
||||
|
||||
gi->gameID = stream_getU16( stream );
|
||||
if ( gi->timerEnabled ) {
|
||||
gi->gameSeconds = stream_getU16( stream );
|
||||
|
@ -433,6 +439,7 @@ gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi )
|
|||
stream_putBits( stream, 1, gi->timerEnabled );
|
||||
stream_putBits( stream, 1, gi->allowPickTiles );
|
||||
stream_putBits( stream, 1, gi->allowHintRect );
|
||||
stream_putBits( stream, 1, gi->confirmBTConnect );
|
||||
|
||||
stream_putU16( stream, gi->gameID );
|
||||
if ( gi->timerEnabled) {
|
||||
|
|
|
@ -30,16 +30,13 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define STREAM_VERS_BLUETOOTH 0x05
|
||||
#define STREAM_VERS_KEYNAV 0x04
|
||||
#define STREAM_VERS_RELAY 0x03
|
||||
#define STREAM_VERS_41B4 0x02
|
||||
#define STREAM_VERS_405 0x01
|
||||
|
||||
#ifdef KEYBOARD_NAV
|
||||
# define CUR_STREAM_VERS STREAM_VERS_KEYNAV
|
||||
#else
|
||||
# define CUR_STREAM_VERS STREAM_VERS_RELAY
|
||||
#endif
|
||||
# define CUR_STREAM_VERS STREAM_VERS_BLUETOOTH
|
||||
|
||||
typedef struct LocalPlayer {
|
||||
XP_UCHAR* name;
|
||||
|
@ -67,7 +64,7 @@ typedef struct CurGameInfo {
|
|||
XP_Bool allowHintRect;
|
||||
XP_U8 robotSmartness;
|
||||
XWPhoniesChoice phoniesAction;
|
||||
|
||||
XP_Bool confirmBTConnect; /* only used for BT */
|
||||
} CurGameInfo;
|
||||
|
||||
typedef struct XWGame {
|
||||
|
|
|
@ -60,8 +60,9 @@ typedef struct ConnsDlgState {
|
|||
} ConnsDlgState;
|
||||
|
||||
static void
|
||||
ctlsFromState( PalmAppGlobals* XP_UNUSED_BT(globals), ConnsDlgState* state )
|
||||
ctlsFromState( PalmAppGlobals* globals )
|
||||
{
|
||||
ConnsDlgState* state = globals->connState;
|
||||
CommsAddrRec* addr = state->addr;
|
||||
XP_Bool isNewGame = state->isNewGame;
|
||||
state->conType = addr->conType;
|
||||
|
@ -92,14 +93,20 @@ ctlsFromState( PalmAppGlobals* XP_UNUSED_BT(globals), ConnsDlgState* state )
|
|||
CtlSetLabel( ctrl, addr->u.bt.hostName );
|
||||
}
|
||||
CtlSetEnabled( ctrl, isNewGame );
|
||||
|
||||
XP_ASSERT( !!globals->prefsDlgState );
|
||||
setBooleanCtrl( XW_CONNS_BTCONFIRM_CHECKBOX_ID,
|
||||
globals->prefsDlgState->confirmBTConnect );
|
||||
#endif
|
||||
}
|
||||
} /* ctlsFromState */
|
||||
|
||||
static void
|
||||
stateFromCtls( ConnsDlgState* state )
|
||||
static XP_Bool
|
||||
stateFromCtls( PalmAppGlobals* globals )
|
||||
{
|
||||
ConnsDlgState* state = globals->connState;
|
||||
CommsAddrRec* addr = state->addr;
|
||||
XP_Bool prefsChanged = XP_FALSE;
|
||||
|
||||
addr->conType = state->conType;
|
||||
|
||||
|
@ -119,14 +126,25 @@ stateFromCtls( ConnsDlgState* state )
|
|||
#ifdef XWFEATURE_BLUETOOTH
|
||||
} else if ( addr->conType == COMMS_CONN_BT
|
||||
&& state->serverRole == SERVER_ISCLIENT ) {
|
||||
XP_Bool confirmBTConnect;
|
||||
/* Not exactly from a control... */
|
||||
/* POSE is flagging this as reading from a bad address, but it
|
||||
looks ok inside the debugger */
|
||||
XP_MEMCPY( addr->u.bt.hostName, state->btName,
|
||||
sizeof(addr->u.bt.hostName) );
|
||||
XP_MEMCPY( &addr->u.bt.btAddr, &state->btAddr,
|
||||
sizeof(addr->u.bt.btAddr) );
|
||||
LOG_HEX( &addr->u.bt.btAddr, sizeof(addr->u.bt.btAddr), __func__ );
|
||||
|
||||
confirmBTConnect = getBooleanCtrl( XW_CONNS_BTCONFIRM_CHECKBOX_ID );
|
||||
XP_ASSERT( !!globals->prefsDlgState );
|
||||
if ( confirmBTConnect != globals->prefsDlgState->confirmBTConnect ) {
|
||||
globals->prefsDlgState->confirmBTConnect = confirmBTConnect;
|
||||
prefsChanged = XP_TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return prefsChanged;
|
||||
} /* stateFromCtls */
|
||||
|
||||
static void
|
||||
|
@ -134,7 +152,7 @@ updateFormCtls( FormPtr form, ConnsDlgState* state )
|
|||
{
|
||||
const XP_U16 relayCtls[] = {
|
||||
#ifdef XWFEATURE_RELAY
|
||||
XW_CONNS_RELAY_LABEL_ID ,
|
||||
XW_CONNS_RELAY_LABEL_ID,
|
||||
XW_CONNS_RELAY_FIELD_ID,
|
||||
XW_CONNS_PORT_LABEL_ID,
|
||||
XW_CONNS_PORT_FIELD_ID,
|
||||
|
@ -147,8 +165,7 @@ updateFormCtls( FormPtr form, ConnsDlgState* state )
|
|||
#ifdef XWFEATURE_BLUETOOTH
|
||||
XW_CONNS_BT_HOSTNAME_LABEL_ID,
|
||||
XW_CONNS_BT_HOSTTRIGGER_ID,
|
||||
#else
|
||||
XW_CONNS_BT_NOTSUPPORT_LABEL_ID,
|
||||
XW_CONNS_BTCONFIRM_CHECKBOX_ID,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
@ -200,8 +217,9 @@ selToConType( const ConnsDlgState* state, XP_U16 sel )
|
|||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
static void
|
||||
browseForDeviceName( PalmAppGlobals* globals, ConnsDlgState* state )
|
||||
browseForDeviceName( PalmAppGlobals* globals )
|
||||
{
|
||||
ConnsDlgState* state = globals->connState;
|
||||
XP_BtAddr btAddr;
|
||||
if ( palm_bt_browse_device( globals, &btAddr,
|
||||
state->btName, sizeof( state->btName ) ) ) {
|
||||
|
@ -214,8 +232,9 @@ browseForDeviceName( PalmAppGlobals* globals, ConnsDlgState* state )
|
|||
#endif
|
||||
|
||||
static void
|
||||
setupXportList( PalmAppGlobals* globals, ConnsDlgState* state )
|
||||
setupXportList( PalmAppGlobals* globals )
|
||||
{
|
||||
ConnsDlgState* state = globals->connState;
|
||||
ListData* sLd = &state->sLd;
|
||||
XP_U16 i;
|
||||
XP_S16 selSel = -1;
|
||||
|
@ -296,11 +315,11 @@ ConnsFormHandleEvent( EventPtr event )
|
|||
XP_MEMCPY( &state->btAddr, &state->addr->u.bt.btAddr,
|
||||
sizeof(state->btAddr) );
|
||||
|
||||
ctlsFromState( globals, state );
|
||||
ctlsFromState( globals );
|
||||
|
||||
/* setup connection popup */
|
||||
buildXportData( state );
|
||||
setupXportList( globals, state );
|
||||
setupXportList( globals );
|
||||
|
||||
updateFormCtls( form, state );
|
||||
|
||||
|
@ -316,7 +335,7 @@ ConnsFormHandleEvent( EventPtr event )
|
|||
#ifdef XWFEATURE_BLUETOOTH
|
||||
case XW_CONNS_BT_HOSTTRIGGER_ID:
|
||||
if ( state->isNewGame ) {
|
||||
browseForDeviceName( globals, state );
|
||||
browseForDeviceName( globals );
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -337,7 +356,9 @@ ConnsFormHandleEvent( EventPtr event )
|
|||
if ( !state->isNewGame ) {
|
||||
/* do nothing; same as cancel */
|
||||
} else {
|
||||
stateFromCtls( state );
|
||||
if ( stateFromCtls( globals ) ) {
|
||||
postEmptyEvent( prefsChangedEvent );
|
||||
}
|
||||
postEmptyEvent( connsSettingChgEvent );
|
||||
}
|
||||
/* FALLTHRU */
|
||||
|
|
|
@ -141,11 +141,11 @@
|
|||
{ "STR_BT_XPORTNAME", "Bluetooth" },
|
||||
{ "STR_BT_NOINIT", "Bluetooth appears to be off. Please turn it "
|
||||
"on if you want Crosswords to use it." },
|
||||
{ "STRS_BT_NOHOST", "Bluetooth messages are not reaching Crosswords "
|
||||
"on %s. Do you want me to resend? (If you "
|
||||
"choose \"No\" I will not try again until you "
|
||||
"choose the \"Resend\" menu item.)" },
|
||||
{ "STR_BT_RESEND", "Resend" },
|
||||
{ "STRS_BT_CONFIRM", "Is Crosswords running on the host device and "
|
||||
"ready to accept a connection? (If you "
|
||||
"choose \"No\" Crosswords will not try to connect until you restart it "
|
||||
"or choose the \"Resend\" menu item.)" },
|
||||
|
||||
#endif
|
||||
|
||||
{ "STR_ABOUT_CONTENT",
|
||||
|
|
|
@ -276,6 +276,12 @@ NAVIGATIONMAP
|
|||
END /* NAVIGATION ID XW_NEWGAMES_FORM */
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
/* Let's define this in one place so it stays the same */
|
||||
# define BT_CONF_STRING "Ask before connecting Bluetooth"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH || defined XWFEATURE_IR
|
||||
#define LEFTCOL 4
|
||||
#define CONNS_FIELD_LEFT 70
|
||||
|
@ -300,6 +306,8 @@ BEGIN
|
|||
AT ( LEFTCOL LOCALIP_TOP+5 ) NONUSABLE
|
||||
SELECTORTRIGGER "Find host..." XW_CONNS_BT_HOSTTRIGGER_ID \
|
||||
AT (CONNS_FIELD_LEFT PREVTOP 70 AUTO) NONUSABLE LEFTANCHOR
|
||||
CHECKBOX BT_CONF_STRING ID XW_CONNS_BTCONFIRM_CHECKBOX_ID \
|
||||
AT ( LEFTCOL LOCALIP_TOP+21 AUTO AUTO ) NONUSABLE
|
||||
#endif
|
||||
|
||||
/* Relay... */
|
||||
|
@ -335,16 +343,22 @@ END /* XW_CONNS_FORM */
|
|||
#else
|
||||
# define SEARCHLIMIT_ADJUST 0
|
||||
#endif
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
# define BTCONF_ADJUST PREFS_SPACING
|
||||
#else
|
||||
# define BTCONF_ADJUST 0
|
||||
#endif
|
||||
|
||||
#define PREFS_MODE_TOP 15
|
||||
#define PREFS_ROW1 30
|
||||
#define PREFS_SPACING 15
|
||||
|
||||
/* #define DLG_TOP (52-TRAY_EDIT_ADJUST-SEARCHLIMIT_ADJUST) */
|
||||
#define DLG_HEIGHT (112+TRAY_EDIT_ADJUST+SEARCHLIMIT_ADJUST)
|
||||
#define DLG_HEIGHT (112+TRAY_EDIT_ADJUST+SEARCHLIMIT_ADJUST+BTCONF_ADJUST)
|
||||
#define DLG_TOP (160 - DLG_HEIGHT - 2)
|
||||
#define TIMER_TOP (74+SEARCHLIMIT_ADJUST)
|
||||
#define BUTTON_TOP (TIMER_TOP+18+TRAY_EDIT_ADJUST)
|
||||
#define BTCONF_TOP (TIMER_TOP+18+TRAY_EDIT_ADJUST)
|
||||
#define BUTTON_TOP (BTCONF_TOP + PREFS_SPACING)
|
||||
#define PREFS_LNHT 4
|
||||
|
||||
FORM ID XW_PREFS_FORM AT (2 DLG_TOP 156 DLG_HEIGHT)
|
||||
|
@ -413,6 +427,11 @@ BEGIN
|
|||
AT (LEFTCOL PREVTOP+PREFS_SPACING AUTO AUTO) NONUSABLE
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
CHECKBOX BT_CONF_STRING ID XW_PREFS_BTCONFIRM_CHECKBOX_ID \
|
||||
AT (LEFTCOL PREVTOP+PREFS_SPACING AUTO AUTO) NONUSABLE
|
||||
#endif
|
||||
|
||||
/* buttons at the bottom */
|
||||
BUTTON "Cancel" XW_PREFS_CANCEL_BUTTON_ID 42 BUTTON_TOP AUTO AUTO
|
||||
BUTTON "Ok" XW_PREFS_OK_BUTTON_ID PREVRIGHT+10 PREVTOP AUTO AUTO
|
||||
|
@ -447,6 +466,7 @@ NAVIGATIONMAP
|
|||
#ifdef FEATURE_TRAY_EDIT
|
||||
ROW XW_PREFS_PICKTILES_CHECKBOX_ID
|
||||
#endif
|
||||
ROW XW_PREFS_BTCONFIRM_CHECKBOX_ID
|
||||
|
||||
/* cmd buttons */
|
||||
ROW XW_PREFS_CANCEL_BUTTON_ID
|
||||
|
|
|
@ -54,7 +54,6 @@ typedef enum {
|
|||
, PBT_ACT_GETSDP /* slave only */
|
||||
, PBT_ACT_CONNECT_DATA /* l2cap or rfcomm */
|
||||
, PBT_ACT_TELLCONN
|
||||
, PBT_ACT_TELLNOHOST
|
||||
, PBT_ACT_GOTDATA /* can be duplicated */
|
||||
, PBT_ACT_TRYSEND
|
||||
} PBT_ACTION;
|
||||
|
@ -467,6 +466,7 @@ palm_bt_send( const XP_U8* buf, XP_U16 len, const CommsAddrRec* addr,
|
|||
|
||||
btStuff = pbt_checkInit( globals, userCancelled );
|
||||
if ( !!btStuff ) {
|
||||
/* addr is NULL when client has not established connection to host */
|
||||
if ( !addr ) {
|
||||
comms_getAddr( globals->game.comms, &remoteAddr );
|
||||
addr = &remoteAddr;
|
||||
|
@ -661,6 +661,7 @@ pbt_do_work( PalmBTStuff* btStuff, BtCbEvtProc proc )
|
|||
PBT_ACTION act;
|
||||
Err err;
|
||||
XP_U16 btLibRefNum = btStuff->btLibRefNum;
|
||||
BtCbEvtInfo info;
|
||||
|
||||
debug_logQueue( btStuff );
|
||||
|
||||
|
@ -685,6 +686,13 @@ pbt_do_work( PalmBTStuff* btStuff, BtCbEvtProc proc )
|
|||
|
||||
case PBT_ACT_CONNECT_ACL:
|
||||
if ( GET_STATE(btStuff) == PBTST_NONE ) {
|
||||
info.evt = BTCBEVT_CONFIRM;
|
||||
info.u.confirm.confirmed = XP_TRUE;
|
||||
(*proc)( btStuff->globals, &info );
|
||||
if ( !info.u.confirm.confirmed ) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* sends btLibManagementEventACLConnectOutbound */
|
||||
CALL_ERR( err, BtLibLinkConnect, btLibRefNum,
|
||||
&btStuff->otherAddr );
|
||||
|
@ -790,12 +798,9 @@ pbt_do_work( PalmBTStuff* btStuff, BtCbEvtProc proc )
|
|||
break;
|
||||
|
||||
case PBT_ACT_TELLCONN:
|
||||
case PBT_ACT_TELLNOHOST: {
|
||||
BtCbEvtInfo info;
|
||||
XP_ASSERT( !!proc );
|
||||
info.evt = act == PBT_ACT_TELLCONN? BTCBEVT_CONN: BTCBEVT_HOSTFAIL;
|
||||
info.evt = BTCBEVT_CONN;
|
||||
(*proc)( btStuff->globals, &info );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1231,17 +1236,6 @@ socketCallback( BtLibSocketEventType* sEvent, UInt32 refCon )
|
|||
break;
|
||||
|
||||
case btLibSocketEventDisconnected:
|
||||
/* We'll see this as client if the host quits. What to do? I think
|
||||
* we need to start trying to reconnect hoping the host got
|
||||
* restarted. Presumably users will not sit there forever running
|
||||
* the app once one of the players has taken his device and gone
|
||||
* home. But there should probably be UI warning users that it's
|
||||
* trying to connect....
|
||||
*/
|
||||
if ( sEvent->status == btLibL2DiscConnPsmUnsupported ) {
|
||||
pbt_postpone( btStuff, PBT_ACT_TELLNOHOST );
|
||||
}
|
||||
|
||||
if ( PBT_SLAVE == btStuff->picoRole ) {
|
||||
pbt_killLinks( btStuff );
|
||||
waitACL( btStuff );
|
||||
|
@ -1273,7 +1267,6 @@ socketCallback( BtLibSocketEventType* sEvent, UInt32 refCon )
|
|||
waitACL( btStuff );
|
||||
} else {
|
||||
if ( sEvent->status == btLibErrSdpAttributeNotSet ) {
|
||||
pbt_postpone( btStuff, PBT_ACT_TELLNOHOST );
|
||||
XP_LOGF( "**** Host not running!!! ****" );
|
||||
}
|
||||
/* try again???? */
|
||||
|
@ -1292,7 +1285,6 @@ socketCallback( BtLibSocketEventType* sEvent, UInt32 refCon )
|
|||
For alpha just do the error message. :-) Also, no point in
|
||||
continuing to try to connect. User will have to quit in order to
|
||||
establish trust. So warn once per inited session. */
|
||||
pbt_postpone( btStuff, PBT_ACT_TELLNOHOST );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1400,7 +1392,6 @@ actToStr(PBT_ACTION act)
|
|||
CASESTR(PBT_ACT_GOTDATA);
|
||||
CASESTR(PBT_ACT_TRYSEND);
|
||||
CASESTR(PBT_ACT_TELLCONN);
|
||||
CASESTR(PBT_ACT_TELLNOHOST);
|
||||
default:
|
||||
XP_ASSERT(0);
|
||||
return "";
|
||||
|
|
|
@ -51,10 +51,15 @@ XP_Bool palm_bt_init( PalmAppGlobals* globals, XP_Bool* userCancelled );
|
|||
void palm_bt_reset( PalmAppGlobals* globals );
|
||||
void palm_bt_close( PalmAppGlobals* globals );
|
||||
|
||||
typedef enum { BTCBEVT_CONN, BTCBEVT_DATA, BTCBEVT_HOSTFAIL } BtCbEvt;
|
||||
typedef enum {
|
||||
BTCBEVT_CONFIRM, BTCBEVT_CONN, BTCBEVT_DATA
|
||||
} BtCbEvt;
|
||||
typedef struct BtCbEvtInfo {
|
||||
BtCbEvt evt;
|
||||
union {
|
||||
struct {
|
||||
XP_Bool confirmed;
|
||||
} confirm;
|
||||
struct {
|
||||
const void* data;
|
||||
const CommsAddrRec* fromAddr;
|
||||
|
@ -63,7 +68,7 @@ typedef struct BtCbEvtInfo {
|
|||
} u;
|
||||
} BtCbEvtInfo;
|
||||
|
||||
typedef void (*BtCbEvtProc)( PalmAppGlobals* globals, const BtCbEvtInfo* evt );
|
||||
typedef void (*BtCbEvtProc)( PalmAppGlobals* globals, BtCbEvtInfo* evt );
|
||||
XP_Bool palm_bt_doWork( PalmAppGlobals* globals, BtCbEvtProc proc, BtUIState* btState );
|
||||
|
||||
void palm_bt_addrString( PalmAppGlobals* globals, const XP_BtAddr* btAddr,
|
||||
|
|
|
@ -139,7 +139,7 @@ static void palm_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
|
|||
const CommsAddrRec* newAddr );
|
||||
#endif
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
static void btEvtHandler( PalmAppGlobals* globals, const BtCbEvtInfo* evt );
|
||||
static void btEvtHandler( PalmAppGlobals* globals, BtCbEvtInfo* evt );
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
|
@ -1611,9 +1611,23 @@ showConnState( PalmAppGlobals* globals )
|
|||
} /* showConnState */
|
||||
|
||||
static void
|
||||
btEvtHandler( PalmAppGlobals* globals, const BtCbEvtInfo* evt )
|
||||
btEvtHandler( PalmAppGlobals* globals, BtCbEvtInfo* evt )
|
||||
{
|
||||
switch ( evt->evt ) {
|
||||
case BTCBEVT_CONFIRM:
|
||||
if ( globals->suspendBT ) {
|
||||
evt->u.confirm.confirmed = XP_FALSE;
|
||||
} else if ( globals->gameInfo.confirmBTConnect ) {
|
||||
const XP_UCHAR* str;
|
||||
XP_ASSERT( !!globals->game.comms &&
|
||||
!comms_getIsServer(globals->game.comms) );
|
||||
str = getResString( globals, STRS_BT_CONFIRM );
|
||||
evt->u.confirm.confirmed = palmask( globals, str, NULL, -1 );
|
||||
globals->suspendBT = !evt->u.confirm.confirmed;
|
||||
} else {
|
||||
evt->u.confirm.confirmed = XP_TRUE;
|
||||
}
|
||||
break;
|
||||
case BTCBEVT_CONN:
|
||||
if ( !!globals->game.comms ) {
|
||||
comms_resendAll( globals->game.comms );
|
||||
|
@ -1636,21 +1650,6 @@ btEvtHandler( PalmAppGlobals* globals, const BtCbEvtInfo* evt )
|
|||
postEmptyEvent( closeBtLibEvent );
|
||||
}
|
||||
break;
|
||||
case BTCBEVT_HOSTFAIL: {
|
||||
const XP_UCHAR* str = getResString( globals, STRS_BT_NOHOST );
|
||||
const XP_UCHAR* resend = getResString( globals, STR_BT_RESEND );
|
||||
XP_UCHAR buf[256];
|
||||
|
||||
CommsAddrRec addr;
|
||||
comms_getAddr( globals->game.comms, &addr );
|
||||
XP_ASSERT( addr.conType == COMMS_CONN_BT );
|
||||
|
||||
XP_SNPRINTF( buf, sizeof(buf), str, addr.u.bt.hostName );
|
||||
if ( !palmask( globals, buf, resend, -1 ) ) {
|
||||
globals->suspendBT = XP_TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
XP_ASSERT(0);
|
||||
}
|
||||
|
|
|
@ -181,6 +181,9 @@ typedef struct PrefsDlgState {
|
|||
XP_Bool timerEnabled;
|
||||
XP_Bool allowPickTiles;
|
||||
XP_Bool allowHintRect;
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
XP_Bool confirmBTConnect;
|
||||
#endif
|
||||
} PrefsDlgState;
|
||||
|
||||
typedef struct DictState {
|
||||
|
@ -189,8 +192,6 @@ typedef struct DictState {
|
|||
XP_U16 nDicts;
|
||||
} DictState;
|
||||
|
||||
#define MAX_DISABLED 24 /* I've seen 19.... */
|
||||
|
||||
typedef struct PalmNewGameState {
|
||||
FormPtr form;
|
||||
ListPtr playerNumList;
|
||||
|
|
|
@ -210,6 +210,10 @@ GlobalPrefsToLocal( PalmAppGlobals* globals )
|
|||
state->allowPickTiles = globals->util.gameInfo->allowPickTiles;
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
state->confirmBTConnect = globals->util.gameInfo->confirmBTConnect;
|
||||
#endif
|
||||
|
||||
state->stateTypeIsGlobal = globals->stateTypeIsGlobal;
|
||||
} /* GlobalPrefsToLocal */
|
||||
|
||||
|
@ -246,6 +250,10 @@ LocalPrefsToGlobal( PalmAppGlobals* globals )
|
|||
globals->util.gameInfo->allowPickTiles = state->allowPickTiles;
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
globals->util.gameInfo->confirmBTConnect = state->confirmBTConnect;
|
||||
#endif
|
||||
|
||||
return erase;
|
||||
} /* LocalPrefsToGlobal */
|
||||
|
||||
|
@ -290,6 +298,10 @@ localPrefsToControls( PrefsDlgState* state )
|
|||
setBooleanCtrl( XW_PREFS_PICKTILES_CHECKBOX_ID, state->allowPickTiles );
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
setBooleanCtrl( XW_PREFS_BTCONFIRM_CHECKBOX_ID, state->confirmBTConnect );
|
||||
#endif
|
||||
|
||||
numToField( XW_PREFS_TIMER_FIELD_ID, state->gameSeconds/60 );
|
||||
} /* localPrefsToControls */
|
||||
|
||||
|
@ -333,6 +345,11 @@ controlsToLocalPrefs( PrefsDlgState* state )
|
|||
state->allowPickTiles =
|
||||
getBooleanCtrl( XW_PREFS_PICKTILES_CHECKBOX_ID );
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
state->confirmBTConnect = getBooleanCtrl( XW_PREFS_BTCONFIRM_CHECKBOX_ID );
|
||||
#endif
|
||||
|
||||
} /* controlsToLocalPrefs */
|
||||
|
||||
static void
|
||||
|
|
|
@ -293,6 +293,9 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
# define XW_PREFS_BTCONFIRM_CHECKBOX_ID 2725
|
||||
#endif
|
||||
|
||||
#ifdef XWFEATURE_FIVEWAY
|
||||
/* These should be in same order as BoardObjectType */
|
||||
|
@ -312,16 +315,18 @@
|
|||
#define XW_PREFS_LAST_GLOBAL_ID XW_PREFS_HIDETRAYVAL_CHECKBOX_ID
|
||||
#define XW_PREFS_FIRST_PERGAME_ID XW_PREFS_ROBOTSMART_CHECKBOX_ID
|
||||
|
||||
#if defined XWFEATURE_SEARCHLIMIT
|
||||
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_HINTRECT_CHECKBOX_ID
|
||||
#elif defined FEATURE_TRAY_EDIT
|
||||
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_PICKTILES_CHECKBOX_ID
|
||||
#else
|
||||
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_TIMER_FIELD_ID
|
||||
#endif
|
||||
/* #if defined XWFEATURE_SEARCHLIMIT */
|
||||
/* # define XW_PREFS_LAST_PERGAME_ID XW_PREFS_HINTRECT_CHECKBOX_ID */
|
||||
/* #elif defined FEATURE_TRAY_EDIT */
|
||||
/* # define XW_PREFS_LAST_PERGAME_ID XW_PREFS_PICKTILES_CHECKBOX_ID */
|
||||
/* #else */
|
||||
/* # define XW_PREFS_LAST_PERGAME_ID XW_PREFS_TIMER_FIELD_ID */
|
||||
/* #endif */
|
||||
|
||||
#define XW_PREFS_CANCEL_BUTTON_ID 2725
|
||||
#define XW_PREFS_OK_BUTTON_ID 2726
|
||||
#define XW_PREFS_LAST_PERGAME_ID XW_PREFS_BTCONFIRM_CHECKBOX_ID
|
||||
|
||||
#define XW_PREFS_CANCEL_BUTTON_ID 2726
|
||||
#define XW_PREFS_OK_BUTTON_ID 2727
|
||||
|
||||
/*
|
||||
* saved games dialog
|
||||
|
@ -354,6 +359,7 @@
|
|||
#ifdef XWFEATURE_BLUETOOTH
|
||||
# define XW_CONNS_BT_HOSTNAME_LABEL_ID 2911
|
||||
# define XW_CONNS_BT_HOSTTRIGGER_ID 2912
|
||||
# define XW_CONNS_BTCONFIRM_CHECKBOX_ID 2913
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -433,7 +439,7 @@
|
|||
|
||||
/* versioning stuff */
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
# define XW_PALM_VERSION_STRING "4.3b3"
|
||||
# define XW_PALM_VERSION_STRING "4.3b4"
|
||||
#else
|
||||
/* There's a separate branch for 2.4 releases now. */
|
||||
# define XW_PALM_VERSION_STRING "4.2.1"
|
||||
|
|
Loading…
Reference in a new issue