Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d441d3b8
Commit
d441d3b8
authored
May 24, 2011
by
David Hedberg
Committed by
Alexandre Julliard
May 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Implement SetDefaultFilename.
parent
5fd6180a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
4 deletions
+80
-4
cdlg.h
dlls/comdlg32/cdlg.h
+1
-0
filedlg.c
dlls/comdlg32/filedlg.c
+1
-1
itemdlg.c
dlls/comdlg32/itemdlg.c
+78
-3
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+0
-0
No files found.
dlls/comdlg32/cdlg.h
View file @
d441d3b8
...
@@ -178,6 +178,7 @@ void COMDLG32_GetCanonicalPath(PCIDLIST_ABSOLUTE pidlAbsCurrent, LPWSTR lpstrFil
...
@@ -178,6 +178,7 @@ void COMDLG32_GetCanonicalPath(PCIDLIST_ABSOLUTE pidlAbsCurrent, LPWSTR lpstrFil
int
FILEDLG95_ValidatePathAction
(
LPWSTR
lpstrPathAndFile
,
IShellFolder
**
ppsf
,
int
FILEDLG95_ValidatePathAction
(
LPWSTR
lpstrPathAndFile
,
IShellFolder
**
ppsf
,
HWND
hwnd
,
DWORD
flags
,
BOOL
isSaveDlg
,
int
defAction
)
DECLSPEC_HIDDEN
;
HWND
hwnd
,
DWORD
flags
,
BOOL
isSaveDlg
,
int
defAction
)
DECLSPEC_HIDDEN
;
int
COMDLG32_SplitFileNames
(
LPWSTR
lpstrEdit
,
UINT
nStrLen
,
LPWSTR
*
lpstrFileList
,
UINT
*
sizeUsed
)
DECLSPEC_HIDDEN
;
int
COMDLG32_SplitFileNames
(
LPWSTR
lpstrEdit
,
UINT
nStrLen
,
LPWSTR
*
lpstrFileList
,
UINT
*
sizeUsed
)
DECLSPEC_HIDDEN
;
void
FILEDLG95_OnOpenMessage
(
HWND
hwnd
,
int
idCaption
,
int
idText
)
DECLSPEC_HIDDEN
;
/* ITEMIDLIST */
/* ITEMIDLIST */
...
...
dlls/comdlg32/filedlg.c
View file @
d441d3b8
...
@@ -2259,7 +2259,7 @@ static void FILEDLG95_MRU_load_filename(LPWSTR stored_path)
...
@@ -2259,7 +2259,7 @@ static void FILEDLG95_MRU_load_filename(LPWSTR stored_path)
TRACE
(
"got MRU path: %s
\n
"
,
wine_dbgstr_w
(
stored_path
));
TRACE
(
"got MRU path: %s
\n
"
,
wine_dbgstr_w
(
stored_path
));
}
}
static
void
FILEDLG95_OnOpenMessage
(
HWND
hwnd
,
int
idCaption
,
int
idText
)
void
FILEDLG95_OnOpenMessage
(
HWND
hwnd
,
int
idCaption
,
int
idText
)
{
{
WCHAR
strMsgTitle
[
MAX_PATH
];
WCHAR
strMsgTitle
[
MAX_PATH
];
WCHAR
strMsgText
[
MAX_PATH
];
WCHAR
strMsgText
[
MAX_PATH
];
...
...
dlls/comdlg32/itemdlg.c
View file @
d441d3b8
...
@@ -87,6 +87,7 @@ typedef struct FileDialogImpl {
...
@@ -87,6 +87,7 @@ typedef struct FileDialogImpl {
DWORD
ebevents_cookie
;
DWORD
ebevents_cookie
;
LPWSTR
set_filename
;
LPWSTR
set_filename
;
LPWSTR
default_ext
;
LPWSTR
custom_title
;
LPWSTR
custom_title
;
LPWSTR
custom_okbutton
;
LPWSTR
custom_okbutton
;
LPWSTR
custom_cancelbutton
;
LPWSTR
custom_cancelbutton
;
...
@@ -271,6 +272,21 @@ static void fill_filename_from_selection(FileDialogImpl *This)
...
@@ -271,6 +272,21 @@ static void fill_filename_from_selection(FileDialogImpl *This)
return
;
return
;
}
}
static
LPWSTR
get_first_ext_from_spec
(
LPWSTR
buf
,
LPCWSTR
spec
)
{
WCHAR
*
endpos
,
*
ext
;
lstrcpyW
(
buf
,
spec
);
if
(
(
endpos
=
StrChrW
(
buf
,
';'
))
)
*
endpos
=
'\0'
;
ext
=
PathFindExtensionW
(
buf
);
if
(
StrChrW
(
ext
,
'*'
))
return
NULL
;
return
ext
;
}
static
HRESULT
on_default_action
(
FileDialogImpl
*
This
)
static
HRESULT
on_default_action
(
FileDialogImpl
*
This
)
{
{
IShellFolder
*
psf_parent
,
*
psf_desktop
;
IShellFolder
*
psf_parent
,
*
psf_desktop
;
...
@@ -316,9 +332,62 @@ static HRESULT on_default_action(FileDialogImpl *This)
...
@@ -316,9 +332,62 @@ static HRESULT on_default_action(FileDialogImpl *This)
open_action
=
ONOPEN_BROWSE
;
open_action
=
ONOPEN_BROWSE
;
open_action
=
FILEDLG95_ValidatePathAction
(
canon_filename
,
&
psf_parent
,
This
->
dlg_hwnd
,
open_action
=
FILEDLG95_ValidatePathAction
(
canon_filename
,
&
psf_parent
,
This
->
dlg_hwnd
,
This
->
options
,
(
This
->
dlg_type
==
ITEMDLG_TYPE_SAVE
),
This
->
options
&
~
FOS_FILEMUSTEXIST
,
(
This
->
dlg_type
==
ITEMDLG_TYPE_SAVE
),
open_action
);
open_action
);
/* Add the proper extension */
if
(
open_action
==
ONOPEN_OPEN
)
{
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
if
(
This
->
dlg_type
==
ITEMDLG_TYPE_SAVE
)
{
WCHAR
extbuf
[
MAX_PATH
],
*
newext
=
NULL
;
if
(
This
->
filterspec_count
)
{
newext
=
get_first_ext_from_spec
(
extbuf
,
This
->
filterspecs
[
This
->
filetypeindex
].
pszSpec
);
}
else
if
(
This
->
default_ext
)
{
lstrcpyW
(
extbuf
,
dotW
);
lstrcatW
(
extbuf
,
This
->
default_ext
);
newext
=
extbuf
;
}
if
(
newext
)
{
WCHAR
*
ext
=
PathFindExtensionW
(
canon_filename
);
if
(
lstrcmpW
(
ext
,
newext
))
lstrcatW
(
canon_filename
,
newext
);
}
}
else
{
if
(
!
(
This
->
options
&
FOS_NOVALIDATE
)
&&
(
This
->
options
&
FOS_FILEMUSTEXIST
)
&&
!
PathFileExistsW
(
canon_filename
))
{
if
(
This
->
default_ext
)
{
lstrcatW
(
canon_filename
,
dotW
);
lstrcatW
(
canon_filename
,
This
->
default_ext
);
if
(
!
PathFileExistsW
(
canon_filename
))
{
FILEDLG95_OnOpenMessage
(
This
->
dlg_hwnd
,
0
,
IDS_FILENOTEXISTING
);
open_action
=
ONOPEN_BROWSE
;
}
}
else
{
FILEDLG95_OnOpenMessage
(
This
->
dlg_hwnd
,
0
,
IDS_FILENOTEXISTING
);
open_action
=
ONOPEN_BROWSE
;
}
}
}
}
pidla
[
i
]
=
COMDLG32_SHSimpleIDListFromPathAW
(
canon_filename
);
pidla
[
i
]
=
COMDLG32_SHSimpleIDListFromPathAW
(
canon_filename
);
if
(
psf_parent
&&
!
(
open_action
==
ONOPEN_BROWSE
))
if
(
psf_parent
&&
!
(
open_action
==
ONOPEN_BROWSE
))
...
@@ -959,6 +1028,7 @@ static ULONG WINAPI IFileDialog2_fnRelease(IFileDialog2 *iface)
...
@@ -959,6 +1028,7 @@ static ULONG WINAPI IFileDialog2_fnRelease(IFileDialog2 *iface)
if
(
This
->
psia_results
)
IShellItemArray_Release
(
This
->
psia_results
);
if
(
This
->
psia_results
)
IShellItemArray_Release
(
This
->
psia_results
);
LocalFree
(
This
->
set_filename
);
LocalFree
(
This
->
set_filename
);
LocalFree
(
This
->
default_ext
);
LocalFree
(
This
->
custom_title
);
LocalFree
(
This
->
custom_title
);
LocalFree
(
This
->
custom_okbutton
);
LocalFree
(
This
->
custom_okbutton
);
LocalFree
(
This
->
custom_cancelbutton
);
LocalFree
(
This
->
custom_cancelbutton
);
...
@@ -1281,8 +1351,12 @@ static HRESULT WINAPI IFileDialog2_fnAddPlace(IFileDialog2 *iface, IShellItem *p
...
@@ -1281,8 +1351,12 @@ static HRESULT WINAPI IFileDialog2_fnAddPlace(IFileDialog2 *iface, IShellItem *p
static
HRESULT
WINAPI
IFileDialog2_fnSetDefaultExtension
(
IFileDialog2
*
iface
,
LPCWSTR
pszDefaultExtension
)
static
HRESULT
WINAPI
IFileDialog2_fnSetDefaultExtension
(
IFileDialog2
*
iface
,
LPCWSTR
pszDefaultExtension
)
{
{
FileDialogImpl
*
This
=
impl_from_IFileDialog2
(
iface
);
FileDialogImpl
*
This
=
impl_from_IFileDialog2
(
iface
);
FIXME
(
"stub - %p (%s)
\n
"
,
This
,
debugstr_w
(
pszDefaultExtension
));
TRACE
(
"%p (%s)
\n
"
,
This
,
debugstr_w
(
pszDefaultExtension
));
return
E_NOTIMPL
;
LocalFree
(
This
->
default_ext
);
This
->
default_ext
=
StrDupW
(
pszDefaultExtension
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
IFileDialog2_fnClose
(
IFileDialog2
*
iface
,
HRESULT
hr
)
static
HRESULT
WINAPI
IFileDialog2_fnClose
(
IFileDialog2
*
iface
,
HRESULT
hr
)
...
@@ -2316,6 +2390,7 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **p
...
@@ -2316,6 +2390,7 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **p
fdimpl
->
peb
=
NULL
;
fdimpl
->
peb
=
NULL
;
fdimpl
->
set_filename
=
NULL
;
fdimpl
->
set_filename
=
NULL
;
fdimpl
->
default_ext
=
NULL
;
fdimpl
->
custom_cancelbutton
=
fdimpl
->
custom_filenamelabel
=
NULL
;
fdimpl
->
custom_cancelbutton
=
fdimpl
->
custom_filenamelabel
=
NULL
;
/* FIXME: The default folder setting should be restored for the
/* FIXME: The default folder setting should be restored for the
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
d441d3b8
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment