[gitg] Added busy property on GitgExt.Application



commit f1fd7612736472bef112d6f27961b06916dd5e5f
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Tue Jul 1 14:16:01 2014 +0200

    Added busy property on GitgExt.Application

 gitg/gitg-window.vala                 |   31 +++++++++++++++++++++++++++++++
 libgitg-ext/gitg-ext-application.vala |    2 ++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 8ca3e07..1c62f28 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -29,6 +29,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        private GitgExt.MessageBus d_message_bus;
        private string? d_action;
        private Gee.HashMap<string, string> d_environment;
+       private bool d_busy;
        private Gtk.Dialog? d_dialog;
 
        private UIElements<GitgExt.Activity> d_activities;
@@ -618,6 +619,36 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        {
                owned get { return d_environment; }
        }
+
+       public bool busy
+       {
+               get { return d_busy; }
+               set
+               {
+                       d_busy = value;
+
+                       Gdk.Window win;
+
+                       if (d_dialog != null)
+                       {
+                               win = d_dialog.get_window();
+                       }
+                       else
+                       {
+                               win = get_window();
+                       }
+
+                       if (d_busy)
+                       {
+                               win.set_cursor(new Gdk.Cursor.for_display(get_display(),
+                                                                         Gdk.CursorType.WATCH));
+                       }
+                       else
+                       {
+                               win.set_cursor(null);
+                       }
+               }
+       }
 }
 
 }
diff --git a/libgitg-ext/gitg-ext-application.vala b/libgitg-ext/gitg-ext-application.vala
index 4cf9c6a..51e3a86 100644
--- a/libgitg-ext/gitg-ext-application.vala
+++ b/libgitg-ext/gitg-ext-application.vala
@@ -61,6 +61,8 @@ public interface Application : Object
                                          string          secondary_msg,
                                          Gtk.MessageType type);
 
+       public abstract bool busy { get; set; }
+
        public abstract Gee.Map<string, string> environment { owned get; }
 }
 


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