Displaying dialog when Sparkle is disabled

This commit is contained in:
michael starke
2016-03-17 17:37:40 +01:00
parent dc57628c81
commit 2af98ef3d6
4 changed files with 24 additions and 7 deletions

View File

@@ -36,6 +36,8 @@
#import "MPTemporaryFileStorageCenter.h"
#import "MPValueTransformerHelper.h"
#import "NSApplication+MPAdditions.h"
#import "KeePassKit/KeePassKit.h"
#import <Sparkle/Sparkle.h>
@@ -95,7 +97,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
- (void)awakeFromNib {
_isAllowedToStoreKeyFile = NO;
/* Update the at the save menu */
[[self.saveMenuItem menu] setDelegate:self];
self.saveMenuItem.menu.delegate = self;
/* We want to inform anyone about the changes to keyFile remembering */
[self bind:NSStringFromSelector(@selector(isAllowedToStoreKeyFile))
@@ -160,8 +162,8 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
[MPAutotypeDaemon defaultDaemon];
/* Create Plugin Manager */
[MPPluginManager sharedManager];
#ifdef RELEASE
/* Only enabel updater in Release */
#ifndef DEBUG
/* Only enable updater in Release */
[SUUpdater sharedUpdater];
#endif
}
@@ -227,9 +229,19 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
}
- (void)showHelp:(id)sender {
/* TODO: use Info.plist for URL */
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/mstarke/MacPass"]];
}
- (void)checkForUpdates:(id)sender {
#ifdef DEBUG
NSAlert *alert = [NSAlert alertWithMessageText:@"Updates are disabled!" defaultButton:@"Ok" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Sparkle updates are only available in offical releases of %@!", NSApp.applicationName];
[alert runModal];
#else
[[SUUpdater sharedUpdater] checkForUpdates:sender];
#endif
}
#pragma mark -
#pragma mark Private Helper
- (void)_applicationDidFinishRestoringWindows:(NSNotification *)notification {