diff options
author | George Hazan <george.hazan@gmail.com> | 2024-07-12 16:25:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-07-12 16:25:57 +0300 |
commit | e08143e37cff1be034540d89028b9dba6f0cef70 (patch) | |
tree | 1196deaa1a2f15ca83531c612128da286d6bce10 /protocols/Weather/src | |
parent | 1f5c34c5678de36df653da048662008bfe6e1af2 (diff) |
fixes #4530 (Weaher: недоступна кнопка "Обновить" в информации о пользователе)
Diffstat (limited to 'protocols/Weather/src')
-rw-r--r-- | protocols/Weather/src/weather_svcs.cpp | 17 | ||||
-rw-r--r-- | protocols/Weather/src/weather_userinfo.cpp | 14 |
2 files changed, 16 insertions, 15 deletions
diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp index ced1ce5c71..daeb7f8bd1 100644 --- a/protocols/Weather/src/weather_svcs.cpp +++ b/protocols/Weather/src/weather_svcs.cpp @@ -35,17 +35,18 @@ extern VARSW g_pwszIconsName; // protocol service function for setting weather protocol status INT_PTR WeatherSetStatus(WPARAM new_status, LPARAM) { - new_status = new_status != ID_STATUS_OFFLINE ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE; - // if we don't want to show status for default station - if (!opt.NoProtoCondition && status != new_status) { + if (status != new_status) { old_status = status; - status = new_status != ID_STATUS_OFFLINE ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE; - ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, status); + status = new_status = new_status != ID_STATUS_OFFLINE ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE; + + if (!opt.NoProtoCondition) { + ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, status); - UpdateMenu(new_status != ID_STATUS_OFFLINE); - if (new_status != ID_STATUS_OFFLINE) - UpdateAll(FALSE, FALSE); + UpdateMenu(new_status != ID_STATUS_OFFLINE); + if (new_status != ID_STATUS_OFFLINE) + UpdateAll(FALSE, FALSE); + } } return 0; diff --git a/protocols/Weather/src/weather_userinfo.cpp b/protocols/Weather/src/weather_userinfo.cpp index b0e0bf6859..ecee919ce5 100644 --- a/protocols/Weather/src/weather_userinfo.cpp +++ b/protocols/Weather/src/weather_userinfo.cpp @@ -54,22 +54,22 @@ static int BriefDlgResizer(HWND, LPARAM, UTILRESIZECONTROL *urc) // also load brief info into message box static void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact) { - WEATHERINFO winfo; wchar_t str[4096]; // load weather information from the contact into the WEATHERINFO struct - winfo = LoadWeatherInfo(hContact); + WEATHERINFO winfo = LoadWeatherInfo(hContact); // check if data exist. If not, display error message box if (!g_plugin.getByte(hContact, "IsUpdated")) - wcsncpy(str, TranslateT("No information available.\r\nPlease update weather condition first."), _countof(str) - 1); - else + SetDlgItemTextW(hwndDlg, IDC_MTEXT, TranslateT("No information available.\r\nPlease update weather condition first.")); + else { // set the display text and show the message box GetDisplay(&winfo, GetTextValue('B'), str); - SetDlgItemText(hwndDlg, IDC_MTEXT, str); + SetDlgItemTextW(hwndDlg, IDC_MTEXT, str); + } GetDisplay(&winfo, L"%c, %t", str); - SetWindowText(hwndDlg, winfo.city); - SetDlgItemText(hwndDlg, IDC_HEADERBAR, str); + SetWindowTextW(hwndDlg, winfo.city); + SetDlgItemTextW(hwndDlg, IDC_HEADERBAR, str); } // dialog process for more data in the user info window |