diff options
Diffstat (limited to 'plugins/PluginUpdater/src/Events.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Events.cpp | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp index e05aba0ff2..e892092094 100644 --- a/plugins/PluginUpdater/src/Events.cpp +++ b/plugins/PluginUpdater/src/Events.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "common.h"
-HANDLE Timer;
+HANDLE Timer, hPluginUpdaterFolder;
int OnFoldersChanged(WPARAM, LPARAM)
{
@@ -30,10 +30,16 @@ int OnFoldersChanged(WPARAM, LPARAM) return 0;
}
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
+ hPluginUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Plugin Updater"), MIRANDA_PATHT _T("\\")DEFAULT_UPDATES_FOLDER);
+ if (hPluginUpdaterFolder)
+ OnFoldersChanged(0, 0);
+ else
+ lstrcpyn(tszRoot, VARST( _T("%miranda_path%\\"DEFAULT_UPDATES_FOLDER)), SIZEOF(tszRoot));
+
opts.bSilent = true;
int iRestartCount = db_get_b(NULL, MODNAME, "RestartCount", 2);
@@ -51,22 +57,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-INT_PTR MenuCommand(WPARAM,LPARAM)
-{
- opts.bSilent = false;
- DoCheck(true);
- return 0;
-}
-
-#if MIRANDA_VER >= 0x0A00
-INT_PTR ShowListCommand(WPARAM,LPARAM)
-{
- opts.bSilent = false;
- DoGetList(true);
- return 0;
-}
-#endif
-
INT_PTR EmptyFolder(WPARAM,LPARAM lParam)
{
SHFILEOPSTRUCT file_op = {
@@ -92,8 +82,14 @@ int OnPreShutdown(WPARAM, LPARAM) UninitCheck();
- #if MIRANDA_VER >= 0x0A00
- UninitListNew();
- #endif
+#if MIRANDA_VER >= 0x0A00
+ UninitListNew();
+#endif
return 0;
}
+
+void InitEvents()
+{
+ HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+}
\ No newline at end of file |