summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-19 19:02:48 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-19 19:02:48 +0000
commit5403a5be85b5b8a207a704a5298c7f76d8312d0e (patch)
tree087ba7abbcf84ed12141b49373a56e9d253266eb /src/util.c
parentf827028d29f6e463c8aeaa329603047d3ac80da1 (diff)
reannounce, blocklist enable/url/update
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 3621e4d..c2f623f 100644
--- a/src/util.c
+++ b/src/util.c
@@ -33,6 +33,20 @@
#include "util.h"
#include "dispatch.h"
+void trg_error_dialog(GtkWindow *parent, int status, JsonObject *response)
+{
+ const gchar *msg = make_error_message(response, status);
+ GtkWidget *dialog = gtk_message_dialog_new(parent,
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK, "%s",
+ msg);
+ gtk_window_set_title(GTK_WINDOW(dialog), "Error");
+ gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+ g_free((gpointer) msg);
+}
+
const gchar *make_error_message(JsonObject * response, int status)
{
if (status == FAIL_JSON_DECODE) {