From dc57628c81cc26fbee763a50d2b1b69add4db3d4 Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 24 Feb 2016 15:17:37 +0100 Subject: [PATCH] SUUpdater now only gets created in release --- MacPass/Base.lproj/MainMenu.xib | 8 ++------ MacPass/Base.lproj/UpdateSettings.xib | 15 +++++---------- MacPass/MPAppDelegate.m | 6 ++++++ MacPass/MPUpdateSettingsController.m | 15 +++++++++++++++ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/MacPass/Base.lproj/MainMenu.xib b/MacPass/Base.lproj/MainMenu.xib index 1905c94f..05fa5a7a 100644 --- a/MacPass/Base.lproj/MainMenu.xib +++ b/MacPass/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -25,9 +25,6 @@ - - - @@ -320,6 +317,5 @@ - diff --git a/MacPass/Base.lproj/UpdateSettings.xib b/MacPass/Base.lproj/UpdateSettings.xib index 4446ce71..a77c535a 100644 --- a/MacPass/Base.lproj/UpdateSettings.xib +++ b/MacPass/Base.lproj/UpdateSettings.xib @@ -1,12 +1,14 @@ - + - + + + @@ -24,9 +26,6 @@ - - - @@ -44,10 +43,6 @@ - - - - @@ -69,7 +64,7 @@ + - diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index f0f6bc40..4567058a 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -38,6 +38,8 @@ #import "KeePassKit/KeePassKit.h" +#import + NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDidChangeStoredKeyFilesSettings"; @interface MPAppDelegate () { @@ -158,6 +160,10 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi [MPAutotypeDaemon defaultDaemon]; /* Create Plugin Manager */ [MPPluginManager sharedManager]; +#ifdef RELEASE + /* Only enabel updater in Release */ + [SUUpdater sharedUpdater]; +#endif } #pragma mark - diff --git a/MacPass/MPUpdateSettingsController.m b/MacPass/MPUpdateSettingsController.m index ac27aa36..f8bbf311 100644 --- a/MacPass/MPUpdateSettingsController.m +++ b/MacPass/MPUpdateSettingsController.m @@ -7,8 +7,11 @@ // #import "MPUpdateSettingsController.h" +#import @interface MPUpdateSettingsController () +@property (weak) IBOutlet NSButton *automaticallyCheckForUpdatesCheckButton; +@property (weak) IBOutlet NSPopUpButton *checkIntervallPopupButton; @end @@ -30,4 +33,16 @@ return NSLocalizedString(@"UPDATE_SETTINGS", @"Update Settings Label"); } +- (void)awakeFromNib { +#ifdef RELEASE + [self.checkIntervallPopupButton bind:NSSelectedTagBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(updateCheckInterval)) options:nil]; + [self.checkIntervallPopupButton bind:NSEnabledBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(automaticallyChecksForUpdates)) options:nil]; + [self.automaticallyCheckForUpdatesCheckButton bind:NSValueBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(automaticallyChecksForUpdates)) options:nil]; +#else + self.checkIntervallPopupButton.enabled = NO; + self.automaticallyCheckForUpdatesCheckButton.enabled = NO; +#endif + +} + @end