mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-30 00:13:03 +00:00
and now for macOS
blind coding - untested.....
This commit is contained in:
parent
ab006d5d78
commit
078055526d
1 changed files with 18 additions and 0 deletions
18
extern/nfd-modified/src/nfd_cocoa.mm
vendored
18
extern/nfd-modified/src/nfd_cocoa.mm
vendored
|
@ -149,6 +149,12 @@ nfdresult_t NFD_OpenDialog( const std::vector<std::string>& filterList,
|
|||
// Set the starting directory
|
||||
SetDefaultPath(dialog, defaultPath);
|
||||
|
||||
// Set the file name
|
||||
if (defaultFileName!=NULL) {
|
||||
NSString* defFileName=[NSString stringWithUTF8String:defaultFileName];
|
||||
[dialog setNameFieldStringValue:defFileName];
|
||||
}
|
||||
|
||||
nfdresult_t nfdResult = NFD_CANCEL;
|
||||
if ( [dialog runModal] == NSModalResponseOK )
|
||||
{
|
||||
|
@ -192,6 +198,12 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
|
|||
|
||||
// Set the starting directory
|
||||
SetDefaultPath(dialog, defaultPath);
|
||||
|
||||
// Set the file name
|
||||
if (defaultFileName!=NULL) {
|
||||
NSString* defFileName=[NSString stringWithUTF8String:defaultFileName];
|
||||
[dialog setNameFieldStringValue:defFileName];
|
||||
}
|
||||
|
||||
nfdresult_t nfdResult = NFD_CANCEL;
|
||||
if ( [dialog runModal] == NSModalResponseOK )
|
||||
|
@ -239,6 +251,12 @@ nfdresult_t NFD_SaveDialog( const std::vector<std::string>& filterList,
|
|||
// Set the starting directory
|
||||
SetDefaultPath(dialog, defaultPath);
|
||||
|
||||
// Set the file name
|
||||
if (defaultFileName!=NULL) {
|
||||
NSString* defFileName=[NSString stringWithUTF8String:defaultFileName];
|
||||
[dialog setNameFieldStringValue:defFileName];
|
||||
}
|
||||
|
||||
nfdresult_t nfdResult = NFD_CANCEL;
|
||||
if ( [dialog runModal] == NSModalResponseOK )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue