From 56bdae442699a6defb1b783ed4d8e81824acf8de Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 May 2019 14:12:44 +0300 Subject: all icons with keys replaced with skin password icon SKINICON_OTHER_KEYS --- plugins/Db3x_mmap/res/db3x_mmap.rc | 1 - plugins/Db3x_mmap/res/pass.ico | Bin 1150 -> 0 bytes plugins/Db3x_mmap/src/resource.h | 1 - plugins/Db3x_mmap/src/stdafx.h | 1 + plugins/Db3x_mmap/src/ui.cpp | 5 +- plugins/Dbx_mdbx/res/dbx_mdbx.rc | 1 - plugins/Dbx_mdbx/src/dbcrypt.cpp | 142 +++++++++++++++- plugins/Dbx_mdbx/src/resource.h | 2 - plugins/Dbx_mdbx/src/stdafx.h | 1 + plugins/Dbx_mdbx/src/ui.cpp | 66 +++++++- plugins/Dbx_mdbx/src/ui.h | 183 --------------------- plugins/NewStory/src/history.cpp | 86 ++++------ plugins/NewStory/src/icons.cpp | 62 ------- plugins/NewStory/src/icons.h | 7 - plugins/NewStory/src/main.cpp | 57 ++++--- plugins/NewStory/src/opt_passwords.cpp | 10 +- plugins/NewStory/src/stdafx.h | 1 - plugins/NewStory/src/templates.cpp | 22 +-- plugins/UserInfoEx/IconPacks/default/res/icons.rc | 1 - .../UserInfoEx/IconPacks/default/res/icons_z2.rc | 1 - plugins/UserInfoEx/IconPacks/default/src/icons.h | 1 - plugins/UserInfoEx/IconPacks/ice/res/icons.rc | 1 - plugins/UserInfoEx/IconPacks/ice/res/icons_z2.rc | 1 - plugins/UserInfoEx/IconPacks/ice/src/icons.h | 1 - plugins/UserInfoEx/src/mir_icolib.cpp | 1 - 25 files changed, 289 insertions(+), 366 deletions(-) delete mode 100644 plugins/Db3x_mmap/res/pass.ico delete mode 100644 plugins/NewStory/src/icons.cpp delete mode 100644 plugins/NewStory/src/icons.h (limited to 'plugins') diff --git a/plugins/Db3x_mmap/res/db3x_mmap.rc b/plugins/Db3x_mmap/res/db3x_mmap.rc index 6e0e6b9916..7b810e2ded 100644 --- a/plugins/Db3x_mmap/res/db3x_mmap.rc +++ b/plugins/Db3x_mmap/res/db3x_mmap.rc @@ -162,7 +162,6 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICONPASS ICON "pass.ico" IDI_LOGO ICON "logo.ico" #ifdef APSTUDIO_INVOKED diff --git a/plugins/Db3x_mmap/res/pass.ico b/plugins/Db3x_mmap/res/pass.ico deleted file mode 100644 index dc47a6ed4f..0000000000 Binary files a/plugins/Db3x_mmap/res/pass.ico and /dev/null differ diff --git a/plugins/Db3x_mmap/src/resource.h b/plugins/Db3x_mmap/src/resource.h index fae04bf51b..f0734b5662 100644 --- a/plugins/Db3x_mmap/src/resource.h +++ b/plugins/Db3x_mmap/src/resource.h @@ -3,7 +3,6 @@ // Используется D:\Others\SVN\MirandaNG\trunk\plugins\Db3x_mmap\res\db3x_mmap.rc // #define IDREMOVE 3 -#define IDI_ICONPASS 100 #define IDI_LOGO 101 #define IDD_LOGIN 102 #define IDD_NEWPASS 103 diff --git a/plugins/Db3x_mmap/src/stdafx.h b/plugins/Db3x_mmap/src/stdafx.h index e80a1d79db..1d469c058f 100644 --- a/plugins/Db3x_mmap/src/stdafx.h +++ b/plugins/Db3x_mmap/src/stdafx.h @@ -46,6 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include #include diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index 270006ac20..610d378321 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -34,8 +34,7 @@ struct DlgChangePassParam static IconItem iconList[] = { - { LPGEN("Logo"), "logo", IDI_LOGO }, - { LPGEN("Password"), "password", IDI_ICONPASS } + { LPGEN("Logo"), "logo", IDI_LOGO } }; static HGENMENU hSetPwdMenu; @@ -315,7 +314,7 @@ static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM) void CDb3Mmap::UpdateMenuItem() { - Menu_ModifyItem(hSetPwdMenu, GetMenuTitle(), iconList[1].hIcolib); + Menu_ModifyItem(hSetPwdMenu, GetMenuTitle(), Skin_GetIconHandle(SKINICON_OTHER_KEYS)); } static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) diff --git a/plugins/Dbx_mdbx/res/dbx_mdbx.rc b/plugins/Dbx_mdbx/res/dbx_mdbx.rc index 0f2318f884..81d739e697 100644 --- a/plugins/Dbx_mdbx/res/dbx_mdbx.rc +++ b/plugins/Dbx_mdbx/res/dbx_mdbx.rc @@ -106,7 +106,6 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ICONPASS ICON "pass.ico" IDI_LOGO ICON "logo.ico" IDI_COMPACT ICON "compact.ico" diff --git a/plugins/Dbx_mdbx/src/dbcrypt.cpp b/plugins/Dbx_mdbx/src/dbcrypt.cpp index 47bf3c3e34..eafbf7e6e8 100644 --- a/plugins/Dbx_mdbx/src/dbcrypt.cpp +++ b/plugins/Dbx_mdbx/src/dbcrypt.cpp @@ -23,7 +23,59 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -///////////////////////////////////////////////////////////////////////////////////////// +class CSelectCryptoDialog : public CDlgBase +{ + CCtrlCombo m_combo; + CCtrlData m_descr; + CCtrlCheck m_chkTotalCrypt; + CRYPTO_PROVIDER **m_provs; + size_t m_provscount; + CRYPTO_PROVIDER *m_selected; + bool m_bTotalEncryption; + + bool OnInitDialog() override + { + for (size_t i = 0; i < m_provscount; i++) { + CRYPTO_PROVIDER *prov = m_provs[i]; + m_combo.AddStringA(prov->pszName, i); + } + m_combo.SetCurSel(0); + m_descr.SetText(m_provs[0]->szDescr.w); + return true; + } + + bool OnClose() override + { + m_selected = m_provs[m_combo.GetItemData(m_combo.GetCurSel())]; + m_bTotalEncryption = m_chkTotalCrypt.GetState() != 0; + return true; + } + + void OnComboChanged(CCtrlCombo*) + { + m_descr.SetText(m_provs[m_combo.GetItemData(m_combo.GetCurSel())]->szDescr.w); + } + +public: + CSelectCryptoDialog(CRYPTO_PROVIDER **provs, size_t count) : + CDlgBase(g_plugin, IDD_SELECT_CRYPTOPROVIDER), + m_combo(this, IDC_SELECTCRYPT_COMBO), + m_descr(this, IDC_CRYPTOPROVIDER_DESCR), + m_chkTotalCrypt(this, IDC_CHECK_TOTALCRYPT), + m_provs(provs), + m_provscount(count), + m_selected(nullptr) + { + m_combo.OnChange = Callback(this, &CSelectCryptoDialog::OnComboChanged); + } + + inline CRYPTO_PROVIDER* GetSelected() + { return m_selected; + } + inline bool TotalSelected() + { return m_bTotalEncryption; + } +}; char DBKey_Crypto_Provider[] = "Provider"; char DBKey_Crypto_Key[] = "Key"; @@ -66,6 +118,85 @@ CRYPTO_PROVIDER* CDbxMDBX::SelectProvider() return pProv; } +///////////////////////////////////////////////////////////////////////////////////////// + +class CEnterPasswordDialog : public CDlgBase +{ + CCtrlData m_header; + CCtrlData m_language; + CCtrlEdit m_passwordEdit; + CCtrlButton m_buttonOK; + + friend class CDbxMDBX; + CDbxMDBX *m_db; + TCHAR m_newPass[100]; + unsigned short m_wrongPass = 0; + + INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override + { + if (msg == WM_TIMER) { + UINT_PTR LangID = (UINT_PTR)GetKeyboardLayout(0); + char Lang[3] = { 0 }; + GetLocaleInfoA(MAKELCID((LangID & 0xffffffff), SORT_DEFAULT), LOCALE_SABBREVLANGNAME, Lang, 2); + Lang[0] = toupper(Lang[0]); + Lang[1] = tolower(Lang[1]); + m_language.SetTextA(Lang); + return FALSE; + } + else if (msg == WM_CTLCOLORSTATIC) { + if ((HWND)lParam == m_language.GetHwnd()) { + SetTextColor((HDC)wParam, GetSysColor(COLOR_HIGHLIGHTTEXT)); + SetBkMode((HDC)wParam, TRANSPARENT); + return (INT_PTR)GetSysColorBrush(COLOR_HIGHLIGHT); + } + } + return CDlgBase::DlgProc(msg, wParam, lParam); + } + + bool OnInitDialog() override + { + m_header.SendMsg(WM_SETICON, ICON_SMALL, (LPARAM)g_plugin.getIcon(IDI_LOGO, true)); + + if (m_wrongPass) { + if (m_wrongPass > 2) { + m_passwordEdit.Disable(); + m_buttonOK.Disable(); + m_header.SetText(TranslateT("Too many errors!")); + } + else m_header.SetText(TranslateT("Password is not correct!")); + } + else m_header.SetText(TranslateT("Please type in your password")); + + SetTimer(m_hwnd, 1, 200, nullptr); + return true; + } + + void OnDestroy() override + { + KillTimer(m_hwnd, 1); + Window_FreeIcon_IcoLib(m_header.GetHwnd()); + } + + void OnOK(CCtrlButton*) + { + m_passwordEdit.GetText(m_newPass, _countof(m_newPass)); + EndDialog(m_hwnd, -128); + } + +public: + CEnterPasswordDialog(CDbxMDBX *db) : + CDlgBase(g_plugin, IDD_LOGIN), + m_header(this, IDC_HEADERBAR), + m_language(this, IDC_LANG), + m_passwordEdit(this, IDC_USERPASS), + m_buttonOK(this, IDOK), + m_db(db) + { + m_newPass[0] = 0; + m_buttonOK.OnClick = Callback(this, &CEnterPasswordDialog::OnOK); + } +}; + int CDbxMDBX::InitCrypt() { if (m_crypto != nullptr) @@ -91,18 +222,17 @@ int CDbxMDBX::InitCrypt() key.iov_len = sizeof(DBKey_Crypto_Key); key.iov_base = DBKey_Crypto_Key; if (mdbx_get(txn, m_dbCrypto, &key, &value) == MDBX_SUCCESS && (value.iov_len == m_crypto->getKeyLength())) { if (!m_crypto->setKey((const BYTE*)value.iov_base, value.iov_len)) { - DlgChangePassParam param = { this }; - CEnterPasswordDialog dlg(¶m); + CEnterPasswordDialog dlg(this); while (true) { if (-128 != dlg.DoModal()) return 4; - m_crypto->setPassword(pass_ptrA(mir_utf8encodeW(param.newPass))); + m_crypto->setPassword(pass_ptrA(mir_utf8encodeW(dlg.m_newPass))); if (m_crypto->setKey((const BYTE*)value.iov_base, value.iov_len)) { m_bUsesPassword = true; - SecureZeroMemory(¶m, sizeof(param)); + SecureZeroMemory(&dlg.m_newPass, sizeof(dlg.m_newPass)); break; } - param.wrongPass++; + dlg.m_wrongPass++; } } } diff --git a/plugins/Dbx_mdbx/src/resource.h b/plugins/Dbx_mdbx/src/resource.h index ac0d874da2..dfc3ffc748 100644 --- a/plugins/Dbx_mdbx/src/resource.h +++ b/plugins/Dbx_mdbx/src/resource.h @@ -3,7 +3,6 @@ // Используется d:\Others\SVN\MirandaNG\trunk\plugins\Dbx_mdb\res\dbx_mdbx.rc // #define IDREMOVE 3 -#define IDI_ICONPASS 100 #define IDI_LOGO 101 #define IDD_LOGIN 102 #define IDD_NEWPASS 103 @@ -21,7 +20,6 @@ #define IDC_TOTAL 1008 #define IDC_SELECTCRYPT_COMBO 1010 #define IDC_CRYPTOPROVIDER_DESCR 1011 -#define IDC_CHECK1 1012 #define IDC_CHECK_TOTALCRYPT 1012 // Next default values for new objects diff --git a/plugins/Dbx_mdbx/src/stdafx.h b/plugins/Dbx_mdbx/src/stdafx.h index 1d01db9c12..f2e2c2f6e1 100644 --- a/plugins/Dbx_mdbx/src/stdafx.h +++ b/plugins/Dbx_mdbx/src/stdafx.h @@ -50,6 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include "../../Libs/libmdbx/src/mdbx.h" diff --git a/plugins/Dbx_mdbx/src/ui.cpp b/plugins/Dbx_mdbx/src/ui.cpp index 7740130a9c..aa32b95ccf 100644 --- a/plugins/Dbx_mdbx/src/ui.cpp +++ b/plugins/Dbx_mdbx/src/ui.cpp @@ -39,7 +39,6 @@ void LanguageChanged(HWND hwndDlg) } } - ///////////////////////////////////////////////////////////////////////////////////////// static bool CheckOldPassword(HWND hwndDlg, CDbxMDBX *db) @@ -58,6 +57,13 @@ static bool CheckOldPassword(HWND hwndDlg, CDbxMDBX *db) return true; } +struct DlgChangePassParam +{ + CDbxMDBX *db; + TCHAR newPass[100]; + unsigned short wrongPass; +}; + static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { DlgChangePassParam *param = (DlgChangePassParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -66,7 +72,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam switch (uMsg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - SendDlgItemMessage(hwndDlg, IDC_HEADERBAR, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(iconList[0].hIcolib, true)); + SendDlgItemMessage(hwndDlg, IDC_HEADERBAR, WM_SETICON, ICON_SMALL, (LPARAM)g_plugin.getIcon(IDI_LOGO, true)); param = (DlgChangePassParam*)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); @@ -136,7 +142,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam case WM_DESTROY: KillTimer(hwndDlg, 1); - IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0)); + Window_FreeIcon_IcoLib(GetDlgItem(hwndDlg, IDC_HEADERBAR)); } return FALSE; @@ -160,6 +166,48 @@ static INT_PTR CompactMe(void* obj, WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// +class COptionsDialog : public CDlgBase +{ + CCtrlCheck m_chkStandart; + CCtrlCheck m_chkTotal; + CCtrlButton m_btnChangePass; + CDbxMDBX *m_db; + + bool OnInitDialog() override + { + m_chkStandart.SetState(!m_db->isEncrypted()); + m_chkTotal.SetState(m_db->isEncrypted()); + m_btnChangePass.SetTextA(Translate(m_db->GetMenuTitle())); + return true; + } + + bool OnApply() override + { + SetCursor(LoadCursor(nullptr, IDC_WAIT)); + m_db->EnableEncryption(m_chkTotal.GetState() != 0); + SetCursor(LoadCursor(nullptr, IDC_ARROW)); + m_chkStandart.SetState(!m_db->isEncrypted()); + m_chkTotal.SetState(m_db->isEncrypted()); + return true; + } + + void ChangePass(CCtrlButton*) + { + CallService(MS_DB_CHANGEPASSWORD, 0, 0); + } + +public: + COptionsDialog(CDbxMDBX *db) : + CDlgBase(g_plugin, IDD_OPTIONS), + m_chkStandart(this, IDC_STANDARD), + m_chkTotal(this, IDC_TOTAL), + m_btnChangePass(this, IDC_USERPASS), + m_db(db) + { + m_btnChangePass.OnClick = Callback(this, &COptionsDialog::ChangePass); + } +}; + static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; @@ -173,9 +221,15 @@ static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// +static IconItem iconList[] = +{ + { LPGEN("Logo"), "logo", IDI_LOGO }, + { LPGEN("Compact"), "compact", IDI_COMPACT } +}; + void CDbxMDBX::UpdateMenuItem() { - Menu_ModifyItem(hSetPwdMenu, _A2T(GetMenuTitle()), iconList[1].hIcolib); + Menu_ModifyItem(hSetPwdMenu, _A2T(GetMenuTitle()), Skin_GetIconHandle(SKINICON_OTHER_KEYS)); } static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) @@ -194,14 +248,14 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e); mi.position = 1000000001; - mi.hIcolibItem = iconList[1].hIcolib; + mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_KEYS); mi.name.a = db->GetMenuTitle(); mi.pszService = MS_DB_CHANGEPASSWORD; hSetPwdMenu = Menu_AddMainMenuItem(&mi); SET_UID(mi, 0x98c0caf3, 0xBfe5, 0x4e31, 0xac, 0xf0, 0xab, 0x95, 0xb2, 0x9b, 0x9f, 0x73); mi.position++; - mi.hIcolibItem = iconList[2].hIcolib; + mi.hIcolibItem = iconList[1].hIcolib; mi.name.a = LPGEN("Compact"); mi.pszService = MS_DB_COMPACT; hSetPwdMenu = Menu_AddMainMenuItem(&mi); diff --git a/plugins/Dbx_mdbx/src/ui.h b/plugins/Dbx_mdbx/src/ui.h index 8ed9c0b1c3..832146ea33 100644 --- a/plugins/Dbx_mdbx/src/ui.h +++ b/plugins/Dbx_mdbx/src/ui.h @@ -1,187 +1,4 @@ #pragma once -static IconItem iconList[] = -{ - { LPGEN("Logo"), "logo", IDI_LOGO }, - { LPGEN("Password"), "password", IDI_ICONPASS }, - { LPGEN("Compact"), "compact", IDI_COMPACT } -}; - #define MS_DB_CHANGEPASSWORD "DB/UI/ChangePassword" #define MS_DB_COMPACT "DB/UI/Compact" - -class COptionsDialog : public CDlgBase -{ - CCtrlCheck m_chkStandart; - CCtrlCheck m_chkTotal; - CCtrlButton m_btnChangePass; - CDbxMDBX *m_db; - - bool OnInitDialog() override - { - m_chkStandart.SetState(!m_db->isEncrypted()); - m_chkTotal.SetState(m_db->isEncrypted()); - m_btnChangePass.SetTextA(Translate(m_db->GetMenuTitle())); - return true; - } - - bool OnApply() override - { - SetCursor(LoadCursor(nullptr, IDC_WAIT)); - m_db->EnableEncryption(m_chkTotal.GetState() != 0); - SetCursor(LoadCursor(nullptr, IDC_ARROW)); - m_chkStandart.SetState(!m_db->isEncrypted()); - m_chkTotal.SetState(m_db->isEncrypted()); - return true; - } - - void ChangePass(CCtrlButton*) - { - CallService(MS_DB_CHANGEPASSWORD, 0, 0); - } - -public: - COptionsDialog(CDbxMDBX *db) : - CDlgBase(g_plugin, IDD_OPTIONS), - m_chkStandart(this, IDC_STANDARD), - m_chkTotal(this, IDC_TOTAL), - m_btnChangePass(this, IDC_USERPASS), - m_db(db) - { - m_btnChangePass.OnClick = Callback(this, &COptionsDialog::ChangePass); - } -}; - -class CSelectCryptoDialog : public CDlgBase -{ - CCtrlCombo m_combo; - CCtrlData m_descr; - CCtrlCheck m_chkTotalCrypt; - CRYPTO_PROVIDER **m_provs; - size_t m_provscount; - CRYPTO_PROVIDER *m_selected; - bool m_bTotalEncryption; - - bool OnInitDialog() override - { - for (size_t i = 0; i < m_provscount; i++) { - CRYPTO_PROVIDER *prov = m_provs[i]; - m_combo.AddStringA(prov->pszName, i); - } - m_combo.SetCurSel(0); - m_descr.SetText(m_provs[0]->szDescr.w); - return true; - } - - bool OnClose() override - { - m_selected = m_provs[m_combo.GetItemData(m_combo.GetCurSel())]; - m_bTotalEncryption = m_chkTotalCrypt.GetState() != 0; - return true; - } - - void OnComboChanged(CCtrlCombo*) - { - m_descr.SetText(m_provs[m_combo.GetItemData(m_combo.GetCurSel())]->szDescr.w); - } - -public: - CSelectCryptoDialog(CRYPTO_PROVIDER **provs, size_t count) : - CDlgBase(g_plugin, IDD_SELECT_CRYPTOPROVIDER), - m_combo(this, IDC_SELECTCRYPT_COMBO), - m_descr(this, IDC_CRYPTOPROVIDER_DESCR), - m_chkTotalCrypt(this, IDC_CHECK_TOTALCRYPT), - m_provs(provs), - m_provscount(count), - m_selected(nullptr) - { - m_combo.OnChange = Callback(this, &CSelectCryptoDialog::OnComboChanged); - } - - inline CRYPTO_PROVIDER* GetSelected() - { - return m_selected; - } - inline bool TotalSelected() - { - return m_bTotalEncryption; - } -}; - -struct DlgChangePassParam -{ - CDbxMDBX *db; - TCHAR newPass[100]; - unsigned short wrongPass; -}; - -class CEnterPasswordDialog : public CDlgBase -{ - CCtrlData m_header; - CCtrlData m_language; - CCtrlEdit m_passwordEdit; - CCtrlButton m_buttonOK; - - DlgChangePassParam *m_param; - - INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override - { - if (msg == WM_TIMER) { - UINT_PTR LangID = (UINT_PTR)GetKeyboardLayout(0); - char Lang[3] = { 0 }; - GetLocaleInfoA(MAKELCID((LangID & 0xffffffff), SORT_DEFAULT), LOCALE_SABBREVLANGNAME, Lang, 2); - Lang[0] = toupper(Lang[0]); - Lang[1] = tolower(Lang[1]); - m_language.SetTextA(Lang); - return FALSE; - } - else if (msg == WM_CTLCOLORSTATIC) { - if ((HWND)lParam == m_language.GetHwnd()) { - SetTextColor((HDC)wParam, GetSysColor(COLOR_HIGHLIGHTTEXT)); - SetBkMode((HDC)wParam, TRANSPARENT); - return (INT_PTR)GetSysColorBrush(COLOR_HIGHLIGHT); - } - } - return CDlgBase::DlgProc(msg, wParam, lParam); - } - - bool OnInitDialog() override - { - m_header.SendMsg(WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(iconList[0].defIconID))); - if (m_param->wrongPass) { - if (m_param->wrongPass > 2) { - m_passwordEdit.Disable(); - m_buttonOK.Disable(); - m_header.SetText(TranslateT("Too many errors!")); - } - else m_header.SetText(TranslateT("Password is not correct!")); - } - else m_header.SetText(TranslateT("Please type in your password")); - - SetTimer(m_hwnd, 1, 200, nullptr); - return true; - } - - void OnDestroy() override - { - KillTimer(m_hwnd, 1); - } - - void OnOK(CCtrlButton*) - { - m_passwordEdit.GetText(m_param->newPass, _countof(m_param->newPass)); - EndDialog(m_hwnd, -128); - } - -public: - CEnterPasswordDialog(DlgChangePassParam *param) : - CDlgBase(g_plugin, IDD_LOGIN), - m_header(this, IDC_HEADERBAR), - m_language(this, IDC_LANG), - m_passwordEdit(this, IDC_USERPASS), - m_buttonOK(this, IDOK), - m_param(param) - { - m_buttonOK.OnClick = Callback(this, &CEnterPasswordDialog::OnOK); - } -}; diff --git a/plugins/NewStory/src/history.cpp b/plugins/NewStory/src/history.cpp index cb1dd3d2c3..16ef59df54 100644 --- a/plugins/NewStory/src/history.cpp +++ b/plugins/NewStory/src/history.cpp @@ -569,21 +569,15 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SetWindowText(hwnd, title); free(title); } - else - if (data->hContact == INVALID_CONTACT_ID) { + else { + if (data->hContact == INVALID_CONTACT_ID) SetWindowText(hwnd, TranslateT("Newstory Search Results")); - } - else { + else SetWindowText(hwnd, TranslateT("System Newstory")); - } + } - if (data->hContact != INVALID_CONTACT_ID) { - // ShowWindow(GetDlgItem(hwnd, IDC_TIMETREE), SW_HIDE); - // ShowWindow(GetDlgItem(hwnd, IDC_ITEMS), SW_HIDE); - // ShowWindow(GetDlgItem(hwnd, IDC_ITEMS2), SW_HIDE); - // ShowWindow(GetDlgItem(hwnd, IDC_SEARCHICON), SW_HIDE); + if (data->hContact != INVALID_CONTACT_ID) PostMessage(GetDlgItem(hwnd, IDC_ITEMS2), WM_USER, (WPARAM)data->hContact, 0); - } SendMessage(hwnd, UM_UPDATEICONS, 0, 0); SetFocus(GetDlgItem(hwnd, IDC_ITEMS2)); @@ -601,49 +595,41 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara return TRUE; } - /*case WM_MOUSEWHEEL: - SendMessage(GetDlgItem(hwnd, IDC_CUSTOM1), msg, wParam, lParam); - return TRUE;*/ - - /*case WM_SETFOCUS: - SetFocus(GetDlgItem(hwnd, IDC_CUSTOM1)); - return TRUE;*/ - case UM_UPDATEICONS: - SendMessage(hwnd, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)GetIcon(ICO_NEWSTORY)); - - SendMessage(GetDlgItem(hwnd, IDC_SEARCHICON), STM_SETICON, (WPARAM)GetIcon(ICO_SEARCH), 0); - - SendMessage(GetDlgItem(hwnd, IDC_USERINFO), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_USERINFO)); - SendMessage(GetDlgItem(hwnd, IDC_MESSAGE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_SENDMSG)); - SendMessage(GetDlgItem(hwnd, IDC_USERMENU), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_USERMENU)); - SendMessage(GetDlgItem(hwnd, IDC_COPY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_COPY)); - SendMessage(GetDlgItem(hwnd, IDC_LOGOPTIONS), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_OPTIONS)); - SendMessage(GetDlgItem(hwnd, IDC_FILTER), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_FILTER)); - SendMessage(GetDlgItem(hwnd, IDC_DATEPOPUP), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_CALENDAR)); - SendMessage(GetDlgItem(hwnd, IDC_SEARCH), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_SEARCH)); - SendMessage(GetDlgItem(hwnd, IDC_EXPORT), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_EXPORT)); - SendMessage(GetDlgItem(hwnd, IDC_CLOSE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_CLOSE)); - SendMessage(GetDlgItem(hwnd, IDC_FINDPREV), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_FINDPREV)); - SendMessage(GetDlgItem(hwnd, IDC_FINDNEXT), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_FINDNEXT)); - - SendMessage(data->ibMessages.hwndIco, STM_SETICON, (LPARAM)GetIcon(ICO_SENDMSG), 0); - SendMessage(data->ibMessages.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGIN)); - SendMessage(data->ibMessages.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGOUT)); - SendMessage(data->ibFiles.hwndIco, STM_SETICON, (LPARAM)GetIcon(ICO_FILE), 0); - SendMessage(data->ibFiles.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGIN)); - SendMessage(data->ibFiles.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGOUT)); - SendMessage(data->ibUrls.hwndIco, STM_SETICON, (LPARAM)GetIcon(ICO_URL), 0); - SendMessage(data->ibUrls.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGIN)); - SendMessage(data->ibUrls.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGOUT)); - SendMessage(data->ibTotal.hwndIco, STM_SETICON, (LPARAM)GetIcon(ICO_UNKNOWN), 0); - SendMessage(data->ibTotal.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGIN)); - SendMessage(data->ibTotal.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_MSGOUT)); + SendMessage(hwnd, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)g_plugin.getIcon(ICO_NEWSTORY)); + + SendMessage(GetDlgItem(hwnd, IDC_SEARCHICON), STM_SETICON, (WPARAM)g_plugin.getIcon(ICO_SEARCH), 0); + + SendMessage(GetDlgItem(hwnd, IDC_USERINFO), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_USERINFO)); + SendMessage(GetDlgItem(hwnd, IDC_MESSAGE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_SENDMSG)); + SendMessage(GetDlgItem(hwnd, IDC_USERMENU), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_USERMENU)); + SendMessage(GetDlgItem(hwnd, IDC_COPY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_COPY)); + SendMessage(GetDlgItem(hwnd, IDC_LOGOPTIONS), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_OPTIONS)); + SendMessage(GetDlgItem(hwnd, IDC_FILTER), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_FILTER)); + SendMessage(GetDlgItem(hwnd, IDC_DATEPOPUP), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_CALENDAR)); + SendMessage(GetDlgItem(hwnd, IDC_SEARCH), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_SEARCH)); + SendMessage(GetDlgItem(hwnd, IDC_EXPORT), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_EXPORT)); + SendMessage(GetDlgItem(hwnd, IDC_CLOSE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_CLOSE)); + SendMessage(GetDlgItem(hwnd, IDC_FINDPREV), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_FINDPREV)); + SendMessage(GetDlgItem(hwnd, IDC_FINDNEXT), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_FINDNEXT)); + + SendMessage(data->ibMessages.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(ICO_SENDMSG), 0); + SendMessage(data->ibMessages.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); + SendMessage(data->ibMessages.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); + SendMessage(data->ibFiles.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(ICO_FILE), 0); + SendMessage(data->ibFiles.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); + SendMessage(data->ibFiles.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); + SendMessage(data->ibUrls.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(ICO_URL), 0); + SendMessage(data->ibUrls.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); + SendMessage(data->ibUrls.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); + SendMessage(data->ibTotal.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(ICO_UNKNOWN), 0); + SendMessage(data->ibTotal.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); + SendMessage(data->ibTotal.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); if (CheckPassword(data->hContact, "")) - SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_NOPASSWORD)); + SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_NOPASSWORD)); else - SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_PASSWORD)); + SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_PASSWORD)); break; diff --git a/plugins/NewStory/src/icons.cpp b/plugins/NewStory/src/icons.cpp deleted file mode 100644 index b7dc2a9adb..0000000000 --- a/plugins/NewStory/src/icons.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "stdafx.h" - -static IconItem icons[] = -{ - { LPGEN("Main Icon"), "main", ICO_NEWSTORY }, - { LPGEN("User Info"), "userinfo", ICO_USERINFO }, - { LPGEN("User Menu"), "usermenu", ICO_USERMENU }, - { LPGEN("Search"), "search", ICO_SEARCH }, - { LPGEN("Options"), "options", ICO_OPTIONS }, - { LPGEN("Filter"), "filter", ICO_FILTER }, - { LPGEN("Export"), "export", ICO_EXPORT }, - { LPGEN("Copy"), "copy", ICO_COPY }, - { LPGEN("Send Message"), "message", ICO_SENDMSG }, - { LPGEN("Close"), "close", ICO_CLOSE }, - - { LPGEN("Incoming Message"), "msgin", ICO_MSGIN }, - { LPGEN("Outgoing Message"), "msgout", ICO_MSGOUT }, - { LPGEN("User Signed In"), "signin", ICO_SIGNIN }, - { LPGEN("File"), "file", ICO_FILE }, - { LPGEN("URL"), "url", ICO_URL }, - { LPGEN("Unknown Event"), "unknown", ICO_UNKNOWN }, - - { LPGEN("Find Previous"), "findprev", ICO_FINDPREV }, - { LPGEN("Find Next"), "findnext", ICO_FINDNEXT }, - { LPGEN("Password disabled"), "nopassword",ICO_NOPASSWORD }, - { LPGEN("Password enabled"), "password", ICO_PASSWORD }, - { LPGEN("Jump to Date"), "calendar", ICO_CALENDAR }, - - { LPGEN("Template Group"), "tplgroup", ICO_TPLGROUP }, - { LPGEN("Reset"), "reset", ICO_RESET }, - { LPGEN("Update Preview"), "preview", ICO_PREVIEW }, - { LPGEN("Help"), "varhelp", ICO_VARHELP }, - { LPGEN("Save Password"), "savepass", ICO_SAVEPASS } -}; - -int evtIconsChanged(WPARAM, LPARAM) -{ - //RefreshIcons(icons, ICO_COUNT); - //WindowList_Broadcast(hNewstoryWindows, UM_UPDATEICONS, 0, 0); - return 0; -} - -void InitIcons() -{ - g_plugin.registerIcon(MODULETITLE, icons); - HookEvent(ME_SKIN_ICONSCHANGED, evtIconsChanged); -} - -/*void RefreshIcons(IconItem *icons, int count) -{ - //if (ServiceExists(MS_SKIN2_ADDICON)) - // for (int i = 0; i < count; i++) - // icons[i].hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)icons[i].szId); -}*/ - -HICON GetIcon(int iconId) -{ - for (auto &it : icons) - if (it.defIconID == iconId) - return IcoLib_GetIconByHandle(it.hIcolib); - return nullptr; -} diff --git a/plugins/NewStory/src/icons.h b/plugins/NewStory/src/icons.h deleted file mode 100644 index 0d74e6c977..0000000000 --- a/plugins/NewStory/src/icons.h +++ /dev/null @@ -1,7 +0,0 @@ -//extern IconItem icons[]; -//extern int iconCount; - -HICON GetIcon(int iconId); - -void InitIcons(); -void RefreshIcons(IconItem *icons, int count); \ No newline at end of file diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index ebce994534..7bdfb36713 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -42,9 +42,41 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIHIST ///////////////////////////////////////////////////////////////////////////////////////// +static IconItem icons[] = +{ + { LPGEN("Main Icon"), "main", ICO_NEWSTORY }, + { LPGEN("User Info"), "userinfo", ICO_USERINFO }, + { LPGEN("User Menu"), "usermenu", ICO_USERMENU }, + { LPGEN("Search"), "search", ICO_SEARCH }, + { LPGEN("Options"), "options", ICO_OPTIONS }, + { LPGEN("Filter"), "filter", ICO_FILTER }, + { LPGEN("Export"), "export", ICO_EXPORT }, + { LPGEN("Copy"), "copy", ICO_COPY }, + { LPGEN("Send Message"), "message", ICO_SENDMSG }, + { LPGEN("Close"), "close", ICO_CLOSE }, + + { LPGEN("Incoming Message"), "msgin", ICO_MSGIN }, + { LPGEN("Outgoing Message"), "msgout", ICO_MSGOUT }, + { LPGEN("User Signed In"), "signin", ICO_SIGNIN }, + { LPGEN("File"), "file", ICO_FILE }, + { LPGEN("URL"), "url", ICO_URL }, + { LPGEN("Unknown Event"), "unknown", ICO_UNKNOWN }, + + { LPGEN("Find Previous"), "findprev", ICO_FINDPREV }, + { LPGEN("Find Next"), "findnext", ICO_FINDNEXT }, + { LPGEN("Password disabled"), "nopassword",ICO_NOPASSWORD }, + { LPGEN("Password enabled"), "password", ICO_PASSWORD }, + { LPGEN("Jump to Date"), "calendar", ICO_CALENDAR }, + + { LPGEN("Template Group"), "tplgroup", ICO_TPLGROUP }, + { LPGEN("Reset"), "reset", ICO_RESET }, + { LPGEN("Update Preview"), "preview", ICO_PREVIEW }, + { LPGEN("Help"), "varhelp", ICO_VARHELP }, + { LPGEN("Save Password"), "savepass", ICO_SAVEPASS } +}; + int evtModulesLoaded(WPARAM, LPARAM) { - InitIcons(); InitFonts(); InitNewstoryControl(); InitHistory(); @@ -57,46 +89,31 @@ int evtModulesLoaded(WPARAM, LPARAM) mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY; mi.name.w = L"User Newstory"; mi.position = 1999990000; - mi.hIcon = GetIcon(ICO_NEWSTORY); + mi.hIcon = g_plugin.getIcon(ICO_NEWSTORY); Menu_AddContactMenuItem(&mi); mi.pszService = "Newstory/System"; mi.name.w = L"System Newstory"; mi.position = 1999990000; - mi.hIcon = GetIcon(ICO_NEWSTORY); + mi.hIcon = g_plugin.getIcon(ICO_NEWSTORY); Menu_AddMainMenuItem(&mi); - return 0; } int CMPlugin::Load() { + g_plugin.registerIcon(MODULETITLE, icons); + CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY, svcShowNewstory); CreateServiceFunction("Newstory/System", svcShowSystemNewstory); hhkModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, evtModulesLoaded); - /* - hhkOptInitialise = HookEvent(ME_OPT_INITIALISE, OptInitialise); - - options.fnup = options.fndown = 0; - options.flags = 0; - LoadOptions(); - */ return 0; } -//void DoCleanup(); - int CMPlugin::Unload() { UnhookEvent(hhkModulesLoaded); - /* - UnhookEvent(hhkOptInitialise); - if (hhkTTBLoaded) - UnhookEvent(hhkTTBLoaded); - - DoCleanup(); - */ FreeHistory(); return 0; } diff --git a/plugins/NewStory/src/opt_passwords.cpp b/plugins/NewStory/src/opt_passwords.cpp index 3427def74d..46b280ba98 100644 --- a/plugins/NewStory/src/opt_passwords.cpp +++ b/plugins/NewStory/src/opt_passwords.cpp @@ -29,8 +29,8 @@ INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) case WM_INITDIALOG: HIMAGELIST himg; himg = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3, 3); - icoidNoPassword = ImageList_AddIcon(himg, GetIcon(ICO_NOPASSWORD)); - icoidPassword = ImageList_AddIcon(himg, GetIcon(ICO_PASSWORD)); + icoidNoPassword = ImageList_AddIcon(himg, g_plugin.getIcon(ICO_NOPASSWORD)); + icoidPassword = ImageList_AddIcon(himg, g_plugin.getIcon(ICO_PASSWORD)); SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)himg); SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 1, 0); @@ -50,12 +50,12 @@ INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) SetAllContactIcons(GetDlgItem(hwnd, IDC_LIST)); ResetListOptions(GetDlgItem(hwnd, IDC_LIST)); - SendMessage(GetDlgItem(hwnd, IDC_ICO_NOPASSWORD), STM_SETICON, (WPARAM)GetIcon(ICO_NOPASSWORD), 0); - SendMessage(GetDlgItem(hwnd, IDC_ICO_PASSWORD), STM_SETICON, (WPARAM)GetIcon(ICO_PASSWORD), 0); + SendMessage(GetDlgItem(hwnd, IDC_ICO_NOPASSWORD), STM_SETICON, (WPARAM)g_plugin.getIcon(ICO_NOPASSWORD), 0); + SendMessage(GetDlgItem(hwnd, IDC_ICO_PASSWORD), STM_SETICON, (WPARAM)g_plugin.getIcon(ICO_PASSWORD), 0); SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BUTTONSETASFLATBTN, 0, 0); SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BUTTONADDTOOLTIP, (WPARAM)Translate("Save Password"), 0); - SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_SAVEPASS)); + SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_SAVEPASS)); return TRUE; case WM_NOTIFY: diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index 1d86e347f2..d58baf48d0 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -68,7 +68,6 @@ Boston, MA 02111-1307, USA. #include "utils.h" #include "opt_passwords.h" #include "options.h" -#include "icons.h" #include "fonts.h" #include "password.h" #include "calendartool.h" diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index da74186b59..76d2b9ea27 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -268,16 +268,16 @@ void vfEvent(int, TemplateVars *vars, MCONTACT, HistoryArray::ItemData *item) // %I: Icon switch (item->dbe.eventType) { case EVENTTYPE_MESSAGE: - hIcon = GetIcon(ICO_SENDMSG); + hIcon = g_plugin.getIcon(ICO_SENDMSG); break; case EVENTTYPE_FILE: - hIcon = GetIcon(ICO_FILE); + hIcon = g_plugin.getIcon(ICO_FILE); break; case EVENTTYPE_STATUSCHANGE: - hIcon = GetIcon(ICO_SIGNIN); + hIcon = g_plugin.getIcon(ICO_SIGNIN); break; default: - hIcon = GetIcon(ICO_UNKNOWN); + hIcon = g_plugin.getIcon(ICO_UNKNOWN); break; } s = (TCHAR *)calloc(64, sizeof(TCHAR)); @@ -286,9 +286,9 @@ void vfEvent(int, TemplateVars *vars, MCONTACT, HistoryArray::ItemData *item) // %i: Direction icon if (item->dbe.flags & DBEF_SENT) - hIcon = GetIcon(ICO_MSGOUT); + hIcon = g_plugin.getIcon(ICO_MSGOUT); else - hIcon = GetIcon(ICO_MSGIN); + hIcon = g_plugin.getIcon(ICO_MSGIN); s = (TCHAR *)calloc(64, sizeof(TCHAR)); wsprintf(s, _T("[$hicon=%d$]"), hIcon); @@ -431,7 +431,7 @@ INT_PTR CALLBACK OptTemplatesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HIMAGELIST himgTree = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 1, 1); TreeView_SetImageList(GetDlgItem(hwnd, IDC_TEMPLATES), himgTree, TVSIL_NORMAL); - ImageList_AddIcon(himgTree, GetIcon(ICO_TPLGROUP)); + ImageList_AddIcon(himgTree, g_plugin.getIcon(ICO_TPLGROUP)); for (int i = 0; i < TPL_COUNT; i++) { if (!i || lstrcmp(templates[i].group, templates[i - 1].group)) { @@ -457,7 +457,7 @@ INT_PTR CALLBACK OptTemplatesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE; tvis.item.pszText = templates[i].title; tvis.item.iSelectedImage = tvis.item.iImage = - ImageList_AddIcon(himgTree, GetIcon(templates[i].icon)); + ImageList_AddIcon(himgTree, g_plugin.getIcon(templates[i].icon)); tvis.item.lParam = i; TreeView_InsertItem(GetDlgItem(hwnd, IDC_TEMPLATES), &tvis); } @@ -476,9 +476,9 @@ INT_PTR CALLBACK OptTemplatesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendMessage(GetDlgItem(hwnd, IDC_UPDATEPREVIEW), BUTTONADDTOOLTIP, (WPARAM)Translate("Update Preview"), 0); SendMessage(GetDlgItem(hwnd, IDC_VARHELP), BUTTONADDTOOLTIP, (WPARAM)Translate("Help on Variables"), 0); - SendMessage(GetDlgItem(hwnd, IDC_DISCARD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_RESET)); - SendMessage(GetDlgItem(hwnd, IDC_UPDATEPREVIEW), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_PREVIEW)); - SendMessage(GetDlgItem(hwnd, IDC_VARHELP), BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIcon(ICO_VARHELP)); + SendMessage(GetDlgItem(hwnd, IDC_DISCARD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_RESET)); + SendMessage(GetDlgItem(hwnd, IDC_UPDATEPREVIEW), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_PREVIEW)); + SendMessage(GetDlgItem(hwnd, IDC_VARHELP), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_VARHELP)); return TRUE; diff --git a/plugins/UserInfoEx/IconPacks/default/res/icons.rc b/plugins/UserInfoEx/IconPacks/default/res/icons.rc index 7a7844370f..e79dc72f4c 100644 --- a/plugins/UserInfoEx/IconPacks/default/res/icons.rc +++ b/plugins/UserInfoEx/IconPacks/default/res/icons.rc @@ -16,7 +16,6 @@ IDI_CLOCK ICON "clock.ico" IDI_FEMALE ICON "female.ico" IDI_MALE ICON "male.ico" IDI_MARITAL ICON "marital.ico" -IDI_PASSWORD ICON "password.ico" IDI_TREE_ADDRESS ICON "address.ico" IDI_TREE_GENERAL ICON "treeGeneral.ico" IDI_TREE_ADVANCED ICON "treeAdvanced.ico" diff --git a/plugins/UserInfoEx/IconPacks/default/res/icons_z2.rc b/plugins/UserInfoEx/IconPacks/default/res/icons_z2.rc index 6a8291a879..acb8f9fa7b 100644 --- a/plugins/UserInfoEx/IconPacks/default/res/icons_z2.rc +++ b/plugins/UserInfoEx/IconPacks/default/res/icons_z2.rc @@ -16,7 +16,6 @@ IDI_CLOCK ICON "clock.ico" IDI_FEMALE ICON "female.ico" IDI_MALE ICON "male.ico" IDI_MARITAL ICON "marital.ico" -IDI_PASSWORD ICON "password.ico" IDI_TREE_ADDRESS ICON "address.ico" IDI_TREE_GENERAL ICON "treeGeneral.ico" IDI_TREE_ADVANCED ICON "treeAdvanced.ico" diff --git a/plugins/UserInfoEx/IconPacks/default/src/icons.h b/plugins/UserInfoEx/IconPacks/default/src/icons.h index 46871836bd..21a5bf78c4 100644 --- a/plugins/UserInfoEx/IconPacks/default/src/icons.h +++ b/plugins/UserInfoEx/IconPacks/default/src/icons.h @@ -17,7 +17,6 @@ // common icons of details dialog pages #define IDI_MIRANDA 108 -#define IDI_PASSWORD 109 #define IDI_FEMALE 110 #define IDI_MALE 111 #define IDI_CLOCK 112 diff --git a/plugins/UserInfoEx/IconPacks/ice/res/icons.rc b/plugins/UserInfoEx/IconPacks/ice/res/icons.rc index 7a7844370f..e79dc72f4c 100644 --- a/plugins/UserInfoEx/IconPacks/ice/res/icons.rc +++ b/plugins/UserInfoEx/IconPacks/ice/res/icons.rc @@ -16,7 +16,6 @@ IDI_CLOCK ICON "clock.ico" IDI_FEMALE ICON "female.ico" IDI_MALE ICON "male.ico" IDI_MARITAL ICON "marital.ico" -IDI_PASSWORD ICON "password.ico" IDI_TREE_ADDRESS ICON "address.ico" IDI_TREE_GENERAL ICON "treeGeneral.ico" IDI_TREE_ADVANCED ICON "treeAdvanced.ico" diff --git a/plugins/UserInfoEx/IconPacks/ice/res/icons_z2.rc b/plugins/UserInfoEx/IconPacks/ice/res/icons_z2.rc index 6a8291a879..acb8f9fa7b 100644 --- a/plugins/UserInfoEx/IconPacks/ice/res/icons_z2.rc +++ b/plugins/UserInfoEx/IconPacks/ice/res/icons_z2.rc @@ -16,7 +16,6 @@ IDI_CLOCK ICON "clock.ico" IDI_FEMALE ICON "female.ico" IDI_MALE ICON "male.ico" IDI_MARITAL ICON "marital.ico" -IDI_PASSWORD ICON "password.ico" IDI_TREE_ADDRESS ICON "address.ico" IDI_TREE_GENERAL ICON "treeGeneral.ico" IDI_TREE_ADVANCED ICON "treeAdvanced.ico" diff --git a/plugins/UserInfoEx/IconPacks/ice/src/icons.h b/plugins/UserInfoEx/IconPacks/ice/src/icons.h index 7c2dfa7971..c861b425ec 100644 --- a/plugins/UserInfoEx/IconPacks/ice/src/icons.h +++ b/plugins/UserInfoEx/IconPacks/ice/src/icons.h @@ -17,7 +17,6 @@ // common icons of details dialog pages #define IDI_MIRANDA 108 -#define IDI_PASSWORD 109 #define IDI_FEMALE 110 #define IDI_MALE 111 #define IDI_CLOCK 112 diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 8d13206a7c..311c01bca1 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -31,7 +31,6 @@ static IconItem icons1[] = { // common { "common_im", LPGEN("IM naming"), IDI_MIRANDA }, - { "common_password", LPGEN("Password"), IDI_PASSWORD }, { "common_female", LPGEN("Female"), IDI_FEMALE }, { "common_male", LPGEN("Male"), IDI_MALE }, { "common_birthday", LPGEN("Birthday"), IDI_BIRTHDAY }, -- cgit v1.2.3