summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/options.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-14 13:04:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-14 13:04:17 +0300
commitec73c22503f6e4f742abcfeca300629e95dc573d (patch)
treecc9211a4b1cac043d0e9ed5aec6a4f39ccdb0606 /protocols/Discord/src/options.cpp
parente963c904c862bafbf477a85ee60a42374ffa5bae (diff)
fixes #1893 ([Discord] Make option to DISABLE at all group chats/channels)
Diffstat (limited to 'protocols/Discord/src/options.cpp')
-rw-r--r--protocols/Discord/src/options.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp
index dce2a2e46c..98f6e285ce 100644
--- a/protocols/Discord/src/options.cpp
+++ b/protocols/Discord/src/options.cpp
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class CDiscardAccountOptions : public CProtoDlgBase<CDiscordProto>
{
- CCtrlCheck chkHideChats, chkUseGroups;
+ CCtrlCheck chkUseChats, chkHideChats, chkUseGroups;
CCtrlEdit m_edGroup, m_edUserName, m_edPassword;
ptrW m_wszOldGroup;
@@ -31,6 +31,7 @@ public:
m_edGroup(this, IDC_GROUP),
m_edUserName(this, IDC_USERNAME),
m_edPassword(this, IDC_PASSWORD),
+ chkUseChats(this, IDC_USECHANNELS),
chkHideChats(this, IDC_HIDECHATS),
chkUseGroups(this, IDC_USEGROUPS),
m_wszOldGroup(mir_wstrdup(ppro->m_wszDefaultGroup))
@@ -38,8 +39,11 @@ public:
CreateLink(m_edGroup, ppro->m_wszDefaultGroup);
CreateLink(m_edUserName, ppro->m_wszEmail);
if (bFullDlg) {
+ CreateLink(chkUseChats, ppro->m_bUseGroupchats);
CreateLink(chkHideChats, ppro->m_bHideGroupchats);
CreateLink(chkUseGroups, ppro->m_bUseGuildGroups);
+
+ chkUseChats.OnChange = Callback(this, &CDiscardAccountOptions::onChange_GroupChats);
}
}
@@ -48,6 +52,8 @@ public:
ptrW buf(m_proto->getWStringA(DB_KEY_PASSWORD));
if (buf)
m_edPassword.SetText(buf);
+
+ onChange_GroupChats(0);
return true;
}
@@ -60,6 +66,13 @@ public:
m_proto->setWString(DB_KEY_PASSWORD, buf);
return true;
}
+
+ void onChange_GroupChats(CCtrlCheck*)
+ {
+ bool bEnabled = chkUseChats.GetState();
+ chkHideChats.Enable(bEnabled);
+ chkUseGroups.Enable(bEnabled);
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////