From e96324399f02ebc4b00da12b38c144407a6acd98 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 5 Feb 2010 20:47:48 +0000 Subject: [PATCH] - MGR: Fix build break by adjusting the SetIcon function prototype so that it conforms to the wxWidget standard. clientgui/ BOINCTaskBar.cpp, .h clientgui/msw/ taskbarex.cpp, .h svn path=/trunk/boinc/; revision=20450 --- checkin_notes | 9 +++++++++ clientgui/BOINCTaskBar.cpp | 8 ++++---- clientgui/BOINCTaskBar.h | 1 + clientgui/msw/taskbarex.cpp | 28 +++++----------------------- clientgui/msw/taskbarex.h | 4 +--- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/checkin_notes b/checkin_notes index 14e10ba330..044e7eed1d 100644 --- a/checkin_notes +++ b/checkin_notes @@ -947,3 +947,12 @@ Rom 5 Feb 2010 clientgui/ BOINCTaskBar.cpp, .h + +Rom 5 Feb 2010 + - MGR: Fix build break by adjusting the SetIcon function prototype so that it conforms + to the wxWidget standard. + + clientgui/ + BOINCTaskBar.cpp, .h + clientgui/msw/ + taskbarex.cpp, .h diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp index bf8eaeeb2a..defc7dc86b 100644 --- a/clientgui/BOINCTaskBar.cpp +++ b/clientgui/BOINCTaskBar.cpp @@ -141,11 +141,14 @@ void CTaskBarIcon::OnRefresh(CTaskbarEvent& WXUNUSED(event)) { // Which icon should be displayed? if (!pDoc->IsConnected()) { + m_iconCurrent = m_iconTaskBarDisconnected; SetIcon(m_iconTaskBarDisconnected); } else { if (RUN_MODE_NEVER == status.task_mode) { + m_iconCurrent = m_iconTaskBarSnooze; SetIcon(m_iconTaskBarSnooze); } else { + m_iconCurrent = m_iconTaskBarNormal; SetIcon(m_iconTaskBarNormal); } } @@ -411,10 +414,7 @@ void CTaskBarIcon::OnMouseMove(wxTaskBarIconEvent& WXUNUSED(event)) { strMessage += strBuffer; } -#ifdef wxUSE_TOOLTIPS - SetTooltip(strMessage); -#endif - + SetIcon(m_iconCurrent, strMessage); } } diff --git a/clientgui/BOINCTaskBar.h b/clientgui/BOINCTaskBar.h index e5c413300f..0b05f304f2 100644 --- a/clientgui/BOINCTaskBar.h +++ b/clientgui/BOINCTaskBar.h @@ -77,6 +77,7 @@ public: wxIcon m_iconTaskBarNormal; wxIcon m_iconTaskBarDisconnected; wxIcon m_iconTaskBarSnooze; + wxIcon m_iconCurrent; wxString m_strDefaultTitle; bool m_bTaskbarInitiatedShutdown; diff --git a/clientgui/msw/taskbarex.cpp b/clientgui/msw/taskbarex.cpp index 37861aace0..3aaf5db84e 100644 --- a/clientgui/msw/taskbarex.cpp +++ b/clientgui/msw/taskbarex.cpp @@ -118,7 +118,7 @@ void wxTaskBarIconEx::OnTaskBarCreated(wxTaskBarIconExEvent& WXUNUSED(event)) } // Operations -bool wxTaskBarIconEx::SetIcon(const wxIcon& icon) +bool wxTaskBarIconEx::SetIcon(const wxIcon& icon, const wxString& message) { if (!IsOK()) return false; @@ -135,28 +135,10 @@ bool wxTaskBarIconEx::SetIcon(const wxIcon& icon) notifyData.uVersion = NOTIFYICON_VERSION; notifyData.hIcon = (HICON) icon.GetHICON(); - UpdateIcon(); - return m_iconAdded; -} - -bool wxTaskBarIconEx::SetTooltip(const wxString& message) -{ - if (!IsOK()) - return false; - - if (message.empty()) - return false; - - memset(¬ifyData, 0, sizeof(NOTIFYICONDATA)); - notifyData.cbSize = sizeof(notifyData); - notifyData.hWnd = (HWND) m_hWnd; - notifyData.uID = m_iTaskbarID; - notifyData.uCallbackMessage = WM_TASKBARMESSAGE; - notifyData.uFlags = NIF_MESSAGE | NIF_TIP | NIF_REALTIME; - notifyData.uVersion = NOTIFYICON_VERSION; - notifyData.hIcon = NULL; - - lstrcpyn(notifyData.szTip, WXSTRINGCAST message, sizeof(notifyData.szTip)); + if (!message.empty()) { + notifyData.uFlags |= NIF_TIP; + lstrcpyn(notifyData.szTip, WXSTRINGCAST message, sizeof(notifyData.szTip)); + } UpdateIcon(); return m_iconAdded; diff --git a/clientgui/msw/taskbarex.h b/clientgui/msw/taskbarex.h index 8635beddf4..13d73e94d0 100644 --- a/clientgui/msw/taskbarex.h +++ b/clientgui/msw/taskbarex.h @@ -44,9 +44,7 @@ public: // Operations - virtual bool SetIcon( const wxIcon& icon ); - - virtual bool SetTooltip( const wxString& message ); + virtual bool SetIcon( const wxIcon& icon, const wxString& message = wxEmptyString ); virtual bool SetBalloon( const wxIcon& icon,