Commit 930b7da6 authored by Phil Krylov's avatar Phil Krylov Committed by Alexandre Julliard

Implemented OFN_OVERWRITEPROMPT and OFN_EXTENSIONDIFFERENT flags.

Changed IDL_OVERWRITEFILE string resource ID to IDS_OVERWRITEFILE. Use the extended UI for the "Look In" combo. Select the text in the "File name" field after filling it.
parent f41e0470
......@@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "找不到文件"
IDS_VERIFYFILE "请检验是否给予正确的文件名称。"
IDS_CREATEFILE "找不到文件\n是否创建新文件?"
IDL_OVERWRITEFILE "文件已经存在。\n要替换吗?"
IDS_OVERWRITEFILE "文件已经存在。\n要替换吗?"
IDS_INVALID_FILENAME_TITLE "文件名中存在无效的字符"
IDS_INVALID_FILENAME "文件名中不能包含任何一下字符:: \n / : < > |"
IDS_PATHNOTEXISTING "文件夹不存在"
......
......@@ -366,7 +366,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Datei nicht gefunden"
IDS_VERIFYFILE "Bitte berprfen sie, ob der korrekte Dateiname angegeben wurde"
IDS_CREATEFILE "Die Datei existiert nicht.\nWollen Sie sie neu anlegen?"
IDL_OVERWRITEFILE "Die Datei existiert bereits.\nWollen Sie sie berschreiben?"
IDS_OVERWRITEFILE "Die Datei existiert bereits.\nWollen Sie sie berschreiben?"
IDS_INVALID_FILENAME_TITLE "Unzulssige Zeichen im Pfad"
IDS_INVALID_FILENAME "Ein Dateiname darf folgende Zeichen nicht enthalten:\n / : < > |"
IDS_PATHNOTEXISTING "Der Pfad existiert nicht"
......
......@@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "File not found"
IDS_VERIFYFILE "Please verify that the correct file name was given"
IDS_CREATEFILE "File does not exist\nDo you want to create file"
IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path"
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
IDS_PATHNOTEXISTING "Path does not exist"
......
......@@ -371,7 +371,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Fichier non trouv"
IDS_VERIFYFILE "Prire de vrifier que le nom de fichier indiqu est correct"
IDS_CREATEFILE "Ce fichier n'existe pas.\nSouhaitez-vous le crer ?"
IDL_OVERWRITEFILE "Ce fichier existe dj.\nVoulez-vous le remplacer ?"
IDS_OVERWRITEFILE "Ce fichier existe dj.\nVoulez-vous le remplacer ?"
IDS_INVALID_FILENAME_TITLE "Le chemin d'accs contient des caractres invalides"
IDS_INVALID_FILENAME "Un nom de fichier ne peut contenir un des caractres suivants : \n / : < > |"
IDS_PATHNOTEXISTING "Le chemin d'accs n'existe pas"
......
......@@ -369,7 +369,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Arquivo no encontrado"
IDS_VERIFYFILE "Por favor verifique se foi fornecido o nome correto do arquivo"
IDS_CREATEFILE "Arquivo no existe\nVoc gostaria de cria-lo"
IDL_OVERWRITEFILE "Arquivo j existe.\nGostaria de substitu-lo?"
IDS_OVERWRITEFILE "Arquivo j existe.\nGostaria de substitu-lo?"
IDS_INVALID_FILENAME_TITLE "Caracter(es) invlidos no caminho"
IDS_INVALID_FILENAME "Um nome de arquivo no pode conter quaisquer dos seguintes caracteres: \n / : < > |"
IDS_PATHNOTEXISTING "Caminho no existe"
......
......@@ -337,7 +337,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND " "
IDS_VERIFYFILE ", "
IDS_CREATEFILE " \n ?"
IDL_OVERWRITEFILE " .\n ?"
IDS_OVERWRITEFILE " .\n ?"
IDS_INVALID_FILENAME_TITLE " "
IDS_INVALID_FILENAME " : \n / : < > |"
IDS_PATHNOTEXISTING " "
......
......@@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Datoteke ni mogoe najti"
IDS_VERIFYFILE "Preverite, ali ste vnesli pravilno ime datoteke"
IDS_CREATEFILE "Datoteka ne obstaja\nAli jo elite ustvariti?"
IDL_OVERWRITEFILE "Datoteka e obstaja.\nAli jo elite zamenjati?"
IDS_OVERWRITEFILE "Datoteka e obstaja.\nAli jo elite zamenjati?"
IDS_INVALID_FILENAME_TITLE "Neustrezni znaki v imenu"
IDS_INVALID_FILENAME "Ime datoteke ne sme vsebovati naslednjih znakov: \n / : < > |"
IDS_PATHNOTEXISTING "Pot ne obstaja"
......
......@@ -339,7 +339,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Sbor nenjden"
IDS_VERIFYFILE "Please verify if the correct file name was given"
IDS_CREATEFILE "File does not exist\nDo you want to create file"
IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path"
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
IDS_PATHNOTEXISTING "Cesta neexistuje"
......
......@@ -361,7 +361,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "Kunde inte hitta filen"
IDS_VERIFYFILE "Vad god verifiera s korrekt filnamn r angivet"
IDS_CREATEFILE "Filen finns inte\nVill du skapa fil"
IDL_OVERWRITEFILE "Filen finns redan.\nVill du erstta den?"
IDS_OVERWRITEFILE "Filen finns redan.\nVill du erstta den?"
IDS_INVALID_FILENAME_TITLE "Illegalt tecken i skvg"
IDS_INVALID_FILENAME "Ett filnamn kan inte innehlla ngon av fljande tecken: \n / : < > |"
IDS_PATHNOTEXISTING "Skvgen finns inte"
......
......@@ -213,7 +213,7 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "File not found"
IDS_VERIFYFILE "Please verify if the correct file name was given"
IDS_CREATEFILE "File does not exist\nDo you want to create file"
IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path"
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
IDS_PATHNOTEXISTING "Path does not exist"
......
......@@ -42,9 +42,9 @@
* FIXME: add to recent docs
*
* FIXME: flags not implemented: OFN_CREATEPROMPT, OFN_DONTADDTORECENT,
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING, OFN_EXTENSIONDIFFERENT,
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING,
* OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN,
* OFN_NOTESTFILECREATE, OFN_OVERWRITEPROMPT, OFN_USEMONIKERS
* OFN_NOTESTFILECREATE, OFN_USEMONIKERS
*
* FIXME: lCustData for lpfnHook (WM_INITDIALOG)
*
......@@ -85,9 +85,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#define UNIMPLEMENTED_FLAGS \
(OFN_CREATEPROMPT | OFN_DONTADDTORECENT |\
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING | OFN_EXTENSIONDIFFERENT |\
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING |\
OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\
OFN_NOTESTFILECREATE | OFN_OVERWRITEPROMPT /*| OFN_USEMONIKERS*/)
OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/)
#define IsHooked(fodInfos) \
((fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook)
......@@ -168,6 +168,8 @@ typedef struct tagLookInInfo
#define CBSetItemHeight(hwnd,index,height) \
SendMessageA(hwnd,CB_SETITEMHEIGHT,(WPARAM)index,(LPARAM)height);
#define CBSetExtendedUI(hwnd,flag) \
SendMessageA(hwnd,CB_SETEXTENDEDUI,(WPARAM)(flag),0)
const char *FileOpenDlgInfosStr = "FileOpenDlgInfos"; /* windows property description string */
const char *LookInInfosStr = "LookInInfos"; /* LOOKIN combo box property */
......@@ -1875,7 +1877,9 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* add default extension */
if (fodInfos->defext)
{
if (! *PathFindExtensionW(lpstrPathAndFile))
WCHAR *ext = PathFindExtensionW(lpstrPathAndFile);
if (! *ext)
{
/* only add "." in case a default extension does exist */
if (*fodInfos->defext != '\0')
......@@ -1886,11 +1890,38 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
strcatW(lpstrPathAndFile, szwDot);
strcatW(lpstrPathAndFile, fodInfos->defext);
/* if file does not exist try without extension */
if (!PathFileExistsW(lpstrPathAndFile))
/* In Open dialog: if file does not exist try without extension */
if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
&& !PathFileExistsW(lpstrPathAndFile))
lpstrPathAndFile[PathLength] = '\0';
}
}
/* Set/clear the output OFN_EXTENSIONDIFFERENT flag */
if (*ext)
ext++;
if (!lstrcmpiW(fodInfos->defext, ext))
fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT;
else
fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT;
}
/* In Save dialog: check if the file already exists */
if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG
&& fodInfos->ofnInfos->Flags & OFN_OVERWRITEPROMPT
&& PathFileExistsW(lpstrPathAndFile))
{
WCHAR lpstrOverwrite[100];
int answer;
LoadStringW(COMDLG32_hInstance, IDS_OVERWRITEFILE, lpstrOverwrite, 100);
answer = MessageBoxW(hwnd, lpstrOverwrite, fodInfos->title,
MB_YESNO | MB_ICONEXCLAMATION);
if (answer == IDNO)
{
ret = FALSE;
goto ret;
}
}
/* Check that the size of the file does not exceed buffer size.
......@@ -2291,6 +2322,9 @@ static HRESULT FILEDLG95_LOOKIN_Init(HWND hwndCombo)
/* set item height for both text field and listbox */
CBSetItemHeight(hwndCombo,-1,GetSystemMetrics(SM_CYSMICON));
CBSetItemHeight(hwndCombo,0,GetSystemMetrics(SM_CYSMICON));
/* Turn on the extended UI for the combo box like Windows does */
CBSetExtendedUI(hwndCombo, TRUE);
/* Initialise data of Desktop folder */
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
......@@ -2807,6 +2841,9 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
}
}
SetWindowTextA( fodInfos->DlgInfos.hwndFileName, lpstrAllFile );
/* Select the file name like Windows does */
SendMessageA(fodInfos->DlgInfos.hwndFileName, EM_SETSEL, (WPARAM)0, (LPARAM)-1);
}
HeapFree(GetProcessHeap(),0, lpstrAllFile );
}
......
......@@ -116,7 +116,7 @@ typedef struct
#define IDS_CREATEFILE 116
#define IDS_CREATEFOLDER_DENIED 117
#define IDS_FILEOPEN_CAPTION 118
#define IDL_OVERWRITEFILE 119
#define IDS_OVERWRITEFILE 119
#define IDS_INVALID_FILENAME_TITLE 120
#define IDS_INVALID_FILENAME 121
#define IDS_PATHNOTEXISTING 122
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment