[kupfer] data, browser: Add at_root parameter to source-changed signal
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] data, browser: Add at_root parameter to source-changed signal
- Date: Thu, 10 Sep 2009 04:14:09 +0000 (UTC)
commit e955c1c24d20b7164d190edf5c215776b36ffe17
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Mon Sep 7 00:43:56 2009 +0200
data, browser: Add at_root parameter to source-changed signal
kupfer/browser.py | 12 +++++++++---
kupfer/data.py | 5 +++--
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index edf0d6a..e39975c 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -1054,18 +1054,21 @@ class Interface (gobject.GObject):
self.reset()
self.switch_to_source()
- def _new_source(self, sender, pane, source):
+ def _new_source(self, sender, pane, source, at_root):
"""Notification about a new data source,
(represented object for the self.search object
"""
+ print "new source", pane, source, at_root
wid = self._widget_for_pane(pane)
wid.set_source(source)
+ wid.reset()
if pane is data.SourcePane:
self.switch_to_source()
if wid is self.current:
self.toggle_text_mode(False)
- self._populate_search()
- wid.show_table()
+ if not at_root:
+ self._populate_search()
+ wid.show_table()
def _show_hide_third(self, ctr, mode, ignored):
gobject.source_remove(self._current_ui_transition)
@@ -1184,6 +1187,9 @@ class Interface (gobject.GObject):
return
pane = self._pane_for_widget(self.current)
+ if not self.current.get_is_browsing():
+ print "Not browsing"
+ #self.data_controller.reset_pane(pane)
self.data_controller.search(pane, key=text, context=text,
text_mode=self.get_in_text_mode())
diff --git a/kupfer/data.py b/kupfer/data.py
index 800c46a..2bb814f 100644
--- a/kupfer/data.py
+++ b/kupfer/data.py
@@ -833,7 +833,8 @@ class DataController (gobject.GObject, pretty.OutputMixin):
pane = SourcePane
elif ctr is self.object_pane:
pane = ObjectPane
- self.emit("source-changed", pane, src)
+ root = ctr.is_at_source_root()
+ self.emit("source-changed", pane, src, root)
def reset(self):
self.source_pane.reset()
@@ -999,7 +1000,7 @@ gobject.signal_new("search-result", DataController, gobject.SIGNAL_RUN_LAST,
gobject.TYPE_BOOLEAN, (gobject.TYPE_INT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT))
gobject.signal_new("source-changed", DataController, gobject.SIGNAL_RUN_LAST,
- gobject.TYPE_BOOLEAN, (gobject.TYPE_INT, gobject.TYPE_PYOBJECT,))
+ gobject.TYPE_BOOLEAN, (int, object, bool))
# mode, None(?)
gobject.signal_new("mode-changed", DataController, gobject.SIGNAL_RUN_LAST,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]