diff --git a/checkin_notes b/checkin_notes index 6f535a836a..b040cac7e8 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5527,3 +5527,22 @@ Charlie 23 Jul 2010 clientgui/ BOINCBaseFrame.cpp + +Rom 23 Jul 2010 + - MGR: Don't update the notice tab text unless the unread notice + count has changed. + - MGR: Don't update the last arrival time for the host unless + it has changed from the last time it was saved. + - MGR: Opps, forgot to move some code before commiting yesterday, + don't update the last save arrival time unless the user + clicks on the balloon. + - MGR: Stop the simple GUI from blinking the messages button + when the balloon is clicked. + + clientgui/ + AdvancedFrame.cpp + BOINCGUIApp.cpp + BOINCTaskBar.cpp + MainDocument.cpp + sg_BoincSimpleGUI.cpp + sg_ProjectsComponent.h diff --git a/clientgui/AdvancedFrame.cpp b/clientgui/AdvancedFrame.cpp index 59e39152e3..da99a99b8b 100644 --- a/clientgui/AdvancedFrame.cpp +++ b/clientgui/AdvancedFrame.cpp @@ -1649,6 +1649,7 @@ void CAdvancedFrame::OnRefreshView(CFrameEvent& WXUNUSED(event)) { wxTimerEvent timerEvent; wxString strTabTitle = wxEmptyString; int iCount = 0; + static int iLastCount = 0; wxASSERT(m_pNotebook); wxASSERT(pDoc); @@ -1657,13 +1658,17 @@ void CAdvancedFrame::OnRefreshView(CFrameEvent& WXUNUSED(event)) { // Force update the notice tab text pView = wxDynamicCast(m_pNotebook->GetPage(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE), CBOINCBaseView); iCount = pDoc->GetUnreadNoticeCount(); - if (iCount) { - strTabTitle.Printf(wxT("%s (%d)"), pView->GetViewDisplayName().c_str(), iCount); - } else { - strTabTitle = pView->GetViewDisplayName(); - } + if (iLastCount != iCount) { + iLastCount = iCount; - m_pNotebook->SetPageText(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE, strTabTitle); + if (iCount) { + strTabTitle.Printf(wxT("%s (%d)"), pView->GetViewDisplayName().c_str(), iCount); + } else { + strTabTitle = pView->GetViewDisplayName(); + } + + m_pNotebook->SetPageText(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE, strTabTitle); + } // Update current tab contents diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index d335dde36e..ead0874729 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -1100,6 +1100,7 @@ bool CBOINCGUIApp::ShowNotifications() { retval = SetActiveGUI(m_iGUISelected, true); if (retval) { GetFrame()->FireNotification(); + GetDocument()->UpdateUnreadNoticeState(); } return retval; diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp index dcf92bcfb3..a197463530 100644 --- a/clientgui/BOINCTaskBar.cpp +++ b/clientgui/BOINCTaskBar.cpp @@ -41,10 +41,9 @@ #include "res/macbadgemask.xpm" #define MIN_IDLE_TIME_FOR_NOTIFICATION 45 -#endif - // How long to bounce Dock icon on Mac #define MAX_NOTIFICATION_DURATION 15 +#endif DEFINE_EVENT_TYPE(wxEVT_TASKBAR_RELOADSKIN) DEFINE_EVENT_TYPE(wxEVT_TASKBAR_REFRESH) @@ -141,7 +140,6 @@ void CTaskBarIcon::OnRefresh(CTaskbarEvent& WXUNUSED(event)) { wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnRefresh - Function Begin")); UpdateTaskbarStatus(); - UpdateNoticeStatus(); wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnRefresh - Function End")); @@ -172,12 +170,7 @@ void CTaskBarIcon::OnNotificationClick(wxTaskBarIconExEvent& WXUNUSED(event)) { void CTaskBarIcon::OnNotificationTimeout(wxTaskBarIconExEvent& WXUNUSED(event)) { wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnNotificationTimeout - Function Begin")); - CMainDocument* pDoc = wxGetApp().GetDocument(); - wxASSERT(pDoc); - wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - ResetTaskBar(); - pDoc->UpdateUnreadNoticeState(); wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnNotificationTimeout - Function End")); } diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index fe0e2fac63..452da35065 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -1829,17 +1829,20 @@ void CMainDocument::SaveUnreadNoticeInfo() { // We want only the unique and invariant part (host name) of the domain path wxString strHostName = strDomainName.AfterLast(wxFileName::GetPathSeparator()); wxString strArrivalTime = wxEmptyString; - + static double dLastSavedArrivalTime = 0.0; + pConfig->SetPath(strBaseConfigLocation + strHostName); - strArrivalTime.Printf(wxT("%f"), m_dLastReadNoticeArrivalTime); - pConfig->Write(wxT("LastReadNoticeTime"), strArrivalTime); + + if (dLastSavedArrivalTime != m_dLastReadNoticeArrivalTime) { + pConfig->Write(wxT("LastReadNoticeTime"), m_dLastReadNoticeArrivalTime); + dLastSavedArrivalTime = m_dLastReadNoticeArrivalTime; + } } void CMainDocument::RestoreUnreadNoticeInfo() { wxString strBaseConfigLocation = wxString(wxT("/Notices/")); wxConfigBase* pConfig = wxConfigBase::Get(FALSE); - wxString strArrivalTime = wxEmptyString; wxString strDomainName = wxString(host.domain_name, wxConvUTF8, strlen(host.domain_name)); // We want only the unique and invariant part (host name) of the domain path wxString strHostName = strDomainName.AfterLast(wxFileName::GetPathSeparator()); @@ -1847,8 +1850,8 @@ void CMainDocument::RestoreUnreadNoticeInfo() { int i, n = (int)notices.notices.size(); pConfig->SetPath(strBaseConfigLocation + strHostName); - if (pConfig->Read(wxT("LastReadNoticeTime"), &strArrivalTime)) { - strArrivalTime.ToDouble(&dLastReadNoticeTime); + + if (pConfig->Read(wxT("LastReadNoticeTime"), &dLastReadNoticeTime)) { for (i=0; iarrival_time >= dLastReadNoticeTime) { m_iLastReadNoticeSequenceNumber = notices.notices[i]->seqno; diff --git a/clientgui/sg_BoincSimpleGUI.cpp b/clientgui/sg_BoincSimpleGUI.cpp index bc44e17579..b5d11d021c 100644 --- a/clientgui/sg_BoincSimpleGUI.cpp +++ b/clientgui/sg_BoincSimpleGUI.cpp @@ -331,9 +331,11 @@ void CSimpleFrame::OnNotification(CFrameEvent& WXUNUSED(event)) { wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::OnNotification - Function Begin")); CDlgMessages dlg(GetParent()); + m_pBackgroundPanel->SetDlgOpen(true); SetMsgsDlgOpen(&dlg); + m_pBackgroundPanel->projComponent->MessagesViewed(); dlg.ShowModal(); m_pBackgroundPanel->SetDlgOpen(false); diff --git a/clientgui/sg_ProjectsComponent.h b/clientgui/sg_ProjectsComponent.h index 72e67ee631..05a8fb61b9 100644 --- a/clientgui/sg_ProjectsComponent.h +++ b/clientgui/sg_ProjectsComponent.h @@ -72,6 +72,7 @@ public: void CreateComponent(); void UpdateInterface(); void ReskinInterface(); + void MessagesViewed(); void OnBtnClick(wxCommandEvent& event); void OnPaint(wxPaintEvent& event); void UpdateProjectArray(); @@ -88,6 +89,7 @@ public: protected: void OnEraseBackground(wxEraseEvent& event); + void OnMessageCheck(wxTimerEvent& WXUNUSED(event)); private: wxTimer* checkForMessagesTimer; @@ -96,8 +98,6 @@ private: bool receivedErrorMessage; bool alertMessageDisplayed; bool m_bIs_acct_mgr_detected; - void OnMessageCheck(wxTimerEvent& WXUNUSED(event)); - void MessagesViewed(); void UpdateDisplayedProjects(); };