From 35b380499c87c521c4c9977c7c55bf169c6d3dfa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Nov 2015 09:05:08 +0000 Subject: fix for setting Jabber activities git-svn-id: http://svn.miranda-ng.org/main/trunk@15707 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_xstatus.cpp | 47 ++++++++++++++++---------------- protocols/JabberG/src/resource.h | 4 +-- 2 files changed, 26 insertions(+), 25 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 089ce677d6..1683992e06 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -744,19 +744,20 @@ void CPepMood::ShowSetDialog(BYTE bQuiet) replaceStrT(m_text, dlg.GetStatusText()); } - if (m_proto->m_pInfoFrame) { - if (m_mode >= 0) { - Publish(); - - UpdateMenuItem(g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag), g_arrMoods[m_mode].szName); - m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/mood", g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag), TranslateTS(g_arrMoods[m_mode].szName)); - } - else { - Retract(); - UpdateMenuItem(Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), LPGENT("Set mood...")); - m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/mood", Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), TranslateT("Set mood...")); - } + HANDLE hIcon; + TCHAR *ptszTitle; + if (m_mode >= 0) { + Publish(); + hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag); ptszTitle = TranslateTS(g_arrMoods[m_mode].szName); } + else { + Retract(); + hIcon = Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT); ptszTitle = TranslateT("Set mood..."); + } + + UpdateMenuItem(hIcon, ptszTitle); + if (m_proto->m_pInfoFrame) + m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/mood", hIcon, ptszTitle); } /////////////////////////////////////////////////////////////////////////////// @@ -1077,21 +1078,21 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec m_mode = activity; replaceStrT(m_text, szText); - HANDLE hIcon = (activity >= 0) ? g_ActivityIcons.GetIcolibHandle(returnActivity(activity)) : Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT); + HANDLE hIcon; TCHAR title[128]; - if (m_proto->m_pInfoFrame) { - if (activity >= 0) { - mir_sntprintf(title, TranslateT("Activity: %s"), activityTitle); - m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", g_ActivityIcons.GetIcolibHandle(returnActivity(activity)), activityTitle); - } - else { - mir_tstrcpy(title, LPGENT("Set activity...")); - m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), TranslateT("Set activity...")); - } + if (activity >= 0) { + mir_sntprintf(title, TranslateT("Activity: %s"), activityTitle); + hIcon = g_ActivityIcons.GetIcolibHandle(returnActivity(activity)); } - + else { + mir_tstrcpy(title, LPGENT("Set activity...")); + hIcon = Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT); + } + UpdateMenuItem(hIcon, title); + if (m_proto->m_pInfoFrame) + m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", hIcon, title); } else SetExtraIcon(hContact, activity < 0 ? NULL : returnActivity(activity)); diff --git a/protocols/JabberG/src/resource.h b/protocols/JabberG/src/resource.h index 8834602db5..4b4831e8e1 100644 --- a/protocols/JabberG/src/resource.h +++ b/protocols/JabberG/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by C:\Users\xx\Documents\Visual Studio 2010\Projects\miranda-ng\protocols\JabberG\res\jabber.rc +// Used by w:\miranda-ng\protocols\JabberG\res\jabber.rc // #define IDD_OPT_JABBER 101 #define IDI_JABBER 102 @@ -321,7 +321,7 @@ #define IDC_VALUE 3019 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 -- cgit v1.2.3