summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Compat
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-05-22 20:15:32 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-05-22 20:15:32 +0000
commitba020540c064ebd48bf6b77e5bd5e11255766f23 (patch)
treead87b13d4dbc6cc43a489aa1022b28b48d0e2dd5 /plugins/PluginUpdater/src/Compat
parentc09aa99a7e9915c503064d6eb5e9dd1bdd2a673f (diff)
-PluginUpdater:
-code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@13765 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Compat')
-rw-r--r--plugins/PluginUpdater/src/Compat/compat.cpp21
-rw-r--r--plugins/PluginUpdater/src/Compat/compat.h18
2 files changed, 39 insertions, 0 deletions
diff --git a/plugins/PluginUpdater/src/Compat/compat.cpp b/plugins/PluginUpdater/src/Compat/compat.cpp
index 260ff99039..e6b67265bd 100644
--- a/plugins/PluginUpdater/src/Compat/compat.cpp
+++ b/plugins/PluginUpdater/src/Compat/compat.cpp
@@ -114,3 +114,24 @@ void __stdcall RestartMe(void*)
STARTUPINFO si = { sizeof(si) };
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
+
+/////////////////////////////////////////////////////////////////////////////////////
+// we don't use Icon_Register here because it should work under Miranda IM too
+
+void InitIcoLib()
+{
+ TCHAR destfile[MAX_PATH];
+ GetModuleFileName(hInst, destfile, MAX_PATH);
+
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.flags = SIDF_PATH_TCHAR;
+ sid.ptszDefaultFile = destfile;
+ sid.pszSection = MODULEA;
+
+ for (int i = 0; i < SIZEOF(iconList); i++) {
+ sid.pszName = iconList[i].szIconName;
+ sid.pszDescription = iconList[i].szDescr;
+ sid.iDefaultIndex = -iconList[i].IconID;
+ Skin_AddIcon(&sid);
+ }
+}
diff --git a/plugins/PluginUpdater/src/Compat/compat.h b/plugins/PluginUpdater/src/Compat/compat.h
index d6dca84836..01f6536b71 100644
--- a/plugins/PluginUpdater/src/Compat/compat.h
+++ b/plugins/PluginUpdater/src/Compat/compat.h
@@ -1,5 +1,8 @@
#define MIID_UPDATER {0x4a47b19b, 0xde5a, 0x4436, { 0xab, 0x4b, 0xe1, 0xf3, 0xa0, 0x22, 0x5d, 0xe7}}
+#include <m_database.h>
+#include "..\..\..\..\include\m_pluginupdater.h"
+
#define db_free(A) DBFreeVariant(A)
#define db_get_b(A,B,C,D) DBGetContactSettingByte(A,B,C,D)
@@ -73,6 +76,20 @@ public:
}
};
+struct
+{
+ char *szIconName;
+ char *szDescr;
+ int IconID;
+}
+static iconList[] =
+{
+ { "check_update", LPGEN("Check for updates"), IDI_MENU },
+ { "info", LPGEN("Plugin info"), IDI_INFO },
+ { "plg_list", LPGEN("Component list"), IDI_PLGLIST },
+ { "plg_restart", LPGEN("Restart"), IDI_RESTART },
+};
+
__forceinline INT_PTR Options_Open(OPENOPTIONSDIALOG *ood)
{
return CallService("Opt/OpenOptions", 0, (LPARAM)ood);
@@ -87,6 +104,7 @@ char *bin2hex(const void *pData, size_t len, char *dest);
char *rtrim(char *str);
void CreatePathToFileT(TCHAR *ptszPath);
int wildcmpit(const WCHAR *name, const WCHAR *mask);
+void InitIcoLib()
#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1) *sizeof(TCHAR)), A)