mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-08-27 11:59:17 +00:00
Fix 'Clone Repository' dialog errors
Route 'Clone Repository' dialog errors to new GtkInfobar.
This commit is contained in:
parent
3344f8ce84
commit
e5c30050d0
|
@ -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);
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue