Commit a64b70d2 authored by David Fuhrmann's avatar David Fuhrmann

macosx: progress dialog: Fix cancellability and cancellable state

According to API, an empty (NULL) cancel string means the dialog
is not cancellable.
Dialog can be also cancelled by calling pf_cancel, which in turn
stops the modal event loop with 0. In this case,
vlc_dialog_id_dismiss shall be called as well.
parent b6ea6f5d
...@@ -286,8 +286,10 @@ static void updateProgressCallback(void *p_data, ...@@ -286,8 +286,10 @@ static void updateProgressCallback(void *p_data,
if ([[dialogData objectAtIndex:5] length] > 0) { if ([[dialogData objectAtIndex:5] length] > 0) {
progressCancelButton.title = [dialogData objectAtIndex:5]; progressCancelButton.title = [dialogData objectAtIndex:5];
progressCancelButton.enabled = YES;
} else { } else {
progressCancelButton.title = _NS("Cancel"); progressCancelButton.title = _NS("Cancel");
progressCancelButton.enabled = NO;
} }
[progressIndicator startAnimation:self]; [progressIndicator startAnimation:self];
...@@ -298,8 +300,7 @@ static void updateProgressCallback(void *p_data, ...@@ -298,8 +300,7 @@ static void updateProgressCallback(void *p_data,
[progressIndicator stopAnimation:self]; [progressIndicator stopAnimation:self];
if (returnValue == -1) vlc_dialog_id_dismiss([[dialogData objectAtIndex:0] pointerValue]);
vlc_dialog_id_dismiss([[dialogData objectAtIndex:0] pointerValue]);
} }
- (void)updateDisplayedProgressDialog:(NSArray *)dialogData - (void)updateDisplayedProgressDialog:(NSArray *)dialogData
......
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