[gnome-maps] Make "about" a window action
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Make "about" a window action
- Date: Mon, 1 Apr 2013 22:18:13 +0000 (UTC)
commit c6cda2c53307b5fdd6e2d5dfac9bb0ba5806212f
Author: Paolo Borelli <pborelli gnome org>
Date: Tue Apr 2 00:15:41 2013 +0200
Make "about" a window action
Declare the "about" as a window action instead of an application action
and the manually delegate to the window in order to show the about
dialog with the proper parent.
src/app-menu.ui | 2 +-
src/application.js | 5 -----
src/mainWindow.js | 12 ++++++++----
3 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/src/app-menu.ui b/src/app-menu.ui
index fa1e631..6782fe7 100644
--- a/src/app-menu.ui
+++ b/src/app-menu.ui
@@ -2,7 +2,7 @@
<menu id="app-menu">
<section>
<item>
- <attribute name="action">app.about</attribute>
+ <attribute name="action">win.about</attribute>
<attribute name="label" translatable="yes">About</attribute>
</item>
<item>
diff --git a/src/application.js b/src/application.js
index 14e197d..cd25795 100644
--- a/src/application.js
+++ b/src/application.js
@@ -58,10 +58,6 @@ const Application = new Lang.Class({
this._mainWindow.window.destroy();
},
- _onActionAbout: function() {
- this._mainWindow.showAbout();
- },
-
_initAppMenu: function() {
let builder = new Gtk.Builder();
builder.add_from_resource('/org/gnome/maps/app-menu.ui');
@@ -83,7 +79,6 @@ const Application = new Lang.Class({
settings = new Gio.Settings({ schema: 'org.gnome.maps' });
Utils.initActions(this, [
- { name: 'about', callback: this._onActionAbout },
{ name: 'quit', callback: this._onActionQuit }
]);
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 58c8df0..7188a03 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -50,9 +50,13 @@ const MainWindow = new Lang.Class({
this.window = new Gtk.ApplicationWindow({ application: app,
width_request: _WINDOW_MIN_WIDTH,
height_request: _WINDOW_MIN_HEIGHT,
- window_position: Gtk.WindowPosition.CENTER,
+ window_position: Gtk.WindowPosition.CENTER,
hide_titlebar_when_maximized: true,
- title: _("Maps") });
+ title: _("Maps") });
+
+ Utils.initActions(this.window, [
+ { name: 'about', callback: this._onActionAbout }
+ ]);
// apply the last saved window size and position
let size = Application.settings.get_value('window-size');
@@ -150,7 +154,7 @@ const MainWindow = new Lang.Class({
return false;
},
- showAbout: function() {
+ _onActionAbout: function() {
let aboutDialog = new Gtk.AboutDialog();
aboutDialog.artists = [ 'Jakub Steiner <jimmac gmail com>', 'Andreas Nilsson <nisses mail home se>'
];
@@ -167,7 +171,7 @@ const MainWindow = new Lang.Class({
aboutDialog.wrap_license = true;
aboutDialog.modal = true;
- aboutDialog.transient_for = this.window;
+ aboutDialog.transient_for = this;
aboutDialog.show();
aboutDialog.connect('response', function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]