[gnome-builder/gnome-builder-43] plugins/vcsui: include backend-provided error message
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-43] plugins/vcsui: include backend-provided error message
- Date: Mon, 26 Sep 2022 17:30:48 +0000 (UTC)
commit 6e131f713b557121806b340416bbe4007c99752a
Author: Christian Hergert <chergert redhat com>
Date: Mon Sep 26 10:30:25 2022 -0700
plugins/vcsui: include backend-provided error message
This won't necessarily be translated, which is unfortunate, but does at
least give some hint to the user of the failure.
Fixes #1817
src/plugins/vcsui/gbp-vcsui-clone-page.c | 4 ++++
src/plugins/vcsui/gbp-vcsui-clone-page.ui | 12 ++++++++++++
2 files changed, 16 insertions(+)
---
diff --git a/src/plugins/vcsui/gbp-vcsui-clone-page.c b/src/plugins/vcsui/gbp-vcsui-clone-page.c
index 5f3c3a647..fe9d57c06 100644
--- a/src/plugins/vcsui/gbp-vcsui-clone-page.c
+++ b/src/plugins/vcsui/gbp-vcsui-clone-page.c
@@ -49,6 +49,7 @@ struct _GbpVcsuiClonePage
AdwEntryRow *uri_row;
IdeProgressIcon *progress;
GtkLabel *failure_message;
+ GtkLabel *error_label;
IdeVcsCloneRequest *request;
};
@@ -147,6 +148,7 @@ gbp_vcsui_clone_page_clone_cb (GObject *object,
gtk_stack_set_visible_child_name (self->stack, "details");
gtk_label_set_label (self->failure_message,
_("A failure occurred while cloning the repository."));
+ gtk_label_set_label (self->error_label, error->message);
IDE_GOTO (failure);
}
else
@@ -248,6 +250,7 @@ clone_action (GtkWidget *widget,
gtk_widget_action_set_enabled (widget, "clone-page.clone", FALSE);
gtk_label_set_label (self->failure_message, NULL);
+ gtk_label_set_label (self->error_label, NULL);
ide_vcs_clone_request_clone_async (self->request,
notif,
@@ -394,6 +397,7 @@ gbp_vcsui_clone_page_class_init (GbpVcsuiClonePageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GbpVcsuiClonePage, author_name_row);
gtk_widget_class_bind_template_child (widget_class, GbpVcsuiClonePage, branch_button);
gtk_widget_class_bind_template_child (widget_class, GbpVcsuiClonePage, branch_label);
+ gtk_widget_class_bind_template_child (widget_class, GbpVcsuiClonePage, error_label);
gtk_widget_class_bind_template_child (widget_class, GbpVcsuiClonePage, failure_message);
gtk_widget_class_bind_template_child (widget_class, GbpVcsuiClonePage, location_row);
gtk_widget_class_bind_template_child (widget_class, GbpVcsuiClonePage, main);
diff --git a/src/plugins/vcsui/gbp-vcsui-clone-page.ui b/src/plugins/vcsui/gbp-vcsui-clone-page.ui
index e34c32681..1fa2374e7 100644
--- a/src/plugins/vcsui/gbp-vcsui-clone-page.ui
+++ b/src/plugins/vcsui/gbp-vcsui-clone-page.ui
@@ -285,6 +285,18 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkBox">
+ <property name="margin-top">12</property>
+ <child>
+ <object class="GtkLabel" id="error_label">
+ <property name="wrap">true</property>
+ <property name="hexpand">true</property>
+ <property name="xalign">0</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]