From: Toni Wilen Date: Sat, 10 Mar 2018 10:43:25 +0000 (+0200) Subject: Show loaded config file name in window title screen when config was loaded via comman... X-Git-Tag: 4000~150 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=021fa791960176c781c10b4c55a48de060ba46b1;p=francis%2Fwinuae.git Show loaded config file name in window title screen when config was loaded via command line. Strip .uae from name. --- diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 5adf2b8d..9d0a5c0b 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -2134,9 +2134,10 @@ int target_cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int type, i int v, i, type2; int ct, ct2, size; TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH]; - TCHAR fname[MAX_DPATH]; + TCHAR fname[MAX_DPATH], cname[MAX_DPATH]; _tcscpy (fname, filename); + cname[0] = 0; if (!zfile_exists (fname)) { fetch_configurationpath (fname, sizeof (fname) / sizeof (TCHAR)); if (_tcsncmp (fname, filename, _tcslen (fname))) @@ -2150,6 +2151,13 @@ int target_cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int type, i if (type < 0) { type = 0; cfgfile_get_description(NULL, fname, NULL, NULL, NULL, &type); + if (!isdefault) { + const TCHAR *p = _tcsrchr(fname, '\\'); + if (!p) + p = _tcsrchr(fname, '/'); + if (p) + _tcscpy(cname, p + 1); + } } if (type == 0 || type == 1) { discard_prefs (p, 0); @@ -2173,6 +2181,8 @@ int target_cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int type, i return v; if (type > 0) return v; + if (cname[0]) + _tcscpy(config_filename, cname); box_art_check(p); for (i = 1; i <= 2; i++) { if (type != i) { @@ -3298,6 +3308,8 @@ static void setguititle (HWND phwnd) if (name && _tcslen (name) > 0) { _tcscat (title2, _T("[")); _tcscat (title2, name); + if (_tcslen(title2) > 4 && !_tcsicmp(title2 + _tcslen(title2) - 4, _T(".uae"))) + title2[_tcslen(title2) - 4] = 0; _tcscat (title2, _T("] - ")); } }