[gnome-documents] selections: Hide "Share" button in Books



commit 5315cef0235a13f3bad703611ab3cd9392505e76
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Dec 19 20:26:22 2014 +0100

    selections: Hide "Share" button in Books
    
    As it only works with Google Docs, and that's disabled in gnome-books.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740974

 src/selections.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/selections.js b/src/selections.js
index 747cc50..cd2485c 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -759,9 +759,11 @@ const SelectionToolbar = new Lang.Class({
         this._toolbarTrash.connect('clicked', Lang.bind(this, this._onToolbarTrash));
 
         // share button
-        this._toolbarShare = new Gtk.Button({ label: _("Share") });
-        toolbar.pack_end(this._toolbarShare);
-        this._toolbarShare.connect('clicked', Lang.bind(this, this._onToolbarShare));
+        if (!Application.application.isBooks) {
+            this._toolbarShare = new Gtk.Button({ label: _("Share") });
+            toolbar.pack_end(this._toolbarShare);
+            this._toolbarShare.connect('clicked', Lang.bind(this, this._onToolbarShare));
+        }
 
         // properties button
         this._toolbarProperties = new Gtk.Button({ label: _("Properties") });
@@ -865,7 +867,8 @@ const SelectionToolbar = new Lang.Class({
         this._toolbarProperties.set_sensitive(showProperties);
         this._toolbarTrash.set_sensitive(showTrash);
         this._toolbarOpen.set_sensitive(showOpen);
-        this._toolbarShare.set_sensitive(showShare);
+        if (this._toolbarShare)
+            this._toolbarShare.set_sensitive(showShare);
         this._toolbarCollection.set_sensitive(showCollection);
 
         this._insideRefresh = false;


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