[gitg] Add basic notification infrastructure



commit 172eb33192b939feedfedb9da03f33c6a37989dd
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sat Dec 27 13:43:18 2014 +0100

    Add basic notification infrastructure

 gitg/Makefile.am                                 |    1 +
 gitg/gitg-notifications.vala                     |  104 +++++++++++
 gitg/gitg-ref-action-fetch.vala                  |   40 +++++
 gitg/gitg-window.vala                            |   11 ++
 gitg/resources/ui/gitg-window.ui                 |  202 +++++++++++-----------
 gitg/resources/ui/style.css                      |    5 +
 libgitg-ext/Makefile.am                          |    1 +
 libgitg-ext/gitg-ext-application.vala            |   12 +-
 libgitg-ext/gitg-ext-notifications.vala          |   31 ++++
 libgitg/Makefile.am                              |    1 +
 libgitg/gitg-remote-notification.vala            |  116 +++++++++++++
 libgitg/resources/resources.xml                  |    1 +
 libgitg/resources/ui/gitg-remote-notification.ui |   41 +++++
 13 files changed, 466 insertions(+), 100 deletions(-)
---
diff --git a/gitg/Makefile.am b/gitg/Makefile.am
index 51f7d56..104229e 100644
--- a/gitg/Makefile.am
+++ b/gitg/Makefile.am
@@ -66,6 +66,7 @@ gitg_gitg_VALASOURCES =                                               \
        gitg/gitg-create-tag-dialog.vala                        \
        gitg/gitg-dash-view.vala                                \
        gitg/gitg-dirs.vala                                     \
+       gitg/gitg-notifications.vala                            \
        gitg/gitg-plugins-engine.vala                           \
        gitg/gitg-popup-menu.vala                               \
        gitg/gitg-ref-action-copy-name.vala                     \
diff --git a/gitg/gitg-notifications.vala b/gitg/gitg-notifications.vala
new file mode 100644
index 0000000..ce6dfa6
--- /dev/null
+++ b/gitg/gitg-notifications.vala
@@ -0,0 +1,104 @@
+/*
+ * This file is part of gitg
+ *
+ * Copyright (C) 2014 - Jesse van den Kieboom
+ *
+ * gitg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gitg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gitg. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace Gitg
+{
+
+public class Notifications : Object, GitgExt.Notifications
+{
+       private Gtk.Overlay d_overlay;
+       private Gee.HashSet<uint> d_delay_handles;
+       private Gtk.Box d_box;
+
+       public Notifications(Gtk.Overlay overlay)
+       {
+               d_overlay = overlay;
+               d_delay_handles = new Gee.HashSet<uint>();
+
+               d_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 3);
+               d_box.get_style_context().add_class("notifications");
+               d_box.show();
+
+               d_box.valign = Gtk.Align.END;
+               d_overlay.add_overlay(d_box);
+       }
+
+       public override void dispose()
+       {
+               foreach (var id in d_delay_handles)
+               {
+                       Source.remove(id);
+               }
+
+               d_delay_handles.clear();
+
+               base.dispose();
+       }
+
+       public void add(Gtk.Widget widget)
+       {
+               var revealer = new Gtk.Revealer();
+
+               revealer.margin_top = 1;
+               revealer.set_transition_duration(500);
+               revealer.set_transition_type(Gtk.RevealerTransitionType.SLIDE_UP);
+               revealer.add(widget);
+
+               widget.show();
+               revealer.show();
+
+               d_box.add(revealer);
+               revealer.reveal_child = true;
+       }
+
+       private void remove_now(Gtk.Widget widget)
+       {
+               var revealer = widget.get_parent() as Gtk.Revealer;
+
+               revealer.notify["child-revealed"].connect(() => {
+                       revealer.remove(widget);
+                       revealer.destroy();
+               });
+
+               revealer.reveal_child = false;
+       }
+
+       public void remove(Gtk.Widget widget, uint delay)
+       {
+               if (delay == 0)
+               {
+                       remove_now(widget);
+               }
+
+               uint id = 0;
+
+               id = Timeout.add(delay, () => {
+                       d_delay_handles.remove(id);
+                       remove_now(widget);
+
+                       return false;
+               });
+
+               d_delay_handles.add(id);
+       }
+}
+
+}
+
+// ex:set ts=4 noet:
diff --git a/gitg/gitg-ref-action-fetch.vala b/gitg/gitg-ref-action-fetch.vala
index 43f2162..22b3803 100644
--- a/gitg/gitg-ref-action-fetch.vala
+++ b/gitg/gitg-ref-action-fetch.vala
@@ -104,6 +104,26 @@ class RefActionFetch : GitgExt.UIElement, GitgExt.Action, GitgExt.RefAction, Obj
                        return;
                }
 
+               var notification = new RemoteNotification(d_remote);
+               application.notifications.add(notification);
+
+               notification.text = _("Fetching from %s").printf(d_remote.get_url());
+
+               var updates = new Gee.ArrayList<string>();
+
+               var tip_updated_id = d_remote.tip_updated.connect((remote, name, a, b) => {
+                       if (a.is_zero())
+                       {
+                               /* Translators: new refers to a new remote reference having been fetched, */
+                               updates.add(@"$name (%s)".printf(_("new")));
+                       }
+                       else
+                       {
+                               /* Translators: updated refers to a remote reference having been updated, */
+                               updates.add(@"$name (%s)".printf(_("updated")));
+                       }
+               });
+
                d_remote.fetch.begin(sig, null, (obj, res) =>{
                        try
                        {
@@ -111,8 +131,28 @@ class RefActionFetch : GitgExt.UIElement, GitgExt.Action, GitgExt.RefAction, Obj
                        }
                        catch (Error e)
                        {
+                               notification.error(_("Failed to fetch from %s: 
%s").printf(d_remote.get_url(), e.message));
                                stderr.printf("Failed to fetch: %s\n", e.message);
+                               return;
                        }
+                       finally
+                       {
+                               (d_remote as Object).disconnect(tip_updated_id);
+                       }
+
+                       if (updates.size == 0)
+                       {
+                               /* Translators: the %s will get replaced with the remote url, */
+                               notification.success(_("Fetched from %s: everything is up to 
date").printf(d_remote.get_url()));
+                       }
+                       else
+                       {
+                               /* Translators: the first %s is the remote url to fetch from,
+                                * the second is a list of references that got updated. */
+                               notification.success(_("Fetched from %s: %s").printf(d_remote.get_url(), 
string.joinv(", ", updates.to_array())));
+                       }
+
+                       application.notifications.remove(notification, 3000);
                });
        }
 }
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index a2e6633..da565c5 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -39,6 +39,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        private UIElements<GitgExt.Activity> d_activities;
 
        private RemoteManager d_remote_manager;
+       private Notifications d_notifications;
 
        // Widgets
        [GtkChild]
@@ -88,6 +89,9 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        [GtkChild]
        private Gtk.Label d_infobar_secondary_label;
 
+       [GtkChild]
+       private Gtk.Overlay d_overlay;
+
        enum Mode
        {
                DASH,
@@ -200,6 +204,8 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        {
                add_action_entries(win_entries, this);
 
+               d_notifications = new Notifications(d_overlay);
+
                var selact = lookup_action("select");
 
                selact.notify["state"].connect(() => {
@@ -946,6 +952,11 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
        {
                owned get { return d_remote_manager; }
        }
+
+       public GitgExt.Notifications notifications
+       {
+               owned get { return d_notifications; }
+       }
 }
 
 }
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index cc0b9d1..ea1dfd5 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -130,139 +130,145 @@
       </object>
     </child>
     <child>
-      <object class="GtkGrid" id="d_grid_main">
+      <object class="GtkOverlay" id="d_overlay">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <child>
-          <object class="GtkBox" id="d_infobar_placeholder">
+          <object class="GtkGrid" id="d_grid_main">
             <property name="visible">True</property>
-            <property name="orientation">horizontal</property>
+            <property name="can_focus">False</property>
             <child>
-              <object class="GtkInfoBar" id="d_infobar">
-                <property name="visible">False</property>
-                <child internal-child="content_area">
-                  <object class="GtkBox" id="infobar_content_area">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="border_width">8</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">16</property>
-                    <child>
-                      <object class="GtkLabel" id="d_infobar_primary_label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="selectable">True</property>
-                        <property name="use-markup">True</property>
-                        <property name="halign">GTK_ALIGN_START</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="d_infobar_secondary_label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="selectable">True</property>
-                        <property name="use-markup">True</property>
-                        <property name="halign">GTK_ALIGN_START</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child internal-child="action_area">
-                      <object class="GtkButtonBox" id="infobar_action_area">
+              <object class="GtkBox" id="d_infobar_placeholder">
+                <property name="visible">True</property>
+                <property name="orientation">horizontal</property>
+                <child>
+                  <object class="GtkInfoBar" id="d_infobar">
+                    <property name="visible">False</property>
+                    <child internal-child="content_area">
+                      <object class="GtkBox" id="infobar_content_area">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="border_width">5</property>
+                        <property name="border_width">8</property>
                         <property name="orientation">vertical</property>
-                        <property name="spacing">6</property>
-                        <property name="layout_style">end</property>
+                        <property name="spacing">16</property>
                         <child>
-                          <object class="GtkButton" id="d_infobar_close_button">
+                          <object class="GtkLabel" id="d_infobar_primary_label">
                             <property name="visible">True</property>
-                            <property name="label" translatable="yes">Close</property>
+                            <property name="can_focus">True</property>
+                            <property name="selectable">True</property>
+                            <property name="use-markup">True</property>
+                            <property name="halign">GTK_ALIGN_START</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="d_infobar_secondary_label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="selectable">True</property>
+                            <property name="use-markup">True</property>
+                            <property name="halign">GTK_ALIGN_START</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child internal-child="action_area">
+                          <object class="GtkButtonBox" id="infobar_action_area">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="border_width">5</property>
+                            <property name="orientation">vertical</property>
+                            <property name="spacing">6</property>
+                            <property name="layout_style">end</property>
+                            <child>
+                              <object class="GtkButton" id="d_infobar_close_button">
+                                <property name="visible">True</property>
+                                <property name="label" translatable="yes">Close</property>
+                              </object>
+                            </child>
                           </object>
                         </child>
                       </object>
                     </child>
+                    <action-widgets>
+                      <action-widget response="-6">d_infobar_close_button</action-widget>
+                    </action-widgets>
                   </object>
                 </child>
-                <action-widgets>
-                  <action-widget response="-6">d_infobar_close_button</action-widget>
-                </action-widgets>
               </object>
             </child>
-          </object>
-        </child>
-        <child>
-          <object class="GtkSearchBar" id="d_search_bar">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="show-close-button">False</property>
             <child>
-              <object class="GdTaggedEntry" id="d_search_entry">
+              <object class="GtkSearchBar" id="d_search_bar">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="invisible_char">●</property>
-                <property name="invisible_char_set">True</property>
-                <property name="width-request">500</property>
-                <signal name="changed" handler="search_entry_changed" swapped="no"/>
+                <property name="can_focus">False</property>
+                <property name="show-close-button">False</property>
+                <child>
+                  <object class="GdTaggedEntry" id="d_search_entry">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">●</property>
+                    <property name="invisible_char_set">True</property>
+                    <property name="width-request">500</property>
+                    <signal name="changed" handler="search_entry_changed" swapped="no"/>
+                  </object>
+                </child>
               </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
             </child>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkStack" id="d_main_stack">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="hexpand">True</property>
-            <property name="vexpand">True</property>
             <child>
-              <object class="GtkScrolledWindow" id="d_dash_scrolled_window">
+              <object class="GtkStack" id="d_main_stack">
                 <property name="visible">True</property>
-                <property name="vexpand">True</property>
+                <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
-                <style>
-                  <class name="view"/>
-                </style>
+                <property name="vexpand">True</property>
                 <child>
-                  <object class="GitgDashView" id="d_dash_view">
+                  <object class="GtkScrolledWindow" id="d_dash_scrolled_window">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <signal name="repository_activated" handler="dash_view_repository_activated" 
swapped="no"/>
-                    <signal name="show_error" handler="dash_view_show_error" swapped="no"/>
+                    <property name="vexpand">True</property>
+                    <property name="hexpand">True</property>
                     <style>
                       <class name="view"/>
                     </style>
+                    <child>
+                      <object class="GitgDashView" id="d_dash_view">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <signal name="repository_activated" handler="dash_view_repository_activated" 
swapped="no"/>
+                        <signal name="show_error" handler="dash_view_show_error" swapped="no"/>
+                        <style>
+                          <class name="view"/>
+                        </style>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkStack" id="d_stack_activities">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                   </object>
                 </child>
               </object>
-            </child>
-            <child>
-              <object class="GtkStack" id="d_stack_activities">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
             </child>
           </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">2</property>
-            <property name="width">1</property>
-            <property name="height">1</property>
-          </packing>
         </child>
       </object>
     </child>
diff --git a/gitg/resources/ui/style.css b/gitg/resources/ui/style.css
index dea9390..cbeb317 100644
--- a/gitg/resources/ui/style.css
+++ b/gitg/resources/ui/style.css
@@ -142,3 +142,8 @@ GitgHistoryRefRow {
        color: @insensitive_fg_color;
        font-family: monospace;
 }
+
+.notifications {
+       background-color: @theme_bg_color;
+       border-top: 1px solid @borders;
+}
diff --git a/libgitg-ext/Makefile.am b/libgitg-ext/Makefile.am
index e568034..5ecb9b4 100644
--- a/libgitg-ext/Makefile.am
+++ b/libgitg-ext/Makefile.am
@@ -53,6 +53,7 @@ libgitg_ext_libgitg_ext_1_0_la_VALASOURCES =          \
        libgitg-ext/gitg-ext-message-bus.vala           \
        libgitg-ext/gitg-ext-message-id.vala            \
        libgitg-ext/gitg-ext-message.vala               \
+       libgitg-ext/gitg-ext-notifications.vala         \
        libgitg-ext/gitg-ext-preferences.vala           \
        libgitg-ext/gitg-ext-ref-action-interface.vala  \
        libgitg-ext/gitg-ext-ref-action.vala            \
diff --git a/libgitg-ext/gitg-ext-application.vala b/libgitg-ext/gitg-ext-application.vala
index c5350cd..30e6027 100644
--- a/libgitg-ext/gitg-ext-application.vala
+++ b/libgitg-ext/gitg-ext-application.vala
@@ -46,6 +46,16 @@ public interface Application : Object
        public abstract GitgExt.Activity? current_activity { owned get; }
 
        /**
+        * The environment with which the application was opened.
+        */
+       public abstract Gee.Map<string, string> environment { owned get; }
+
+       /**
+        * Get the notifications manager for the application.
+        */
+       public abstract Notifications notifications { owned get; }
+
+       /**
         * Set the current application main activity.
         *
         * @param id the id of the activity { link UIElement.id}.
@@ -63,8 +73,6 @@ public interface Application : Object
 
        public abstract bool busy { get; set; }
 
-       public abstract Gee.Map<string, string> environment { owned get; }
-
        public abstract Application open_new(Ggit.Repository repository, string? hint = null);
 
        public abstract RemoteLookup remote_lookup { owned get; }
diff --git a/libgitg-ext/gitg-ext-notifications.vala b/libgitg-ext/gitg-ext-notifications.vala
new file mode 100644
index 0000000..2b4d9de
--- /dev/null
+++ b/libgitg-ext/gitg-ext-notifications.vala
@@ -0,0 +1,31 @@
+/*
+ * This file is part of gitg
+ *
+ * Copyright (C) 2014 - Jesse van den Kieboom
+ *
+ * gitg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gitg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gitg. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace GitgExt
+{
+
+public interface Notifications : Object
+{
+       public abstract void add(Gtk.Widget widget);
+       public abstract void remove(Gtk.Widget widget, uint delay);
+}
+
+}
+
+// ex:set ts=4 noet:
diff --git a/libgitg/Makefile.am b/libgitg/Makefile.am
index 4bf8378..5dc0031 100644
--- a/libgitg/Makefile.am
+++ b/libgitg/Makefile.am
@@ -71,6 +71,7 @@ libgitg_libgitg_1_0_la_VALASOURCES =                  \
        libgitg/gitg-ref-base.vala                      \
        libgitg/gitg-ref.vala                           \
        libgitg/gitg-remote.vala                        \
+       libgitg/gitg-remote-notification.vala           \
        libgitg/gitg-repository-list-box.vala           \
        libgitg/gitg-repository.vala                    \
        libgitg/gitg-sidebar.vala                       \
diff --git a/libgitg/gitg-remote-notification.vala b/libgitg/gitg-remote-notification.vala
new file mode 100644
index 0000000..aabaeaa
--- /dev/null
+++ b/libgitg/gitg-remote-notification.vala
@@ -0,0 +1,116 @@
+/*
+ * This file is part of gitg
+ *
+ * Copyright (C) 2012 - Ignacio Casal Quinteiro
+ *
+ * gitg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gitg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gitg. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace Gitg
+{
+
+[GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-remote-notification.ui")]
+public class RemoteNotification : ProgressBin
+{
+       private Remote? d_remote;
+
+       [GtkChild ( name = "image_icon" )]
+       private Gtk.Image d_image_icon;
+
+       [GtkChild ( name = "label_text" )]
+       private Gtk.Label d_label_text;
+
+       [GtkChild ( name = "button_cancel" )]
+       private Gtk.Button d_button_cancel;
+
+       private bool d_finished;
+
+       public signal void cancel();
+       public signal void close();
+
+       public RemoteNotification(Remote remote)
+       {
+               d_remote = remote;
+
+               d_remote.bind_property("state", this, "remote_state");
+               d_remote.bind_property("transfer-progress", this, "fraction");
+       }
+
+       public void success(string text)
+       {
+               d_image_icon.icon_name = "emblem-ok-symbolic";
+               this.text = text;
+
+               get_style_context().add_class("success");
+
+               finish();
+       }
+
+       public void error(string text)
+       {
+               d_image_icon.icon_name = "network-error-symbolic";
+               this.text = text;
+
+               get_style_context().add_class("error");
+               finish();
+       }
+
+       private void finish()
+       {
+               d_finished = true;
+               d_button_cancel.label = _("Close");
+       }
+
+       public string text
+       {
+               get { return d_label_text.label; }
+               set { d_label_text.label = value; }
+       }
+
+       public RemoteState remote_state
+       {
+               set
+               {
+                       switch (value)
+                       {
+                               case Gitg.RemoteState.CONNECTING:
+                                       d_image_icon.icon_name = "network-wireless-acquiring-symbolic";
+                                       break;
+                               case Gitg.RemoteState.CONNECTED:
+                                       d_image_icon.icon_name = "network-idle-symbolic";
+                                       break;
+                               case Gitg.RemoteState.TRANSFERRING:
+                                       d_image_icon.icon_name = "network-transmit-receive-symbolic";
+                                       break;
+                       }
+               }
+       }
+
+       [GtkCallback]
+       private void on_button_cancel_clicked()
+       {
+               if (d_finished)
+               {
+                       close();
+               }
+               else
+               {
+                       cancel();
+               }
+       }
+}
+
+}
+
+// ex:ts=4 noet
diff --git a/libgitg/resources/resources.xml b/libgitg/resources/resources.xml
index 6368ba6..1c3053d 100644
--- a/libgitg/resources/resources.xml
+++ b/libgitg/resources/resources.xml
@@ -11,6 +11,7 @@
     <file compressed="true" preprocess="xml-stripblanks">ui/gitg-repository-list-box-row.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">ui/gitg-authentication-dialog.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">ui/gitg-sidebar.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">ui/gitg-remote-notification.ui</file>
   </gresource>
 </gresources>
 
diff --git a/libgitg/resources/ui/gitg-remote-notification.ui 
b/libgitg/resources/ui/gitg-remote-notification.ui
new file mode 100644
index 0000000..5888dd4
--- /dev/null
+++ b/libgitg/resources/ui/gitg-remote-notification.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.3 -->
+  <!-- interface-requires gitg 0.0 -->
+  <template class="GitgRemoteNotification" parent="GitgProgressBin">
+    <property name="visible">True</property>
+    <child>
+      <object class="GtkBox" id="box">
+        <property name="visible">True</property>
+        <property name="orientation">horizontal</property>
+        <property name="spacing">12</property>
+        <property name="border_width">12</property>
+        <child>
+          <object class="GtkImage" id="image_icon">
+            <property name="visible">True</property>
+            <property name="icon_size">1</property>
+            <property name="valign">baseline</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label_text">
+            <property name="visible">True</property>
+            <property name="hexpand">True</property>
+            <property name="halign">start</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="button_cancel">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Cancel</property>
+            <property name="halign">end</property>
+            <property name="valign">baseline</property>
+
+            <signal name="clicked" handler="on_button_cancel_clicked"/>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
+<!-- vi:ts=2:et -->


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