diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 2fc3984c..7f7db53a 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -210,9 +210,9 @@ 4C978E0D19AE54AB003067DF /* MPFlagsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C978E0C19AE54AB003067DF /* MPFlagsHelper.m */; }; 4C9BFFFB1FD19B5400264B16 /* MPPrettyPasswordTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9BFFFA1FD19B5400264B16 /* MPPrettyPasswordTransformer.m */; }; 4CA08DA017A831B200A6544B /* MPAddEntryContextMenuDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA08D9F17A831B200A6544B /* MPAddEntryContextMenuDelegate.m */; }; - 4CA0B2ED15BCADAC00654E32 /* SettingsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */; }; + 4CA0B2ED15BCADAC00654E32 /* PreferencesWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CA0B2EC15BCADAC00654E32 /* PreferencesWindow.xib */; }; 4CA0B2F915BCAF6700654E32 /* MPGeneralSettingsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0B2F815BCAF6700654E32 /* MPGeneralSettingsController.m */; }; - 4CA0B2FC15BCAF8600654E32 /* MPSettingsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0B2FB15BCAF8600654E32 /* MPSettingsWindowController.m */; }; + 4CA0B2FC15BCAF8600654E32 /* MPPreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0B2FB15BCAF8600654E32 /* MPPreferencesWindowController.m */; }; 4CA0F3ED1A3074B50067C0E5 /* MPWindowTitleComboBoxDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0F3EC1A3074B50067C0E5 /* MPWindowTitleComboBoxDelegate.m */; }; 4CA182741F963FF600DD4A4A /* MPTitlebarColorAccessoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA182721F963FF600DD4A4A /* MPTitlebarColorAccessoryViewController.m */; }; 4CA182751F963FF600DD4A4A /* TitlebarColorAccessoryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CA182731F963FF600DD4A4A /* TitlebarColorAccessoryViewController.xib */; }; @@ -724,12 +724,12 @@ 4C9BFFFA1FD19B5400264B16 /* MPPrettyPasswordTransformer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPPrettyPasswordTransformer.m; sourceTree = ""; }; 4CA08D9E17A831B200A6544B /* MPAddEntryContextMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAddEntryContextMenuDelegate.h; sourceTree = ""; }; 4CA08D9F17A831B200A6544B /* MPAddEntryContextMenuDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAddEntryContextMenuDelegate.m; sourceTree = ""; }; - 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SettingsWindow.xib; sourceTree = ""; }; + 4CA0B2EC15BCADAC00654E32 /* PreferencesWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PreferencesWindow.xib; sourceTree = ""; }; 4CA0B2F715BCAF6700654E32 /* MPGeneralSettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPGeneralSettingsController.h; sourceTree = ""; }; 4CA0B2F815BCAF6700654E32 /* MPGeneralSettingsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPGeneralSettingsController.m; sourceTree = ""; }; - 4CA0B2FA15BCAF8600654E32 /* MPSettingsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSettingsWindowController.h; sourceTree = ""; }; - 4CA0B2FB15BCAF8600654E32 /* MPSettingsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSettingsWindowController.m; sourceTree = ""; }; - 4CA0B30D15BCB6FD00654E32 /* MPSettingsTab.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPSettingsTab.h; sourceTree = ""; }; + 4CA0B2FA15BCAF8600654E32 /* MPPreferencesWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPreferencesWindowController.h; sourceTree = ""; }; + 4CA0B2FB15BCAF8600654E32 /* MPPreferencesWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPreferencesWindowController.m; sourceTree = ""; }; + 4CA0B30D15BCB6FD00654E32 /* MPPreferencesTab.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPreferencesTab.h; sourceTree = ""; }; 4CA0F3EB1A3074B50067C0E5 /* MPWindowTitleComboBoxDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPWindowTitleComboBoxDelegate.h; sourceTree = ""; }; 4CA0F3EC1A3074B50067C0E5 /* MPWindowTitleComboBoxDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPWindowTitleComboBoxDelegate.m; sourceTree = ""; }; 4CA182711F963FF600DD4A4A /* MPTitlebarColorAccessoryViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPTitlebarColorAccessoryViewController.h; sourceTree = ""; }; @@ -1246,7 +1246,7 @@ name = "Supporting Files"; sourceTree = ""; }; - 4C47D77718B37911002755E4 /* Settings */ = { + 4C47D77718B37911002755E4 /* Preferences */ = { isa = PBXGroup; children = ( 4CA0B2F715BCAF6700654E32 /* MPGeneralSettingsController.h */, @@ -1268,7 +1268,7 @@ 4CC663E5216F7A7100E33965 /* MPPluginRepositoryBrowserViewController.m */, 4CC663E6216F7A7100E33965 /* PluginRepositoryBrowserView.xib */, ); - name = Settings; + name = Preferences; sourceTree = ""; }; 4C4B7EF517A46815000234C7 /* Inspector */ = { @@ -1547,7 +1547,7 @@ isa = PBXGroup; children = ( 4C5133861FA0C32C00C94C73 /* Accessory */, - 4C47D77718B37911002755E4 /* Settings */, + 4C47D77718B37911002755E4 /* Preferences */, 4C4B7EF517A46815000234C7 /* Inspector */, 4C2E382416D1470200037A9D /* MPViewController.h */, 4C2E382516D1470200037A9D /* MPViewController.m */, @@ -1605,7 +1605,7 @@ 4CA0B30E15BCB70200654E32 /* Protocolls */ = { isa = PBXGroup; children = ( - 4CA0B30D15BCB6FD00654E32 /* MPSettingsTab.h */, + 4CA0B30D15BCB6FD00654E32 /* MPPreferencesTab.h */, 4C2B0B7419F66F6400E48913 /* MPTargetNodeResolving.h */, 4C7679BC1D75E690001F33D6 /* MPModelChangeObserving.h */, ); @@ -1641,9 +1641,9 @@ 4CE8247016E2E96500573141 /* Window Controller */ = { isa = PBXGroup; children = ( - 4CA0B2FA15BCAF8600654E32 /* MPSettingsWindowController.h */, - 4CA0B2FB15BCAF8600654E32 /* MPSettingsWindowController.m */, - 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */, + 4CA0B2FA15BCAF8600654E32 /* MPPreferencesWindowController.h */, + 4CA0B2FB15BCAF8600654E32 /* MPPreferencesWindowController.m */, + 4CA0B2EC15BCADAC00654E32 /* PreferencesWindow.xib */, 4C83814015BF4677001AE468 /* MPDocumentWindowController.h */, 4C83814115BF4677001AE468 /* MPDocumentWindowController.m */, 4CD884B615BD47080042BBF8 /* DocumentWindow.xib */, @@ -1830,7 +1830,7 @@ 4C3826B41AD04D8E007D7D67 /* 39_HistoryTemplate.pdf in Resources */, 4C77E37D15B84A240093A587 /* MainMenu.xib in Resources */, 4C3826CD1AD04D8E007D7D67 /* 66_MoneyTemplate.pdf in Resources */, - 4CA0B2ED15BCADAC00654E32 /* SettingsWindow.xib in Resources */, + 4CA0B2ED15BCADAC00654E32 /* PreferencesWindow.xib in Resources */, 4C76155C1764C04C0015A1A6 /* GeneralSettings.xib in Resources */, 4CD884B715BD47080042BBF8 /* DocumentWindow.xib in Resources */, 4C17F109184E6B6C00E85625 /* 30_TerminalTemplate.pdf in Resources */, @@ -1987,7 +1987,7 @@ 4C8F0C791FD05A6A00BE157F /* NSString+MPPrettyPasswordDisplay.m in Sources */, 4C73B6F1215E64A7009787F7 /* MPWelcomeViewController.m in Sources */, 4C6B7C7D18BE7EB0001D5D77 /* MPDocument+History.m in Sources */, - 4CA0B2FC15BCAF8600654E32 /* MPSettingsWindowController.m in Sources */, + 4CA0B2FC15BCAF8600654E32 /* MPPreferencesWindowController.m in Sources */, 4C4F72D118DF704400E8D378 /* DDHotKeyTextField.m in Sources */, 4C8F0C6E1FCEE9B900BE157F /* MPPluginConstants.m in Sources */, 4C83814215BF4677001AE468 /* MPDocumentWindowController.m in Sources */, diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 7d407453..e20d7831 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -33,7 +33,7 @@ #import "MPPasswordCreatorViewController.h" #import "MPPluginHost.h" #import "MPSettingsHelper.h" -#import "MPSettingsWindowController.h" +#import "MPPreferencesWindowController.h" #import "MPStringLengthValueTransformer.h" #import "MPPrettyPasswordTransformer.h" #import "MPTemporaryFileStorageCenter.h" @@ -59,7 +59,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi @property (strong) NSWindow *welcomeWindow; @property (strong) IBOutlet NSWindow *passwordCreatorWindow; -@property (strong, nonatomic) MPSettingsWindowController *settingsController; +@property (strong, nonatomic) MPPreferencesWindowController *preferencesController; @property (strong, nonatomic) MPPasswordCreatorViewController *passwordCreatorController; @end @@ -228,10 +228,10 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi #pragma mark - #pragma mark Actions - (void)showPreferences:(id)sender { - if(self.settingsController == nil) { - self.settingsController = [[MPSettingsWindowController alloc] init]; + if(self.preferencesController == nil) { + self.preferencesController = [[MPPreferencesWindowController alloc] init]; } - [self.settingsController showSettings]; + [self.preferencesController showPreferences]; } - (void)showPasswordCreator:(id)sender { diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 99f46795..306993fd 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -523,7 +523,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou } - (NSURL *)suggestedKeyURL { - MPAppDelegate *delegate = (MPAppDelegate *)[NSApp delegate]; + MPAppDelegate *delegate = (MPAppDelegate *)NSApp.delegate; if(!delegate.isAllowedToStoreKeyFile) { return nil; } @@ -630,7 +630,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou if(!metaData.enforceMasterKeyChange) { return NO; } - return ((24*60*60*metaData.masterKeyChangeEnforcementInterval) < -[metaData.masterKeyChanged timeIntervalSinceNow]); + return ((24*60*60*metaData.masterKeyChangeEnforcementInterval) < - metaData.masterKeyChanged.timeIntervalSinceNow); } - (BOOL)shouldRecommendPasswordChange { @@ -638,7 +638,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou if(!metaData.recommendMasterKeyChange) { return NO; } - return ( (24*60*60*metaData.masterKeyChangeRecommendationInterval) < -[metaData.masterKeyChanged timeIntervalSinceNow]); + return ( (24*60*60*metaData.masterKeyChangeRecommendationInterval) < - metaData.masterKeyChanged.timeIntervalSinceNow); } #pragma mark Data manipulation diff --git a/MacPass/MPGeneralSettingsController.h b/MacPass/MPGeneralSettingsController.h index 9c9f525e..894dd2b4 100644 --- a/MacPass/MPGeneralSettingsController.h +++ b/MacPass/MPGeneralSettingsController.h @@ -22,9 +22,9 @@ #import #import "MPViewController.h" -#import "MPSettingsTab.h" +#import "MPPreferencesTab.h" -@interface MPGeneralSettingsController : MPViewController +@interface MPGeneralSettingsController : MPViewController @property (weak) IBOutlet NSButton *clearPasteboardOnQuitCheckButton; @property (weak) IBOutlet NSPopUpButton *clearPasteboardTimeoutPopup; diff --git a/MacPass/MPIntegrationSettingsController.h b/MacPass/MPIntegrationSettingsController.h index 656a459c..c4e58e05 100644 --- a/MacPass/MPIntegrationSettingsController.h +++ b/MacPass/MPIntegrationSettingsController.h @@ -21,11 +21,11 @@ // #import "MPViewController.h" -#import "MPSettingsTab.h" +#import "MPPreferencesTab.h" @class DDHotKeyTextField; -@interface MPIntegrationSettingsController : MPViewController +@interface MPIntegrationSettingsController : MPViewController /* Autotype */ @property (strong) IBOutlet NSButton *enableGlobalAutotypeCheckBox; @property (strong) IBOutlet DDHotKeyTextField *hotKeyTextField; diff --git a/MacPass/MPPluginHost.m b/MacPass/MPPluginHost.m index 1918047e..3e2d7ec1 100644 --- a/MacPass/MPPluginHost.m +++ b/MacPass/MPPluginHost.m @@ -31,6 +31,7 @@ #import "MPPluginVersionComparator.h" #import "NSApplication+MPAdditions.h" +#import "MPAppDelegate.h" #import "MPSettingsHelper.h" #import "NSError+Messages.h" @@ -286,7 +287,25 @@ NSString *const MPPluginHostPluginBundleIdentifiyerKey = @"MPPluginHostPluginBun alert.informativeText = NSLocalizedString(@"ALERT_INCOMPATIBLE_PLUGINS_ENCOUNTERED_INFORMATIVE_TEXT", "Informative text of the alert displayed when plugins where disabled due to incompatibilty"); alert.alertStyle = NSAlertStyleWarning; alert.showsSuppressionButton = YES; - [alert runModal]; + [alert addButtonWithTitle:NSLocalizedString(@"ALERT_INCOMPATIBLE_PLUGINS_ENCOUNTERED_BUTTON_OK", @"Button in dialog to leave plugin ds disabled and continiue!")]; + [alert addButtonWithTitle:NSLocalizedString(@"ALERT_INCOMPATIBLE_PLUGINS_ENCOUNTERED_BUTTON_OPEN_PREFERENCES", @"Button in dialog to open plugin preferences pane!")]; + NSModalResponse returnCode = [alert runModal]; + //BOOL suppressWarning = (alert.suppressionButton.state == NSOnState); + //[NSUserDefaults.standardUserDefaults setBool:suppressWarning forKey:kMPSettingsKeyAutotypeHideAccessibiltyWarning]; + switch(returnCode) { + case NSAlertFirstButtonReturn: { + /* ok, ignore */ + break; + } + case NSAlertSecondButtonReturn: + /* open prefs */ + [((MPAppDelegate *)NSApp.delegate) showPreferences:nil]; + break; + default: + break; + } + + } } diff --git a/MacPass/MPPluginSettingsController.h b/MacPass/MPPluginSettingsController.h index bc5034ba..85bad1d3 100644 --- a/MacPass/MPPluginSettingsController.h +++ b/MacPass/MPPluginSettingsController.h @@ -21,9 +21,9 @@ // #import "MPViewController.h" -#import "MPSettingsTab.h" +#import "MPPreferencesTab.h" -@interface MPPluginSettingsController : MPViewController +@interface MPPluginSettingsController : MPViewController - (IBAction)addOrRemovePlugin:(id)sender; - (IBAction)browsePlugins:(id)sender; diff --git a/MacPass/MPSettingsTab.h b/MacPass/MPPreferencesTab.h similarity index 97% rename from MacPass/MPSettingsTab.h rename to MacPass/MPPreferencesTab.h index eba33760..3972ca61 100644 --- a/MacPass/MPSettingsTab.h +++ b/MacPass/MPPreferencesTab.h @@ -26,7 +26,7 @@ Protrocoll to be implemented by ViewControllers that can be added to the settings windows. Tabs are ordered as the controllers are included. */ -@protocol MPSettingsTab +@protocol MPPreferencesTab @required @property (readonly, copy) NSString *identifier; diff --git a/MacPass/MPSettingsWindowController.h b/MacPass/MPPreferencesWindowController.h similarity index 71% rename from MacPass/MPSettingsWindowController.h rename to MacPass/MPPreferencesWindowController.h index 0b5c9bd2..82fe1a46 100644 --- a/MacPass/MPSettingsWindowController.h +++ b/MacPass/MPPreferencesWindowController.h @@ -22,11 +22,18 @@ #import -@protocol MPSettingsTab; +@protocol MPPreferencesTab; -@interface MPSettingsWindowController : NSWindowController +typedef NS_ENUM(NSUInteger, MPPreferencesTab) { + MPPreferencesTabGeneral, + MPPreferencesTabWorkflow, + MPPreferencesTabUpdate, + MPPreferencesTabPlugins +}; -- (void)showSettings; -- (void)showSettingsTabWithIdentifier:(NSString *)identifier; +@interface MPPreferencesWindowController : NSWindowController + +- (void)showPreferences; +- (void)showPreferencesTab:(MPPreferencesTab)tab; @end diff --git a/MacPass/MPSettingsWindowController.m b/MacPass/MPPreferencesWindowController.m similarity index 72% rename from MacPass/MPSettingsWindowController.m rename to MacPass/MPPreferencesWindowController.m index 2d3cfa06..e3720ceb 100644 --- a/MacPass/MPSettingsWindowController.m +++ b/MacPass/MPPreferencesWindowController.m @@ -20,40 +20,43 @@ // along with this program. If not, see . // -#import "MPSettingsWindowController.h" +#import "MPPreferencesWindowController.h" + +#import "MPPreferencesTab.h" + #import "MPGeneralSettingsController.h" #import "MPIntegrationSettingsController.h" #import "MPWorkflowSettingsController.h" #import "MPUpdateSettingsController.h" #import "MPPluginSettingsController.h" -@interface MPSettingsWindowController () { +@interface MPPreferencesWindowController () { NSString *lastIdentifier; } -@property (strong, nonatomic) NSMutableDictionary *settingsController; +@property (strong, nonatomic) NSMutableDictionary *preferencesController; @property (strong, nonatomic) NSMutableDictionary *toolbarItems; @property (strong) NSArray *defaultToolbarItems; @end -@implementation MPSettingsWindowController +@implementation MPPreferencesWindowController - (NSString *)windowNibName { - return @"SettingsWindow"; + return @"PreferencesWindow"; } -(id)init { self = [super initWithWindow:nil]; if(self) { - NSToolbar *tb = [[NSToolbar alloc] initWithIdentifier:@"SettingsToolBar"]; + NSToolbar *tb = [[NSToolbar alloc] initWithIdentifier:@"PreferencesToolBar"]; tb.allowsUserCustomization = NO; tb.displayMode = NSToolbarDisplayModeIconAndLabel; - _settingsController = [[NSMutableDictionary alloc] initWithCapacity:5]; + _preferencesController = [[NSMutableDictionary alloc] initWithCapacity:5]; _toolbarItems = [[NSMutableDictionary alloc] initWithCapacity:5]; lastIdentifier = nil; - [self _setupDefaultSettingsTabs]; + [self _setupDefaultPreferencesTabs]; tb.delegate = self; self.window.toolbar = tb; @@ -62,17 +65,17 @@ } -- (void)showSettings { +- (void)showPreferences { if(self.defaultToolbarItems.count > 0) { - [self showSettingsTabWithIdentifier:self.defaultToolbarItems[0]]; + [self _showPreferencesTabWithIdentifier:self.defaultToolbarItems[0]]; } } -- (void)showSettingsTabWithIdentifier:(NSString *)identifier { +- (void)_showPreferencesTabWithIdentifier:(NSString *)identifier { if(nil == identifier) { @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Identifier cannot be nil" userInfo:nil]; } - id tab = self.settingsController[identifier]; + id tab = self.preferencesController[identifier]; if(tab == nil){ NSLog(@"Warning. Unknown settingscontroller for identifier: %@. Did you miss to add the controller?", identifier); return; @@ -111,8 +114,35 @@ [self.window makeKeyAndOrderFront:nil]; } -- (void)_addSettingsTab:(id)tabController { - if(NO == [tabController conformsToProtocol:@protocol(MPSettingsTab)]) { +- (void)showPreferencesTab:(MPPreferencesTab)tab { + Class tabClass; + switch(tab) { + case MPPreferencesTabPlugins: + tabClass = MPPluginSettingsController.class; + break; + case MPPreferencesTabUpdate: + tabClass = MPUpdateSettingsController.class; + break; + case MPPreferencesTabWorkflow: + tabClass = MPWorkflowSettingsController.class; + break; + case MPPreferencesTabGeneral: + default: + tabClass = MPGeneralSettingsController.class; + break; + } + NSString *identifier; + for(id tab in self.preferencesController) { + if([tab isKindOfClass:tabClass]) { + identifier = tab.identifier; + break; + } + } + [self _showPreferencesTabWithIdentifier:identifier]; +} + +- (void)_addSettingsTab:(id)tabController { + if(NO == [tabController conformsToProtocol:@protocol(MPPreferencesTab)]) { NSException *protocollException = [NSException exceptionWithName:NSInvalidArgumentException reason:@"Controller must conform to MPSettingsTabProtrocoll" userInfo:nil]; @@ -125,22 +155,22 @@ @throw controllerException; } NSString *identifier = tabController.identifier; - if(nil != self.settingsController[identifier]) { + if(nil != self.preferencesController[identifier]) { NSLog(@"Warning: Settingscontroller with identifier %@ already present!", identifier); } else { - self.settingsController[identifier] = tabController; + self.preferencesController[identifier] = tabController; } } -- (void)_setupDefaultSettingsTabs { +- (void)_setupDefaultPreferencesTabs { NSArray *controllers = @[ [[MPGeneralSettingsController alloc] init], - [[MPIntegrationSettingsController alloc] init], - [[MPWorkflowSettingsController alloc] init], - [[MPUpdateSettingsController alloc] init], - [[MPPluginSettingsController alloc] init] ]; + [[MPIntegrationSettingsController alloc] init], + [[MPWorkflowSettingsController alloc] init], + [[MPUpdateSettingsController alloc] init], + [[MPPluginSettingsController alloc] init] ]; NSMutableArray *identifier = [[NSMutableArray alloc] initWithCapacity:controllers.count]; - for(id controller in controllers) { + for(id controller in controllers) { [self _addSettingsTab:controller]; [identifier addObject:controller.identifier]; } @@ -150,14 +180,14 @@ - (void)_showSettingsTab:(id)sender { if([sender respondsToSelector:@selector(itemIdentifier)]) { NSString *identfier = [sender itemIdentifier]; - [self showSettingsTabWithIdentifier:identfier]; + [self _showPreferencesTabWithIdentifier:identfier]; } } #pragma mark NSToolbarDelegate - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - return self.settingsController.allKeys; + return self.preferencesController.allKeys; } - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { @@ -165,7 +195,7 @@ } - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar { - return self.settingsController.allKeys; + return self.preferencesController.allKeys; } - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag { @@ -176,7 +206,7 @@ Setup the item to use the controllers label if one is present and supports the appropriate @optional protocol messages */ - id tab = self.settingsController[itemIdentifier]; + id tab = self.preferencesController[itemIdentifier]; if([tab respondsToSelector:@selector(label)]) { item.label = [tab label]; } diff --git a/MacPass/MPUpdateSettingsController.h b/MacPass/MPUpdateSettingsController.h index dce84418..41e1cc4d 100644 --- a/MacPass/MPUpdateSettingsController.h +++ b/MacPass/MPUpdateSettingsController.h @@ -21,8 +21,8 @@ // #import "MPViewController.h" -#import "MPSettingsTab.h" +#import "MPPreferencesTab.h" -@interface MPUpdateSettingsController : MPViewController +@interface MPUpdateSettingsController : MPViewController @end diff --git a/MacPass/MPWorkflowSettingsController.h b/MacPass/MPWorkflowSettingsController.h index 490e6921..50b6b5a6 100644 --- a/MacPass/MPWorkflowSettingsController.h +++ b/MacPass/MPWorkflowSettingsController.h @@ -21,9 +21,9 @@ // #import "MPViewController.h" -#import "MPSettingsTab.h" +#import "MPPreferencesTab.h" -@interface MPWorkflowSettingsController : MPViewController +@interface MPWorkflowSettingsController : MPViewController @property (weak) IBOutlet NSPopUpButton *browserPopup; @property (weak) IBOutlet NSPopUpButton *doubleClickURLPopup; diff --git a/MacPass/SettingsWindow.xib b/MacPass/PreferencesWindow.xib similarity index 80% rename from MacPass/SettingsWindow.xib rename to MacPass/PreferencesWindow.xib index 976bde4b..67a449d7 100644 --- a/MacPass/SettingsWindow.xib +++ b/MacPass/PreferencesWindow.xib @@ -1,18 +1,19 @@ - + - + + - + - +