- 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

svn path=/trunk/boinc/; revision=22051
This commit is contained in:
Rom Walton 2010-07-23 15:25:39 +00:00
parent c3d19dfe8a
commit 5e87d07598
7 changed files with 45 additions and 22 deletions

View File

@ -5527,3 +5527,22 @@ Charlie 23 Jul 2010
clientgui/ clientgui/
BOINCBaseFrame.cpp 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

View File

@ -1649,6 +1649,7 @@ void CAdvancedFrame::OnRefreshView(CFrameEvent& WXUNUSED(event)) {
wxTimerEvent timerEvent; wxTimerEvent timerEvent;
wxString strTabTitle = wxEmptyString; wxString strTabTitle = wxEmptyString;
int iCount = 0; int iCount = 0;
static int iLastCount = 0;
wxASSERT(m_pNotebook); wxASSERT(m_pNotebook);
wxASSERT(pDoc); wxASSERT(pDoc);
@ -1657,13 +1658,17 @@ void CAdvancedFrame::OnRefreshView(CFrameEvent& WXUNUSED(event)) {
// Force update the notice tab text // Force update the notice tab text
pView = wxDynamicCast(m_pNotebook->GetPage(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE), CBOINCBaseView); pView = wxDynamicCast(m_pNotebook->GetPage(ID_ADVNOTICESVIEW - ID_ADVVIEWBASE), CBOINCBaseView);
iCount = pDoc->GetUnreadNoticeCount(); iCount = pDoc->GetUnreadNoticeCount();
if (iCount) { if (iLastCount != iCount) {
strTabTitle.Printf(wxT("%s (%d)"), pView->GetViewDisplayName().c_str(), iCount); iLastCount = iCount;
} else {
strTabTitle = pView->GetViewDisplayName();
}
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 // Update current tab contents

View File

@ -1100,6 +1100,7 @@ bool CBOINCGUIApp::ShowNotifications() {
retval = SetActiveGUI(m_iGUISelected, true); retval = SetActiveGUI(m_iGUISelected, true);
if (retval) { if (retval) {
GetFrame()->FireNotification(); GetFrame()->FireNotification();
GetDocument()->UpdateUnreadNoticeState();
} }
return retval; return retval;

View File

@ -41,10 +41,9 @@
#include "res/macbadgemask.xpm" #include "res/macbadgemask.xpm"
#define MIN_IDLE_TIME_FOR_NOTIFICATION 45 #define MIN_IDLE_TIME_FOR_NOTIFICATION 45
#endif
// How long to bounce Dock icon on Mac // How long to bounce Dock icon on Mac
#define MAX_NOTIFICATION_DURATION 15 #define MAX_NOTIFICATION_DURATION 15
#endif
DEFINE_EVENT_TYPE(wxEVT_TASKBAR_RELOADSKIN) DEFINE_EVENT_TYPE(wxEVT_TASKBAR_RELOADSKIN)
DEFINE_EVENT_TYPE(wxEVT_TASKBAR_REFRESH) 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")); wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnRefresh - Function Begin"));
UpdateTaskbarStatus(); UpdateTaskbarStatus();
UpdateNoticeStatus(); UpdateNoticeStatus();
wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnRefresh - Function End")); 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)) { void CTaskBarIcon::OnNotificationTimeout(wxTaskBarIconExEvent& WXUNUSED(event)) {
wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnNotificationTimeout - Function Begin")); wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnNotificationTimeout - Function Begin"));
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
ResetTaskBar(); ResetTaskBar();
pDoc->UpdateUnreadNoticeState();
wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnNotificationTimeout - Function End")); wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnNotificationTimeout - Function End"));
} }

View File

@ -1829,17 +1829,20 @@ void CMainDocument::SaveUnreadNoticeInfo() {
// We want only the unique and invariant part (host name) of the domain path // We want only the unique and invariant part (host name) of the domain path
wxString strHostName = strDomainName.AfterLast(wxFileName::GetPathSeparator()); wxString strHostName = strDomainName.AfterLast(wxFileName::GetPathSeparator());
wxString strArrivalTime = wxEmptyString; wxString strArrivalTime = wxEmptyString;
static double dLastSavedArrivalTime = 0.0;
pConfig->SetPath(strBaseConfigLocation + strHostName); 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() { void CMainDocument::RestoreUnreadNoticeInfo() {
wxString strBaseConfigLocation = wxString(wxT("/Notices/")); wxString strBaseConfigLocation = wxString(wxT("/Notices/"));
wxConfigBase* pConfig = wxConfigBase::Get(FALSE); wxConfigBase* pConfig = wxConfigBase::Get(FALSE);
wxString strArrivalTime = wxEmptyString;
wxString strDomainName = wxString(host.domain_name, wxConvUTF8, strlen(host.domain_name)); 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 // We want only the unique and invariant part (host name) of the domain path
wxString strHostName = strDomainName.AfterLast(wxFileName::GetPathSeparator()); wxString strHostName = strDomainName.AfterLast(wxFileName::GetPathSeparator());
@ -1847,8 +1850,8 @@ void CMainDocument::RestoreUnreadNoticeInfo() {
int i, n = (int)notices.notices.size(); int i, n = (int)notices.notices.size();
pConfig->SetPath(strBaseConfigLocation + strHostName); pConfig->SetPath(strBaseConfigLocation + strHostName);
if (pConfig->Read(wxT("LastReadNoticeTime"), &strArrivalTime)) {
strArrivalTime.ToDouble(&dLastReadNoticeTime); if (pConfig->Read(wxT("LastReadNoticeTime"), &dLastReadNoticeTime)) {
for (i=0; i<n; ++i) { for (i=0; i<n; ++i) {
if (notices.notices[i]->arrival_time >= dLastReadNoticeTime) { if (notices.notices[i]->arrival_time >= dLastReadNoticeTime) {
m_iLastReadNoticeSequenceNumber = notices.notices[i]->seqno; m_iLastReadNoticeSequenceNumber = notices.notices[i]->seqno;

View File

@ -331,9 +331,11 @@ void CSimpleFrame::OnNotification(CFrameEvent& WXUNUSED(event)) {
wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::OnNotification - Function Begin")); wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::OnNotification - Function Begin"));
CDlgMessages dlg(GetParent()); CDlgMessages dlg(GetParent());
m_pBackgroundPanel->SetDlgOpen(true); m_pBackgroundPanel->SetDlgOpen(true);
SetMsgsDlgOpen(&dlg); SetMsgsDlgOpen(&dlg);
m_pBackgroundPanel->projComponent->MessagesViewed();
dlg.ShowModal(); dlg.ShowModal();
m_pBackgroundPanel->SetDlgOpen(false); m_pBackgroundPanel->SetDlgOpen(false);

View File

@ -72,6 +72,7 @@ public:
void CreateComponent(); void CreateComponent();
void UpdateInterface(); void UpdateInterface();
void ReskinInterface(); void ReskinInterface();
void MessagesViewed();
void OnBtnClick(wxCommandEvent& event); void OnBtnClick(wxCommandEvent& event);
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
void UpdateProjectArray(); void UpdateProjectArray();
@ -88,6 +89,7 @@ public:
protected: protected:
void OnEraseBackground(wxEraseEvent& event); void OnEraseBackground(wxEraseEvent& event);
void OnMessageCheck(wxTimerEvent& WXUNUSED(event));
private: private:
wxTimer* checkForMessagesTimer; wxTimer* checkForMessagesTimer;
@ -96,8 +98,6 @@ private:
bool receivedErrorMessage; bool receivedErrorMessage;
bool alertMessageDisplayed; bool alertMessageDisplayed;
bool m_bIs_acct_mgr_detected; bool m_bIs_acct_mgr_detected;
void OnMessageCheck(wxTimerEvent& WXUNUSED(event));
void MessagesViewed();
void UpdateDisplayedProjects(); void UpdateDisplayedProjects();
}; };