[gnome-documents/gnome-3-8] mainToolbar: Don't forward key presses to the search bar on load-error
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/gnome-3-8] mainToolbar: Don't forward key presses to the search bar on load-error
- Date: Tue, 28 May 2013 09:29:03 +0000 (UTC)
commit b4ef2a13cb5964d3be2054fea47911dc6a2ce7b8
Author: Debarshi Ray <debarshir gnome org>
Date: Mon May 27 16:27:51 2013 +0200
mainToolbar: Don't forward key presses to the search bar on load-error
https://bugzilla.gnome.org/show_bug.cgi?id=700716
src/mainToolbar.js | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index 273dcc2..25e6b94 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -39,6 +39,7 @@ const MainToolbar = new Lang.Class({
_init: function() {
this._model = null;
+ this._handleEvent = true;
this.widget = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
this.widget.show();
@@ -50,9 +51,23 @@ const MainToolbar = new Lang.Class({
this._searchbar = this.createSearchbar();
if (this._searchbar)
this.widget.add(this._searchbar.widget);
+
+ Application.documentManager.connect('load-started', Lang.bind(this,
+ function() {
+ this._handleEvent = true;
+ }));
+
+ Application.documentManager.connect('load-error', Lang.bind(this, this._onLoadErrorOrPassword));
+ },
+
+ _onLoadErrorOrPassword: function() {
+ this._handleEvent = false;
},
handleEvent: function(event) {
+ if (!this._handleEvent)
+ return false;
+
let res = this._searchbar.handleEvent(event);
return res;
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]