mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
change env variable name; provided inital board size and dict choices
This commit is contained in:
parent
b768d8fccc
commit
f06d129c24
2 changed files with 13 additions and 11 deletions
|
@ -357,18 +357,16 @@ makeNewGameDialog( GtkNewGameState* state )
|
|||
for ( iter = dicts, ii = 0; !!iter; iter = iter->next, ++ii ) {
|
||||
const gchar* name = iter->data;
|
||||
gtk_combo_box_append_text( GTK_COMBO_BOX(dictCombo), name );
|
||||
if ( !!gi->dictName && !strcmp( name, gi->dictName ) ) {
|
||||
if ( !!gi->dictName ) {
|
||||
if ( !strcmp( name, gi->dictName ) ) {
|
||||
gtk_combo_box_set_active( GTK_COMBO_BOX(dictCombo), ii );
|
||||
}
|
||||
} else if ( 0 == ii ) {
|
||||
gtk_combo_box_set_active( GTK_COMBO_BOX(dictCombo), ii );
|
||||
}
|
||||
}
|
||||
g_slist_free( dicts );
|
||||
|
||||
/* if ( !!gi->dictName ) { */
|
||||
/* gtk_box_pack_start( GTK_BOX(hbox), */
|
||||
/* gtk_label_new(gi->dictName), */
|
||||
/* FALSE, TRUE, 0 ); */
|
||||
/* } */
|
||||
|
||||
gtk_widget_show( hbox );
|
||||
|
||||
gtk_box_pack_start( GTK_BOX(vbox), hbox, FALSE, TRUE, 0 );
|
||||
|
@ -571,6 +569,9 @@ newGameDialog( GtkGameGlobals* globals, CurGameInfo* gi, CommsAddrRec* addr,
|
|||
state.revert = FALSE;
|
||||
state.loaded = XP_FALSE;
|
||||
state.nCols = gi->boardSize;
|
||||
if ( 0 == state.nCols ) {
|
||||
state.nCols = globals->cGlobals.params->pgi.boardSize;
|
||||
}
|
||||
state.role = gi->serverRole;
|
||||
|
||||
XP_MEMCPY( &state.addr, addr, sizeof(state.addr) );
|
||||
|
|
|
@ -1512,10 +1512,10 @@ getDictPath( const LaunchParams *params, const char* name,
|
|||
char* result, int resultLen )
|
||||
{
|
||||
XP_Bool success = XP_FALSE;
|
||||
GSList* dictDirs;
|
||||
GSList* iter;
|
||||
result[0] = '\0';
|
||||
for ( dictDirs = params->dictDirs; !!dictDirs; dictDirs = dictDirs->next ) {
|
||||
const char* path = dictDirs->data;
|
||||
for ( iter = params->dictDirs; !!iter; iter = iter->next ) {
|
||||
const char* path = iter->data;
|
||||
char buf[256];
|
||||
int len = snprintf( buf, VSIZE(buf), "%s/%s.xwd", path, name );
|
||||
if ( len < VSIZE(buf) && file_exists( buf ) ) {
|
||||
|
@ -1734,7 +1734,8 @@ main( int argc, char** argv )
|
|||
mainParams.showRobotScores = XP_FALSE;
|
||||
mainParams.useMmap = XP_TRUE;
|
||||
|
||||
char* envDictPath = getenv( "XW_DICTSPATH" );
|
||||
char* envDictPath = getenv( "XW_DICTDIR" );
|
||||
XP_LOGF( "%s: envDictPath=%s", __func__, envDictPath );
|
||||
if ( !!envDictPath ) {
|
||||
char *saveptr;
|
||||
for ( ; ; ) {
|
||||
|
|
Loading…
Reference in a new issue