diff options
author | George Hazan <george.hazan@gmail.com> | 2025-01-27 12:05:20 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-01-27 12:05:20 +0300 |
commit | 376ce8d16a039456bc6725ebe6bfbc9e0314a0d0 (patch) | |
tree | c1ce4fd1313c5daafa1a5e3b02a1c288a3f2ee38 /protocols/Weather/src | |
parent | 50077e614cbed92cf54a90b2546497fec153733f (diff) |
fixes #4853 (Weather: некорректно работает кнопка "Получить название города по ID")
Diffstat (limited to 'protocols/Weather/src')
-rw-r--r-- | protocols/Weather/src/resource.h | 1 | ||||
-rw-r--r-- | protocols/Weather/src/weather_contacts.cpp | 34 |
2 files changed, 3 insertions, 32 deletions
diff --git a/protocols/Weather/src/resource.h b/protocols/Weather/src/resource.h index 701feeacf9..e53877d0ee 100644 --- a/protocols/Weather/src/resource.h +++ b/protocols/Weather/src/resource.h @@ -74,7 +74,6 @@ #define IDC_BROWSE 2054 #define IDC_V1 2058 #define IDC_V2 2059 -#define IDC_GETNAME 2062 #define IDC_P1 2063 #define IDC_P2 2064 #define IDC_P3 2065 diff --git a/protocols/Weather/src/weather_contacts.cpp b/protocols/Weather/src/weather_contacts.cpp index 91fed3358f..2661c1b20e 100644 --- a/protocols/Weather/src/weather_contacts.cpp +++ b/protocols/Weather/src/weather_contacts.cpp @@ -90,9 +90,9 @@ class CEditDlg : public CWeatherDlgBase { MCONTACT hContact; - CCtrlEdit edtID, edtName; + CCtrlEdit edtName; CCtrlButton btnExternal, btnChange; - CCtrlMButton btnGetName, btnBrowse; + CCtrlMButton btnBrowse; wchar_t str[MAX_DATA_LEN], str2[256]; @@ -100,19 +100,15 @@ public: CEditDlg(CWeatherProto *ppro, MCONTACT _1) : CWeatherDlgBase(ppro, IDD_EDIT), hContact(_1), - edtID(this, IDC_ID), edtName(this, IDC_NAME), btnBrowse(this, IDC_BROWSE, SKINICON_EVENT_FILE, LPGEN("Browse")), - btnGetName(this, IDC_GETNAME, SKINICON_OTHER_RENAME, LPGEN("Get city name from ID")), btnChange(this, IDC_CHANGE), btnExternal(this, IDC_External) { - edtID.OnChange = Callback(this, &CEditDlg::onChanged_ID); edtName.OnChange = Callback(this, &CEditDlg::onChanged_Name); btnBrowse.OnClick = Callback(this, &CEditDlg::onClick_Browse); btnChange.OnClick = Callback(this, &CEditDlg::onClick_Change); - btnGetName.OnClick = Callback(this, &CEditDlg::onClick_GetName); btnExternal.OnClick = Callback(this, &CEditDlg::onClick_External); } @@ -120,7 +116,6 @@ public: { // make all buttons flat btnBrowse.MakeFlat(); - btnGetName.MakeFlat(); // save the handle for the contact WindowList_Add(hWindowList, m_hwnd, hContact); @@ -153,7 +148,7 @@ public: CheckDlgButton(m_hwnd, IDC_Internal, m_proto->getByte(hContact, "History", 0) ? BST_CHECKED : BST_UNCHECKED); // display the dialog box and free memory - Utils_RestoreWindowPositionNoMove(m_hwnd, NULL, MODULENAME, "EditSetting_"); + Utils_RestoreWindowPositionNoSize(m_hwnd, NULL, MODULENAME, "EditSetting_"); ShowWindow(m_hwnd, SW_SHOW); return true; } @@ -166,14 +161,6 @@ public: Utils_SaveWindowPosition(m_hwnd, NULL, MODULENAME, "EditSetting_"); } - void onChanged_ID(CCtrlEdit *) - { - // check if there are 2 parts in the ID (svc/id) seperated by "/" - // if not, don't let user change the setting - GetDlgItemText(m_hwnd, IDC_ID, str, _countof(str)); - btnChange.Enable(wcschr(str, '/') != nullptr); - } - void onChanged_Name(CCtrlEdit *) { // check if station name is entered @@ -182,21 +169,6 @@ public: EnableWindow(GetDlgItem(m_hwnd, IDC_CHANGE), str[0] != 0); } - void onClick_GetName(CCtrlButton *) - { - // the button for getting station name from the internet - // this function uses the ID search for add/find weather station - if (!m_proto->CheckSearch()) - return; // don't download if update is in progress - - // get the weather update data using the string in the ID field - GetDlgItemText(m_hwnd, IDC_ID, str, _countof(str)); - - // give no station name but only ID if the search is unavailable - if (str[0] != 0) - SetDlgItemText(m_hwnd, IDC_NAME, str); - } - void onClick_External(CCtrlButton *) { // enable/disable the borwse button depending if the external log is enabled |