Find the MainMenu nib correctly

This commit is contained in:
Paul Betts 2014-12-05 23:19:05 -08:00
parent 3d4491a468
commit 091357ad8e

View file

@ -13,6 +13,11 @@
namespace atom { namespace atom {
std::string GetApplicationName() {
std::string name = brightray::MainApplicationBundlePath().BaseName().AsUTF8Unsafe();
return name.substr(0, name.length() - 4/*.app*/);
}
void AtomBrowserMainParts::PreMainMessageLoopStart() { void AtomBrowserMainParts::PreMainMessageLoopStart() {
// Initialize locale setting. // Initialize locale setting.
l10n_util::OverrideLocaleWithCocoaLocale(); l10n_util::OverrideLocaleWithCocoaLocale();
@ -26,7 +31,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() {
base::FilePath frameworkPath = brightray::MainApplicationBundlePath() base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
.Append("Contents") .Append("Contents")
.Append("Frameworks") .Append("Frameworks")
.Append("Atom Framework.framework"); .Append(GetApplicationName() + " Framework.framework");
NSBundle* frameworkBundle = [NSBundle NSBundle* frameworkBundle = [NSBundle
bundleWithPath:base::mac::FilePathToNSString(frameworkPath)]; bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu" NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"