summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2015-10-15 19:38:44 +0200
committerDamiano Galassi <[email protected]>2015-10-16 11:23:56 +0200
commit742e32b875a2e6a7c879ba0a84fb7512608c25fd (patch)
treee9cd73bbc797ad5808d12aecea910c5dc7bf22e3 /macosx
parent040a983a188c602a567512a250b5d61f7372a03c (diff)
MacGui: do not try to import a preset even if the cancel button was clicked.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBPresetsViewController.m27
1 files changed, 15 insertions, 12 deletions
diff --git a/macosx/HBPresetsViewController.m b/macosx/HBPresetsViewController.m
index fd8bc9677..8933c7e27 100644
--- a/macosx/HBPresetsViewController.m
+++ b/macosx/HBPresetsViewController.m
@@ -101,7 +101,7 @@
[panel beginWithCompletionHandler:^(NSInteger result)
{
- if (result == NSOKButton)
+ if (result == NSFileHandlingPanelOKButton)
{
NSURL *presetExportDirectory = [panel.URL URLByDeletingLastPathComponent];
[[NSUserDefaults standardUserDefaults] setURL:presetExportDirectory forKey:@"LastPresetExportDirectoryURL"];
@@ -133,19 +133,22 @@
{
[[NSUserDefaults standardUserDefaults] setURL:panel.directoryURL forKey:@"LastPresetImportDirectoryURL"];
- for (NSURL *url in panel.URLs)
+ if (result == NSFileHandlingPanelOKButton)
{
- NSError *error;
- HBPreset *import = [[HBPreset alloc] initWithContentsOfURL:url error:&error];
-
- if (import == nil)
- {
- [self presentError:error];
- }
-
- for (HBPreset *child in import.children)
+ for (NSURL *url in panel.URLs)
{
- [self.presets addPreset:child];
+ NSError *error;
+ HBPreset *import = [[HBPreset alloc] initWithContentsOfURL:url error:&error];
+
+ if (import == nil)
+ {
+ [self presentError:error];
+ }
+
+ for (HBPreset *child in import.children)
+ {
+ [self.presets addPreset:child];
+ }
}
}
}];