diff --git a/checkin_notes b/checkin_notes index 0ed3a1bffa..df31874258 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11512,3 +11512,12 @@ David 25 Oct 2006 project_specific_prefs.inc.sample sched/ sched_send.C + +Rom 25 Oct 2006 + - MGR: Check to see if the clientindictor timer pointer is valid before + stopping and deleting it. + + clientgui/ + BOINCGUIApp.cpp + sg_BoincSimpleGUI.cpp, .h + sg_ClientStateIndicator.cpp diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index f28895427e..c4131e0edb 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -90,9 +90,9 @@ bool CBOINCGUIApp::OnInit() { m_pMacSystemMenu = NULL; #endif m_bGUIVisible = true; - m_strDefaultWindowStation = wxT(""); - m_strDefaultDesktop = wxT(""); - m_strDefaultDisplay = wxT(""); + m_strDefaultWindowStation = wxEmptyString; + m_strDefaultDesktop = wxEmptyString; + m_strDefaultDisplay = wxEmptyString; m_lBOINCCoreProcessId = 0; #ifdef SIMPLEGUI m_iGUISelected = BOINC_SIMPLEGUI; diff --git a/clientgui/SkinManager.cpp b/clientgui/SkinManager.cpp index db25d0f4bc..a2b4640b4b 100644 --- a/clientgui/SkinManager.cpp +++ b/clientgui/SkinManager.cpp @@ -1251,7 +1251,6 @@ bool CSkinManager::ReloadSkin(wxLocale* pLocale, wxString strSkin) { // locale. // i.e. en if (ERR_XML_PARSE == retval) { - retval = ERR_XML_PARSE; p = fopen(ConstructSkinFileName().c_str(), "r"); if (p) { mf.init_file(p); @@ -1263,7 +1262,6 @@ bool CSkinManager::ReloadSkin(wxLocale* pLocale, wxString strSkin) { // If we failed the second lookup try english // i.e. en if (ERR_XML_PARSE == retval) { - retval = ERR_XML_PARSE; p = fopen(ConstructSkinFileName().c_str(), "r"); if (p) { mf.init_file(p); @@ -1280,7 +1278,6 @@ bool CSkinManager::ReloadSkin(wxLocale* pLocale, wxString strSkin) { ); } - // Make sure all the resources are loaded and valid. ValidateSkin(); diff --git a/clientgui/sg_BoincSimpleGUI.cpp b/clientgui/sg_BoincSimpleGUI.cpp index 352a4791c5..ea32d2c1a2 100644 --- a/clientgui/sg_BoincSimpleGUI.cpp +++ b/clientgui/sg_BoincSimpleGUI.cpp @@ -249,7 +249,28 @@ void CSimpleFrame::OnConnect(CFrameEvent& WXUNUSED(event)) { void CSimpleFrame::OnReloadSkin(CFrameEvent& WXUNUSED(event)) { - ReskinAppGUI(); + wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::OnReloadSkin - Function Start")); + + CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); + + wxASSERT(pSkinSimple); + wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); + + //bg color + SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor()); + + if(notebookViewInitialized){ + if (wrkUnitNB) wrkUnitNB->ReskinAppGUI(); + } else { + if (clientState) clientState->ReskinInterface(); + } + + //reskin component + if (projComponent) projComponent->ReskinInterface(); + + Refresh(); + + wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::OnReloadSkin - Function End")); } @@ -404,69 +425,15 @@ void CSimpleFrame::InitNotebook() } -void CSimpleFrame::ReskinAppGUI(){ - wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::ReskinAppGUI - Function Start")); - - CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); - - wxASSERT(pSkinSimple); - wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); - - //bg color - SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor()); - - if(notebookViewInitialized){ - if (wrkUnitNB) wrkUnitNB->ReskinAppGUI(); - } else { - if (clientState) clientState->ReskinInterface(); - } - - //reskin component - if (projComponent) projComponent->ReskinInterface(); - - Refresh(); - - wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::ReskinAppGUI - Function End")); -} - - void CSimpleFrame::OnEraseBackground(wxEraseEvent& event){ CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); wxASSERT(pSkinSimple); wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); - wxObject *m_wxWin = event.GetEventObject(); - if(m_wxWin==this){event.Skip(true);DrawBackImg(event,this,pSkinSimple->GetBackgroundImage()->GetBitmap(),0);return;} - event.Skip(true); -} - - -void CSimpleFrame::DrawBackImg(wxEraseEvent& event,wxWindow *win,wxBitmap* bitMap,int opz){ - - event.Skip(false); - wxDC *dc; - dc=event.GetDC(); - dc->SetBackground(wxBrush(win->GetBackgroundColour(),wxSOLID)); - dc->Clear(); - switch (opz) { - case 0:{ - dc->DrawBitmap(*bitMap, 0, 0); - break;} - case 1:{ - wxRect rec=win->GetClientRect(); - rec.SetLeft((rec.GetWidth()-bitMap->GetWidth()) / 2); - rec.SetTop ((rec.GetHeight()-bitMap->GetHeight()) / 2); - dc->DrawBitmap(*bitMap,rec.GetLeft(),rec.GetTop(),0); - break;} - case 2:{ - wxRect rec=win->GetClientRect(); - for(int y=0;y < rec.GetHeight();y+=bitMap->GetHeight()){ - for(int x=0;x < rec.GetWidth();x+=bitMap->GetWidth()){ - dc->DrawBitmap(*bitMap,x,y,0); - } - } - break;} - } + wxDC *dc = event.GetDC(); + dc->Clear(); + dc->SetBackground(wxBrush(GetBackgroundColour(),wxSOLID)); + dc->DrawBitmap(*pSkinSimple->GetBackgroundImage()->GetBitmap(), 0, 0); } diff --git a/clientgui/sg_BoincSimpleGUI.h b/clientgui/sg_BoincSimpleGUI.h index d77ba4b25c..51f08b0edd 100644 --- a/clientgui/sg_BoincSimpleGUI.h +++ b/clientgui/sg_BoincSimpleGUI.h @@ -65,7 +65,6 @@ public: void InitResultView(); void InitProjectView(); void UpdateProjectView(); - void ReskinAppGUI(); void InitNotebook(); void DestroyNotebook(); void OnProjectsAttachToProject(); @@ -97,8 +96,6 @@ protected: void OnReloadSkin( CFrameEvent& event ); void OnFrameRender(wxTimerEvent& event ); - void DrawBackImg(wxEraseEvent& event,wxWindow *win,wxBitmap* bitMap,int opz); - private: bool SaveState(); bool RestoreState(); diff --git a/clientgui/sg_ClientStateIndicator.cpp b/clientgui/sg_ClientStateIndicator.cpp index 743a4d0906..0318104a74 100644 --- a/clientgui/sg_ClientStateIndicator.cpp +++ b/clientgui/sg_ClientStateIndicator.cpp @@ -58,7 +58,7 @@ ClientStateIndicator::ClientStateIndicator(CSimpleFrame* parent,wxPoint coord) : indexIndVis = 1;//first will be visible on start rightPosition = 118; topPosition = 5; - stateMessage = wxString(""); + stateMessage = wxEmptyString; clientState = CLIENT_STATE_NONE; CreateComponent(); error_time = 0; @@ -67,7 +67,10 @@ ClientStateIndicator::ClientStateIndicator(CSimpleFrame* parent,wxPoint coord) : ClientStateIndicator::~ClientStateIndicator() { - delete m_connRenderTimer; + if (m_connRenderTimer) { + m_connRenderTimer->Stop(); + delete m_connRenderTimer; + } } void ClientStateIndicator::CreateComponent(){