[meld/ui-next: 29/35] filediff: Hook up the show-sourcemap setting



commit a01144023fb86e02581f9b2c9f82a4ff881401f4
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Feb 16 06:28:07 2019 +1000

    filediff: Hook up the show-sourcemap setting

 meld/filediff.py            | 10 ++++++++--
 meld/resources/gtk/menus.ui |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 02635a9d..03497db5 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -108,8 +108,9 @@ class FileDiff(Gtk.VBox, MeldDoc):
     next_diff_changed_signal = MeldDoc.next_diff_changed_signal
     tab_state_changed = MeldDoc.tab_state_changed
 
-    __gsettings_bindings__ = (
+    __gsettings_bindings_view__ = (
         ('ignore-blank-lines', 'ignore-blank-lines'),
+        ('show-sourcemap', 'show-sourcemap'),
     )
 
     ignore_blank_lines = GObject.Property(
@@ -118,6 +119,7 @@ class FileDiff(Gtk.VBox, MeldDoc):
         blurb="Whether to ignore blank lines when comparing file contents",
         default=False,
     )
+    show_sourcemap = GObject.Property(type=bool, default=True)
 
     actiongroup = Template.Child('FilediffActions')
     actiongutter0 = Template.Child()
@@ -272,7 +274,11 @@ class FileDiff(Gtk.VBox, MeldDoc):
         # Set up per-view action group for top-level menu insertion
         self.view_action_group = Gio.SimpleActionGroup()
         action = Gio.PropertyAction.new(
-            'show-overview-map', self.sourcemap_revealer, 'reveal-child')
+            'show-sourcemap', self, 'show-sourcemap')
+        self.bind_property(
+            'show-sourcemap', self.sourcemap_revealer, 'reveal-child',
+            GObject.BindingFlags.DEFAULT | GObject.BindingFlags.SYNC_CREATE,
+        )
         self.sourcemap_revealer.bind_property(
             'child-revealed', self.dummy_toolbar_sourcemap, 'visible')
         self.view_action_group.add_action(action)
diff --git a/meld/resources/gtk/menus.ui b/meld/resources/gtk/menus.ui
index 2f822b3c..70f3b0dd 100644
--- a/meld/resources/gtk/menus.ui
+++ b/meld/resources/gtk/menus.ui
@@ -8,7 +8,7 @@
           <attribute name="id">view-section</attribute>
           <item>
             <attribute name="label" translatable="yes">Overview Map</attribute>
-            <attribute name="action">view.show-overview-map</attribute>
+            <attribute name="action">view.show-sourcemap</attribute>
           </item>
         </section>
       </submenu>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]