15
15
#import " NSError+Recovery.h"
16
16
#import " NSError+SSYInfo.h"
17
17
#import " SSYWindowHangout.h"
18
+ #import " NSBundle+MainApp.h"
18
19
19
20
NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager = nil ;
20
21
@@ -363,7 +364,7 @@ @implementation SSYAlert : NSWindowController
363
364
364
365
365
366
+ (NSString *)supportEmailString {
366
- return [[NSBundle mainBundle ] objectForInfoDictionaryKey: SSYAlert_ErrorSupportEmailKey] ;
367
+ return [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: SSYAlert_ErrorSupportEmailKey] ;
367
368
}
368
369
369
370
- (id )clickObject {
@@ -651,18 +652,18 @@ + (NSInteger)tryRecoveryAttempterForError:(NSError*)error
651
652
652
653
- (IBAction )help : (id )sender {
653
654
[[NSHelpManager sharedHelpManager ] openHelpAnchor: [self helpAnchorString ]
654
- inBook: [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleHelpBookName" ]] ;
655
+ inBook: [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleHelpBookName" ]] ;
655
656
}
656
657
657
658
- (IBAction )support : (id )sender {
658
659
[SSYAlert supportError: [self errorPresenting ]] ;
659
660
}
660
661
661
662
+ (void )supportError : (NSError *)error {
662
- NSString * appName = [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleExecutable" ] ;
663
+ NSString * appName = [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleExecutable" ] ;
663
664
// Note: If you'd prefer the app name to be localized, use "CFBundleName" instead.
664
- NSString * appVersion = [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleVersion" ] ;
665
- NSString * appVersionString = [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleShortVersionString" ] ;
665
+ NSString * appVersion = [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleVersion" ] ;
666
+ NSString * appVersionString = [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleShortVersionString" ] ;
666
667
NSString * systemDescription = [SSYSystemDescriber softwareVersionAndArchitecture ] ;
667
668
NSString * mailableDescription ;
668
669
if (
@@ -678,7 +679,7 @@ + (void)supportError:(NSError*)error {
678
679
679
680
NSString * filename = [NSString stringWithFormat:
680
681
@" %@ -Error-%lx .txt" ,
681
- [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleName" ],
682
+ [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleName" ],
682
683
(long )[NSDate timeIntervalSinceReferenceDate ]] ;
683
684
NSString * filePath = [[NSHomeDirectory () stringByAppendingPathComponent: @" Desktop" ] stringByAppendingPathComponent: filename] ;
684
685
NSError * writeError = nil ;
@@ -836,7 +837,7 @@ - (void)setSupportEmail {
836
837
[button setBezelStyle: NSRegularSquareBezelStyle ] ;
837
838
[button setTarget: self ] ;
838
839
[button setAction: @selector (support: )] ;
839
- NSString * imagePath = [[NSBundle mainBundle ] pathForResource: @" support"
840
+ NSString * imagePath = [[NSBundle mainAppBundle ] pathForResource: @" support"
840
841
ofType: @" tif" ] ;
841
842
NSImage * image = [[NSImage alloc ] initByReferencingFile: imagePath] ;
842
843
[button setImage: image] ;
@@ -858,7 +859,7 @@ - (void)setSupportEmail {
858
859
859
860
- (void )setWindowTitle : (NSString *)title {
860
861
if (!title) {
861
- title = [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleName" ] ; // CFBundleName may be localized
862
+ title = [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleName" ] ; // CFBundleName may be localized
862
863
}
863
864
864
865
[[self window ] setTitle: title] ;
@@ -1912,7 +1913,7 @@ - (id)init {
1912
1913
styleMask: NSTitledWindowMask
1913
1914
backing: NSBackingStoreBuffered
1914
1915
defer: NO ] ;
1915
- NSString * appName = [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleName" ] ; // CFBundleName may be localized
1916
+ NSString * appName = [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleName" ] ; // CFBundleName may be localized
1916
1917
if (appName) {
1917
1918
[window setTitle: appName] ;
1918
1919
}
0 commit comments