summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/options.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-03 19:45:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-03 19:45:48 +0300
commit54a9d50daf120ec738ecba5cc9541e992e800407 (patch)
tree4af1fa92b0c7af6583077ad220eca2c296eb351f /protocols/Telegram/src/options.cpp
parent97aaa26b16121281291acf58c26e1032a24d85bf (diff)
Telegram: fix for options
Diffstat (limited to 'protocols/Telegram/src/options.cpp')
-rw-r--r--protocols/Telegram/src/options.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp
index e66da19f0c..d3823c1df1 100644
--- a/protocols/Telegram/src/options.cpp
+++ b/protocols/Telegram/src/options.cpp
@@ -44,6 +44,8 @@ public:
if (bFullDlg)
CreateLink(chkUsePopups, ppro->m_bUsePopups);
+
+ cmbCountry.OnChange = Callback(this, &COptionsDlg::onChange_Country);
}
bool OnInitDialog() override
@@ -58,14 +60,15 @@ public:
if (countryCode == m_proto->m_iCountry)
cmbCountry.SetCurSel(idx);
}
-
+
+ onChange_Country(0);
return true;
}
bool OnApply() override
{
int iCountry = cmbCountry.GetCurData();
- if (iCountry == 9999 || mir_wstrlen(m_proto->m_szOwnPhone)) {
+ if (iCountry == 9999 || !mir_wstrlen(m_proto->m_szOwnPhone)) {
SetFocus(edtPhone.GetHwnd());
return false;
}
@@ -76,6 +79,17 @@ public:
Clist_GroupCreate(0, m_proto->m_wszDefaultGroup);
return true;
}
+
+ void onChange_Country(CCtrlCombo *)
+ {
+ CMStringA buf;
+ int iCode = cmbCountry.GetCurData();
+ if (iCode == 9999)
+ buf = "---";
+ else
+ buf.Format("+%d", iCode);
+ SetDlgItemTextA(m_hwnd, IDC_CODE, buf);
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////