MGR: Fix crash bug

svn path=/trunk/boinc/; revision=24459
This commit is contained in:
Charlie Fenton 2011-10-22 01:00:50 +00:00
parent 8e689c7434
commit 068e8823bb
3 changed files with 14 additions and 9 deletions

View File

@ -7657,3 +7657,9 @@ David 21 Oct 2011
tools/
update_versions
Charlie 21 Oct 2011
- MGR: Fix crash bug.
clientgui/
sg_BoincSimpleFrame.cpp,.h

View File

@ -119,9 +119,9 @@ CSimpleFrame::CSimpleFrame(wxString title, wxIcon* icon, wxIcon* icon32, wxPoint
);
// Skins submenu
wxMenu *submenuSkins = new wxMenu;
m_pSubmenuSkins = new wxMenu;
BuildSkinSubmenu(submenuSkins);
BuildSkinSubmenu(m_pSubmenuSkins);
// All other skin names will be appended as radio
// menu items with ID_SGSKINSELECTOR
@ -140,12 +140,12 @@ CSimpleFrame::CSimpleFrame(wxString title, wxIcon* icon, wxIcon* icon32, wxPoint
menuView->Append(
ID_SGSKINSELECTOR,
_("Skin"),
submenuSkins,
m_pSubmenuSkins,
_("Select the appearance of the user interface.")
);
// Skins sumenu always contains the Default entry
if (submenuSkins->GetMenuItemCount() <= 1) {
if (m_pSubmenuSkins->GetMenuItemCount() <= 1) {
menuView->Enable(ID_SGSKINSELECTOR, false);
}
@ -403,8 +403,7 @@ void CSimpleFrame::OnSelectDefaultSkin( wxCommandEvent& WXUNUSED(event) ) {
}
void CSimpleFrame::OnSelectSkin( wxCommandEvent& event ){
wxMenu *theMenu;
void CSimpleFrame::OnSelectSkin( wxCommandEvent& WXUNUSED(event) ){
size_t i, n;
CSkinManager* pSkinManager = wxGetApp().GetSkinManager();
@ -413,10 +412,9 @@ void CSimpleFrame::OnSelectSkin( wxCommandEvent& event ){
wxString strSelectedSkin = pSkinManager->GetDefaultSkinName(); // For safety
theMenu = (wxMenu*)event.GetEventObject();
n = theMenu->GetMenuItemCount();
n = m_pSubmenuSkins->GetMenuItemCount();
for (i=0; i<n; ++i) {
wxMenuItem* item = theMenu->FindItemByPosition(i);
wxMenuItem* item = m_pSubmenuSkins->FindItemByPosition(i);
if (item->IsChecked()) {
strSelectedSkin = item->GetItemLabelText();
break;

View File

@ -134,6 +134,7 @@ protected:
virtual int _GetCurrentViewPage();
wxMenuBar* m_pMenubar;
wxMenu* m_pSubmenuSkins;
wxAcceleratorEntry m_Shortcuts[1];
wxAcceleratorTable* m_pAccelTable;