Revision: 27647
          http://sourceforge.net/p/bibdesk/svn/27647
Author:   hofman
Date:     2022-06-18 17:41:32 +0000 (Sat, 18 Jun 2022)
Log Message:
-----------
Pass status window frame to arguments of update app from Sparkle to use the 
same frame as the one run by the app

Modified Paths:
--------------
    
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m
    trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h
    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-18 06:30:19 UTC (rev 27646)
+++ 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m   
    2022-06-18 17:41:32 UTC (rev 27647)
@@ -31,9 +31,9 @@
  * parentProcessId - process identifier of the host before launching us
  * 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 the status window as a string
  */
-- (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:(NSString *)statusFrame;
 
 @end
 
@@ -47,6 +47,7 @@
 @property (nonatomic, copy) NSString *relaunchPath;
 @property (nonatomic, assign) BOOL shouldRelaunch;
 @property (nonatomic, assign) BOOL shouldShowUI;
+@property (nonatomic, copy) NSString *statusFrame;
 
 @property (nonatomic, assign) BOOL isTerminating;
 
@@ -62,8 +63,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:(NSString *)statusFrame
 {
     if (!(self = [super init])) {
         return nil;
@@ -76,7 +78,8 @@
     self.updateFolderPath = updateFolderPath;
     self.shouldRelaunch = shouldRelaunch;
     self.shouldShowUI = shouldShowUI;
-    
+    self.statusFrame = statusFrame;
+
     return self;
 }
 
@@ -137,6 +140,8 @@
         [self.statusController setButtonTitle:SULocalizedString(@"Cancel 
Update", @"") target:nil action:Nil isDefault:NO];
         [self.statusController 
beginActionWithTitle:SULocalizedString(@"Installing update...", @"")
                                    maxProgressValue:100 statusText: @""];
+        if (self.statusFrame.length)
+            [self.statusController.window 
setFrame:NSRectFromString(self.statusFrame) display:NO];
         [self.statusController showWindow:self];
     }
     
@@ -249,7 +254,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) ? [args objectAtIndex:7] : nil];
         [application setDelegate:appInstaller];
         [application run];
     }

Modified: 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h
===================================================================
--- trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h 
2022-06-18 06:30:19 UTC (rev 27646)
+++ trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h 
2022-06-18 17:41:32 UTC (rev 27647)
@@ -19,6 +19,7 @@
 @property (strong, readonly) SUAppcastItem *updateItem;
 @property (strong, readonly) SPUDownloader *download;
 @property (copy, readonly) NSString *downloadPath;
+@property (copy, readonly) NSString *statusFrame;
 
 - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
 

Modified: 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
===================================================================
--- trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m 
2022-06-18 06:30:19 UTC (rev 27646)
+++ trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m 
2022-06-18 17:41:32 UTC (rev 27647)
@@ -55,6 +55,8 @@
 
 @synthesize updateValidator = _updateValidator;
 
+@dynamic statusFrame;
+
 - (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
 {
     [super checkForUpdatesAtURL:URL host:aHost];
@@ -469,6 +471,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 +609,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-18 06:30:19 UTC (rev 27646)
+++ 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m   
    2022-06-18 17:41:32 UTC (rev 27647)
@@ -286,6 +286,13 @@
     [self installWithToolAndRelaunch:YES];
 }
 
+- (NSString *)statusFrame
+{
+    if (self.statusController == nil)
+        return @"";
+    return 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

Reply via email to