Revision: 27650
http://sourceforge.net/p/bibdesk/svn/27650
Author: hofman
Date: 2022-06-19 14:31:12 +0000 (Sun, 19 Jun 2022)
Log Message:
-----------
Pass frame for status window to autoupodate app so it can use the same frame
for UI based driver
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m
Modified:
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m
===================================================================
---
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m
2022-06-19 09:19:39 UTC (rev 27649)
+++
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m
2022-06-19 14:31:12 UTC (rev 27650)
@@ -32,8 +32,9 @@
* updateFolderPath - path to update folder (i.e, temporary directory
containing the new update)
* shouldRelaunch - indicates if the new installed app should re-launched
* shouldShowUI - indicates if we should show the status window when
installing the update
+ * statusFrame - the frame to use for for the status window
*/
-- (instancetype)initWithHostPath:(NSString *)hostPath relaunchPath:(NSString
*)relaunchPath parentProcessId:(pid_t)parentProcessId
updateFolderPath:(NSString *)updateFolderPath
shouldRelaunch:(BOOL)shouldRelaunch shouldShowUI:(BOOL)shouldShowUI;
+- (instancetype)initWithHostPath:(NSString *)hostPath relaunchPath:(NSString
*)relaunchPath parentProcessId:(pid_t)parentProcessId
updateFolderPath:(NSString *)updateFolderPath
shouldRelaunch:(BOOL)shouldRelaunch shouldShowUI:(BOOL)shouldShowUI
statusFrame:(NSRect)statusFrame;
@end
@@ -47,6 +48,7 @@
@property (nonatomic, copy) NSString *relaunchPath;
@property (nonatomic, assign) BOOL shouldRelaunch;
@property (nonatomic, assign) BOOL shouldShowUI;
+@property (nonatomic, assign) NSRect statusFrame;
@property (nonatomic, assign) BOOL isTerminating;
@@ -62,8 +64,9 @@
@synthesize shouldRelaunch = _shouldRelaunch;
@synthesize shouldShowUI = _shouldShowUI;
@synthesize isTerminating = _isTerminating;
+@synthesize statusFrame = _statusFrame;
-- (instancetype)initWithHostPath:(NSString *)hostPath relaunchPath:(NSString
*)relaunchPath parentProcessId:(pid_t)parentProcessId
updateFolderPath:(NSString *)updateFolderPath
shouldRelaunch:(BOOL)shouldRelaunch shouldShowUI:(BOOL)shouldShowUI
+- (instancetype)initWithHostPath:(NSString *)hostPath relaunchPath:(NSString
*)relaunchPath parentProcessId:(pid_t)parentProcessId
updateFolderPath:(NSString *)updateFolderPath
shouldRelaunch:(BOOL)shouldRelaunch shouldShowUI:(BOOL)shouldShowUI
statusFrame:(NSRect)statusFrame
{
if (!(self = [super init])) {
return nil;
@@ -76,6 +79,7 @@
self.updateFolderPath = updateFolderPath;
self.shouldRelaunch = shouldRelaunch;
self.shouldShowUI = shouldShowUI;
+ self.statusFrame = statusFrame;
return self;
}
@@ -137,6 +141,8 @@
[self.statusController setButtonTitle:SULocalizedString(@"Cancel
Update", @"") target:nil action:Nil isDefault:NO];
[self.statusController
beginActionWithTitle:SULocalizedString(@"Installing update...", @"")
maxProgressValue:100 statusText: @""];
+ if (NSIsEmptyRect(self.statusFrame) == NO)
+ [self.statusController.window setFrame:self.statusFrame
display:NO];
[self.statusController showWindow:self];
}
@@ -233,7 +239,7 @@
@autoreleasepool
{
NSArray<NSString *> *args = [[NSProcessInfo processInfo] arguments];
- if (args.count < 5 || args.count > 7) {
+ if (args.count < 5 || args.count > 8) {
return EXIT_FAILURE;
}
@@ -249,7 +255,8 @@
parentProcessId:[[args objectAtIndex:3] intValue]
updateFolderPath:[args objectAtIndex:4]
shouldRelaunch:(args.count > 5) ? [[args objectAtIndex:5] boolValue] : YES
-
shouldShowUI:shouldShowUI];
+
shouldShowUI:shouldShowUI
+
statusFrame:(args.count > 7) ? NSRectFromString([args objectAtIndex:7]) :
NSZeroRect];
[application setDelegate:appInstaller];
[application run];
}
Modified:
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
===================================================================
--- trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
2022-06-19 09:19:39 UTC (rev 27649)
+++ trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
2022-06-19 14:31:12 UTC (rev 27650)
@@ -469,6 +469,11 @@
return (!updater.delegate || ![updater.delegate
respondsToSelector:@selector(updaterShouldRelaunchApplication:)] ||
[updater.delegate updaterShouldRelaunchApplication:self.updater]);
}
+- (NSString *)statusFrame
+{
+ return @"";
+}
+
- (void)installWithToolAndRelaunch:(BOOL)relaunch
displayingUserInterface:(BOOL)showUI
{
assert(self.updateItem);
@@ -602,7 +607,8 @@
[NSString
stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]],
self.tempDir,
relaunch ?
@"1" : @"0",
- showUI ?
@"1" : @"0"]];
+ showUI ?
@"1" : @"0",
+
self.statusFrame]];
[self terminateApp];
}
Modified:
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m
===================================================================
---
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m
2022-06-19 09:19:39 UTC (rev 27649)
+++
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m
2022-06-19 14:31:12 UTC (rev 27650)
@@ -286,6 +286,11 @@
[self installWithToolAndRelaunch:YES];
}
+- (NSString *)statusFrame
+{
+ return self.statusController == nil ? @"" :
NSStringFromRect(self.statusController.window.frame);
+}
+
- (void)installWithToolAndRelaunch:(BOOL)relaunch
{
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing
update...", @"Take care not to overflow the status window.")
maxProgressValue:0.0 statusText:nil];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit