[gnome-documents/wip/gepub: 5/6] evince: make Present a stateless action



commit cd24b98431b6794a28e49f4ddd62541bd5ab2838
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jun 21 21:41:53 2016 -0700

    evince: make Present a stateless action
    
    Or it will appear with a checkbox instead of a plain menu item. Also it
    does not really make sense to think about presentation as an additional
    state.

 src/evinceview.js |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/evinceview.js b/src/evinceview.js
index 8190a17..7d85145 100644
--- a/src/evinceview.js
+++ b/src/evinceview.js
@@ -125,14 +125,11 @@ const EvinceView = new Lang.Class({
             this._bookmarks.remove(bookmark);
     },
 
-    _presentStateChanged: function(action) {
+    _present: function() {
         if (!this._model)
             return;
 
-        if (action.state.get_boolean())
-            this._promptPresentation();
-        else
-            this._hidePresentation();
+        this._promptPresentation();
     },
 
     _edit: function() {
@@ -185,9 +182,7 @@ const EvinceView = new Lang.Class({
 
         if (!Application.application.isBooks)
             actions.push({ name: 'present-current',
-                           callback: Utils.actionToggleCallback,
-                           state: GLib.Variant.new('b', false),
-                           stateChanged: Lang.bind(this, this._presentStateChanged),
+                           callback: Lang.bind(this, this._present),
                            accels: ['F5'] });
 
         return actions;
@@ -283,8 +278,6 @@ const EvinceView = new Lang.Class({
             this._presentation.close();
             this._presentation = null;
         }
-
-        this.getAction('present-current').change_state(GLib.Variant.new('b', false));
     },
 
     _showPresentation: function(output) {


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