mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +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",
|
||||
dictName );
|
||||
buf[VSIZE(buf)-1] = '\0';
|
||||
ceMessageBoxChar( globals, NULL, buf, L"Oops!",
|
||||
MB_OK | MB_ICONHAND );
|
||||
ceOops( globals, NULL, buf );
|
||||
|
||||
}
|
||||
XP_FREE( globals->mpool, dictName );
|
||||
#endif
|
||||
|
@ -1138,8 +1138,11 @@ ceLoadSavedGame( CEAppGlobals* globals )
|
|||
CE_RESET_PROC globals );
|
||||
if ( success ) {
|
||||
ceSetTitleFromName( globals );
|
||||
} else if ( !!dict ) {
|
||||
dict_destroy( dict );
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
ceMessageBoxChar( globals, NULL, message, L"Oops!", MB_OK | MB_ICONHAND );
|
||||
ceOops( globals, NULL, message );
|
||||
} /* ce_util_userError */
|
||||
|
||||
static XP_Bool
|
||||
|
|
|
@ -872,8 +872,8 @@ ceGetPath( CEAppGlobals* globals, CePathType typ,
|
|||
} /* ceGetPath */
|
||||
|
||||
int
|
||||
ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str,
|
||||
wchar_t* title, XP_U16 buttons )
|
||||
ceMessageBoxChar( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str,
|
||||
const wchar_t* title, XP_U16 buttons )
|
||||
{
|
||||
/* 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. */
|
||||
|
@ -889,3 +889,10 @@ ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str,
|
|||
}
|
||||
return MessageBox( parent, widebuf, title, buttons );
|
||||
} /* 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 ceMoveItem( HWND hDlg, XP_U16 resID, XP_S16 byX, XP_S16 byY );
|
||||
|
||||
int ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str,
|
||||
wchar_t* title, XP_U16 buttons );
|
||||
int ceMessageBoxChar( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str,
|
||||
const wchar_t* title, XP_U16 buttons );
|
||||
int ceOops( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str );
|
||||
|
||||
typedef enum {
|
||||
PREFS_FILE_PATH_L
|
||||
|
|
Loading…
Reference in a new issue