mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 11:42:30 +00:00
Displaying dialog when Sparkle is disabled
This commit is contained in:
@@ -25,6 +25,9 @@
|
|||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem title="Check for Updates…" id="zMO-8r-g5v">
|
<menuItem title="Check for Updates…" id="zMO-8r-g5v">
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="checkForUpdates:" target="494" id="5dV-gw-yHT"/>
|
||||||
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem isSeparatorItem="YES" id="236">
|
<menuItem isSeparatorItem="YES" id="236">
|
||||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings;
|
|||||||
|
|
||||||
@property (nonatomic, assign) BOOL isAllowedToStoreKeyFile;
|
@property (nonatomic, assign) BOOL isAllowedToStoreKeyFile;
|
||||||
|
|
||||||
|
- (IBAction)checkForUpdates:(id)sender;
|
||||||
- (IBAction)showPreferences:(id)sender;
|
- (IBAction)showPreferences:(id)sender;
|
||||||
- (IBAction)showPasswordCreator:(id)sender;
|
- (IBAction)showPasswordCreator:(id)sender;
|
||||||
- (IBAction)createNewDatabase:(id)sender;
|
- (IBAction)createNewDatabase:(id)sender;
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
#import "MPTemporaryFileStorageCenter.h"
|
#import "MPTemporaryFileStorageCenter.h"
|
||||||
#import "MPValueTransformerHelper.h"
|
#import "MPValueTransformerHelper.h"
|
||||||
|
|
||||||
|
#import "NSApplication+MPAdditions.h"
|
||||||
|
|
||||||
#import "KeePassKit/KeePassKit.h"
|
#import "KeePassKit/KeePassKit.h"
|
||||||
|
|
||||||
#import <Sparkle/Sparkle.h>
|
#import <Sparkle/Sparkle.h>
|
||||||
@@ -95,7 +97,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
|||||||
- (void)awakeFromNib {
|
- (void)awakeFromNib {
|
||||||
_isAllowedToStoreKeyFile = NO;
|
_isAllowedToStoreKeyFile = NO;
|
||||||
/* Update the … at the save menu */
|
/* 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 */
|
/* We want to inform anyone about the changes to keyFile remembering */
|
||||||
[self bind:NSStringFromSelector(@selector(isAllowedToStoreKeyFile))
|
[self bind:NSStringFromSelector(@selector(isAllowedToStoreKeyFile))
|
||||||
@@ -160,8 +162,8 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
|||||||
[MPAutotypeDaemon defaultDaemon];
|
[MPAutotypeDaemon defaultDaemon];
|
||||||
/* Create Plugin Manager */
|
/* Create Plugin Manager */
|
||||||
[MPPluginManager sharedManager];
|
[MPPluginManager sharedManager];
|
||||||
#ifdef RELEASE
|
#ifndef DEBUG
|
||||||
/* Only enabel updater in Release */
|
/* Only enable updater in Release */
|
||||||
[SUUpdater sharedUpdater];
|
[SUUpdater sharedUpdater];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -227,9 +229,19 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)showHelp:(id)sender {
|
- (void)showHelp:(id)sender {
|
||||||
|
/* TODO: use Info.plist for URL */
|
||||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/mstarke/MacPass"]];
|
[[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 -
|
||||||
#pragma mark Private Helper
|
#pragma mark Private Helper
|
||||||
- (void)_applicationDidFinishRestoringWindows:(NSNotification *)notification {
|
- (void)_applicationDidFinishRestoringWindows:(NSNotification *)notification {
|
||||||
|
|||||||
@@ -34,13 +34,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)awakeFromNib {
|
- (void)awakeFromNib {
|
||||||
#ifdef RELEASE
|
/* only enable bindings to settings in release mode */
|
||||||
|
#ifdef DEBUG
|
||||||
|
self.checkIntervallPopupButton.enabled = NO;
|
||||||
|
self.automaticallyCheckForUpdatesCheckButton.enabled = NO;
|
||||||
|
#else
|
||||||
[self.checkIntervallPopupButton bind:NSSelectedTagBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(updateCheckInterval)) options:nil];
|
[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.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];
|
[self.automaticallyCheckForUpdatesCheckButton bind:NSValueBinding toObject:[SUUpdater sharedUpdater] withKeyPath:NSStringFromSelector(@selector(automaticallyChecksForUpdates)) options:nil];
|
||||||
#else
|
|
||||||
self.checkIntervallPopupButton.enabled = NO;
|
|
||||||
self.automaticallyCheckForUpdatesCheckButton.enabled = NO;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user