[gnome-documents] presentation, preview: Separate JS signals from GObject signals



commit db3519baca1a1a56067709c34104c94029bbfa27
Author: Alessandro Bono <shadow openaliasbox org>
Date:   Mon Aug 3 19:10:13 2015 +0200

    presentation, preview: Separate JS signals from GObject signals
    
    Fall out from the composition->inheritance port.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752792

 src/presentation.js |    7 ++++---
 src/preview.js      |   14 +++++++-------
 2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/presentation.js b/src/presentation.js
index 41286ef..64cb644 100644
--- a/src/presentation.js
+++ b/src/presentation.js
@@ -30,6 +30,7 @@ const _ = imports.gettext.gettext;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
+const Utils = imports.utils;
 
 const Application = imports.application;
 
@@ -189,7 +190,7 @@ const PresentationOutputChooser = new Lang.Class({
             return;
 
         this.output = output;
-        this.emit('output-activated', this.output);
+        this.emitJS('output-activated', this.output);
         this.close();
     },
 
@@ -200,7 +201,7 @@ const PresentationOutputChooser = new Lang.Class({
     _createWindow: function() {
         this.connect('response', Lang.bind(this,
             function(widget, response) {
-                this.emit('output-activated', null);
+                this.emitJS('output-activated', null);
             }));
 
         let frame = new Gtk.Frame({ shadow_type: Gtk.ShadowType.IN });
@@ -227,7 +228,7 @@ const PresentationOutputChooser = new Lang.Class({
         contentArea.pack_start(frame, true, false, 0);
     }
 });
-Signals.addSignalMethods(PresentationOutputChooser.prototype);
+Utils.addJSSignalMethods(PresentationOutputChooser.prototype);
 
 const PresentationOutputs = new Lang.Class({
     Name: 'PresentationOutputs',
diff --git a/src/preview.js b/src/preview.js
index 1631be1..723034e 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -251,7 +251,7 @@ const PreviewView = new Lang.Class({
             this._showPresentation();
         } else {
             let chooser = new Presentation.PresentationOutputChooser(outputs);
-            chooser.connect('output-activated', Lang.bind(this,
+            chooser.connectJS('output-activated', Lang.bind(this,
                 function(chooser, output) {
                     if (output) {
                         this._showPresentation(output);
@@ -399,7 +399,7 @@ const PreviewView = new Lang.Class({
             this._fsToolbar.setModel(this._model);
             this._overlay.add_overlay(this._fsToolbar);
 
-            this._fsToolbar.connect('show-controls', Lang.bind(this,
+            this._fsToolbar.connectJS('show-controls', Lang.bind(this,
                 function() {
                     this.controlsVisible = true;
                 }));
@@ -529,7 +529,7 @@ const PreviewView = new Lang.Class({
         // FIXME: ev_job_find_get_results() returns a GList **
         // and thus is not introspectable
         GdPrivate.ev_view_find_changed(this.view, job, page);
-        this.emit('search-changed', job.has_results());
+        this.emitJS('search-changed', job.has_results());
     },
 
     reset: function() {
@@ -590,7 +590,7 @@ const PreviewView = new Lang.Class({
         return this._lastSearch;
     }
 });
-Signals.addSignalMethods(PreviewView.prototype);
+Utils.addJSSignalMethods(PreviewView.prototype);
 
 const _PREVIEW_NAVBAR_MARGIN = 30;
 const _AUTO_HIDE_TIMEOUT = 2;
@@ -934,7 +934,7 @@ const PreviewSearchbar = new Lang.Class({
 
     _init: function(previewView) {
         this._previewView = previewView;
-        this._previewView.connect('search-changed', Lang.bind(this, this._onSearchChanged));
+        this._previewView.connectJS('search-changed', Lang.bind(this, this._onSearchChanged));
 
         this.parent();
     },
@@ -1029,7 +1029,7 @@ const PreviewFullscreenToolbar = new Lang.Class({
                     function(actionGroup, actionName, value) {
                         let state = value.get_boolean();
                         if (state)
-                            this.emit('show-controls');
+                            this.emitJS('show-controls');
                     }));
 
                 signalIds.push(signalId);
@@ -1061,4 +1061,4 @@ const PreviewFullscreenToolbar = new Lang.Class({
         Application.application.change_action_state('search', GLib.Variant.new('b', false));
     }
 });
-Signals.addSignalMethods(PreviewFullscreenToolbar.prototype);
+Utils.addJSSignalMethods(PreviewFullscreenToolbar.prototype);


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