mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 09:12:24 +00:00
Make things other than Pageant use request_file(), why not, although all of
its funkiness is switched off so the behaviour is the same as before. [originally from svn r5414]
This commit is contained in:
parent
d7b50f8066
commit
f246144c44
@ -1905,14 +1905,8 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg,
|
|||||||
HIWORD(wParam) == BN_DOUBLECLICKED))) {
|
HIWORD(wParam) == BN_DOUBLECLICKED))) {
|
||||||
OPENFILENAME of;
|
OPENFILENAME of;
|
||||||
char filename[FILENAME_MAX];
|
char filename[FILENAME_MAX];
|
||||||
int ret;
|
|
||||||
|
|
||||||
memset(&of, 0, sizeof(of));
|
memset(&of, 0, sizeof(of));
|
||||||
#ifdef OPENFILENAME_SIZE_VERSION_400
|
|
||||||
of.lStructSize = OPENFILENAME_SIZE_VERSION_400;
|
|
||||||
#else
|
|
||||||
of.lStructSize = sizeof(of);
|
|
||||||
#endif
|
|
||||||
of.hwndOwner = dp->hwnd;
|
of.hwndOwner = dp->hwnd;
|
||||||
if (ctrl->fileselect.filter)
|
if (ctrl->fileselect.filter)
|
||||||
of.lpstrFilter = ctrl->fileselect.filter;
|
of.lpstrFilter = ctrl->fileselect.filter;
|
||||||
@ -1925,14 +1919,9 @@ int winctrl_handle_command(struct dlgparam *dp, UINT msg,
|
|||||||
filename[lenof(filename)-1] = '\0';
|
filename[lenof(filename)-1] = '\0';
|
||||||
of.nMaxFile = lenof(filename);
|
of.nMaxFile = lenof(filename);
|
||||||
of.lpstrFileTitle = NULL;
|
of.lpstrFileTitle = NULL;
|
||||||
of.lpstrInitialDir = NULL;
|
|
||||||
of.lpstrTitle = ctrl->fileselect.title;
|
of.lpstrTitle = ctrl->fileselect.title;
|
||||||
of.Flags = 0;
|
of.Flags = 0;
|
||||||
if (ctrl->fileselect.for_writing)
|
if (request_file(NULL, &of, FALSE, ctrl->fileselect.for_writing)) {
|
||||||
ret = GetSaveFileName(&of);
|
|
||||||
else
|
|
||||||
ret = GetOpenFileName(&of);
|
|
||||||
if (ret) {
|
|
||||||
SetDlgItemText(dp->hwnd, c->base_id + 1, filename);
|
SetDlgItemText(dp->hwnd, c->base_id + 1, filename);
|
||||||
ctrl->generic.handler(ctrl, dp, dp->data, EVENT_VALCHANGE);
|
ctrl->generic.handler(ctrl, dp, dp->data, EVENT_VALCHANGE);
|
||||||
}
|
}
|
||||||
|
@ -198,11 +198,6 @@ static int prompt_keyfile(HWND hwnd, char *dlgtitle,
|
|||||||
{
|
{
|
||||||
OPENFILENAME of;
|
OPENFILENAME of;
|
||||||
memset(&of, 0, sizeof(of));
|
memset(&of, 0, sizeof(of));
|
||||||
#ifdef OPENFILENAME_SIZE_VERSION_400
|
|
||||||
of.lStructSize = OPENFILENAME_SIZE_VERSION_400;
|
|
||||||
#else
|
|
||||||
of.lStructSize = sizeof(of);
|
|
||||||
#endif
|
|
||||||
of.hwndOwner = hwnd;
|
of.hwndOwner = hwnd;
|
||||||
if (ppk) {
|
if (ppk) {
|
||||||
of.lpstrFilter = "PuTTY Private Key Files (*.ppk)\0*.ppk\0"
|
of.lpstrFilter = "PuTTY Private Key Files (*.ppk)\0*.ppk\0"
|
||||||
@ -217,13 +212,9 @@ static int prompt_keyfile(HWND hwnd, char *dlgtitle,
|
|||||||
*filename = '\0';
|
*filename = '\0';
|
||||||
of.nMaxFile = FILENAME_MAX;
|
of.nMaxFile = FILENAME_MAX;
|
||||||
of.lpstrFileTitle = NULL;
|
of.lpstrFileTitle = NULL;
|
||||||
of.lpstrInitialDir = NULL;
|
|
||||||
of.lpstrTitle = dlgtitle;
|
of.lpstrTitle = dlgtitle;
|
||||||
of.Flags = 0;
|
of.Flags = 0;
|
||||||
if (save)
|
return request_file(NULL, &of, FALSE, save);
|
||||||
return GetSaveFileName(&of);
|
|
||||||
else
|
|
||||||
return GetOpenFileName(&of);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user