From e08dd78ccf05f9d5d768e5436fcfc5e8126356fe Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 4 Apr 2014 14:13:16 +0000 Subject: Steam: some improvements git-svn-id: http://svn.miranda-ng.org/main/trunk@8848 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_proto.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'protocols/Steam/src/steam_proto.cpp') diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 187b9f577b..97a11c8d62 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -6,6 +6,26 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : CreateProtoService(PS_CREATEACCMGRUI, &CSteamProto::OnAccountManagerInit); InitializeCriticalSection(&this->contact_search_lock); + + // icons + wchar_t filePath[MAX_PATH]; + GetModuleFileName(g_hInstance, filePath, MAX_PATH); + + wchar_t sectionName[100]; + mir_sntprintf(sectionName, SIZEOF(sectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); + + char settingName[100]; + mir_snprintf(settingName, SIZEOF(settingName), "%s_%s", MODULE, "main"); + + SKINICONDESC sid = {0}; + sid.cbSize = sizeof(SKINICONDESC); + sid.flags = SIDF_ALL_TCHAR; + sid.ptszDefaultFile = filePath; + sid.pszName = settingName; + sid.ptszSection = sectionName; + sid.ptszDescription = LPGENT("Protocol icon"); + sid.iDefaultIndex = -IDI_STEAM; + Skin_AddIcon(&sid); } CSteamProto::~CSteamProto() @@ -149,6 +169,8 @@ int CSteamProto::SetStatus(int new_status) { m_bTerminated = true; + ForkThread(&CSteamProto::LogOutThread, NULL); + m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); @@ -164,17 +186,12 @@ int CSteamProto::SetStatus(int new_status) { if (old_status == ID_STATUS_OFFLINE/* && !this->IsOnline()*/) { - m_iStatus = ID_STATUS_CONNECTING; ForkThread(&CSteamProto::LogInThread, NULL); - - //ptrA steamId(getStringA("SteamID")); - //Steam::FriendList(m_hNetlibUser/*, token*/) - // .LoadAsync(steamId, CallbackConverter, this); } else { - /*if ( this->account->IsOnline()) + /*if (IsOnline()) { SetServerStatus(new_status); return 0; -- cgit v1.2.3