mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
Warn when unable to open a saved game (generally when an older version
of the app tries to open game saved by newer version.)
This commit is contained in:
parent
6c9c013f1a
commit
d0222385fb
3 changed files with 20 additions and 9 deletions
|
@ -1115,8 +1115,8 @@ ceLoadSavedGame( CEAppGlobals* globals )
|
||||||
snprintf( buf, VSIZE(buf), "Unable to open dictionary: %s",
|
snprintf( buf, VSIZE(buf), "Unable to open dictionary: %s",
|
||||||
dictName );
|
dictName );
|
||||||
buf[VSIZE(buf)-1] = '\0';
|
buf[VSIZE(buf)-1] = '\0';
|
||||||
ceMessageBoxChar( globals, NULL, buf, L"Oops!",
|
ceOops( globals, NULL, buf );
|
||||||
MB_OK | MB_ICONHAND );
|
|
||||||
}
|
}
|
||||||
XP_FREE( globals->mpool, dictName );
|
XP_FREE( globals->mpool, dictName );
|
||||||
#endif
|
#endif
|
||||||
|
@ -1138,8 +1138,11 @@ ceLoadSavedGame( CEAppGlobals* globals )
|
||||||
CE_RESET_PROC globals );
|
CE_RESET_PROC globals );
|
||||||
if ( success ) {
|
if ( success ) {
|
||||||
ceSetTitleFromName( globals );
|
ceSetTitleFromName( globals );
|
||||||
} else if ( !!dict ) {
|
} else {
|
||||||
dict_destroy( dict );
|
if ( !!dict ) {
|
||||||
|
dict_destroy( dict );
|
||||||
|
}
|
||||||
|
ceOops( globals, NULL, "Saved game cannot be opened." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2970,7 +2973,7 @@ ce_util_userError( XW_UtilCtxt* uc, UtilErrID id )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ceMessageBoxChar( globals, NULL, message, L"Oops!", MB_OK | MB_ICONHAND );
|
ceOops( globals, NULL, message );
|
||||||
} /* ce_util_userError */
|
} /* ce_util_userError */
|
||||||
|
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
|
|
|
@ -872,8 +872,8 @@ ceGetPath( CEAppGlobals* globals, CePathType typ,
|
||||||
} /* ceGetPath */
|
} /* ceGetPath */
|
||||||
|
|
||||||
int
|
int
|
||||||
ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str,
|
ceMessageBoxChar( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str,
|
||||||
wchar_t* title, XP_U16 buttons )
|
const wchar_t* title, XP_U16 buttons )
|
||||||
{
|
{
|
||||||
/* Get the length required, then alloc and go. This is technically
|
/* Get the length required, then alloc and go. This is technically
|
||||||
correct, but everywhere else I assume a 2:1 ratio for wchar_t:char. */
|
correct, but everywhere else I assume a 2:1 ratio for wchar_t:char. */
|
||||||
|
@ -889,3 +889,10 @@ ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str,
|
||||||
}
|
}
|
||||||
return MessageBox( parent, widebuf, title, buttons );
|
return MessageBox( parent, widebuf, title, buttons );
|
||||||
} /* ceMessageBoxChar */
|
} /* ceMessageBoxChar */
|
||||||
|
|
||||||
|
int
|
||||||
|
ceOops( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str )
|
||||||
|
{
|
||||||
|
return ceMessageBoxChar( globals, parent, str, L"Oops!",
|
||||||
|
MB_OK | MB_ICONHAND );
|
||||||
|
}
|
||||||
|
|
|
@ -47,8 +47,9 @@ void ceCheckMenus( const CEAppGlobals* globals );
|
||||||
void ceGetItemRect( HWND hDlg, XP_U16 resID, RECT* rect );
|
void ceGetItemRect( HWND hDlg, XP_U16 resID, RECT* rect );
|
||||||
void ceMoveItem( HWND hDlg, XP_U16 resID, XP_S16 byX, XP_S16 byY );
|
void ceMoveItem( HWND hDlg, XP_U16 resID, XP_S16 byX, XP_S16 byY );
|
||||||
|
|
||||||
int ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str,
|
int ceMessageBoxChar( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str,
|
||||||
wchar_t* title, XP_U16 buttons );
|
const wchar_t* title, XP_U16 buttons );
|
||||||
|
int ceOops( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str );
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PREFS_FILE_PATH_L
|
PREFS_FILE_PATH_L
|
||||||
|
|
Loading…
Add table
Reference in a new issue