Fix 'Clone Repository' dialog errors

Route 'Clone Repository' dialog errors to new GtkInfobar.
This commit is contained in:
Sindhu S 2013-09-03 22:09:28 +05:30
parent 3344f8ce84
commit e5c30050d0
3 changed files with 11 additions and 3 deletions

View file

@ -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);

View file

@ -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"/>

View file

@ -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;
}