[gnome-weather] Window: show the yr.no attribution the about dialog
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] Window: show the yr.no attribution the about dialog
- Date: Sun, 22 Mar 2015 22:36:44 +0000 (UTC)
commit f93c00de0ac99352a68c09a57e4f85677fa211d8
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Wed Mar 18 13:39:28 2015 -0700
Window: show the yr.no attribution the about dialog
We need to show it somewhere, and the about dialog seems the
ideal place for it.
src/app/window.js | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/app/window.js b/src/app/window.js
index d634c83..95ac1ec 100644
--- a/src/app/window.js
+++ b/src/app/window.js
@@ -206,13 +206,16 @@ const MainWindow = new Lang.Class({
'davharuk',
'Tech Haven Ministries',
'Jim Pennucci' ];
+
+ let copyright = 'Copyright 2013-2015 The Weather Developers';
+ let attribution = this._cityView.info ? this._cityView.info.get_attribution() : '';
+ let copyright = copyright + (attribution ? '\n' + attribution : '');
let aboutDialog = new Gtk.AboutDialog(
{ artists: artists,
authors: [ 'Giovanni Campagna <gcampagna src gnome org>' ],
translator_credits: _("translator-credits"),
program_name: _("Weather"),
comments: _("A weather application"),
- copyright: 'Copyright 2013 The Weather Developers',
license_type: Gtk.License.GPL_2_0,
logo_icon_name: 'org.gnome.Weather.Application',
version: pkg.version,
@@ -223,6 +226,14 @@ const MainWindow = new Lang.Class({
use_header_bar: true
});
+ // HACK: we need to poke into gtkaboutdialog internals
+ // to set the copyright with markup like attribution requires
+ // FIXME: file a gtk+ bug
+
+ let copyrightLabel = aboutDialog.get_template_child(Gtk.AboutDialog, 'copyright_label');
+ copyrightLabel.set_markup('<span size="small">' + copyright + '</span>');
+ copyrightLabel.show();
+
aboutDialog.show();
aboutDialog.connect('response', function() {
aboutDialog.destroy();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]