[gitg] Add refresh feature to gitg



commit 9a33faea0e9f392e066207aa8524acb65abd3121
Author: Sindhu S <sindhus live in>
Date:   Fri May 17 19:39:04 2013 +0530

    Add refresh feature to gitg
    
    Add function to refresh history view.
    Add menu item "Refresh" in settings menu.

 gitg/gitg-window.vala           |   10 ++++++++++
 gitg/resources/ui/gitg-menus.ui |    7 +++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 9a5524e..68d703b 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -63,6 +63,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
                {"open-repository", on_open_repository},
                {"clone-repository", on_clone_repository},
                {"close", on_close_activated},
+               {"reload", on_reload_activated},
                {"user-information-global", on_global_user_info_activated},
                {"user-information-repo", on_repo_user_info_activated},
        };
@@ -204,6 +205,15 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
 
                chooser.show();
        }
+       
+       private void on_reload_activated()
+       {
+               // Check to ensure history is active
+               if (d_repository != null)
+               {
+                       repository_changed();
+               }
+       }
 
        private void on_clone_repository()
        {
diff --git a/gitg/resources/ui/gitg-menus.ui b/gitg/resources/ui/gitg-menus.ui
index f17c59a..a9c6f2e 100644
--- a/gitg/resources/ui/gitg-menus.ui
+++ b/gitg/resources/ui/gitg-menus.ui
@@ -63,6 +63,13 @@
   <menu id="win-menu-views">
     <section>
       <item>
+        <attribute name="label" translatable="yes">_Reload</attribute>
+        <attribute name="action">win.reload</attribute>
+        <attribute name="accel">&lt;Primary&gt;r</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
         <attribute name="label" translatable="yes">User Information</attribute>
         <attribute name="action">win.user-information-repo</attribute>
       </item>


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