mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 14:29:50 +08:00
[mac] Fix for cancelling Dialogs. Fixes #1047
This commit is contained in:
parent
0571deb290
commit
e2f3a11a33
@ -540,6 +540,10 @@
|
|||||||
|
|
||||||
// Setup callback handler
|
// Setup callback handler
|
||||||
[dialog beginSheetModalForWindow:self.mainWindow completionHandler:^(NSModalResponse returnCode) {
|
[dialog beginSheetModalForWindow:self.mainWindow completionHandler:^(NSModalResponse returnCode) {
|
||||||
|
if ( returnCode != NSModalResponseOK) {
|
||||||
|
processOpenFileDialogResponse("[]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
NSMutableArray *arr = [NSMutableArray new];
|
NSMutableArray *arr = [NSMutableArray new];
|
||||||
for (NSURL *url in [dialog URLs]) {
|
for (NSURL *url in [dialog URLs]) {
|
||||||
[arr addObject:[url path]];
|
[arr addObject:[url path]];
|
||||||
@ -592,10 +596,12 @@
|
|||||||
|
|
||||||
// Setup callback handler
|
// Setup callback handler
|
||||||
[dialog beginSheetModalForWindow:self.mainWindow completionHandler:^(NSModalResponse returnCode) {
|
[dialog beginSheetModalForWindow:self.mainWindow completionHandler:^(NSModalResponse returnCode) {
|
||||||
NSURL *url = [dialog URL];
|
if ( returnCode == NSModalResponseOK ) {
|
||||||
if ( url != nil ) {
|
NSURL *url = [dialog URL];
|
||||||
processSaveFileDialogResponse([url.path UTF8String]);
|
if ( url != nil ) {
|
||||||
return;
|
processSaveFileDialogResponse([url.path UTF8String]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
processSaveFileDialogResponse("");
|
processSaveFileDialogResponse("");
|
||||||
}];
|
}];
|
||||||
|
Loading…
Reference in New Issue
Block a user