Revision: 13771
http://sourceforge.net/p/skim-app/code/13771
Author: hofman
Date: 2023-11-17 16:01:27 +0000 (Fri, 17 Nov 2023)
Log Message:
-----------
Replace SUUpdater by updater controller in MainMenu nib. Add outlet to
application for updater controller, so we can get to it from the general
preferences.
Modified Paths:
--------------
trunk/Base.lproj/MainMenu.xib
trunk/SKApplication.h
trunk/SKApplication.m
trunk/SKApplicationController.m
trunk/SKGeneralPreferences.m
Modified: trunk/Base.lproj/MainMenu.xib
===================================================================
--- trunk/Base.lproj/MainMenu.xib 2023-11-17 15:48:28 UTC (rev 13770)
+++ trunk/Base.lproj/MainMenu.xib 2023-11-17 16:01:27 UTC (rev 13771)
@@ -5,9 +5,10 @@
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin"
version="19529"/>
</dependencies>
<objects>
- <customObject id="-2" userLabel="File's Owner"
customClass="NSApplication">
+ <customObject id="-2" userLabel="File's Owner"
customClass="SKApplication">
<connections>
<outlet property="delegate" destination="210" id="211"/>
+ <outlet property="updaterController" destination="728"
id="sOn-3e-h4U"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder"
customClass="FirstResponder"/>
@@ -1298,9 +1299,9 @@
</customObject>
<customObject id="457" userLabel="Font Manager"
customClass="NSFontManager"/>
<customObject id="518" userLabel="SKDocumentController"
customClass="SKDocumentController"/>
- <customObject id="728" userLabel="SUUpdater" customClass="SUUpdater">
+ <customObject id="728" userLabel="SPUStandardUpdaterController"
customClass="SPUStandardUpdaterController">
<connections>
- <outlet property="delegate" destination="210" id="967"/>
+ <outlet property="updaterDelegate" destination="210"
id="m9q-R1-qhl"/>
</connections>
</customObject>
<customObject id="1086" customClass="SKBookmarkController"/>
Modified: trunk/SKApplication.h
===================================================================
--- trunk/SKApplication.h 2023-11-17 15:48:28 UTC (rev 13770)
+++ trunk/SKApplication.h 2023-11-17 16:01:27 UTC (rev 13771)
@@ -42,10 +42,15 @@
@protocol SKApplicationDelegate;
+@class SPUStandardUpdaterController;
+
@interface SKApplication : NSApplication {
BOOL userAttentionDisabled;
+ SPUStandardUpdaterController *updaterController;
}
+@property (nonatomic, retain) IBOutlet SPUStandardUpdaterController
*updaterController;
+
@property (nonatomic, getter=isUserAttentionDisabled) BOOL
userAttentionDisabled;
- (void)updatePresentationOptionsForWindow:(NSWindow *)aWindow;
Modified: trunk/SKApplication.m
===================================================================
--- trunk/SKApplication.m 2023-11-17 15:48:28 UTC (rev 13770)
+++ trunk/SKApplication.m 2023-11-17 16:01:27 UTC (rev 13771)
@@ -49,7 +49,7 @@
@implementation SKApplication
-@synthesize userAttentionDisabled;
+@synthesize updaterController, userAttentionDisabled;
- (NSInteger)requestUserAttention:(NSRequestUserAttentionType)requestType {
return userAttentionDisabled ? 0 : [super
requestUserAttention:requestType];
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2023-11-17 15:48:28 UTC (rev 13770)
+++ trunk/SKApplicationController.m 2023-11-17 16:01:27 UTC (rev 13771)
@@ -267,7 +267,7 @@
#pragma mark Updater
-- (void)updaterWillRelaunchApplication:(SUUpdater *)updater {
+- (void)updaterWillRelaunchApplication:(SPUUpdater *)updater {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:SKIsRelaunchKey];
}
Modified: trunk/SKGeneralPreferences.m
===================================================================
--- trunk/SKGeneralPreferences.m 2023-11-17 15:48:28 UTC (rev 13770)
+++ trunk/SKGeneralPreferences.m 2023-11-17 16:01:27 UTC (rev 13771)
@@ -45,6 +45,7 @@
#import "NSImage_SKExtensions.h"
#import "SKViewSettingsController.h"
#import "NSWindowController_SKExtensions.h"
+#import "SKApplication.h"
#define UPDATEINTERVAL_KEY @"updateInterval"
#define AUTOMATICALLYCHECKSFORUPDATES_KEY @"automaticallyChecksForUpdates"
@@ -54,7 +55,8 @@
static char SKGeneralPreferencesUpdaterObservationContext;
-@interface SKGeneralPreferences (Private)
+@interface SKGeneralPreferences ()
+@property (nonatomic, readonly) SPUUpdater *updater;
- (void)synchronizeUpdateInterval;
@end
@@ -61,11 +63,12 @@
@implementation SKGeneralPreferences
@synthesize updateIntervalPopUpButton, updateInterval;
+@dynamic updater;
- (void)dealloc {
@try {
- [[SUUpdater sharedUpdater] removeObserver:self
forKeyPath:AUTOMATICALLYCHECKSFORUPDATES_KEY
context:&SKGeneralPreferencesUpdaterObservationContext];
- [[SUUpdater sharedUpdater] removeObserver:self
forKeyPath:UPDATECHECKINTERVAL_KEY
context:&SKGeneralPreferencesUpdaterObservationContext];
+ [[self updater] removeObserver:self
forKeyPath:AUTOMATICALLYCHECKSFORUPDATES_KEY
context:&SKGeneralPreferencesUpdaterObservationContext];
+ [[self updater] removeObserver:self forKeyPath:UPDATECHECKINTERVAL_KEY
context:&SKGeneralPreferencesUpdaterObservationContext];
}
@catch(id e) {}
SKDESTROY(updateIntervalPopUpButton);
@@ -81,8 +84,8 @@
[self synchronizeUpdateInterval];
- [[SUUpdater sharedUpdater] addObserver:self
forKeyPath:AUTOMATICALLYCHECKSFORUPDATES_KEY options:0
context:&SKGeneralPreferencesUpdaterObservationContext];
- [[SUUpdater sharedUpdater] addObserver:self
forKeyPath:UPDATECHECKINTERVAL_KEY options:0
context:&SKGeneralPreferencesUpdaterObservationContext];
+ [[self updater] addObserver:self
forKeyPath:AUTOMATICALLYCHECKSFORUPDATES_KEY options:0
context:&SKGeneralPreferencesUpdaterObservationContext];
+ [[self updater] addObserver:self forKeyPath:UPDATECHECKINTERVAL_KEY
options:0 context:&SKGeneralPreferencesUpdaterObservationContext];
}
#pragma mark Accessors
@@ -91,11 +94,15 @@
- (void)setUpdateInterval:(NSInteger)interval {
if (interval > 0)
- [[SUUpdater sharedUpdater] setUpdateCheckInterval:interval];
- [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:interval > 0];
+ [[self updater] setUpdateCheckInterval:interval];
+ [[self updater] setAutomaticallyChecksForUpdates:interval > 0];
updateInterval = interval;
}
+- (SPUUpdater *)updater {
+ return [[NSApp updaterController] updater];
+}
+
#pragma mark Actions
- (IBAction)changePDFViewSettings:(id)sender {
@@ -128,7 +135,7 @@
- (void)synchronizeUpdateInterval {
[self willChangeValueForKey:UPDATEINTERVAL_KEY];
- updateInterval = (NSInteger)[[SUUpdater sharedUpdater]
automaticallyChecksForUpdates] ? (NSInteger)[[SUUpdater sharedUpdater]
updateCheckInterval] : 0;
+ updateInterval = (NSInteger)[[self updater] automaticallyChecksForUpdates]
? (NSInteger)[[self updater] updateCheckInterval] : 0;
[self didChangeValueForKey:UPDATEINTERVAL_KEY];
}
@@ -136,8 +143,8 @@
- (void)defaultsDidRevert {
NSTimeInterval interval = [[[NSBundle mainBundle]
objectForInfoDictionaryKey:SUScheduledCheckIntervalKey] doubleValue];
- [[SUUpdater sharedUpdater] setUpdateCheckInterval:interval];
- [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:interval >
0.0];
+ [[self updater] setUpdateCheckInterval:interval];
+ [[self updater] setAutomaticallyChecksForUpdates:interval > 0.0];
}
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit