mirror of https://github.com/stella-emu/stella.git
Added some message boxes wrt the loading of the ROM cache file.
Various code cleanups. I REALLY HATE Hungarian notation. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@317 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
20408dcae0
commit
17e7653f34
|
@ -14,7 +14,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: MainDlg.cxx,v 1.5 2004-07-11 22:04:22 stephena Exp $
|
// $Id: MainDlg.cxx,v 1.6 2004-07-15 00:11:06 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "pch.hxx"
|
#include "pch.hxx"
|
||||||
|
@ -103,7 +103,7 @@ MainDlg::DialogFunc( UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
return OnInitDialog( );
|
return OnInitDialog();
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
return OnNotify( (int)wParam, (LPNMHDR)lParam );
|
return OnNotify( (int)wParam, (LPNMHDR)lParam );
|
||||||
|
@ -118,7 +118,7 @@ MainDlg::DialogFunc( UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||||
|
|
||||||
// Cool caption handlers
|
// Cool caption handlers
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
OnDestroy( );
|
OnDestroy();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DRAWITEM:
|
case WM_DRAWITEM:
|
||||||
|
@ -179,7 +179,7 @@ BOOL MainDlg::OnInitDialog( void )
|
||||||
::SendMessage( hwndCtrl, WM_SETFONT, (WPARAM)m_hfontRomNote, 0 );
|
::SendMessage( hwndCtrl, WM_SETFONT, (WPARAM)m_hfontRomNote, 0 );
|
||||||
|
|
||||||
// Do subclassing
|
// Do subclassing
|
||||||
m_CoolCaption.OnInitDialog( hwnd );
|
myCoolCaption.OnInitDialog( hwnd );
|
||||||
myHeader.SubclassDlgItem( hwnd, IDC_ROMLIST );
|
myHeader.SubclassDlgItem( hwnd, IDC_ROMLIST );
|
||||||
myAppTitle.SubclassDlgItem( hwnd, IDC_TITLE );
|
myAppTitle.SubclassDlgItem( hwnd, IDC_TITLE );
|
||||||
myPlayButton.SubclassDlgItem( hwnd, IDC_PLAY );
|
myPlayButton.SubclassDlgItem( hwnd, IDC_PLAY );
|
||||||
|
@ -487,8 +487,7 @@ void MainDlg::UpdateRomList( void )
|
||||||
HWND hwndText;
|
HWND hwndText;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
|
||||||
if ( !PopulateRomList() )
|
PopulateRomList();
|
||||||
MessageBoxFromWinError( 0, _T("PopulateRomList") );
|
|
||||||
|
|
||||||
// if items added, select first item and enable play button
|
// if items added, select first item and enable play button
|
||||||
int nCount = ListView_GetItemCount( myHwndList );
|
int nCount = ListView_GetItemCount( myHwndList );
|
||||||
|
@ -521,12 +520,26 @@ bool MainDlg::PopulateRomList( void )
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
bool cacheFileExists = myGlobalData.settings().fileExists("stellax.cache");
|
bool cacheFileExists = myGlobalData.settings().fileExists("stellax.cache");
|
||||||
bool cacheIsStale = false; // FIXME
|
bool cacheIsStale = false; // FIXME - add romdir status checking
|
||||||
|
|
||||||
if(cacheFileExists && !cacheIsStale)
|
if (cacheFileExists && !cacheIsStale)
|
||||||
|
{
|
||||||
result = LoadRomListFromCache();
|
result = LoadRomListFromCache();
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
MessageBox( myHInstance, myHwnd, IDS_CORRUPT_CACHE_FILE );
|
||||||
|
result = LoadRomListFromDisk();
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (!cacheFileExists)
|
||||||
|
MessageBox( myHInstance, myHwnd, IDS_NO_CACHE_FILE );
|
||||||
|
else if (cacheIsStale)
|
||||||
|
MessageBox( myHInstance, myHwnd, IDS_ROMDIR_CHANGED );
|
||||||
|
|
||||||
result = LoadRomListFromDisk();
|
result = LoadRomListFromDisk();
|
||||||
|
}
|
||||||
|
|
||||||
ListView_SortByColumn( myHwndList, myGlobalData.settings().getInt("sortcol") );
|
ListView_SortByColumn( myHwndList, myGlobalData.settings().getInt("sortcol") );
|
||||||
return result;
|
return result;
|
||||||
|
@ -718,42 +731,33 @@ bool MainDlg::LoadRomListFromCache()
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
// Cool caption message handlers
|
// Cool caption message handlers
|
||||||
void MainDlg::OnDestroy(
|
void MainDlg::OnDestroy( void )
|
||||||
void
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_CoolCaption.OnDestroy();
|
myCoolCaption.OnDestroy();
|
||||||
|
|
||||||
if ( m_hfontRomNote )
|
if ( m_hfontRomNote )
|
||||||
{
|
{
|
||||||
::DeleteObject( m_hfontRomNote );
|
DeleteObject( m_hfontRomNote );
|
||||||
m_hfontRomNote = NULL;
|
m_hfontRomNote = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void MainDlg::OnNcPaint(
|
void MainDlg::OnNcPaint( HRGN hrgn )
|
||||||
HRGN hrgn
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_CoolCaption.OnNcPaint( hrgn );
|
myCoolCaption.OnNcPaint( hrgn );
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void MainDlg::OnNcActivate(
|
void MainDlg::OnNcActivate( BOOL fActive )
|
||||||
BOOL fActive
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_CoolCaption.OnNcActivate( fActive );
|
myCoolCaption.OnNcActivate( fActive );
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
BOOL MainDlg::OnNcLButtonDown(
|
BOOL MainDlg::OnNcLButtonDown( INT nHitTest, POINTS pts )
|
||||||
INT nHitTest,
|
|
||||||
POINTS pts
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return m_CoolCaption.OnNCLButtonDown( nHitTest, pts );
|
return myCoolCaption.OnNCLButtonDown( nHitTest, pts );
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: MainDlg.hxx,v 1.4 2004-07-11 22:04:22 stephena Exp $
|
// $Id: MainDlg.hxx,v 1.5 2004-07-15 00:11:07 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef __MAINDLG_H_
|
#ifndef __MAINDLG_H_
|
||||||
|
@ -46,7 +46,7 @@ class MainDlg
|
||||||
private:
|
private:
|
||||||
HWND myHwnd;
|
HWND myHwnd;
|
||||||
|
|
||||||
CCoolCaption m_CoolCaption;
|
CCoolCaption myCoolCaption;
|
||||||
CTextButton3d myAppTitle;
|
CTextButton3d myAppTitle;
|
||||||
CHeaderCtrl myHeader;
|
CHeaderCtrl myHeader;
|
||||||
CRoundButton myPlayButton;
|
CRoundButton myPlayButton;
|
||||||
|
|
Binary file not shown.
|
@ -259,6 +259,9 @@ STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_STATUSTEXT "%d files found"
|
IDS_STATUSTEXT "%d files found"
|
||||||
IDS_STELLA "StellaX"
|
IDS_STELLA "StellaX"
|
||||||
|
IDS_NO_CACHE_FILE "No ROM cache file was found. Regenerating the cache will take some time."
|
||||||
|
IDS_CORRUPT_CACHE_FILE "The ROM cache file was corrupt. Regenerating the cache will take some time."
|
||||||
|
IDS_ROMDIR_CHANGED "The ROM directory has changed. The ROM cache will be regenerated."
|
||||||
END
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
|
|
|
@ -20,7 +20,10 @@
|
||||||
#define IDS_STATUSTEXT 289
|
#define IDS_STATUSTEXT 289
|
||||||
#define IDS_STELLA 290
|
#define IDS_STELLA 290
|
||||||
#define IDS_UNKNOWNERROR 291
|
#define IDS_UNKNOWNERROR 291
|
||||||
|
#define IDS_NO_CACHE_FILE 291
|
||||||
#define IDS_DEBUGBUILD 292
|
#define IDS_DEBUGBUILD 292
|
||||||
|
#define IDS_CORRUPT_CACHE_FILE 292
|
||||||
|
#define IDS_ROMDIR_CHANGED 293
|
||||||
#define IDS_COINIT_FAILED 296
|
#define IDS_COINIT_FAILED 296
|
||||||
#define IDS_ASS_FAILED 297
|
#define IDS_ASS_FAILED 297
|
||||||
#define IDS_PAS_FAILED 298
|
#define IDS_PAS_FAILED 298
|
||||||
|
|
Loading…
Reference in New Issue