mac: Makes sure MainMenu.nib is alwasys loaded from Atom.framework.
This commit is contained in:
parent
8cb624d828
commit
ef92cd8b45
1 changed files with 9 additions and 5 deletions
|
@ -4,9 +4,11 @@
|
||||||
|
|
||||||
#include "browser/atom_browser_main_parts.h"
|
#include "browser/atom_browser_main_parts.h"
|
||||||
|
|
||||||
#import "base/mac/bundle_locations.h"
|
#include "base/files/file_path.h"
|
||||||
|
#import "base/mac/foundation_util.h"
|
||||||
#import "browser/atom_application_mac.h"
|
#import "browser/atom_application_mac.h"
|
||||||
#import "browser/atom_application_delegate_mac.h"
|
#import "browser/atom_application_delegate_mac.h"
|
||||||
|
#import "vendor/brightray/common/mac/main_application_bundle.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -17,10 +19,12 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() {
|
||||||
AtomApplicationDelegate* delegate = [AtomApplicationDelegate alloc];
|
AtomApplicationDelegate* delegate = [AtomApplicationDelegate alloc];
|
||||||
[NSApp setDelegate:delegate];
|
[NSApp setDelegate:delegate];
|
||||||
|
|
||||||
auto infoDictionary = base::mac::OuterBundle().infoDictionary;
|
base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
|
||||||
|
.Append("Contents").Append("Frameworks").Append("Atom.framework");
|
||||||
NSString *mainNibName = [infoDictionary objectForKey:@"NSMainNibFile"];
|
NSBundle* frameworkBundle = [NSBundle
|
||||||
auto mainNib = [[NSNib alloc] initWithNibNamed:mainNibName bundle:base::mac::FrameworkBundle()];
|
bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
|
||||||
|
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"
|
||||||
|
bundle:frameworkBundle];
|
||||||
[mainNib instantiateWithOwner:application topLevelObjects:nil];
|
[mainNib instantiateWithOwner:application topLevelObjects:nil];
|
||||||
[mainNib release];
|
[mainNib release];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue