From c70ca20c2fb90bfad3281aeba61b46b54d8228be Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Tue, 7 Jun 2011 12:57:04 +1000 Subject: [PATCH] GUI ID stuff --- Projects/CodeBlocks/SleepyHead.depend | 6 +++--- src/GUIFrame.cpp | 14 +++++++------- src/GUIFrame.h | 3 +-- src/WxWizFrame.fbp | 7 ++++--- src/libs/sleeplib/loader_plugins/cms50_loader.cpp | 7 ++++--- src/version.h | 12 ++++++------ 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Projects/CodeBlocks/SleepyHead.depend b/Projects/CodeBlocks/SleepyHead.depend index a87e5ec6..3c5dc8d7 100644 --- a/Projects/CodeBlocks/SleepyHead.depend +++ b/Projects/CodeBlocks/SleepyHead.depend @@ -8206,7 +8206,7 @@ "GUIFrame.h" -1307358939 /home/mark/projects/git/sleepyhead/src/GUIFrame.h +1307415268 /home/mark/projects/git/sleepyhead/src/GUIFrame.h @@ -8295,7 +8295,7 @@ -1307413369 /home/mark/projects/git/sleepyhead/src/version.h +1307413738 /home/mark/projects/git/sleepyhead/src/version.h 1307358939 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h "machine.h" @@ -8413,7 +8413,7 @@ 1307358939 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.h "sleeplib/machine_loader.h" -1307413299 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp +1307413737 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp "cms50_loader.h" diff --git a/src/GUIFrame.cpp b/src/GUIFrame.cpp index efb05ccf..13108256 100644 --- a/src/GUIFrame.cpp +++ b/src/GUIFrame.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version May 5 2011) +// C++ code generated with wxFormBuilder (version Jun 6 2011) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -31,14 +31,14 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons FileMenu->Append( FileMenuImportSD ); wxMenuItem* FileMenuPreferences; - FileMenuPreferences = new wxMenuItem( FileMenu, wxID_ANY, wxString( _("&Preferences") ) + wxT('\t') + wxT("F10"), wxEmptyString, wxITEM_NORMAL ); + FileMenuPreferences = new wxMenuItem( FileMenu, wxID_PREFERENCES, wxString( _("&Preferences") ) + wxT('\t') + wxT("F10"), wxEmptyString, wxITEM_NORMAL ); FileMenu->Append( FileMenuPreferences ); wxMenuItem* m_separator1; m_separator1 = FileMenu->AppendSeparator(); wxMenuItem* FileMenuExit; - FileMenuExit = new wxMenuItem( FileMenu, wxID_QUIT, wxString( _("E&xit") ) , wxEmptyString, wxITEM_NORMAL ); + FileMenuExit = new wxMenuItem( FileMenu, wxID_EXIT, wxString( _("E&xit") ) , wxEmptyString, wxITEM_NORMAL ); FileMenu->Append( FileMenuExit ); menubar->Append( FileMenu, _("&File") ); @@ -79,7 +79,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons HelpMenu = new wxMenu(); wxMenuItem* HelpMenuAbout; - HelpMenuAbout = new wxMenuItem( HelpMenu, wxID_ANY, wxString( _("&About") ) , wxEmptyString, wxITEM_NORMAL ); + HelpMenuAbout = new wxMenuItem( HelpMenu, wxID_ABOUT, wxString( _("&About") ) , wxEmptyString, wxITEM_NORMAL ); HelpMenu->Append( HelpMenuAbout ); menubar->Append( HelpMenu, _("&Help") ); @@ -112,14 +112,14 @@ GUIFrame::~GUIFrame() // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GUIFrame::OnClose ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnImportSD ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnPreferencesClicked ) ); - this->Disconnect( wxID_QUIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnQuit ) ); + this->Disconnect( wxID_PREFERENCES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnPreferencesClicked ) ); + this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnQuit ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnViewMenuSummary ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnViewMenuDaily ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnShowSerial ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnFullscreen ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnScreenshot ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) ); + this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) ); m_mgr.UnInit(); diff --git a/src/GUIFrame.h b/src/GUIFrame.h index 82d484ca..b455e6db 100644 --- a/src/GUIFrame.h +++ b/src/GUIFrame.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version May 5 2011) +// C++ code generated with wxFormBuilder (version Jun 6 2011) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -35,7 +35,6 @@ /////////////////////////////////////////////////////////////////////////// -#define wxID_QUIT 1000 /////////////////////////////////////////////////////////////////////////////// /// Class GUIFrame diff --git a/src/WxWizFrame.fbp b/src/WxWizFrame.fbp index 4d0ca2d2..dad02eae 100644 --- a/src/WxWizFrame.fbp +++ b/src/WxWizFrame.fbp @@ -7,6 +7,7 @@ 1 source_name 0 + res UTF-8 connect GUIFrame @@ -221,7 +222,7 @@ 0 1 - wxID_ANY + wxID_PREFERENCES wxITEM_NORMAL &Preferences FileMenuPreferences @@ -240,7 +241,7 @@ 0 1 - wxID_QUIT + wxID_EXIT wxITEM_NORMAL E&xit FileMenuExit @@ -358,7 +359,7 @@ 0 1 - wxID_ANY + wxID_ABOUT wxITEM_NORMAL &About HelpMenuAbout diff --git a/src/libs/sleeplib/loader_plugins/cms50_loader.cpp b/src/libs/sleeplib/loader_plugins/cms50_loader.cpp index 047faebe..f56e91dd 100644 --- a/src/libs/sleeplib/loader_plugins/cms50_loader.cpp +++ b/src/libs/sleeplib/loader_plugins/cms50_loader.cpp @@ -59,8 +59,6 @@ bool CMS50Loader::OpenCMS50(wxString & path, Profile *profile) loader_progress->Update(0); } - - bool cont=dir.GetFirst(&filename); while (cont) { @@ -126,6 +124,8 @@ bool CMS50Loader::OpenSPORFile(wxString path,Machine *mach,Profile *profile) br=f.Read(tmp,2); if (br!=2) return false; num_records=tmp[0] | (tmp[1] << 8); + if (num_records<300) return false; // dont bother. + num_records <<= 1; br=f.Read(tmp,2); @@ -152,6 +152,7 @@ bool CMS50Loader::OpenSPORFile(wxString path,Machine *mach,Profile *profile) br=f.Read(buffer,num_records); if (br!=num_records) { wxLogError(wxT("Short .spoR File: ")+path); + delete [] buffer; return false; } @@ -232,7 +233,7 @@ bool CMS50Loader::OpenSPORFile(wxString path,Machine *mach,Profile *profile) mach->AddSession(sess,profile); sess->SetChanged(true); - delete buffer; + delete [] buffer; return true; } diff --git a/src/version.h b/src/version.h index 1a649ffa..ef7a96db 100644 --- a/src/version.h +++ b/src/version.h @@ -16,14 +16,14 @@ namespace AutoVersion{ //Standard Version Type static const long MAJOR = 0; static const long MINOR = 7; - static const long BUILD = 3347; - static const long REVISION = 1415; + static const long BUILD = 3349; + static const long REVISION = 1420; //Miscellaneous Version Types - static const long BUILDS_COUNT = 529; - #define RC_FILEVERSION 0,7,3347,1415 - #define RC_FILEVERSION_STRING "0, 7, 3347, 1415\0" - static const char FULLVERSION_STRING[] = "0.7.3347.1415"; + static const long BUILDS_COUNT = 532; + #define RC_FILEVERSION 0,7,3349,1420 + #define RC_FILEVERSION_STRING "0, 7, 3349, 1420\0" + static const char FULLVERSION_STRING[] = "0.7.3349.1420"; //These values are to keep track of your versioning state, don't modify them. static const long BUILD_HISTORY = 0;