add --ask-timeout param

This commit is contained in:
Eric House 2013-12-23 07:16:02 -08:00
parent 6d84dfea7e
commit 35c12eb7bb
3 changed files with 9 additions and 1 deletions

View file

@ -1622,7 +1622,7 @@ gtkShowFinalScores( const GtkGameGlobals* globals )
text = strFromStream( stream ); text = strFromStream( stream );
stream_destroy( stream ); stream_destroy( stream );
XP_U16 timeout = cGlobals->manualFinal? 0 : 500; XP_U16 timeout = cGlobals->manualFinal? 0 : cGlobals->params->askTimeout;
(void)gtkask_timeout( globals->window, text, GTK_BUTTONS_OK, timeout ); (void)gtkask_timeout( globals->window, text, GTK_BUTTONS_OK, timeout );
free( text ); free( text );

View file

@ -669,6 +669,7 @@ typedef enum {
,CMD_ASKNEWGAME ,CMD_ASKNEWGAME
,CMD_NHIDDENROWS ,CMD_NHIDDENROWS
#endif #endif
,CMD_ASKTIME
,N_CMDS ,N_CMDS
} XwLinuxCmd; } XwLinuxCmd;
@ -780,6 +781,8 @@ static CmdInfoRec CmdInfoRecs[] = {
#if defined PLATFORM_GTK #if defined PLATFORM_GTK
,{ CMD_ASKNEWGAME, false, "ask-new", "put up ui for new game params" } ,{ CMD_ASKNEWGAME, false, "ask-new", "put up ui for new game params" }
,{ CMD_NHIDDENROWS, true, "hide-rows", "number of rows obscured by tray" } ,{ CMD_NHIDDENROWS, true, "hide-rows", "number of rows obscured by tray" }
,{ CMD_ASKTIME, true, "ask-timeout",
"Wait this many ms before cancelling dialog (default 500 ms; 0 means forever)" }
#endif #endif
}; };
@ -1974,6 +1977,7 @@ main( int argc, char** argv )
mainParams.noHeartbeat = XP_FALSE; mainParams.noHeartbeat = XP_FALSE;
mainParams.nHidden = 0; mainParams.nHidden = 0;
mainParams.needsNewGame = XP_FALSE; mainParams.needsNewGame = XP_FALSE;
mainParams.askTimeout = 500;
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
mainParams.allowHintRect = XP_FALSE; mainParams.allowHintRect = XP_FALSE;
#endif #endif
@ -2312,6 +2316,9 @@ main( int argc, char** argv )
case CMD_NHIDDENROWS: case CMD_NHIDDENROWS:
mainParams.nHidden = atoi(optarg); mainParams.nHidden = atoi(optarg);
break; break;
case CMD_ASKTIME:
mainParams.askTimeout = atoi(optarg);
break;
#endif #endif
default: default:
done = true; done = true;

View file

@ -104,6 +104,7 @@ typedef struct LaunchParams {
XP_Bool useUdp; XP_Bool useUdp;
XP_U16 splitPackets; XP_U16 splitPackets;
XP_U16 chatsInterval; /* 0 means disabled */ XP_U16 chatsInterval; /* 0 means disabled */
XP_U16 askTimeout;
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
XP_Bool allowHintRect; XP_Bool allowHintRect;
#endif #endif