Revision: 12924
          http://sourceforge.net/p/skim-app/code/12924
Author:   hofman
Date:     2022-06-18 17:31:06 +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/vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m
    trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h
    trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
    trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUStatus.xib
    trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m

Modified: trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m       
2022-05-12 09:50:44 UTC (rev 12923)
+++ trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/Autoupdate/Autoupdate.m       
2022-06-18 17:31:06 UTC (rev 12924)
@@ -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 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 +48,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 +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:(NSString *)statusFrame
 {
     if (!(self = [super init])) {
         return nil;
@@ -76,7 +79,8 @@
     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 (self.statusFrame.length)
+            [self.statusController.window 
setFrame:NSRectFromString(self.statusFrame) display:NO];
         [self.statusController showWindow:self];
     }
     
@@ -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) ? [args objectAtIndex:7] : nil];
         [application setDelegate:appInstaller];
         [application run];
     }

Modified: trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h 
2022-05-12 09:50:44 UTC (rev 12923)
+++ trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.h 
2022-06-18 17:31:06 UTC (rev 12924)
@@ -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/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m 
2022-05-12 09:50:44 UTC (rev 12923)
+++ trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m 
2022-06-18 17:31:06 UTC (rev 12924)
@@ -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/vendorsrc/andymatuschak/Sparkle/Sparkle/SUStatus.xib
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUStatus.xib  2022-05-12 
09:50:44 UTC (rev 12923)
+++ trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUStatus.xib  2022-06-18 
17:31:06 UTC (rev 12924)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" 
propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <development version="7000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="11542"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19529"/>
+        <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" 
customClass="SUStatusController">
@@ -20,13 +20,13 @@
             <windowStyleMask key="styleMask" titled="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" 
rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="200" y="222" width="400" height="107"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="775"/>
             <value key="minSize" type="size" width="213" height="107"/>
             <view key="contentView" id="6">
                 <rect key="frame" x="0.0" y="0.0" width="400" height="107"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <imageView id="7">
+                    <imageView fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="7">
                         <rect key="frame" x="24" y="28" width="64" 
height="64"/>
                         <autoresizingMask key="autoresizingMask" 
flexibleMaxX="YES" flexibleMinY="YES"/>
                         <imageCell key="cell" refusesFirstResponder="YES" 
alignment="left" imageScaling="axesIndependently" image="NSApplicationIcon" 
id="53"/>
@@ -34,7 +34,7 @@
                             <binding destination="-2" name="value" 
keyPath="applicationIcon" id="9"/>
                         </connections>
                     </imageView>
-                    <textField verticalHuggingPriority="750" id="8">
+                    <textField verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="8">
                         <rect key="frame" x="106" y="75" width="277" 
height="17"/>
                         <autoresizingMask key="autoresizingMask" 
flexibleMaxX="YES" flexibleMinY="YES"/>
                         <textFieldCell key="cell" 
sendsActionOnEndEditing="YES" title="Status Text (set by loc. string in code)" 
id="54">
@@ -46,7 +46,7 @@
                             <binding destination="-2" name="value" 
keyPath="title" id="26"/>
                         </connections>
                     </textField>
-                    <progressIndicator verticalHuggingPriority="750" 
maxValue="100" bezeled="NO" indeterminate="YES" style="bar" id="11">
+                    <progressIndicator verticalHuggingPriority="750" 
fixedFrame="YES" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" 
translatesAutoresizingMaskIntoConstraints="NO" id="11">
                         <rect key="frame" x="107" y="47" width="275" 
height="20"/>
                         <autoresizingMask key="autoresizingMask"/>
                         <connections>
@@ -54,8 +54,8 @@
                             <binding destination="-2" name="value" 
keyPath="progressValue" previousBinding="13" id="27"/>
                         </connections>
                     </progressIndicator>
-                    <button verticalHuggingPriority="750" id="12">
-                        <rect key="frame" x="272" y="12" width="114" 
height="32"/>
+                    <button verticalHuggingPriority="750" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="12">
+                        <rect key="frame" x="272" y="12" width="113" 
height="32"/>
                         <autoresizingMask key="autoresizingMask" 
flexibleMinX="YES" widthSizable="YES"/>
                         <buttonCell key="cell" type="push" title="Button" 
bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="55">
                             <behavior key="behavior" pushIn="YES" 
lightByBackground="YES" lightByGray="YES"/>
@@ -65,7 +65,7 @@
                             <binding destination="-2" name="title" 
keyPath="buttonTitle" id="21"/>
                         </connections>
                     </button>
-                    <textField verticalHuggingPriority="750" id="16">
+                    <textField verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" fixedFrame="YES" 
translatesAutoresizingMaskIntoConstraints="NO" id="16">
                         <rect key="frame" x="106" y="22" width="167" 
height="17"/>
                         <autoresizingMask key="autoresizingMask"/>
                         <textFieldCell key="cell" 
sendsActionOnEndEditing="YES" title="Small System Font Text" id="56">
@@ -87,9 +87,10 @@
             <connections>
                 <binding destination="-2" name="title" keyPath="windowTitle" 
id="24"/>
             </connections>
+            <point key="canvasLocation" x="139" y="126"/>
         </window>
     </objects>
     <resources>
-        <image name="NSApplicationIcon" width="128" height="128"/>
+        <image name="NSApplicationIcon" width="32" height="32"/>
     </resources>
 </document>

Modified: trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m       
2022-05-12 09:50:44 UTC (rev 12923)
+++ trunk/vendorsrc/andymatuschak/Sparkle/Sparkle/SUUIBasedUpdateDriver.m       
2022-06-18 17:31:06 UTC (rev 12924)
@@ -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.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to