From 1e4ef195bb33397c23a245876d97d534aabec0e5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 12 Oct 2016 10:52:59 -0700 Subject: [PATCH] Use lower-case about panel option keys --- atom/browser/browser_mac.mm | 13 ++++++++++++- docs/api/app.md | 10 +++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index 3812e80cd..4c4462f7b 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -261,7 +261,18 @@ void Browser::ShowAboutPanel() { void Browser::SetAboutPanelOptions(const base::DictionaryValue& options) { about_panel_options_.Clear(); - about_panel_options_.MergeDictionary(&options); + + // Upper case option keys for orderFrontStandardAboutPanelWithOptions format + for (base::DictionaryValue::Iterator iter(options); + !iter.IsAtEnd(); + iter.Advance()) { + std::string key = iter.key(); + std::string value; + if (!key.empty() && iter.value().GetAsString(&value)) { + key[0] = base::ToUpperASCII(key[0]); + about_panel_options_.SetString(key, value); + } + } } } // namespace atom diff --git a/docs/api/app.md b/docs/api/app.md index 094d6360b..3b0e493f4 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -856,11 +856,11 @@ details. ### `app.setAboutPanelOptions(options)` _macOS_ * `options` Object - * `ApplicationName` String (optional) - The app's name. - * `ApplicationVersion` String (optional) - The app's version. - * `Copyright` String (optional) - Copyright information. - * `Credits` String (optional) - Credit information. - * `Version` String (optional) - The app's build version number. + * `applicationName` String (optional) - The app's name. + * `applicationVersion` String (optional) - The app's version. + * `copyright` String (optional) - Copyright information. + * `credits` String (optional) - Credit information. + * `version` String (optional) - The app's build version number. Set the about panel options. This will override the values defined in the app's `.plist` file. See the [Apple docs][about-panel-options] for more details.