[gitg] Fix 'Clone Repository' dialog errors



commit e5c30050d011ac9deaa91cda90547ca08f308f3d
Author: Sindhu S <sindhus live in>
Date:   Tue Sep 3 22:09:28 2013 +0530

    Fix 'Clone Repository' dialog errors
    
    Route 'Clone Repository' dialog errors to new GtkInfobar.

 gitg/gitg-window.vala                 |    6 ++++++
 gitg/resources/ui/gitg-window.ui      |    1 +
 libgitg/gitg-repository-list-box.vala |    7 ++++---
 3 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 14d6c13..eedb457 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -124,6 +124,12 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                repository = r;
        }
 
+       [GtkCallback]
+       private void dash_view_show_error(string primary_msg, string secondary_message)
+       {
+               show_infobar(primary_msg, secondary_message, Gtk.MessageType.ERROR);
+       }
+
        construct
        {
                add_action_entries(win_entries, this);
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index 06aea58..23098b2 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -197,6 +197,7 @@
                     <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"/>
                       <class name="content-view"/>
diff --git a/libgitg/gitg-repository-list-box.vala b/libgitg/gitg-repository-list-box.vala
index a92b549..70433db 100644
--- a/libgitg/gitg-repository-list-box.vala
+++ b/libgitg/gitg-repository-list-box.vala
@@ -130,6 +130,7 @@ namespace Gitg
                }
 
                public signal void repository_activated(Repository repository);
+               public signal void show_error(string primary_message, string secondary_message);
 
                protected override void row_activated(Gtk.ListBoxRow row)
                {
@@ -305,11 +306,11 @@ namespace Gitg
                                }
                                catch (Ggit.Error e)
                                {
-                                       warning("error cloning: %s", e.message);
+                                       show_error("Gitg could not clone the git repository.", e.message);
                                }
                                catch (GLib.Error e)
                                {
-                                       warning("error cloning: %s", e.message);
+                                       show_error("Gitg could not clone the git repository.", e.message);
                                }
 
                                Idle.add((owned) callback);
@@ -347,7 +348,7 @@ namespace Gitg
                        }
                        catch (GLib.Error e)
                        {
-                               warning("error creating subfolder: %s", e.message);
+                               show_error("Gitg could not clone the git repository.", e.message);
                                return;
                        }
 


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