summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-09-17 15:20:58 +0000
committerRobert Pösel <robyer@seznam.cz>2012-09-17 15:20:58 +0000
commit5fa7bb1bd7a975178f64a0cd70f88a1de5764dc2 (patch)
tree3b93fe5e4fdb99286b89e590be40dc0248ac6968 /plugins
parent08253a6da81f34d030ea55051ca45d21919b2b8a (diff)
ProfileManager: Added menu items for restart and dbchecker.
git-svn-id: http://svn.miranda-ng.org/main/trunk@1592 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ProfileManager/res/resource.rc2
-rw-r--r--plugins/ProfileManager/src/pmanagerEx.cpp37
-rw-r--r--plugins/ProfileManager/src/resource.h2
3 files changed, 38 insertions, 3 deletions
diff --git a/plugins/ProfileManager/res/resource.rc b/plugins/ProfileManager/res/resource.rc
index 8a81324da1..11526085cc 100644
--- a/plugins/ProfileManager/res/resource.rc
+++ b/plugins/ProfileManager/res/resource.rc
@@ -30,6 +30,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
// remains consistent on all systems.
IDI_ChangePM ICON "ChangePM.ico"
IDI_LoadPM ICON "LoadPM.ico"
+IDI_Restart ICON "Restart.ico"
+IDI_Dbchecker ICON "Dbchecker.ico"
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp
index 175182be67..8a93a997d0 100644
--- a/plugins/ProfileManager/src/pmanagerEx.cpp
+++ b/plugins/ProfileManager/src/pmanagerEx.cpp
@@ -25,13 +25,13 @@ TCHAR fn[MAX_PATH];
TCHAR lmn[MAX_PATH];
TCHAR* pathn;
int hLangpack;
-HANDLE hLoadPM, hChangePM;
+HANDLE hLoadPM, hChangePM, hDbchecker;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
"Miranda NG Profile Changer",
- PLUGIN_MAKE_VERSION(0,0,0,3),
- "Adds a menu item to change or load a different profile of Miranda NG.",
+ PLUGIN_MAKE_VERSION(0,0,0,4),
+ "Adds a menu item to change or load a different profile of Miranda NG, restart or run a dbchecker.",
"Roman Gemini",
"woobind@ukr.net",
"© 2008 - 2010 Roman Gemini",
@@ -66,6 +66,16 @@ static INT_PTR LoadPM(WPARAM wParam, LPARAM lParam)
return 0;
}
+static INT_PTR CheckDb(WPARAM wParam, LPARAM lParam)
+{
+ if (MessageBox( 0, TranslateT("Miranda NG will exit and Database checker will start.\n\nAre you sure you want to do this?"), TranslateT("Check Database"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2 ) == IDYES) {
+ GetModuleFileName(GetModuleHandle(NULL), fn, SIZEOF(fn));
+ ShellExecute(0, _T("open"), fn, _T("/svc:dbchecker"), _T(""), 1);
+ CallService("CloseAction", 0, 0);
+ }
+ return 0;
+}
+
extern "C" __declspec(dllexport) int Load(void)
{
CLISTMENUITEM mi;
@@ -94,6 +104,27 @@ extern "C" __declspec(dllexport) int Load(void)
mi.pszService = "Database/ChangePM";
Menu_AddMainMenuItem(&mi);
+ hDbchecker = CreateServiceFunction("Database/CheckDb", CheckDb);
+ ZeroMemory(&mi, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = -500200000;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_Dbchecker));
+ mi.ptszPopupName = _T("Database");
+ mi.ptszName = _T("Check database");
+ mi.pszService = "Database/CheckDb";
+ Menu_AddMainMenuItem(&mi);
+
+ ZeroMemory(&mi, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.position = -500200000;
+ mi.flags = CMIF_TCHAR;
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_Restart));
+ mi.ptszPopupName = NULL;
+ mi.ptszName = _T("Restart");
+ mi.pszService = "Miranda/System/Restart";
+ Menu_AddMainMenuItem(&mi);
+
return 0;
}
diff --git a/plugins/ProfileManager/src/resource.h b/plugins/ProfileManager/src/resource.h
index 638fcfb4f6..0b3445b3e7 100644
--- a/plugins/ProfileManager/src/resource.h
+++ b/plugins/ProfileManager/src/resource.h
@@ -4,6 +4,8 @@
//
#define IDI_ChangePM 101
#define IDI_LoadPM 102
+#define IDI_Restart 103
+#define IDI_Dbchecker 104
// Next default values for new objects
//