[polari] entryArea: Disable during selection mode



commit 4c03accff9ef93c749051e4553f2ca4ca35a542b
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 28 08:07:24 2014 +0100

    entryArea: Disable during selection mode
    
    It is odd to continue chatting while selecting channels to leave;
    just disable the entry area in selection mode to clarify the
    separation between the modes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725688

 src/entryArea.js |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index 9bcaf34..9e1e40b 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -1,4 +1,5 @@
 const Gdk = imports.gi.Gdk;
+const Gio = imports.gi.Gio;
 const Gtk = imports.gi.Gtk;
 
 const ChatroomManager = imports.chatroomManager;
@@ -27,6 +28,11 @@ const EntryArea = new Lang.Class({
             this._roomManager.connect('active-changed',
                                       Lang.bind(this, this._updateSensitivity));
 
+        let app = Gio.Application.get_default();
+        this._selectionModeAction = app.lookup_action('selection-mode');
+        this._selectionModeAction.connect('notify::state',
+                                          Lang.bind(this, this._updateSensitivity));
+
         if (!room)
             return;
 
@@ -115,7 +121,10 @@ const EntryArea = new Lang.Class({
 
     _updateSensitivity: function() {
         let room = this._roomManager.getActiveRoom();
-        this.widget.sensitive = this._room && this._room == room && room.channel;
+        this.widget.sensitive = this._room &&
+                                this._room == room &&
+                                room.channel &&
+                                !this._selectionModeAction.state.get_boolean();
 
         if (!this.widget.sensitive)
             return;


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