From b073e215612eda97d9182bc951bf01058585b910 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 8 Aug 2012 14:18:12 +0000 Subject: - temp folder auto-cleanup; - manual cleanup removed git-svn-id: http://svn.miranda-ng.org/main/trunk@1403 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/res/Delete.ico | Bin 2550 -> 0 bytes plugins/PluginUpdater/res/Resource.rc | 1 - plugins/PluginUpdater/src/Events.cpp | 6 ++++++ plugins/PluginUpdater/src/Notifications.cpp | 1 + plugins/PluginUpdater/src/PluginUpdater.cpp | 11 +---------- plugins/PluginUpdater/src/Utils.cpp | 1 - plugins/PluginUpdater/src/resource.h | 1 - 7 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 plugins/PluginUpdater/res/Delete.ico diff --git a/plugins/PluginUpdater/res/Delete.ico b/plugins/PluginUpdater/res/Delete.ico deleted file mode 100644 index eea851da19..0000000000 Binary files a/plugins/PluginUpdater/res/Delete.ico and /dev/null differ diff --git a/plugins/PluginUpdater/res/Resource.rc b/plugins/PluginUpdater/res/Resource.rc index 2e3c945924..10308c4d68 100644 --- a/plugins/PluginUpdater/res/Resource.rc +++ b/plugins/PluginUpdater/res/Resource.rc @@ -27,7 +27,6 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_MENU ICON "menu.ico" -IDI_DELETE ICON "delete.ico" IDI_OK ICON "btnOk.ico" IDI_CANCEL ICON "btnClose.ico" diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp index 84ea06be08..295b9288cb 100644 --- a/plugins/PluginUpdater/src/Events.cpp +++ b/plugins/PluginUpdater/src/Events.cpp @@ -25,6 +25,12 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { opts.bSilent = true; + int iRestartCount = DBGetContactSettingByte(NULL, MODULEA, "RestartCount", 2); + if (iRestartCount > 0) + DBWriteContactSettingByte(NULL, MODULEA, "RestartCount", iRestartCount-1); + else + EmptyFolder(0, TRUE); // silently + if (AllowUpdateOnStartup()) DoCheck(opts.bUpdateOnStartup); diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 8d0a2937c2..63d95d7892 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -284,6 +284,7 @@ static void ApplyUpdates(void* param) DeleteFile(p.File.tszDiskPath); } + DBWriteContactSettingByte(NULL, MODULEA, "RestartCount", 2); DestroyWindow(hDlg); CallFunctionAsync(RestartMe, 0); } diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 19cf80e0e7..0ef0f64fc7 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. HINSTANCE hInst = NULL; -HANDLE hPluginUpdaterFolder = NULL, hCheckUpdates = NULL, hEmptyFolder = NULL; +HANDLE hPluginUpdaterFolder = NULL, hCheckUpdates = NULL; TCHAR tszRoot[MAX_PATH] = {0}; int hLangpack; @@ -79,14 +79,6 @@ extern "C" __declspec(dllexport) int Load(void) mi.pszService = MODNAME"/CheckUpdates"; Menu_AddMainMenuItem(&mi); - // Add empty updates folder menu item - hEmptyFolder = CreateServiceFunction(MODNAME"/EmptyFolder", EmptyFolder); - - mi.icolibItem = Skin_GetIconHandle("empty_folder"); - mi.pszName = LPGEN("Clear plugin updates folder"); - mi.pszService = MODNAME"/EmptyFolder"; - Menu_AddMainMenuItem(&mi); - // Add hotkey HOTKEYDESC hkd = {0}; hkd.cbSize = sizeof(hkd); @@ -113,6 +105,5 @@ extern "C" __declspec(dllexport) int Unload(void) NetlibUnInit(); DestroyServiceFunction(hCheckUpdates); - DestroyServiceFunction(hEmptyFolder); return 0; } diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 2f1e0b17b5..c3863552dc 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -38,7 +38,6 @@ struct static iconList[] = { { "check_update", LPGEN("Check for plugin updates"), IDI_MENU }, - { "empty_folder", LPGEN("Clear plugin updates folder"), IDI_DELETE }, { "btn_ok", LPGEN("'Yes' Button"), IDI_OK }, { "btn_cancel", LPGEN("'No' Button"), IDI_CANCEL } }; diff --git a/plugins/PluginUpdater/src/resource.h b/plugins/PluginUpdater/src/resource.h index 46d86396f2..40bb68f2ca 100644 --- a/plugins/PluginUpdater/src/resource.h +++ b/plugins/PluginUpdater/src/resource.h @@ -7,7 +7,6 @@ #define IDD_OPT_UPDATENOTIFY 104 #define IDD_POPUP 105 #define IDD_POPUPDUMMI 106 -#define IDI_DELETE 107 #define IDI_OK 108 #define IDI_CANCEL 109 #define IDC_UPDATETEXT 1001 -- cgit v1.2.3