[kupfer] ui: Again, reset text field when interface is focused again
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] ui: Again, reset text field when interface is focused again
- Date: Sun, 6 Mar 2011 16:15:05 +0000 (UTC)
commit 3271a1d2a31a48457d167cd5bb9d52b21e1f37b8
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sun Mar 6 04:48:25 2011 +0100
ui: Again, reset text field when interface is focused again
Amending in the fix of the bug that never ends.
Launchpad-bug: https://bugs.launchpad.net/kupfer/+bug/494237
kupfer/ui/browser.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/kupfer/ui/browser.py b/kupfer/ui/browser.py
index 3e0de24..89bca14 100644
--- a/kupfer/ui/browser.py
+++ b/kupfer/ui/browser.py
@@ -1156,7 +1156,7 @@ class Interface (gobject.GObject):
"""
val = bool(val) and self.get_can_enter_text_mode()
self._is_text_mode = val
- gobject.idle_add(self.update_text_mode)
+ self.update_text_mode()
self.reset()
return val
@@ -1204,6 +1204,10 @@ class Interface (gobject.GObject):
# Check that items are still valid when "coming back"
self.data_controller.validate()
+ def did_launch(self):
+ "called to notify that 'activate' was successful"
+ self._reset_when_back = True
+
def put_away(self):
"""Called when the interface is hidden"""
self._relax_search_terms()
@@ -1314,8 +1318,6 @@ class Interface (gobject.GObject):
self.data_controller.browse_down(pane, alternate=alternate)
def _activate(self, widget, current):
- # reset self through toggle_text_mode
- self._reset_when_back = True
self.data_controller.activate()
def activate(self):
@@ -1530,6 +1532,7 @@ class WindowController (pretty.OutputMixin):
# Separate window hide from the action being
# done. This is to solve a window focus bug when
# we switch windows using an action
+ self.interface.did_launch()
self._window_hide_timer.set_ms(100, self.put_away)
def result_callback(self, sender, result_type):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]