diff --git a/checkin_notes b/checkin_notes index 30dd62234f..b039a51db1 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8744,3 +8744,18 @@ David 24 Dec 2003 sched/ handle_request.C sched_shmem.C + +David 23 Dec 2003 (supplied by Rom Walton) + - new message class: warnings and network (with corresponding icons) + + client/ + message.h + win/ + resource.h + resource.rc + wingui_mainwindow.cpp,h + res/ + iconnetwork.ico (new) + iconwarning.ico (new) + win_build/ + boinc_gui.dsp diff --git a/client/message.h b/client/message.h index 60a88118c4..cc38d98b59 100644 --- a/client/message.h +++ b/client/message.h @@ -31,6 +31,7 @@ #define MSG_ERROR 2 // cmdline: write to stderr // GUI: write to msg window in bold or red +#define MSG_WARNING 3 extern void show_message(class PROJECT *p, char* message, int priority); diff --git a/client/win/res/icon.ico b/client/win/res/icon.ico index 117b854c9c..207d5a4a6b 100755 Binary files a/client/win/res/icon.ico and b/client/win/res/icon.ico differ diff --git a/client/win/res/iconerror.ico b/client/win/res/iconerror.ico index 0255a4db2a..9e0c784398 100644 Binary files a/client/win/res/iconerror.ico and b/client/win/res/iconerror.ico differ diff --git a/client/win/res/iconinfo.ico b/client/win/res/iconinfo.ico index e300544c4c..20c992f946 100644 Binary files a/client/win/res/iconinfo.ico and b/client/win/res/iconinfo.ico differ diff --git a/client/win/res/iconnetwork.ico b/client/win/res/iconnetwork.ico new file mode 100644 index 0000000000..ffde117323 Binary files /dev/null and b/client/win/res/iconnetwork.ico differ diff --git a/client/win/res/iconwarning.ico b/client/win/res/iconwarning.ico new file mode 100644 index 0000000000..388628f348 Binary files /dev/null and b/client/win/res/iconwarning.ico differ diff --git a/client/win/resource.h b/client/win/resource.h index b988381614..8b108eede1 100755 --- a/client/win/resource.h +++ b/client/win/resource.h @@ -25,6 +25,8 @@ #define IDI_ICONSMALL 132 #define IDI_ICONERROR 134 #define IDI_ICONINFO 135 +#define IDI_ICONNETWORK 138 +#define IDI_ICONWARNING 139 #define IDC_LOGIN_URL 1000 #define IDC_LOGIN_AUTH 1002 #define IDC_LIST 1006 @@ -101,7 +103,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 136 +#define _APS_NEXT_RESOURCE_VALUE 140 #define _APS_NEXT_COMMAND_VALUE 40051 #define _APS_NEXT_CONTROL_VALUE 1035 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/client/win/resource.rc b/client/win/resource.rc index e61f2f8b47..590bb8d7c4 100755 --- a/client/win/resource.rc +++ b/client/win/resource.rc @@ -275,6 +275,8 @@ IDI_ICONHIGHLIGHT ICON DISCARDABLE "res\\iconhigh.ico" IDI_ICONSMALL ICON DISCARDABLE "res\\iconsmall.ico" IDI_ICONERROR ICON DISCARDABLE "res\\iconerror.ico" IDI_ICONINFO ICON DISCARDABLE "res\\iconinfo.ico" +IDI_ICONNETWORK ICON DISCARDABLE "res\\iconnetwork.ico" +IDI_ICONWARNING ICON DISCARDABLE "res\\iconwarning.ico" #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index 95b9934d7f..bacdb919a0 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -647,47 +647,37 @@ void CMainWindow::UpdateGUI(CLIENT_STATE* pcs) // make icon flash if needed TCITEM tcItem; memset(&tcItem, 0, sizeof(TCITEMW)); // start with NULL defaults + tcItem.mask = TCIF_STATE; + tcItem.dwStateMask = TCIS_HIGHLIGHTED; if(m_bMessage || m_bRequest) { if(m_bRequest){ if(m_nToggleIconState == ICON_NORMAL){ SetStatusIcon(ICON_NORMAL); - m_nToggleIconState = ICON_HIGHLIGHT; + m_nToggleIconState = ICON_NETWORK; } else { - SetStatusIcon(ICON_HIGHLIGHT); + SetStatusIcon(ICON_NETWORK); m_nToggleIconState = ICON_NORMAL; } } else { if(m_nToggleIconState == ICON_NORMAL){ - SetStatusIcon(ICON_NORMAL); - tcItem.mask = TCIF_STATE; - tcItem.dwStateMask = TCIS_HIGHLIGHTED; - m_TabCtrl.SetItem(3, &tcItem); - switch(m_nMessage) { case MSG_INFO: m_nToggleIconState = ICON_INFO; break; case MSG_ERROR: m_nToggleIconState = ICON_ERROR; break; + case MSG_WARNING: m_nToggleIconState = ICON_WARNING; break; } - } else { - SetStatusIcon(m_nToggleIconState); - tcItem.mask = TCIF_STATE; tcItem.dwState = TCIS_HIGHLIGHTED; - tcItem.dwStateMask = TCIS_HIGHLIGHTED; - m_TabCtrl.SetItem(3, &tcItem); - m_nToggleIconState = ICON_NORMAL; } } } else { SetStatusIcon(ICON_NORMAL); - tcItem.mask = TCIF_STATE; - tcItem.dwStateMask = TCIS_HIGHLIGHTED; - m_TabCtrl.SetItem(3, &tcItem); } + m_TabCtrl.SetItem(3, &tcItem); } ////////// @@ -714,7 +704,9 @@ void CMainWindow::MessageUser(char* szProject, char* szMessage, int nPriority) if (nPriority == MSG_ERROR){ m_nMessage = nPriority; - } else if ((nPriority == MSG_INFO) && (m_nMessage != MSG_ERROR)){ + } else if ((nPriority == MSG_WARNING) && (m_nMessage != MSG_ERROR)){ + m_nMessage = nPriority; + } else if ((nPriority == MSG_INFO) && ((m_nMessage != MSG_WARNING) || (m_nMessage != MSG_ERROR))){ m_nMessage = nPriority; } } @@ -795,10 +787,10 @@ bool CMainWindow::SetStatusIcon(DWORD dwMessage) if((dwMessage != ICON_OFF) && (dwMessage != ICON_NORMAL) && - (dwMessage != ICON_HIGHLIGHT) && + (dwMessage != ICON_NETWORK) && (dwMessage != ICON_ERROR) && - (dwMessage != ICON_INFO) - ){ + (dwMessage != ICON_INFO) && + (dwMessage != ICON_WARNING)) { return false; } @@ -822,8 +814,8 @@ bool CMainWindow::SetStatusIcon(DWORD dwMessage) } else { success = Shell_NotifyIcon(NIM_MODIFY, &icon_data); } - } else if(dwMessage == ICON_HIGHLIGHT) { - icon_data.hIcon = g_myApp.LoadIcon(IDI_ICONHIGHLIGHT); + } else if(dwMessage == ICON_NETWORK) { + icon_data.hIcon = g_myApp.LoadIcon(IDI_ICONNETWORK); if(m_nIconState == ICON_OFF) { success = Shell_NotifyIcon(NIM_ADD, &icon_data); } else { @@ -843,6 +835,13 @@ bool CMainWindow::SetStatusIcon(DWORD dwMessage) } else { success = Shell_NotifyIcon(NIM_MODIFY, &icon_data); } + } else if(dwMessage == ICON_WARNING) { + icon_data.hIcon = g_myApp.LoadIcon(IDI_ICONWARNING); + if(m_nIconState == ICON_OFF) { + success = Shell_NotifyIcon(NIM_ADD, &icon_data); + } else { + success = Shell_NotifyIcon(NIM_MODIFY, &icon_data); + } } if (!success) return false; @@ -2128,9 +2127,11 @@ LRESULT CMainWindow::OnStatusIcon(WPARAM wParam, LPARAM lParam) SetForegroundWindow(); } } else if(lParam == WM_LBUTTONDBLCLK) { - if(IsWindowVisible()) { - ShowWindow(SW_HIDE); - } else { + if (IsIconic()) { + ShowWindow(SW_RESTORE); + } else if(IsWindowVisible()) { + ShowWindow(SW_HIDE); + } else { ShowWindow(SW_SHOWNORMAL); } } diff --git a/client/win/wingui_mainwindow.h b/client/win/wingui_mainwindow.h index e3364de35b..6cb0df106f 100755 --- a/client/win/wingui_mainwindow.h +++ b/client/win/wingui_mainwindow.h @@ -35,9 +35,10 @@ #define ICON_OFF 0 // remove icon #define ICON_NORMAL 1 // normal icon -#define ICON_HIGHLIGHT 2 // highlighted icon +#define ICON_NETWORK 2 // network icon #define ICON_ERROR 3 // error icon #define ICON_INFO 4 // info icon +#define ICON_WARNING 5 // warning icon #define DEF_COL_WIDTH 80 // default width of list columns diff --git a/win_build/boinc_gui.dsp b/win_build/boinc_gui.dsp index 2aec724dd7..8b39a92c6d 100755 --- a/win_build/boinc_gui.dsp +++ b/win_build/boinc_gui.dsp @@ -486,14 +486,30 @@ SOURCE=..\client\win\res\icon.ico # End Source File # Begin Source File +SOURCE=..\client\win\res\iconerror.ico +# End Source File +# Begin Source File + SOURCE=..\client\win\res\iconhigh.ico # End Source File # Begin Source File +SOURCE=..\client\win\res\iconinfo.ico +# End Source File +# Begin Source File + +SOURCE=..\client\win\res\iconnetwork.ico +# End Source File +# Begin Source File + SOURCE=..\client\win\res\iconsmall.ico # End Source File # Begin Source File +SOURCE=..\client\win\res\iconwarning.ico +# End Source File +# Begin Source File + SOURCE=..\client\win\res\mess.bmp # End Source File # Begin Source File