From e08143e37cff1be034540d89028b9dba6f0cef70 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 12 Jul 2024 16:25:57 +0300 Subject: =?UTF-8?q?fixes=20#4530=20(Weaher:=20=D0=BD=D0=B5=D0=B4=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=83=D0=BF=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF?= =?UTF-8?q?=D0=BA=D0=B0=20"=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C"=20=D0=B2=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D0=BE=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D0=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Weather/src/weather_svcs.cpp | 17 +++++++++-------- protocols/Weather/src/weather_userinfo.cpp | 14 +++++++------- 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'protocols/Weather/src') 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 -- cgit v1.2.3