summaryrefslogtreecommitdiff
path: root/image-converter/caja-image-resizer.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-03-17 12:34:02 +0100
committerraveit65 <[email protected]>2020-04-12 23:27:43 +0200
commitec749ac683867006ca5ccb20149bba8501a4a489 (patch)
tree45b91c9148811bcfadb004342e10e6dfc3c227a3 /image-converter/caja-image-resizer.c
parentce18af2970f8bee907197b2b8c5b398ae0ab97c2 (diff)
downloadcaja-extensions-ec749ac683867006ca5ccb20149bba8501a4a489.tar.bz2
caja-extensions-ec749ac683867006ca5ccb20149bba8501a4a489.tar.xz
image-converter: Add error-dialog.ui
Diffstat (limited to 'image-converter/caja-image-resizer.c')
-rw-r--r--image-converter/caja-image-resizer.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/image-converter/caja-image-resizer.c b/image-converter/caja-image-resizer.c
index cf17cb2..84f834c 100644
--- a/image-converter/caja-image-resizer.c
+++ b/image-converter/caja-image-resizer.c
@@ -198,21 +198,24 @@ op_finished (GPid pid, gint status, gpointer data)
if (status != 0) {
/* resizing failed */
- char *name = caja_file_info_get_name (file);
-
- GtkWidget *msg_dialog = gtk_message_dialog_new (GTK_WINDOW (priv->progress_dialog),
- GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
- GTK_BUTTONS_NONE,
- "'%s' cannot be resized. Check whether you have permission to write to this folder.",
- name);
- g_free (name);
-
- gtk_dialog_add_button (GTK_DIALOG (msg_dialog), _("_Skip"), 1);
- gtk_dialog_add_button (GTK_DIALOG (msg_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (msg_dialog), _("_Retry"), 0);
- gtk_dialog_set_default_response (GTK_DIALOG (msg_dialog), 0);
-
- int response_id = gtk_dialog_run (GTK_DIALOG (msg_dialog));
+ GtkBuilder *builder;
+ GtkWidget *msg_dialog;
+ GObject *dialog_text;
+ int response_id;
+ char *msg;
+ char *name;
+
+ name = caja_file_info_get_name (file);
+
+ builder = gtk_builder_new_from_resource ("/org/mate/caja/extensions/imageconverter/error-dialog.ui");
+ msg_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "error_dialog"));
+ dialog_text = gtk_builder_get_object (builder, "error_text");
+ msg = g_strdup_printf ("'%s' cannot be resized. Check whether you have permission to write to this folder.", name);
+ gtk_label_set_text (GTK_LABEL (dialog_text), msg);
+ g_free (msg);
+ g_object_unref (builder);
+
+ response_id = gtk_dialog_run (GTK_DIALOG (msg_dialog));
gtk_widget_destroy (msg_dialog);
if (response_id == 0) {
retry = TRUE;