gnome-shell r65 - trunk/js/ui



Author: walters
Date: Thu Nov 20 15:40:44 2008
New Revision: 65
URL: http://svn.gnome.org/viewvc/gnome-shell?rev=65&view=rev

Log:
Convert run dialog to gjs signals

Modified:
   trunk/js/ui/run_dialog.js

Modified: trunk/js/ui/run_dialog.js
==============================================================================
--- trunk/js/ui/run_dialog.js	(original)
+++ trunk/js/ui/run_dialog.js	Thu Nov 20 15:40:44 2008
@@ -1,5 +1,6 @@
 /* -*- mode: js2; js2-basic-offset: 4; -*- */
 
+const Signals = imports.signals;
 const Shell = imports.gi.Shell;
 const Clutter = imports.gi.Clutter;
 
@@ -22,10 +23,6 @@
 };
 
 RunDialog.prototype = {
-    // Event handlers that can be set by the caller.
-    on_run : null,
-    on_cancel : null,
-
     _init : function() {
         let global = Shell.global_get();
 
@@ -82,8 +79,7 @@
         // this._entry.connect('key-press-event', function(o, e) {
         //     if (the pressed key is the escape key) {
         //         me.hide();
-        //         if (me.on_cancel)
-        //             me.on_cancel();
+        //         me.emit('cancel');
         //         return false;
         //     } else
         //         return true;
@@ -104,8 +100,7 @@
             }
         }
 
-        if (this.on_run)
-            this.on_run();
+	this.emit('run');
     },
 
     show : function() {
@@ -120,3 +115,4 @@
         this._group.destroy();
     }
 };
+Signals.addSignalMethods(RunDialog.prototype);



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