diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-19 14:06:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-19 14:06:55 +0000 |
commit | 0a4edf42be37bf12786e668837488ce074f476f2 (patch) | |
tree | e2d4e17f25dc357e1d6bb0bdc15476f3ca148567 /protocols/Quotes | |
parent | 32dedc767dec565c576b78b786e7a95d76ac806e (diff) |
more cleaning of icons' names
git-svn-id: http://svn.miranda-ng.org/main/trunk@2372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Quotes')
-rw-r--r-- | protocols/Quotes/src/ExtraImages.cpp | 13 | ||||
-rw-r--r-- | protocols/Quotes/src/IconLib.cpp | 38 |
2 files changed, 21 insertions, 30 deletions
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;
|