diff --git a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate index d08edb5..1e9e82f 100644 Binary files a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate and b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Clocker/CommonStrings.h b/Clocker/CommonStrings.h index b9e6cc9..143a4e6 100644 --- a/Clocker/CommonStrings.h +++ b/Clocker/CommonStrings.h @@ -14,5 +14,7 @@ extern NSString *const CLEmptyString; extern NSString *const CLDefaultPreferenceKey; extern NSString *const CLTimezoneName; extern NSString *const CLCustomLabel; -extern NSString *const CLC24hourFormatSelectedKey; +extern NSString *const CL24hourFormatSelectedKey; +extern NSString *const CLDragSessionKey; + @end diff --git a/Clocker/CommonStrings.m b/Clocker/CommonStrings.m index dd7b981..cc4dde3 100644 --- a/Clocker/CommonStrings.m +++ b/Clocker/CommonStrings.m @@ -14,6 +14,7 @@ NSString *const CLEmptyString = @""; NSString *const CLDefaultPreferenceKey = @"defaultPreferences"; NSString *const CLTimezoneName = @"timezoneName"; NSString *const CLCustomLabel = @"customLabel"; -NSString *const CLC24hourFormatSelectedKey = @"is24HourFormatSelected"; +NSString *const CL24hourFormatSelectedKey = @"is24HourFormatSelected"; +NSString *const CLDragSessionKey = @"public.text"; @end diff --git a/Clocker/PanelController.m b/Clocker/PanelController.m index 6f924e0..2d8d2b2 100755 --- a/Clocker/PanelController.m +++ b/Clocker/PanelController.m @@ -49,11 +49,13 @@ #pragma mark - #import "PreferencesWindowController.h" +#import "CommonStrings.h" NSString *const CLPanelNibIdentifier = @"Panel"; NSString *const CLRatingCellViewIdentifier = @"ratingCellView"; NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell"; + @implementation PanelController @@ -87,7 +89,7 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell"; [panel setBackgroundColor:[NSColor clearColor]]; //Register for drag and drop - [self.mainTableview registerForDraggedTypes: [NSArray arrayWithObject: @"public.text"]]; + [self.mainTableview registerForDraggedTypes: [NSArray arrayWithObject:CLDragSessionKey]]; } @@ -435,9 +437,9 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell"; { NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes]; - [pboard declareTypes:[NSArray arrayWithObject:@"public.text"] owner:self]; + [pboard declareTypes:[NSArray arrayWithObject:CLDragSessionKey] owner:self]; - [pboard setData:data forType:@"public.text"]; + [pboard setData:data forType:CLDragSessionKey]; [self updateCellForOldSelection:rowIndexes.firstIndex andColor:[NSColor blackColor]]; return YES; @@ -448,7 +450,7 @@ NSString *const CLTimezoneCellViewIdentifier = @"timeZoneCell"; { NSPasteboard *pBoard = [info draggingPasteboard]; - NSData *data = [pBoard dataForType:@"public.text"]; + NSData *data = [pBoard dataForType:CLDragSessionKey]; NSIndexSet *rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:data]; diff --git a/Clocker/PreferencesWindowController.m b/Clocker/PreferencesWindowController.m index 4438001..1c280c5 100644 --- a/Clocker/PreferencesWindowController.m +++ b/Clocker/PreferencesWindowController.m @@ -38,7 +38,6 @@ #import "CommonStrings.h" NSString *const CLPredicateKey = @"SELF CONTAINS[cd]%@"; -NSString *const CLDragSessionKey = @"public.text"; NSString *const CLPreferencesNibIdentifier = @"PreferencesWindow"; NSString *const CLPreferencesTimezoneNameColumnIdentifier = @"timezoneName"; NSString *const CLPreferencesAbbreviationColumnIdentifier = @"abbreviation"; @@ -217,7 +216,7 @@ static PreferencesWindowController *sharedPreferences = nil; if (self.searchField.stringValue.length > 0) { if ([name isEqualToString:self.filteredArray[self.availableTimezoneTableView.selectedRow]]) { - self.messageLabel.stringValue = @"Timezone has already been selected!"; + self.messageLabel.stringValue = NSLocalizedString(@"DuplicateTimezoneMessage", nil); [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(clearLabel) userInfo:nil repeats:NO]; return; } @@ -335,7 +334,7 @@ static PreferencesWindowController *sharedPreferences = nil; NSButton *is24HourFormatSelected = (NSButton *)sender; - [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:is24HourFormatSelected.state] forKey:@"is24HourFormatSelected"]; + [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:is24HourFormatSelected.state] forKey:CL24hourFormatSelectedKey]; [self refreshMainTableview]; }