summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src/options.cpp')
-rw-r--r--protocols/Telegram/src/options.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp
index bee31419c1..8b3bd7d1e7 100644
--- a/protocols/Telegram/src/options.cpp
+++ b/protocols/Telegram/src/options.cpp
@@ -52,7 +52,6 @@ public:
CreateLink(chkCompressFiles, ppro->m_bCompressFiles);
}
- btnLogout.Enable(m_proto->getByte(DBKEY_AUTHORIZED));
btnLogout.OnClick = Callback(this, &COptionsDlg::onClick_Logout);
cmbCountry.OnChange = Callback(this, &COptionsDlg::onChange_Country);
@@ -71,6 +70,11 @@ public:
cmbCountry.SetCurSel(idx);
}
+ bool bAuthorized = m_proto->getBool(DBKEY_AUTHORIZED);
+ btnLogout.Enable(bAuthorized);
+ edtPhone.Enable(!bAuthorized);
+ cmbCountry.Enable(!bAuthorized);
+
onChange_Country(0);
return true;
}
@@ -93,6 +97,9 @@ public:
void onClick_Logout(CCtrlButton *)
{
m_proto->UnregisterSession();
+
+ edtPhone.Enable();
+ cmbCountry.Enable();
}
void onChange_Country(CCtrlCombo *)