diff options
author | George Hazan <ghazan@miranda.im> | 2016-12-29 00:01:38 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-12-29 00:01:38 +0300 |
commit | a956289416dd69108ce3b26b1a6d7ec8627576f4 (patch) | |
tree | 5091031cc121d0c8953c855103e019275314dc4d /protocols/Discord/src/options.cpp | |
parent | cc050575f27ecc736364749d1c5f47a7e3cdc991 (diff) |
login processing completed
Diffstat (limited to 'protocols/Discord/src/options.cpp')
-rw-r--r-- | protocols/Discord/src/options.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp index 2f16811b6a..d57f8d27af 100644 --- a/protocols/Discord/src/options.cpp +++ b/protocols/Discord/src/options.cpp @@ -20,39 +20,34 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class CDiscardAccountOptions : public CProtoDlgBase<CDiscordProto> { CCtrlEdit m_edGroup, m_edUserName, m_edPassword; + ptrW m_wszOldGroup; public: CDiscardAccountOptions(CDiscordProto *ppro) : CProtoDlgBase<CDiscordProto>(ppro, IDD_OPTIONS_ACCOUNT), m_edGroup(this, IDC_GROUP), m_edUserName(this, IDC_USERNAME), - m_edPassword(this, IDC_PASSWORD) - {} + m_edPassword(this, IDC_PASSWORD), + m_wszOldGroup(mir_wstrdup(ppro->m_wszDefaultGroup)) + { + CreateLink(m_edGroup, ppro->m_wszDefaultGroup); + CreateLink(m_edUserName, ppro->m_wszEmail); + } virtual void OnInitDialog() override { - ptrW buf(m_proto->getWStringA(DB_KEY_EMAIL)); - if (buf) - m_edUserName.SetText(buf); - - buf = m_proto->getWStringA(DB_KEY_PASSWORD); + ptrW buf(m_proto->getWStringA(DB_KEY_PASSWORD)); if (buf) m_edPassword.SetText(buf); - - buf = m_proto->getWStringA(DB_KEY_GROUP); - m_edGroup.SetText(buf ? buf : DB_KEYVAL_GROUP); } virtual void OnApply() override { - ptrW buf(m_edUserName.GetText()); - m_proto->setWString(DB_KEY_EMAIL, buf); + if (mir_wstrcmp(m_proto->m_wszDefaultGroup, m_wszOldGroup)) + Clist_GroupCreate(NULL, m_proto->m_wszDefaultGroup); - buf = m_edPassword.GetText(); + ptrW buf(m_edPassword.GetText()); m_proto->setWString(DB_KEY_PASSWORD, buf); - - buf = m_edGroup.GetText(); - m_proto->setWString(DB_KEY_GROUP, buf); } }; |