mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 20:18:28 +00:00
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.
This commit is contained in:
parent
f41e047020
commit
930b7da626
12 changed files with 55 additions and 18 deletions
|
@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "找不到文件"
|
IDS_FILENOTFOUND "找不到文件"
|
||||||
IDS_VERIFYFILE "请检验是否给予正确的文件名称。"
|
IDS_VERIFYFILE "请检验是否给予正确的文件名称。"
|
||||||
IDS_CREATEFILE "找不到文件\n是否创建新文件?"
|
IDS_CREATEFILE "找不到文件\n是否创建新文件?"
|
||||||
IDL_OVERWRITEFILE "文件已经存在。\n要替换吗?"
|
IDS_OVERWRITEFILE "文件已经存在。\n要替换吗?"
|
||||||
IDS_INVALID_FILENAME_TITLE "文件名中存在无效的字符"
|
IDS_INVALID_FILENAME_TITLE "文件名中存在无效的字符"
|
||||||
IDS_INVALID_FILENAME "文件名中不能包含任何一下字符:: \n / : < > |"
|
IDS_INVALID_FILENAME "文件名中不能包含任何一下字符:: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "文件夹不存在"
|
IDS_PATHNOTEXISTING "文件夹不存在"
|
||||||
|
|
|
@ -366,7 +366,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "Datei nicht gefunden"
|
IDS_FILENOTFOUND "Datei nicht gefunden"
|
||||||
IDS_VERIFYFILE "Bitte überprüfen sie, ob der korrekte Dateiname angegeben wurde"
|
IDS_VERIFYFILE "Bitte überprüfen sie, ob der korrekte Dateiname angegeben wurde"
|
||||||
IDS_CREATEFILE "Die Datei existiert nicht.\nWollen Sie sie neu anlegen?"
|
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 "Unzulässige Zeichen im Pfad"
|
IDS_INVALID_FILENAME_TITLE "Unzulässige Zeichen im Pfad"
|
||||||
IDS_INVALID_FILENAME "Ein Dateiname darf folgende Zeichen nicht enthalten:\n / : < > |"
|
IDS_INVALID_FILENAME "Ein Dateiname darf folgende Zeichen nicht enthalten:\n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Der Pfad existiert nicht"
|
IDS_PATHNOTEXISTING "Der Pfad existiert nicht"
|
||||||
|
|
|
@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "File not found"
|
IDS_FILENOTFOUND "File not found"
|
||||||
IDS_VERIFYFILE "Please verify that the correct file name was given"
|
IDS_VERIFYFILE "Please verify that the correct file name was given"
|
||||||
IDS_CREATEFILE "File does not exist\nDo you want to create file"
|
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_TITLE "Invalid character(s) in path"
|
||||||
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
|
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Path does not exist"
|
IDS_PATHNOTEXISTING "Path does not exist"
|
||||||
|
|
|
@ -371,7 +371,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "Fichier non trouvé"
|
IDS_FILENOTFOUND "Fichier non trouvé"
|
||||||
IDS_VERIFYFILE "Prière de vérifier que le nom de fichier indiqué est correct"
|
IDS_VERIFYFILE "Prière de vérifier que le nom de fichier indiqué est correct"
|
||||||
IDS_CREATEFILE "Ce fichier n'existe pas.\nSouhaitez-vous le créer ?"
|
IDS_CREATEFILE "Ce fichier n'existe pas.\nSouhaitez-vous le créer ?"
|
||||||
IDL_OVERWRITEFILE "Ce fichier existe déjà.\nVoulez-vous le remplacer ?"
|
IDS_OVERWRITEFILE "Ce fichier existe déjà.\nVoulez-vous le remplacer ?"
|
||||||
IDS_INVALID_FILENAME_TITLE "Le chemin d'accès contient des caractères invalides"
|
IDS_INVALID_FILENAME_TITLE "Le chemin d'accès contient des caractères invalides"
|
||||||
IDS_INVALID_FILENAME "Un nom de fichier ne peut contenir un des caractères suivants : \n / : < > |"
|
IDS_INVALID_FILENAME "Un nom de fichier ne peut contenir un des caractères suivants : \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Le chemin d'accès n'existe pas"
|
IDS_PATHNOTEXISTING "Le chemin d'accès n'existe pas"
|
||||||
|
|
|
@ -369,7 +369,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "Arquivo não encontrado"
|
IDS_FILENOTFOUND "Arquivo não encontrado"
|
||||||
IDS_VERIFYFILE "Por favor verifique se foi fornecido o nome correto do arquivo"
|
IDS_VERIFYFILE "Por favor verifique se foi fornecido o nome correto do arquivo"
|
||||||
IDS_CREATEFILE "Arquivo não existe\nVocê gostaria de cria-lo"
|
IDS_CREATEFILE "Arquivo não 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) inválidos no caminho"
|
IDS_INVALID_FILENAME_TITLE "Caracter(es) inválidos no caminho"
|
||||||
IDS_INVALID_FILENAME "Um nome de arquivo não pode conter quaisquer dos seguintes caracteres: \n / : < > |"
|
IDS_INVALID_FILENAME "Um nome de arquivo não pode conter quaisquer dos seguintes caracteres: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Caminho não existe"
|
IDS_PATHNOTEXISTING "Caminho não existe"
|
||||||
|
|
|
@ -337,7 +337,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "Файл не найден"
|
IDS_FILENOTFOUND "Файл не найден"
|
||||||
IDS_VERIFYFILE "Проверьте, правильно ли указано имя файла"
|
IDS_VERIFYFILE "Проверьте, правильно ли указано имя файла"
|
||||||
IDS_CREATEFILE "Файла не существует\nХотите ли Вы его создать?"
|
IDS_CREATEFILE "Файла не существует\nХотите ли Вы его создать?"
|
||||||
IDL_OVERWRITEFILE "Файл уже существует.\nЗаменить его?"
|
IDS_OVERWRITEFILE "Файл уже существует.\nЗаменить его?"
|
||||||
IDS_INVALID_FILENAME_TITLE "Некорректный символ в записи пути"
|
IDS_INVALID_FILENAME_TITLE "Некорректный символ в записи пути"
|
||||||
IDS_INVALID_FILENAME "Имя файла не может содержать следующие символы: \n / : < > |"
|
IDS_INVALID_FILENAME "Имя файла не может содержать следующие символы: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Путь не существует"
|
IDS_PATHNOTEXISTING "Путь не существует"
|
||||||
|
|
|
@ -368,7 +368,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "Datoteke ni mogoèe najti"
|
IDS_FILENOTFOUND "Datoteke ni mogoèe najti"
|
||||||
IDS_VERIFYFILE "Preverite, ali ste vnesli pravilno ime datoteke"
|
IDS_VERIFYFILE "Preverite, ali ste vnesli pravilno ime datoteke"
|
||||||
IDS_CREATEFILE "Datoteka ne obstaja\nAli jo želite ustvariti?"
|
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_TITLE "Neustrezni znaki v imenu"
|
||||||
IDS_INVALID_FILENAME "Ime datoteke ne sme vsebovati naslednjih znakov: \n / : < > |"
|
IDS_INVALID_FILENAME "Ime datoteke ne sme vsebovati naslednjih znakov: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Pot ne obstaja"
|
IDS_PATHNOTEXISTING "Pot ne obstaja"
|
||||||
|
|
|
@ -339,7 +339,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "Súbor nenájdený"
|
IDS_FILENOTFOUND "Súbor nenájdený"
|
||||||
IDS_VERIFYFILE "Please verify if the correct file name was given"
|
IDS_VERIFYFILE "Please verify if the correct file name was given"
|
||||||
IDS_CREATEFILE "File does not exist\nDo you want to create file"
|
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_TITLE "Invalid character(s) in path"
|
||||||
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
|
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Cesta neexistuje"
|
IDS_PATHNOTEXISTING "Cesta neexistuje"
|
||||||
|
|
|
@ -361,7 +361,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "Kunde inte hitta filen"
|
IDS_FILENOTFOUND "Kunde inte hitta filen"
|
||||||
IDS_VERIFYFILE "Vad god verifiera så korrekt filnamn är angivet"
|
IDS_VERIFYFILE "Vad god verifiera så korrekt filnamn är angivet"
|
||||||
IDS_CREATEFILE "Filen finns inte\nVill du skapa fil"
|
IDS_CREATEFILE "Filen finns inte\nVill du skapa fil"
|
||||||
IDL_OVERWRITEFILE "Filen finns redan.\nVill du ersätta den?"
|
IDS_OVERWRITEFILE "Filen finns redan.\nVill du ersätta den?"
|
||||||
IDS_INVALID_FILENAME_TITLE "Illegalt tecken i sökväg"
|
IDS_INVALID_FILENAME_TITLE "Illegalt tecken i sökväg"
|
||||||
IDS_INVALID_FILENAME "Ett filnamn kan inte innehålla någon av följande tecken: \n / : < > |"
|
IDS_INVALID_FILENAME "Ett filnamn kan inte innehålla någon av följande tecken: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Sökvägen finns inte"
|
IDS_PATHNOTEXISTING "Sökvägen finns inte"
|
||||||
|
|
|
@ -213,7 +213,7 @@ STRINGTABLE DISCARDABLE
|
||||||
IDS_FILENOTFOUND "File not found"
|
IDS_FILENOTFOUND "File not found"
|
||||||
IDS_VERIFYFILE "Please verify if the correct file name was given"
|
IDS_VERIFYFILE "Please verify if the correct file name was given"
|
||||||
IDS_CREATEFILE "File does not exist\nDo you want to create file"
|
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_TITLE "Invalid character(s) in path"
|
||||||
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
|
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
|
||||||
IDS_PATHNOTEXISTING "Path does not exist"
|
IDS_PATHNOTEXISTING "Path does not exist"
|
||||||
|
|
|
@ -42,9 +42,9 @@
|
||||||
* FIXME: add to recent docs
|
* FIXME: add to recent docs
|
||||||
*
|
*
|
||||||
* FIXME: flags not implemented: OFN_CREATEPROMPT, OFN_DONTADDTORECENT,
|
* FIXME: flags not implemented: OFN_CREATEPROMPT, OFN_DONTADDTORECENT,
|
||||||
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING, OFN_EXTENSIONDIFFERENT,
|
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING,
|
||||||
* OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN,
|
* OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN,
|
||||||
* OFN_NOTESTFILECREATE, OFN_OVERWRITEPROMPT, OFN_USEMONIKERS
|
* OFN_NOTESTFILECREATE, OFN_USEMONIKERS
|
||||||
*
|
*
|
||||||
* FIXME: lCustData for lpfnHook (WM_INITDIALOG)
|
* FIXME: lCustData for lpfnHook (WM_INITDIALOG)
|
||||||
*
|
*
|
||||||
|
@ -85,9 +85,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
|
||||||
|
|
||||||
#define UNIMPLEMENTED_FLAGS \
|
#define UNIMPLEMENTED_FLAGS \
|
||||||
(OFN_CREATEPROMPT | OFN_DONTADDTORECENT |\
|
(OFN_CREATEPROMPT | OFN_DONTADDTORECENT |\
|
||||||
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING | OFN_EXTENSIONDIFFERENT |\
|
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING |\
|
||||||
OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\
|
OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\
|
||||||
OFN_NOTESTFILECREATE | OFN_OVERWRITEPROMPT /*| OFN_USEMONIKERS*/)
|
OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/)
|
||||||
|
|
||||||
#define IsHooked(fodInfos) \
|
#define IsHooked(fodInfos) \
|
||||||
((fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook)
|
((fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook)
|
||||||
|
@ -168,6 +168,8 @@ typedef struct tagLookInInfo
|
||||||
#define CBSetItemHeight(hwnd,index,height) \
|
#define CBSetItemHeight(hwnd,index,height) \
|
||||||
SendMessageA(hwnd,CB_SETITEMHEIGHT,(WPARAM)index,(LPARAM)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 *FileOpenDlgInfosStr = "FileOpenDlgInfos"; /* windows property description string */
|
||||||
const char *LookInInfosStr = "LookInInfos"; /* LOOKIN combo box property */
|
const char *LookInInfosStr = "LookInInfos"; /* LOOKIN combo box property */
|
||||||
|
@ -1875,7 +1877,9 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
/* add default extension */
|
/* add default extension */
|
||||||
if (fodInfos->defext)
|
if (fodInfos->defext)
|
||||||
{
|
{
|
||||||
if (! *PathFindExtensionW(lpstrPathAndFile))
|
WCHAR *ext = PathFindExtensionW(lpstrPathAndFile);
|
||||||
|
|
||||||
|
if (! *ext)
|
||||||
{
|
{
|
||||||
/* only add "." in case a default extension does exist */
|
/* only add "." in case a default extension does exist */
|
||||||
if (*fodInfos->defext != '\0')
|
if (*fodInfos->defext != '\0')
|
||||||
|
@ -1886,11 +1890,38 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
strcatW(lpstrPathAndFile, szwDot);
|
strcatW(lpstrPathAndFile, szwDot);
|
||||||
strcatW(lpstrPathAndFile, fodInfos->defext);
|
strcatW(lpstrPathAndFile, fodInfos->defext);
|
||||||
|
|
||||||
/* if file does not exist try without extension */
|
/* In Open dialog: if file does not exist try without extension */
|
||||||
if (!PathFileExistsW(lpstrPathAndFile))
|
if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
|
||||||
|
&& !PathFileExistsW(lpstrPathAndFile))
|
||||||
lpstrPathAndFile[PathLength] = '\0';
|
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.
|
/* 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 */
|
/* set item height for both text field and listbox */
|
||||||
CBSetItemHeight(hwndCombo,-1,GetSystemMetrics(SM_CYSMICON));
|
CBSetItemHeight(hwndCombo,-1,GetSystemMetrics(SM_CYSMICON));
|
||||||
CBSetItemHeight(hwndCombo,0,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 */
|
/* Initialise data of Desktop folder */
|
||||||
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
|
SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
|
||||||
|
@ -2807,6 +2841,9 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetWindowTextA( fodInfos->DlgInfos.hwndFileName, lpstrAllFile );
|
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 );
|
HeapFree(GetProcessHeap(),0, lpstrAllFile );
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ typedef struct
|
||||||
#define IDS_CREATEFILE 116
|
#define IDS_CREATEFILE 116
|
||||||
#define IDS_CREATEFOLDER_DENIED 117
|
#define IDS_CREATEFOLDER_DENIED 117
|
||||||
#define IDS_FILEOPEN_CAPTION 118
|
#define IDS_FILEOPEN_CAPTION 118
|
||||||
#define IDL_OVERWRITEFILE 119
|
#define IDS_OVERWRITEFILE 119
|
||||||
#define IDS_INVALID_FILENAME_TITLE 120
|
#define IDS_INVALID_FILENAME_TITLE 120
|
||||||
#define IDS_INVALID_FILENAME 121
|
#define IDS_INVALID_FILENAME 121
|
||||||
#define IDS_PATHNOTEXISTING 122
|
#define IDS_PATHNOTEXISTING 122
|
||||||
|
|
Loading…
Reference in a new issue