diff options
-rw-r--r-- | plugins/FingerPrintModPlus/src/fingerprint.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/crypt_icons.cpp | 2 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flags.cpp | 18 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp | 58 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flagsicons.h | 3 | ||||
-rw-r--r-- | protocols/AimOscar/src/theme.cpp | 60 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_xstatus.cpp | 8 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 5 | ||||
-rw-r--r-- | protocols/Quotes/src/ExtraImages.cpp | 13 | ||||
-rw-r--r-- | protocols/Quotes/src/IconLib.cpp | 38 | ||||
-rw-r--r-- | src/modules/extraicons/DefaultExtraIcons.cpp | 13 |
12 files changed, 81 insertions, 143 deletions
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp index 54db722e3b..8b4b542064 100644 --- a/plugins/FingerPrintModPlus/src/fingerprint.cpp +++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp @@ -165,7 +165,7 @@ int FASTCALL ApplyFingerprintImage(HANDLE hContact, LPTSTR szMirVer) if (szMirVer)
hImage = GetIconIndexFromFI(szMirVer);
- ExtraIcon_SetIcon(hExtraIcon,hContact,hImage);
+ ExtraIcon_SetIcon(hExtraIcon, hContact, hImage);
return 0;
}
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index ed0b68d15a..0c87625c07 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -47,7 +47,7 @@ HICON mode2icon(int mode,int type) { }
// обновляет иконки в clist и в messagew
-void ShowStatusIcon(HANDLE hContact,int mode)
+void ShowStatusIcon(HANDLE hContact, int mode)
{
HANDLE hMC = getMetaContact(hContact);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index e3b59f47f8..95d0259ce4 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -235,12 +235,7 @@ static void CALLBACK SetExtraImage(LPARAM lParam) {
/* get contact's country */
int countryNumber = ServiceDetectContactOriginCountry((WPARAM)lParam,0);
- if (countryNumber != 0xFFFF || gFlagsOpts.bUseUnknownFlag) {
- char szId[20];
- mir_snprintf(szId, SIZEOF(szId), (countryNumber == 0xFFFF) ? "%s_0x%X" : "%s_%i","flags", countryNumber); /* buffer safe */
- ExtraIcon_SetIcon(hExtraIconSvc, (HANDLE)lParam, szId);
- }
- else ExtraIcon_Clear(hExtraIconSvc, (HANDLE)lParam);
+ ExtraIcon_SetIcon(hExtraIconSvc, (HANDLE)lParam, (countryNumber != 0xFFFF || gFlagsOpts.bUseUnknownFlag) ? LoadFlagHandle(countryNumber) : NULL);
}
static void CALLBACK RemoveExtraImages(LPARAM lParam)
@@ -314,8 +309,7 @@ VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB) // Flags is on
if (gFlagsOpts.bShowExtraImgFlag) {
- if(hExtraIconSvc == INVALID_HANDLE_VALUE) {
- char szId[20];
+ if (hExtraIconSvc == INVALID_HANDLE_VALUE) {
//get local langID for descIcon (try to use user local Flag as icon)
DWORD langid = 0;
int r = GetLocaleInfo(
@@ -324,13 +318,9 @@ VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB) (LPTSTR)&langid, sizeof(langid)/sizeof(TCHAR));
if (!CallService(MS_UTILS_GETCOUNTRYBYNUMBER,langid,0)) langid = 1;
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "Flags";
- ico.description = "Flags (uinfoex)";
+ char szId[20];
mir_snprintf(szId, SIZEOF(szId), (langid==0xFFFF)?"%s_0x%X":"%s_%i","flags",langid); /* buffer safe */
- ico.descIcon = szId;
- hExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
+ hExtraIconSvc = ExtraIcon_Register("Flags", "Flags (uinfoex)", szId);
if (hExtraIconSvc)
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnExtraIconSvcChanged);
}
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index d7119cd75e..fe4ce708bb 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -138,22 +138,30 @@ static int CountryNumberToBitmapIndex(int countryNumber) HICON LoadFlag(int countryNumber)
{
- char szId[20],*szCountry;
/* create identifier */
- szCountry=(char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber,0);
- if(szCountry == NULL)
- szCountry=(char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber=0xFFFF,0);
+ char *szCountry = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber,0);
+ if (szCountry == NULL)
+ szCountry = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber=0xFFFF,0);
- wsprintfA(szId,(countryNumber==0xFFFF)?"%s_0x%X":"%s_%i","flags",countryNumber); /* buffer safe */
+ char szId[20];
+ wsprintfA(szId,(countryNumber==0xFFFF) ? "%s_0x%X" : "%s_%i","flags",countryNumber); /* buffer safe */
return Skin_GetIcon(szId);
}
+HANDLE LoadFlagHandle(int countryNumber)
+{
+ if (phIconHandles == NULL)
+ return NULL;
+
+ return phIconHandles[ CountryNumberToIndex(countryNumber) ];
+}
+
int CountryNumberToIndex(int countryNumber)
{
- int i,nf=0;
- for(i=0;i<nCountriesCount;++i) {
- if(countries[i].id==countryNumber) return i;
- if(countries[i].id==0xFFFF) nf=i;
+ int nf=0;
+ for(int i=0; i < nCountriesCount; i++) {
+ if(countries[i].id == countryNumber) return i;
+ if(countries[i].id == 0xFFFF) nf=i;
}
return nf; /* Unknown */
}
@@ -382,7 +390,6 @@ VOID InitIcons() FIP->FI_Unload(dib_ico);
return;
}
- //FIP->FI_SaveU(fif,dib_ico,_T("d:\\CD-Archiv\\Miranda\\trunk\\miranda\\bin9\\Debug Unicode\\Plugins\\dib_ico.bmp"),0);
}
else {
FIP->FI_Unload(dib);
@@ -404,29 +411,22 @@ VOID InitIcons() DeleteObject(hScrBM); hScrBM = NULL;
DeleteObject(hbmMask); hbmMask = NULL;
- if(himl!=NULL) {
- phIconHandles=(HANDLE*)mir_alloc(nCountriesCount*sizeof(HANDLE));
- if(phIconHandles!=NULL) {
+ if (himl != NULL) {
+ phIconHandles = (HANDLE*)mir_alloc(nCountriesCount*sizeof(HANDLE));
+ if (phIconHandles != NULL) {
char szId[20];
- int i,index;
- SKINICONDESC skid;
-
- /* register icons */
- ZeroMemory(&skid,sizeof(skid));
- skid.cbSize = sizeof(skid);
- skid.ptszSection = LPGENT("Country Flags");
- skid.pszName = szId; // name to refer to icon when playing and in db
- //skid.pszDefaultFile = NULL; // default icon file to use
- //skid.iDefaultIndex = NULL; // index of icon in default file
- skid.cx = GetSystemMetrics(SM_CXSMICON);
- skid.cy = GetSystemMetrics(SM_CYSMICON);
- skid.flags = SIDF_SORTED|SIDF_TCHAR;
-
- for(i=0;i<nCountriesCount;++i) {
+ SKINICONDESC skid = { sizeof(skid) };
+ skid.ptszSection = LPGENT("Country Flags");
+ skid.pszName = szId; // name to refer to icon when playing and in db
+ skid.cx = GetSystemMetrics(SM_CXSMICON);
+ skid.cy = GetSystemMetrics(SM_CYSMICON);
+ skid.flags = SIDF_SORTED | SIDF_TCHAR;
+
+ for (int i=0; i < nCountriesCount; i++) {
skid.ptszDescription = mir_a2t(LPGEN(countries[i].szName));
/* create identifier */
wsprintfA(szId,(countries[i].id==0xFFFF)?"%s0x%X":"%s%i","flags_",countries[i].id); /* buffer safe */
- index = CountryNumberToBitmapIndex(countries[i].id);
+ int index = CountryNumberToBitmapIndex(countries[i].id);
/* create icon */
skid.hDefaultIcon=ImageList_ExtractIcon(NULL, himl, index);
index = CountryNumberToIndex(countries[i].id);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.h b/plugins/UserInfoEx/src/Flags/svc_flagsicons.h index 7f29330a11..2aabd00c66 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.h +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.h @@ -33,8 +33,9 @@ Last change by : $Author: ing.u.horn $ #ifndef _UINFOEX_FLAGSICONS_H_INCLUDED_
#define _UINFOEX_FLAGSICONS_H_INCLUDED_
-int CountryNumberToIndex(int countryNumber);
+int CountryNumberToIndex(int countryNumber);
HICON LoadFlag(int countryNumber);
+HANDLE LoadFlagHandle(int countryNumber);
VOID InitIcons();
//VOID SvcFlagsOnModulesLoaded();
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index b0b3fd4ec5..e31cc5d664 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -32,8 +32,9 @@ struct _tag_iconList const char* szName;
int defIconID;
const char* szSection;
+ HANDLE hIcolib;
}
-static const iconList[] =
+static iconList[] =
{
{ LPGEN("ICQ"), "icq", IDI_ICQ },
{ LPGEN("Add"), "add", IDI_ADD },
@@ -66,8 +67,6 @@ static const iconList[] = { LPGEN("Not Normal Script"), "nnorm_scrpt", IDI_NNORMALSCRIPT, LPGEN("Profile Editor") },
};
-static HANDLE hIconLibItem[SIZEOF(iconList)];
-
void InitIcons(void)
{
TCHAR szFile[MAX_PATH];
@@ -93,7 +92,7 @@ void InitIcons(void) sid.pszDescription = (char*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = Skin_AddIcon(&sid);
+ iconList[i].hIcolib = Skin_AddIcon(&sid);
}
}
@@ -106,9 +105,10 @@ HICON LoadIconEx(const char* name, bool big) HANDLE GetIconHandle(const char* name)
{
- for (unsigned i=0; i < SIZEOF(iconList); i++)
- if (strcmp(iconList[i].szName, name) == 0)
- return hIconLibItem[i];
+ for (int i=0; i < SIZEOF(iconList); i++)
+ if ( !strcmp(iconList[i].szName, name))
+ return iconList[i].hIcolib;
+
return NULL;
}
@@ -156,31 +156,12 @@ static const char* extra_ES_icon_name[2] = "hiptop",
};
-static HANDLE extra_AT_icon_handle[5];
-static HANDLE extra_ES_icon_handle[2];
-
-static void clear_AT_icon(HANDLE hContact)
-{
- ExtraIcon_Clear(hExtraAT, hContact);
-}
-
-static void clear_ES_icon(HANDLE hContact)
-{
- ExtraIcon_Clear(hExtraES, hContact);
-}
-
static void set_AT_icon(CAimProto* ppro, HANDLE hContact)
{
if (ppro->getByte(hContact, "ChatRoom", 0)) return;
unsigned i = ppro->getByte(hContact, AIM_KEY_AC, 0) - 1;
-
- if (i < 5) {
- char name[64];
- mir_snprintf(name, sizeof(name), "AIM_%s", extra_AT_icon_name[i]);
- ExtraIcon_SetIcon(hExtraAT, hContact, name);
- }
- else ExtraIcon_Clear(hExtraAT, hContact);
+ ExtraIcon_SetIcon(hExtraAT, hContact, (i < 5) ? GetIconHandle(extra_AT_icon_name[i]) : NULL);
}
static void set_ES_icon(CAimProto* ppro, HANDLE hContact)
@@ -188,13 +169,7 @@ static void set_ES_icon(CAimProto* ppro, HANDLE hContact) if (ppro->getByte(hContact, "ChatRoom", 0)) return;
unsigned i = ppro->getByte(hContact, AIM_KEY_ET, 0) - 1;
-
- if (i < 2) {
- char name[64];
- mir_snprintf(name, sizeof(name), "AIM_%s", extra_ES_icon_name[i]);
- ExtraIcon_SetIcon(hExtraES, hContact, name);
- }
- else ExtraIcon_Clear(hExtraES, hContact);
+ ExtraIcon_SetIcon(hExtraAT, hContact, (i < 2) ? GetIconHandle(extra_ES_icon_name[i]) : NULL);
}
void set_contact_icon(CAimProto* ppro, HANDLE hContact)
@@ -206,10 +181,9 @@ void set_contact_icon(CAimProto* ppro, HANDLE hContact) void remove_AT_icons(CAimProto* ppro)
{
HANDLE hContact = db_find_first();
- while (hContact)
- {
+ while (hContact) {
if (ppro->is_my_contact(hContact) && !ppro->getByte(hContact, "ChatRoom", 0))
- clear_AT_icon(hContact);
+ ExtraIcon_Clear(hExtraAT, hContact);
hContact = db_find_next(hContact);
}
@@ -218,10 +192,10 @@ void remove_AT_icons(CAimProto* ppro) void remove_ES_icons(CAimProto* ppro)
{
HANDLE hContact = db_find_first();
- while (hContact)
- {
+ while (hContact) {
if (ppro->is_my_contact(hContact) && !ppro->getByte(hContact, "ChatRoom", 0))
- clear_ES_icon(hContact);
+ ExtraIcon_Clear(hExtraES, hContact);
+
hContact = db_find_next(hContact);
}
}
@@ -229,8 +203,7 @@ void remove_ES_icons(CAimProto* ppro) void add_AT_icons(CAimProto* ppro)
{
HANDLE hContact = db_find_first();
- while (hContact)
- {
+ while (hContact) {
if (ppro->is_my_contact(hContact))
set_AT_icon(ppro, hContact);
@@ -241,8 +214,7 @@ void add_AT_icons(CAimProto* ppro) void add_ES_icons(CAimProto* ppro)
{
HANDLE hContact = db_find_first();
- while (hContact)
- {
+ while (hContact) {
if (ppro->is_my_contact(hContact))
set_ES_icon(ppro, hContact);
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index ab612f30b3..9802b1dee7 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -182,13 +182,7 @@ void releaseXStatusIcon(int bStatus, UINT flags) void setContactExtraIcon(HANDLE hContact, int xstatus)
{
- if (xstatus <= 0)
- ExtraIcon_Clear(hExtraXStatus, hContact);
- else {
- char szTemp[MAX_PATH];
- null_snprintf(szTemp, sizeof(szTemp), "icq_xstatus%d", xstatus-1);
- ExtraIcon_SetIcon(hExtraXStatus, hContact, szTemp);
- }
+ ExtraIcon_SetIcon(hExtraXStatus, hContact, (xstatus > 0) ? hXStatusIcons[xstatus-1]->Handle() : NULL);
}
#define NULLCAP {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 7c96e536f1..4f6e625fcd 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -683,7 +683,7 @@ void CPepMood::ResetExtraIcon(HANDLE hContact) void CPepMood::SetExtraIcon(HANDLE hContact, char *szMood)
{
- ExtraIcon_SetIcon(hExtraMood, hContact, szMood == NULL ? NULL : g_MoodIcons.GetIcolibName(szMood));
+ ExtraIcon_SetIcon(hExtraMood, hContact, szMood == NULL ? NULL : g_MoodIcons.GetIcolibHandle(szMood));
}
void CPepMood::SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText)
@@ -1075,7 +1075,7 @@ void CPepActivity::ResetExtraIcon(HANDLE hContact) void CPepActivity::SetExtraIcon(HANDLE hContact, char *szActivity)
{
- ExtraIcon_SetIcon(hExtraActivity, hContact, szActivity == NULL ? NULL : g_ActivityIcons.GetIcolibName(szActivity));
+ ExtraIcon_SetIcon(hExtraActivity, hContact, szActivity == NULL ? NULL : g_ActivityIcons.GetIcolibHandle(szActivity));
}
void CPepActivity::SetActivity(HANDLE hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText)
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 07ed22270d..5c6905df7e 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -1153,11 +1153,6 @@ void CMraProto::CListShowMenuItem(HANDLE hMenuItem, BOOL bShow) CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&mi);
}
-int ExtraSetIcon(HANDLE hExtraIcon, HANDLE hContact, HANDLE hImage)
-{
- return ExtraIcon_SetIcon(hExtraIcon, hContact, hImage);
-}
-
size_t CopyNumber(LPCVOID lpcOutBuff, LPCVOID lpcBuff, size_t dwLen)
{
BYTE btChar;
diff --git a/protocols/Quotes/src/ExtraImages.cpp b/protocols/Quotes/src/ExtraImages.cpp index 1fbc6d21ff..a89032e53c 100644 --- a/protocols/Quotes/src/ExtraImages.cpp +++ b/protocols/Quotes/src/ExtraImages.cpp @@ -7,6 +7,7 @@ #include "IQuotesProvider.h"
#include "Log.h"
#include "DBUtils.h"
+#include "resource.h"
CExtraImages::CExtraImages() :
m_hExtraIcons(ExtraIcon_Register(ICON_STR_QUOTE,QUOTES_PROTOCOL_NAME,Quotes_MakeIconName(ICON_STR_MAIN).c_str())),
@@ -36,19 +37,21 @@ bool CExtraImages::SetContactExtraImage(HANDLE hContact,EImageIndex nIndex)const if (!m_hExtraIcons)
return false;
- std::string sIconName;
+ HANDLE hIcolib;
switch(nIndex) {
case eiUp:
- sIconName = Quotes_MakeIconName(ICON_STR_QUOTE_UP);
+ hIcolib = Quotes_GetIconHandle(IDI_ICON_UP);
break;
case eiDown:
- sIconName = Quotes_MakeIconName(ICON_STR_QUOTE_DOWN);
+ hIcolib = Quotes_GetIconHandle(IDI_ICON_DOWN);
break;
case eiNotChanged:
- sIconName = Quotes_MakeIconName(ICON_STR_QUOTE_NOT_CHANGED);
+ hIcolib = Quotes_GetIconHandle(IDI_ICON_NOTCHANGED);
break;
+ default:
+ hIcolib = NULL;
}
- return (0 == ExtraIcon_SetIcon(m_hExtraIcons,hContact,sIconName.c_str()));
+ return ExtraIcon_SetIcon(m_hExtraIcons, hContact, hIcolib) == 0;
}
int QuotesEventFunc_onExtraImageApply(WPARAM wp,LPARAM lp)
diff --git a/protocols/Quotes/src/IconLib.cpp b/protocols/Quotes/src/IconLib.cpp index 530d1defd3..9ac96599a5 100644 --- a/protocols/Quotes/src/IconLib.cpp +++ b/protocols/Quotes/src/IconLib.cpp @@ -17,26 +17,25 @@ namespace {
struct CIconList
{
- TCHAR* szDescr;
+ TCHAR* szDescr;
char* szName;
int defIconID;
-// TCHAR* szSection;
HANDLE hIconLibItem;
};
CIconList iconList[] =
{
- {_T("Protocol icon"),ICON_STR_MAIN,IDI_ICON_MAIN},
- {_T("Quote/Rate up"),ICON_STR_QUOTE_UP,IDI_ICON_UP},
- {_T("Quote/Rate down"),ICON_STR_QUOTE_DOWN,IDI_ICON_DOWN},
- {_T("Quote/Rate not changed"),ICON_STR_QUOTE_NOT_CHANGED,IDI_ICON_NOTCHANGED},
- {_T("Quote Section"),ICON_STR_SECTION,IDI_ICON_SECTION},
- {_T("Quote"),ICON_STR_QUOTE,IDI_ICON_QUOTE},
- {_T("Currency Converter"),ICON_STR_CURRENCY_CONVERTER,IDI_ICON_CURRENCY_CONVERTER},
- {_T("Refresh"),ICON_STR_REFRESH,IDI_ICON_REFRESH},
- {_T("Export"),ICON_STR_EXPORT,IDI_ICON_EXPORT},
- {_T("Swap button"),ICON_STR_SWAP,IDI_ICON_SWAP},
- {_T("Import"),ICON_STR_IMPORT,IDI_ICON_IMPORT},
+ { _T("Protocol icon"), ICON_STR_MAIN, IDI_ICON_MAIN },
+ { _T("Quote/Rate up"), ICON_STR_QUOTE_UP, IDI_ICON_UP },
+ { _T("Quote/Rate down"), ICON_STR_QUOTE_DOWN, IDI_ICON_DOWN },
+ { _T("Quote/Rate not changed"), ICON_STR_QUOTE_NOT_CHANGED, IDI_ICON_NOTCHANGED },
+ { _T("Quote Section"), ICON_STR_SECTION, IDI_ICON_SECTION },
+ { _T("Quote"), ICON_STR_QUOTE, IDI_ICON_QUOTE },
+ { _T("Currency Converter"), ICON_STR_CURRENCY_CONVERTER, IDI_ICON_CURRENCY_CONVERTER },
+ { _T("Refresh"), ICON_STR_REFRESH, IDI_ICON_REFRESH },
+ { _T("Export"), ICON_STR_EXPORT, IDI_ICON_EXPORT },
+ { _T("Swap button"), ICON_STR_SWAP, IDI_ICON_SWAP },
+ { _T("Import"), ICON_STR_IMPORT, IDI_ICON_IMPORT }
};
}
@@ -54,18 +53,7 @@ void Quotes_IconsInit() sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = A2T(QUOTES_PROTOCOL_NAME);
-// TCHAR* szRootSection = TranslateTS(A2T(QUOTES_PROTOCOL_NAME));
-
- for ( int i = 0; i < SIZEOF(iconList); i++ )
- {
-// char szSettingName[100];
-// TCHAR szSectionName[100];
-// mir_snprintf( szSettingName, sizeof( szSettingName ),"%s_%s",QUOTES_PROTOCOL_NAME, iconList[i].szName );
-// {
-// mir_sntprintf( szSectionName, SIZEOF( szSectionName ),_T("%s/%s"), TranslateT("Protocols"), szRootSection);
-// sid.ptszSection = szSectionName;
-// }
-
+ for (int i = 0; i < SIZEOF(iconList); i++) {
std::string sName = Quotes_MakeIconName( iconList[i].szName);
sid.pszName = const_cast<char*>(sName.c_str());
sid.ptszDescription = iconList[i].szDescr;
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp index 5a7917a331..5e5c3da926 100644 --- a/src/modules/extraicons/DefaultExtraIcons.cpp +++ b/src/modules/extraicons/DefaultExtraIcons.cpp @@ -76,23 +76,18 @@ static void SetVisibility(HANDLE hContact, int apparentMode, BOOL clear) if (apparentMode == ID_STATUS_OFFLINE)
ico = "ChatActivity";
- if (ico == NULL && !clear)
- return;
-
- ExtraIcon_SetIcon(hExtraChat, hContact, ico);
+ if (ico != NULL || clear)
+ ExtraIcon_SetIcon(hExtraChat, hContact, ico);
}
else {
// Not chat
if (apparentMode == ID_STATUS_OFFLINE)
ico = "core_main_47";
-
else if (apparentMode == ID_STATUS_ONLINE)
ico = "core_main_46";
- if (ico == NULL && !clear)
- return;
-
- ExtraIcon_SetIcon(hExtraVisibility, hContact, ico);
+ if (ico != NULL || clear)
+ ExtraIcon_SetIcon(hExtraVisibility, hContact, ico);
}
}
|