Convert run dialog to gjs signals

svn path=/trunk/; revision=65
This commit is contained in:
Colin Walters 2008-11-20 15:40:44 +00:00
parent 44dde535e0
commit a62b215b06

View File

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