Updater: Add option to skip welcome page #548, Fix memory leak
This commit is contained in:
@@ -60,8 +60,10 @@ BEGIN
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,37,142,10
|
||||
LTEXT "Last update check: N/A",IDC_TEXT,7,7,276,8
|
||||
LTEXT "Next update check: N/A",IDC_TEXT2,7,21,276,8
|
||||
CONTROL "Show update prompt before main window",IDC_AUTOCHECKBOX2,
|
||||
CONTROL "Show update prompt before main window",IDC_SHOWSTARTPROMPTCHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,51,160,10
|
||||
CONTROL "Skip check for updates and search automatically",IDC_SKIPWELCOMEPAGECHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65,169,10
|
||||
END
|
||||
|
||||
IDD_TEXT DIALOGEX 0, 0, 309, 176
|
||||
@@ -139,6 +141,17 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AFX_DIALOG_LAYOUT
|
||||
//
|
||||
|
||||
IDD_OPTIONS AFX_DIALOG_LAYOUT
|
||||
BEGIN
|
||||
0
|
||||
END
|
||||
|
||||
#endif // Neutral resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ LOGICAL DllMain(
|
||||
{ IntegerSettingType, SETTING_NAME_UPDATE_MODE, L"0" },
|
||||
{ IntegerSettingType, SETTING_NAME_UPDATE_AVAILABLE, L"0" },
|
||||
{ StringSettingType, SETTING_NAME_UPDATE_DATA, L"" },
|
||||
{ IntegerSettingType, SETTING_NAME_AUTO_CHECK_PAGE, L"0" }
|
||||
};
|
||||
|
||||
PluginInstance = PhRegisterPlugin(PLUGIN_NAME, Instance, &info);
|
||||
|
||||
+17
-10
@@ -81,7 +81,12 @@ INT_PTR CALLBACK OptionsDlgProc(
|
||||
|
||||
if (PhGetIntegerSetting(SETTING_NAME_UPDATE_MODE))
|
||||
{
|
||||
Button_SetCheck(GetDlgItem(hwndDlg, IDC_AUTOCHECKBOX2), BST_CHECKED);
|
||||
Button_SetCheck(GetDlgItem(hwndDlg, IDC_SHOWSTARTPROMPTCHECK), BST_CHECKED);
|
||||
}
|
||||
|
||||
if (PhGetIntegerSetting(SETTING_NAME_AUTO_CHECK_PAGE))
|
||||
{
|
||||
Button_SetCheck(GetDlgItem(hwndDlg, IDC_SKIPWELCOMEPAGECHECK), BST_CHECKED);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -95,12 +100,18 @@ INT_PTR CALLBACK OptionsDlgProc(
|
||||
Button_GetCheck(GET_WM_COMMAND_HWND(wParam, lParam)) == BST_CHECKED);
|
||||
}
|
||||
break;
|
||||
case IDC_AUTOCHECKBOX2:
|
||||
case IDC_SHOWSTARTPROMPTCHECK:
|
||||
{
|
||||
PhSetIntegerSetting(SETTING_NAME_UPDATE_MODE,
|
||||
Button_GetCheck(GET_WM_COMMAND_HWND(wParam, lParam)) == BST_CHECKED);
|
||||
}
|
||||
break;
|
||||
case IDC_SKIPWELCOMEPAGECHECK:
|
||||
{
|
||||
PhSetIntegerSetting(SETTING_NAME_AUTO_CHECK_PAGE,
|
||||
Button_GetCheck(GET_WM_COMMAND_HWND(wParam, lParam)) == BST_CHECKED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -383,13 +394,9 @@ VOID PhpUpdaterFreeListViewEntries(
|
||||
_In_ PPH_UPDATER_COMMIT_CONTEXT Context
|
||||
)
|
||||
{
|
||||
ULONG index = ULONG_MAX;
|
||||
INT index = INT_ERROR;
|
||||
|
||||
while ((index = PhFindListViewItemByFlags(
|
||||
Context->ListViewHandle,
|
||||
index,
|
||||
LVNI_ALL
|
||||
)) != ULONG_MAX)
|
||||
while ((index = PhFindListViewItemByFlags(Context->ListViewHandle, index, LVNI_ALL)) != INT_ERROR)
|
||||
{
|
||||
PPH_UPDATER_COMMIT_ENTRY entry;
|
||||
|
||||
@@ -730,9 +737,9 @@ INT_PTR CALLBACK TextDlgProc(
|
||||
PPH_STRING commitHashUrl;
|
||||
INT lvItemIndex;
|
||||
|
||||
lvItemIndex = PhFindListViewItemByFlags(context->ListViewHandle, -1, LVNI_SELECTED);
|
||||
lvItemIndex = PhFindListViewItemByFlags(context->ListViewHandle, INT_ERROR, LVNI_SELECTED);
|
||||
|
||||
if (lvItemIndex != -1)
|
||||
if (lvItemIndex != INT_ERROR)
|
||||
{
|
||||
if (PhGetListViewItemParam(context->ListViewHandle, lvItemIndex, &entry))
|
||||
{
|
||||
|
||||
@@ -8,15 +8,16 @@
|
||||
#define IDC_TEXT 1002
|
||||
#define IDC_COMMITS 1003
|
||||
#define IDC_TEXT2 1003
|
||||
#define IDC_AUTOCHECKBOX2 1004
|
||||
#define IDC_SHOWSTARTPROMPTCHECK 1004
|
||||
#define IDC_SKIPWELCOMEPAGECHECK 1005
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 106
|
||||
#define _APS_NEXT_RESOURCE_VALUE 107
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1004
|
||||
#define _APS_NEXT_CONTROL_VALUE 1006
|
||||
#define _APS_NEXT_SYMED_VALUE 104
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -817,6 +817,8 @@ NTSTATUS UpdateDownloadThread(
|
||||
CleanupExit:
|
||||
if (httpContext)
|
||||
PhHttpSocketDestroy(httpContext);
|
||||
if (hashContextLegacy)
|
||||
UpdaterDestroyHash(hashContextLegacy);
|
||||
if (hashContext)
|
||||
UpdaterDestroyHash(hashContext);
|
||||
if (tempFileHandle)
|
||||
@@ -995,9 +997,20 @@ HRESULT CALLBACK TaskDialogBootstrapCallback(
|
||||
SetWindowLongPtr(hwndDlg, GWLP_WNDPROC, (LONG_PTR)TaskDialogSubclassProc);
|
||||
|
||||
if (context->StartupCheck)
|
||||
{
|
||||
ShowAvailableDialog(context);
|
||||
}
|
||||
else
|
||||
ShowCheckForUpdatesDialog(context);
|
||||
{
|
||||
if (PhGetIntegerSetting(SETTING_NAME_AUTO_CHECK_PAGE))
|
||||
{
|
||||
ShowCheckingForUpdatesDialog(context);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowCheckForUpdatesDialog(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define SETTING_NAME_UPDATE_MODE (PLUGIN_NAME L".UpdateMode")
|
||||
#define SETTING_NAME_UPDATE_AVAILABLE (PLUGIN_NAME L".UpdateAvailable")
|
||||
#define SETTING_NAME_UPDATE_DATA (PLUGIN_NAME L".UpdateData")
|
||||
#define SETTING_NAME_AUTO_CHECK_PAGE (PLUGIN_NAME L".AutoCheckPage")
|
||||
#define SETTING_NAME_CHANGELOG_WINDOW_POSITION (PLUGIN_NAME L".ChangelogWindowPosition")
|
||||
#define SETTING_NAME_CHANGELOG_WINDOW_SIZE (PLUGIN_NAME L".ChangelogWindowSize")
|
||||
#define SETTING_NAME_CHANGELOG_COLUMNS (PLUGIN_NAME L".ChangelogListColumns")
|
||||
|
||||
Reference in New Issue
Block a user