[meld/VersionControlRework: 101/123] vcview: Use binding for location visibility and consolidate callbacks
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/VersionControlRework: 101/123] vcview: Use binding for location visibility and consolidate callbacks
- Date: Sun, 19 Apr 2015 20:14:29 +0000 (UTC)
commit ff7428b922a98a4d3ec16f636136228b9e5b5c42
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Apr 18 07:17:11 2015 +1000
vcview: Use binding for location visibility and consolidate callbacks
data/ui/vcview.ui | 2 +-
meld/vcview.py | 8 ++------
2 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/data/ui/vcview.ui b/data/ui/vcview.ui
index 1a446a8..56890ca 100644
--- a/data/ui/vcview.ui
+++ b/data/ui/vcview.ui
@@ -89,7 +89,7 @@
<property name="tooltip" translatable="yes">Flatten directories</property>
<property name="stock_id">gtk-goto-bottom</property>
<property name="is_important">True</property>
- <signal name="toggled" handler="on_button_flatten_toggled" swapped="no"/>
+ <signal name="toggled" handler="on_filter_state_toggled" swapped="no"/>
</object>
</child>
<child>
diff --git a/meld/vcview.py b/meld/vcview.py
index f3e01a5..9be5e73 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -202,10 +202,11 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.status_renderer, markup=col_index(COL_STATUS))
self.extra_column.set_attributes(
self.extra_renderer, markup=col_index(COL_OPTIONS))
+ self.location_column.bind_property(
+ 'visible', self.actiongroup.get_action("VcFlatten"), 'active')
self.consolestream = ConsoleStream(self.consoleview)
self.location = None
- self.location_column.set_visible(self.actiongroup.get_action("VcFlatten").get_active())
self.vc = None
settings.bind('vc-console-visible',
@@ -521,11 +522,6 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
return True
return False
- def on_button_flatten_toggled(self, button):
- action = self.actiongroup.get_action("VcFlatten")
- self.location_column.set_visible(action.get_active())
- self.on_filter_state_toggled(button)
-
def on_filter_state_toggled(self, button):
active_action = lambda a: self.actiongroup.get_action(a).get_active()
active_filters = [a for a in self.state_actions if
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]