From 4e4b0f06f6d67e9d7808450b8b00f452e3f935ab Mon Sep 17 00:00:00 2001 From: michael starke Date: Tue, 13 Jun 2017 11:30:22 +0200 Subject: [PATCH] Added NO_SPARKLE environment ot preprocessor for customization --- MacPass.xcodeproj/project.pbxproj | 2 ++ MacPass/MPAppDelegate.m | 6 +++--- MacPass/MPUpdateSettingsController.m | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 444bc4b5..a2110b54 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -2243,6 +2243,7 @@ GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( + "$(NO_SPARKLE)", "DEBUG=1", "$(inherited)", ); @@ -2285,6 +2286,7 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = "$(NO_SPARKLE)"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 9cc9d374..7be47a0b 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -157,7 +157,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi } - (void)applicationDidFinishLaunching:(NSNotification *)notification { -#if defined(NOSPARKLE) +#if defined(NO_SPARKLE) NSLog(@"Sparkle explicitly disabled!!!"); #endif /* Daemon instanziieren */ @@ -165,7 +165,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi [MPAutotypeDaemon defaultDaemon]; /* Create Plugin Manager */ [MPPluginHost sharedHost]; -#if !defined(DEBUG) && !defined(NOSPARKLE) +#if !defined(DEBUG) && !defined(NO_SPARKLE) /* Disable updates if in debug or nosparkle */ [SUUpdater sharedUpdater]; #endif @@ -234,7 +234,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi } - (void)checkForUpdates:(id)sender { -#if defined(DEBUG) || defined(NOSPARKLE) +#if defined(DEBUG) || defined(NO_SPARKLE) NSAlert *alert = [[NSAlert alloc] init]; alert.messageText = @"Updates are disabled!"; alert.informativeText = [NSString stringWithFormat:@"Sparkle updates are disabled for this build of %@!", NSApp.applicationName]; diff --git a/MacPass/MPUpdateSettingsController.m b/MacPass/MPUpdateSettingsController.m index 01439796..eea0fc74 100644 --- a/MacPass/MPUpdateSettingsController.m +++ b/MacPass/MPUpdateSettingsController.m @@ -35,7 +35,7 @@ - (void)awakeFromNib { /* only enable bindings to settings in release mode */ -#if defined(DEBUG) || defined(NOSPARKLE) +#if defined(DEBUG) || defined(NO_SPARKLE) self.checkIntervallPopupButton.enabled = NO; self.automaticallyCheckForUpdatesCheckButton.enabled = NO; #else