Skip to content

Commit

Permalink
Add cancel notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Bunnell committed Sep 30, 2011
1 parent dab67c4 commit cda481d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DBUserDefaults/DBSyncPrompt.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

#import "DBSyncPromptDelegate.h"

extern NSString* const DBSyncPromptUserDidCancelNotification;

@class DBSyncButton;

// This class provides a window in which you can select the type of sync
Expand Down
3 changes: 3 additions & 0 deletions DBUserDefaults/DBSyncPrompt.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
#import "DBUtils.h"
#import "NSImage+BundleLoading.h"

NSString* const DBSyncPromptUserDidCancelNotification =
@"DBSyncPromptUserDidCancelNotification";

static inline CGFloat DegreesToRadians(CGFloat degrees)
{
return degrees * M_PI / 180;
Expand Down
9 changes: 9 additions & 0 deletions DBUserDefaults/DBUserDefaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ - (void)syncPromptDidSelectOption:(DBSyncPromptOption)option
[self enableMonitoring];
}

// If the user cancels the dropbox sync window, we fire a notification.
- (void)syncPromptDidCancel
{
[[NSNotificationCenter defaultCenter]
postNotificationName:DBSyncPromptUserDidCancelNotification
object:nil
userInfo:nil];
}

// Replaces the in-memory defaults dictionary with the contents of the Dropbox
// file.
- (void)syncFromDropbox
Expand Down

0 comments on commit cda481d

Please sign in to comment.