Skip to content

Commit 4e65af7

Browse files
committed
Fixed more deprecated API warnings. We're deploying to 10.10 now!
1 parent ab9dc66 commit 4e65af7

8 files changed

+302
-210
lines changed

SSWebBrowsing.m

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ + (NSString*)defaultBrowserBundleIdentifier {
8080

8181
// Get path (NSString*)
8282
NSString* path = [(NSURL*)browserUrl path] ;
83+
if (browserUrl) {
84+
CFRelease(browserUrl) ;
85+
}
8386
if (!path) {
8487
NSLog(@"Internal Error 324-5847 %@", error) ;
8588
}

SSYAlert.h

+69-26
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
@class SSYWrappingCheckbox ;
44

55
enum {
6-
SSYAlertIconNoIcon, /*!< Alert will have no icon */
6+
SSYAlertIconNoIcon, /*!< Alert will have no icon */
77
SSYAlertIconInformational, /*!< Alert will be app icon with no badge */
88
SSYAlertIconWarning, /*!< Alert will be app icon with yellow warning badge */
9-
SSYAlertIconCritical, /*!< Alert will be app icon with red critical badge */
9+
SSYAlertIconCritical, /*!< Alert will be app icon with red critical badge */
1010
} ;
1111

1212
enum SSYAlertMode_enum {
@@ -17,8 +17,30 @@ enum SSYAlertMode_enum {
1717
typedef enum SSYAlertMode_enum SSYAlertMode ;
1818

1919
/*!
20-
@brief This is an addition to Apple's anonymous enumeration containing
21-
NSAlertFirstButtonReturn, NSAlertThirdButtonReturn, NSAlertSecondButtonReturn and NSAlertErrorReturn.
20+
@details
21+
22+
Classic layout is commonly used when button1 = OK, button2 = cancel
23+
and button3 = alternate. It looks like this:
24+
25+
| [2] [3] [1] |
26+
27+
Right to left layout is what it says
28+
29+
| [3] [2] [1] |
30+
31+
which reflects Apple's current descriptions of NSAlertFirstButtonReturn,
32+
NSAlertSecondButtonReturn, NSAlertThirdButtonReturn
33+
*/
34+
enum SSYAlertButtonLayout_enum {
35+
SSYAlertButtonLayoutClassic,
36+
SSYAlertButtonLayoutRightToLeft,
37+
};
38+
typedef enum SSYAlertMode_enum SSYAlertButtonLayout ;
39+
40+
/*!
41+
@brief These are an addition to Apple's anonymous enumeration containing
42+
NSAlertFirstButtonReturn, NSAlertSecondButtonReturn, NSAlertThirdButtonReturn
43+
and NSAlertErrorReturn.
2244
2345
@details These values are reflected in the 'Sheep Systems Suite'
2446
AppleScript terminology. Any changes you make here should be reflected
@@ -35,6 +57,7 @@ enum SSYAlertRecovery_enum {
3557
SSYAlertRecoveryInternalError = 106
3658
} ;
3759
typedef enum SSYAlertRecovery_enum SSYAlertRecovery ;
60+
3861
enum SSYAlertRecoveryApplescriptCode_enum {
3962
SSYAlertRecoveryAppleScriptCodeThereWasNoError = 'Nerr',
4063
SSYAlertRecoveryAppleScriptCodeSucceeded = 'ReSx',
@@ -44,7 +67,7 @@ enum SSYAlertRecoveryApplescriptCode_enum {
4467
SSYAlertRecoveryAppleScriptCodeErrorIsHidden = 'ErHd',
4568
SSYAlertRecoveryAppleScriptCodeUserCancelledPreviously = 'UsCn'
4669
} ;
47-
typedef enum SSYAlertRecoveryAppleScriptCode_enum SSYAlertRecoveryAppleScriptCode ;
70+
typedef enum SSYAlertRecoveryApplescriptCode_enum SSYAlertRecoveryAppleScriptCode ;
4871

4972
/*!
5073
@brief Key used in the contextInfo sent to attemptRecoveryFromError:::::
@@ -114,8 +137,9 @@ extern NSString* const SSYAlertDidProcessErrorNotification ;
114137
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
115138
in the 'recoveryOption' parameter.
116139
@param error
117-
@param recoveryOption Should be either NSAlertFirstButtonReturn, NSAlertThirdButtonReturn,
118-
or NSAlertAlternate return. Note that this is different from Apple's method
140+
@param recoveryOption Should be one of NSAlertFirstButtonReturn,
141+
NSAlertSecondButtonReturn, or NSAlertAlternate return. Note that this is
142+
different from Apple's method
119143
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
120144
in which the analagous optionIndex parameter can be any nonnegative integer.
121145
@param delegate
@@ -135,8 +159,9 @@ extern NSString* const SSYAlertDidProcessErrorNotification ;
135159
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
136160
in the 'recoveryOption' parameter.
137161
@param error
138-
@param recoveryOption Should be either NSAlertFirstButtonReturn, NSAlertThirdButtonReturn,
139-
or NSAlertAlternate return. Note that this is different from Apple's method
162+
@param recoveryOption Should be one of NSAlertFirstButtonReturn,
163+
NSAlertSecondButtonReturn, or NSAlertThirdButton return. Note that this is
164+
different from Apple's method
140165
attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
141166
in which the analagous optionIndex parameter can be any nonnegative integer.
142167
@result
@@ -433,9 +458,9 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
433458
to specify which didEndSelector runs.
434459
@result Same as Apple's alert returns:
435460
<ul>
436-
<li>If button 1 (left) was clicked, NSAlertFirstButtonReturn.</li>
437-
<li>If button 2 (right) was clicked, NSAlertThirdButtonReturn.</li>
438-
<li>If button 3 (middle) was clicked, NSAlertSecondButtonReturn.</li>
461+
<li>If button 1 (right) was clicked, NSAlertFirstButtonReturn.</li>
462+
<li>If button 2 (middle) was clicked, NSAlertSecondButtonReturn.</li>
463+
<li>If button 3 (left) was clicked, NSAlertThirdButtonReturn.</li>
439464
</ul>
440465
*/
441466
@property (assign) NSInteger alertReturn ;
@@ -576,6 +601,12 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
576601
*/
577602
@property (assign) BOOL shouldStickAround ;
578603

604+
/*!
605+
@brief Specfies how to lay out the buttons during -doooLayout
606+
@details Default value is SSYAlertButtonLayoutClassic.
607+
*/
608+
@property SSYAlertButtonLayout buttonLayout ;
609+
579610

580611
#pragma mark * Class Methods returning Constants
581612

@@ -698,10 +729,11 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
698729
the error -isOnlyInformational.
699730
700731
@param error The error to be presented, or nil.
701-
@result If recovery was not attempted, will be NSAlertFirstButtonReturn, NSAlertThirdButtonReturn,
702-
or NSAlertSecondButtonReturn depending on whether user clicked the first, second, or third button.
703-
If recovery was attempted, result will be SSYAlertRecoverySucceeded, SSYAlertRecoveryFailed,
704-
or SSYAlertRecoveryAttemptedAsynchronously.
732+
@result If recovery was not attempted, will be NSAlertFirstButtonReturn,
733+
NSAlertSecondButtonReturn, or NSAlertThirdButtonReturn depending on whether
734+
user clicked the first, second, or third button from the right.
735+
If recovery was attempted, result will be SSYAlertRecoverySucceeded,
736+
SSYAlertRecoveryFailed, or SSYAlertRecoveryAttemptedAsynchronously.
705737
*/
706738
- (SSYAlertRecovery)alertError:(NSError*)error ;
707739

@@ -761,7 +793,8 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
761793
buttons 1-3, terminated by a nil sentinel.
762794
If no button titles are passed, dialog will have 1 button titled
763795
as localized "OK".
764-
@result Indicates button clicked by user: NSAlertFirstButtonReturn, NSAlertThirdButtonReturn or NSAlertSecondButtonReturn
796+
@result Indicates button clicked by user: NSAlertFirstButtonReturn,
797+
NSAlertSecondButtonReturn or NSAlertThirdButtonReturn
765798
*/
766799
+ (NSInteger)runModalDialogTitle:(NSString*)title
767800
message:(NSString*)msg
@@ -777,7 +810,8 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
777810
@param buttonsArray: An array of 0-3 strings which will become
778811
the titles of buttons 1-3.&nbsp; If this parameter is nil or an
779812
empty array, dialog will have 1 button titled as localized "OK".
780-
@result Indicates button clicked by user: NSAlertFirstButtonReturn, NSAlertThirdButtonReturn or NSAlertSecondButtonReturn
813+
@result Indicates button clicked by user: NSAlertFirstButtonReturn,
814+
NSAlertSecondButtonReturn or NSAlertThirdButtonReturn
781815
*/
782816
+ (NSInteger)runModalDialogTitle:(NSString*)title
783817
message:(NSString*)msg
@@ -852,9 +886,9 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
852886

853887
/*!
854888
@brief Sets the icon which will appear in the receiver
855-
@param iconStyle Pass one of the constants SSYAlertIconWarning, SSYAlertIconNoIcon,
856-
SSYAlertIconCritical, or SSYAlertIconInformational
857-
*/
889+
@param iconStyle Pass one of the constants SSYAlertIconNoIcon,
890+
SSYAlertIconInformational, SSYAlertIconWarning or SSYAlertIconCritical
891+
*/
858892
- (void)setIconStyle:(NSInteger)iconStyle ;
859893

860894
/*!
@@ -1031,16 +1065,19 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
10311065
10321066
@details This method must be invoked after adding, removing, or
10331067
changing size of any subview.
1068+
1069+
Name of this method has been designed to avoid confusion and/or
1070+
conflict with Cocoa's -doLayout method.
10341071
*/
1035-
- (void)doLayout ;
1072+
- (void)doooLayout ;
10361073

10371074

10381075
/*!
10391076
@brief If the receiver's window is visible, lays out all of the
10401077
subviews, makes it the key window and orders it to the front.&nbsp;
10411078
Otherwise, orders the window out.
10421079
1043-
@details This method, or -doLayout, must be invoked after adding,
1080+
@details This method, or -doooLayout, must be invoked after adding,
10441081
removing, or changing size of any subview.
10451082
*/
10461083
- (void)display ;
@@ -1082,7 +1119,7 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
10821119
@details The only way to end a modal dialog is for the user
10831120
to click a button.&nbsp; If the alert does not currently have a button 1,
10841121
this method will add a button 1 before displaying.&nbsp; The title
1085-
of the added button will be [NSString localize:@"ok"].
1122+
of the added button will be [NSString localize:@"OK"].
10861123
10871124
In most cases, you should configure subviews as desired and then
10881125
invoke -display before invoking this method.
@@ -1114,8 +1151,14 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
11141151

11151152

11161153
/*!
1117-
@brief Ends any modal session that might be running and closes the
1118-
receiver's window.
1154+
@brief Ends any modal session that might be running, sets the
1155+
receiver's window's frame size to NSZeroRect and closes it.
1156+
1157+
@details The reason for setting the frame size to NSZeroRect is
1158+
because this signals to SSYSheetManager, in case the receiver's
1159+
window is still in an SSYSheetManagerQueue and has not been displayed
1160+
yet, to skip it when it is dequeued. In other words,
1161+
this method also "cancels" any future display by SSYSheetManager.
11191162
*/
11201163
- (void)goAway ;
11211164

0 commit comments

Comments
 (0)