[polari] application: Emit a 'prepare-shutdown' signal before exiting



commit ab5172386c14dadde65b68e3fdc1f35f4e24da7f
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jul 27 00:26:14 2013 +0200

    application: Emit a 'prepare-shutdown' signal before exiting

 src/application.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index cc8428b..0341b57 100644
--- a/src/application.js
+++ b/src/application.js
@@ -12,6 +12,7 @@ const Format = imports.format;
 const Gettext = imports.gettext;
 const Lang = imports.lang;
 const MainWindow = imports.mainWindow;
+const Utils = imports.utils;
 
 const Application = new Lang.Class({
     Name: 'Application',
@@ -107,6 +108,10 @@ const Application = new Lang.Class({
         }));
 
         this._window = new MainWindow.MainWindow(this);
+        this._window.window.connect('destroy', Lang.bind(this,
+            function() {
+                this.emitJS('prepare-shutdown');
+            }));
 
         let provider = new Gtk.CssProvider();
         let uri = 'resource:///org/gnome/polari/application.css';
@@ -234,3 +239,4 @@ const Application = new Lang.Class({
         this._window.window.destroy();
     }
 });
+Utils.addJSSignalMethods(Application.prototype);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]