Tweaks toward a dual ARM/68K binary where only 68K supports bluetooth.

Don't try to not show the BT option for connecting, but in the case
where it's not actually supported say so in the dialog.
This commit is contained in:
ehouse 2006-09-18 04:40:27 +00:00
parent 488a2b1bac
commit c20232085a
4 changed files with 33 additions and 39 deletions

View file

@ -59,7 +59,7 @@ strFromField( XP_U16 id, XP_UCHAR* buf, XP_U16 max )
} /* strFromField */
static void
ctlsFromState( PalmAppGlobals* globals, ConnsDlgState* state )
ctlsFromState( PalmAppGlobals* XP_UNUSED_BT(globals), ConnsDlgState* state )
{
XP_Bool isNewGame = state->isNewGame;
XP_UCHAR buf[16];
@ -137,6 +137,8 @@ updateFormCtls( FormPtr form, ConnsDlgState* state )
XW_CONNS_BT_HOSTNAME_LABEL_ID,
XW_CONNS_BT_HOSTFIELD_ID,
XW_CONNS_BT_BROWSEBUTTON_ID,
#else
XW_CONNS_BT_NOTSUPPORT_LABEL_ID,
#endif
0
};
@ -148,11 +150,12 @@ updateFormCtls( FormPtr form, ConnsDlgState* state )
if ( state->addr->conType == COMMS_CONN_RELAY ) {
on = relayCtls;
#ifdef XWFEATURE_BLUETOOTH
} else if ( state->addr->conType == COMMS_CONN_BT
&& state->serverRole == SERVER_ISCLIENT ) {
on = btGuestCtls;
#ifdef XWFEATURE_BLUETOOTH
&& state->serverRole == SERVER_ISCLIENT
#endif
) {
on = btGuestCtls;
} else {
on = NULL;
}
@ -182,14 +185,9 @@ conTypeToSel( CommsConnType conType )
{
XP_U16 result = 0;
switch ( conType ) {
#ifdef XWFEATURE_BLUETOOTH
case COMMS_CONN_BT: /* result = 0; */break;
case COMMS_CONN_IR: result = 1; break;
case COMMS_CONN_RELAY: result = 2; break;
#else
case COMMS_CONN_IR: /* result = 0; */break;
case COMMS_CONN_RELAY: result = 1; break;
#endif
default:
XP_ASSERT(0);
}
@ -199,20 +197,15 @@ conTypeToSel( CommsConnType conType )
static CommsConnType
selToConType( XP_U16 sel )
{
CommsConnType conType;
CommsConnType conType = COMMS_CONN_BT;
switch( sel ) {
#ifdef XWFEATURE_BLUETOOTH
case 0: conType = COMMS_CONN_BT; break;
case 0: /* conType = COMMS_CONN_BT; */break;
case 1: conType = COMMS_CONN_IR; break;
case 2: conType = COMMS_CONN_RELAY; break;
#else
case 0: conType = COMMS_CONN_IR; break;
case 1: conType = COMMS_CONN_RELAY; break;
#endif
default: XP_ASSERT(0);
}
return conType;
}
} /* selToConType */
#ifdef XWFEATURE_BLUETOOTH
static void

View file

@ -229,7 +229,7 @@ END /* FORM XW_PLAYERINFO_FORM */
#define CONNS_FIELD_LEFT 70
#define LOCALIP_TOP 30
FORM ID XW_CONNS_FORM AT (2 54 156 105)
FORM ID XW_CONNS_FORM AT (2 66 156 93)
USABLE MODAL SAVEBEHIND DEFAULTBTNID XW_CONNS_CANCEL_BUTTON_ID
BEGIN
TITLE "Connections"
@ -239,27 +239,23 @@ BEGIN
POPUPTRIGGER "" ID XW_CONNS_TYPE_TRIGGER_ID
AT (PREVRIGHT+5 PREVTOP 72 12) LEFTANCHOR
LIST
#ifdef XWFEATURE_BLUETOOTH
"Bluetooth"
#endif
"IR" "Internet/IP" ID XW_CONNS_TYPE_LIST_ID
PREVLEFT PREVTOP 72 12 VISIBLEITEMS
#ifdef XWFEATURE_BLUETOOTH
3
#else
2
#endif
"Bluetooth" "IR" "Internet/IP" ID XW_CONNS_TYPE_LIST_ID
PREVLEFT PREVTOP 72 12 VISIBLEITEMS 3
NONUSABLE POPUPLIST XW_CONNS_TYPE_TRIGGER_ID XW_CONNS_TYPE_LIST_ID
#ifdef XWFEATURE_BLUETOOTH
/* Bluetooth stuff must be here even if XWFEATURE_BLUETOOTH is not defined
since, e.g. ARM and 68K share these resources yet may not both support
BT */
LABEL "Bluetooth not supported" XW_CONNS_BT_NOTSUPPORT_LABEL_ID
AT ( LEFTCOL+10 LOCALIP_TOP ) NONUSABLE
LABEL "host name:" XW_CONNS_BT_HOSTNAME_LABEL_ID
AT ( LEFTCOL+10 LOCALIP_TOP )
AT ( PREVLEFT PREVTOP ) NONUSABLE
FIELD XW_CONNS_BT_HOSTFIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32 NONUSABLE
BUTTON "Browse" XW_CONNS_BT_BROWSEBUTTON_ID LEFTCOL+10 PREVBOTTOM+5
AUTO AUTO
#endif
AUTO AUTO NONUSABLE
/* Relay... */
LABEL "Relay name:" XW_CONNS_RELAY_LABEL_ID
AT ( LEFTCOL+10 LOCALIP_TOP )
FIELD XW_CONNS_RELAY_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
@ -275,7 +271,7 @@ BEGIN
FIELD XW_CONNS_COOKIE_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32
BUTTON "Cancel" XW_CONNS_CANCEL_BUTTON_ID 42 PREVBOTTOM+5 AUTO AUTO
BUTTON "Cancel" XW_CONNS_CANCEL_BUTTON_ID 42 PREVBOTTOM+6 AUTO AUTO
BUTTON "Ok" XW_CONNS_OK_BUTTON_ID PREVRIGHT+10 PREVTOP AUTO AUTO
END /* XW_CONNS_FORM */
#endif

View file

@ -135,5 +135,11 @@ XP_U8* palm_realloc(XP_U8* in, XP_U16 size);
# define XP_UNUSED_IR(x) XP_UNUSED(x)
#endif
#ifdef XWFEATURE_BLUETOOTH
# define XP_UNUSED_BT(x) x
#else
# define XP_UNUSED_BT(x) XP_UNUSED(x)
#endif
#endif

View file

@ -333,11 +333,10 @@
#define XW_CONNS_PORT_FIELD_ID 2907
#define XW_CONNS_RELAY_LABEL_ID 2908
#define XW_CONNS_RELAY_FIELD_ID 2909
#ifdef XWFEATURE_BLUETOOTH
# define XW_CONNS_BT_HOSTNAME_LABEL_ID 2910
# define XW_CONNS_BT_HOSTFIELD_ID 2911
# define XW_CONNS_BT_BROWSEBUTTON_ID 2912
#endif
#define XW_CONNS_BT_NOTSUPPORT_LABEL_ID 2910
#define XW_CONNS_BT_HOSTNAME_LABEL_ID 2911
#define XW_CONNS_BT_HOSTFIELD_ID 2912
#define XW_CONNS_BT_BROWSEBUTTON_ID 2913
/*
* selector for number of tiles during hint