[kupfer] Update third pane when first pane changes in DataController
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] Update third pane when first pane changes in DataController
- Date: Mon, 18 Jan 2010 02:16:10 +0000 (UTC)
commit 7bb7df2e36c5542a294b474f2f34c9a697ff1ed1
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Mon Jan 18 02:15:35 2010 +0100
Update third pane when first pane changes in DataController
Since now compare actions by equality, not identity, it is an issue
that the third pane must be updated whenever the first pane changes.
kupfer/core/data.py | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/kupfer/core/data.py b/kupfer/core/data.py
index 706e671..eac5d46 100644
--- a/kupfer/core/data.py
+++ b/kupfer/core/data.py
@@ -642,6 +642,9 @@ class DataController (gobject.GObject, pretty.OutputMixin):
citem = self._get_pane_object_composed(self.source_pane)
self.action_pane.set_item(citem)
self.search(ActionPane, interactive=True)
+ if self.mode == SourceActionObjectMode:
+ self.object_stack_clear(ObjectPane)
+ self._populate_third_pane()
elif pane is ActionPane:
assert not item or isinstance(item, base.Action), \
"Selection in Source pane is not an Action!"
@@ -650,18 +653,21 @@ class DataController (gobject.GObject, pretty.OutputMixin):
newmode = SourceActionObjectMode
else:
newmode = SourceActionMode
- if newmode is not self.mode:
+ if newmode != self.mode:
self.mode = newmode
self.emit("mode-changed", self.mode, item)
- if self.mode is SourceActionObjectMode:
- # populate third pane
- citem = self._get_pane_object_composed(self.source_pane)
- self.object_pane.set_item_and_action(citem, item)
- self.search(ObjectPane, lazy=True)
+ if self.mode == SourceActionObjectMode:
+ self._populate_third_pane()
elif pane is ObjectPane:
assert not item or isinstance(item, base.Leaf), \
"Selection in Object pane is not a Leaf!"
+ def _populate_third_pane(self):
+ citem = self._get_pane_object_composed(self.source_pane)
+ action = self.action_pane.get_selection()
+ self.object_pane.set_item_and_action(citem, action)
+ self.search(ObjectPane, lazy=True)
+
def get_can_enter_text_mode(self, pane):
panectl = self._panectl_table[pane]
return panectl.get_can_enter_text_mode()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]