[gedit/wip/statusbar-buttons] Allow enabling auto-indent using the bottom button.



commit 9adb5d3ea69dbf75ae9ee3c8fe26a641d29a2ba0
Author: Steve Frécinaux <code istique net>
Date:   Tue Feb 11 01:11:48 2014 +0100

    Allow enabling auto-indent using the bottom button.

 gedit/gedit-menu.ui  |    4 ++++
 gedit/gedit-window.c |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-menu.ui b/gedit/gedit-menu.ui
index 8c22906..343a735 100644
--- a/gedit/gedit-menu.ui
+++ b/gedit/gedit-menu.ui
@@ -273,6 +273,10 @@
         <attribute name="label" translatable="yes">Use Spaces</attribute>
         <attribute name="action">win.use-spaces</attribute>
       </item>
+      <item>
+        <attribute name="label" translatable="yes">Automatic Indentation</attribute>
+        <attribute name="action">win.auto-indent</attribute>
+      </item>
     </section>
   </menu>
 </interface>
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index c7058ab..d29bcc1 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -1213,6 +1213,7 @@ update_statusbar (GeditWindow *window,
 
                g_action_map_remove_action (G_ACTION_MAP (window), "tab-width");
                g_action_map_remove_action (G_ACTION_MAP (window), "use-spaces");
+               g_action_map_remove_action (G_ACTION_MAP (window), "auto-indent");
        }
 
        if (new_view == NULL)
@@ -1238,6 +1239,10 @@ update_statusbar (GeditWindow *window,
        g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (action));
        g_object_unref (action);
 
+       action = g_property_action_new ("auto-indent", new_view, "auto-indent");
+       g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (action));
+       g_object_unref (action);
+
        window->priv->tab_width_id = g_signal_connect (new_view,
                                                       "notify::tab-width",
                                                       G_CALLBACK (tab_width_changed),


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