summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_options.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-30 13:57:53 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-30 13:57:53 +0000
commitf65741787bee7c5d143d733efb32b7ec3452edc6 (patch)
treeabde66c5c4b96e96dbcc9c0b66906d0ba989e2d4 /protocols/Steam/src/steam_options.cpp
parent98ef126036ee5fdef2155dc15e4e08a7f7eaf534 (diff)
Steam: fixed options
git-svn-id: http://svn.miranda-ng.org/main/trunk@14457 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_options.cpp')
-rw-r--r--protocols/Steam/src/steam_options.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/protocols/Steam/src/steam_options.cpp b/protocols/Steam/src/steam_options.cpp
new file mode 100644
index 0000000000..4f5a2a8dcd
--- /dev/null
+++ b/protocols/Steam/src/steam_options.cpp
@@ -0,0 +1,69 @@
+#include "stdafx.h"
+
+CSteamOptionsMain::CSteamOptionsMain(CSteamProto *proto, int idDialog, HWND hwndParent)
+ : CSteamDlgBase(proto, idDialog, false),
+ m_username(this, IDC_USERNAME), m_password(this, IDC_PASSWORD),
+ m_group(this, IDC_GROUP), m_biggerAvatars(this, IDC_BIGGER_AVATARS)
+{
+ SetParent(hwndParent);
+
+ CreateLink(m_username, "Username", _T(""));
+ CreateLink(m_password, "Password", _T(""));
+ CreateLink(m_group, "DefaultGroup", _T("Steam"));
+ CreateLink(m_biggerAvatars, "UseBigAvatars", DBVT_BYTE, FALSE);
+}
+
+void CSteamOptionsMain::OnInitDialog()
+{
+ CSteamDlgBase::OnInitDialog();
+
+ SendMessage(m_username.GetHwnd(), EM_LIMITTEXT, 64, 0);
+ SendMessage(m_password.GetHwnd(), EM_LIMITTEXT, 64, 0);
+ SendMessage(m_group.GetHwnd(), EM_LIMITTEXT, 64, 0);
+}
+
+void CSteamOptionsMain::OnApply()
+{
+ TCHAR *group = m_group.GetText();
+ if (mir_tstrlen(group) > 0 && Clist_GroupExists(group))
+ Clist_CreateGroup(0, group);
+
+ if (m_proto->IsOnline())
+ {
+ // may be we should show message box with warning?
+ m_proto->SetStatus(ID_STATUS_OFFLINE);
+ }
+ if (m_username.IsChanged())
+ {
+ m_proto->delSetting("SteamID");
+ m_proto->delSetting("TokenSecret");
+ }
+ if (m_password.IsChanged())
+ {
+ m_proto->delSetting("TokenSecret");
+ }
+ mir_free(group);
+}
+
+/////////////////////////////////////////////////////////////////////////////////
+
+CSteamOptionsBlockList::CSteamOptionsBlockList(CSteamProto *proto)
+ : CSuper(proto, IDD_OPT_BLOCK_LIST, false),
+ m_list(this, IDC_LIST),
+ m_contacts(this, IDC_CONTACTS),
+ m_add(this, IDC_BLOCK)
+{
+ m_add.OnClick = Callback(this, &CSteamOptionsBlockList::OnBlock);
+}
+
+void CSteamOptionsBlockList::OnInitDialog()
+{
+ m_list.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);
+
+ m_list.AddColumn(0, TranslateT("Name"), 220);
+ m_list.AddColumn(1, _T(""), 32 - GetSystemMetrics(SM_CXVSCROLL));
+}
+
+void CSteamOptionsBlockList::OnBlock(CCtrlButton*)
+{
+} \ No newline at end of file