Browse Source

Display errors in a window.

Do not only print errors on the console, display an error dialog
as well.
master
parent
commit
7837171d49
  1. 17
      src/yki.c

17
src/yki.c

@ -90,8 +90,21 @@ main(int argc, char **argv)
yki_decrypt(gpgme, files[0], &error);
}
if ( error )
g_printerr("Error: %s: %s\n", yki_error_msg(error->code), error->message);
if ( error ) {
if ( error->domain == YKI_ERROR ) {
GtkWidget *dlg;
g_printerr("Error: %s: %s\n", yki_error_msg(error->code), error->message);
dlg = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
yki_error_msg(error->code));
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dlg), error->message);
gtk_dialog_run(GTK_DIALOG(dlg));
gtk_widget_destroy(dlg);
}
else
g_printerr("Error: %s: %s\n", error->message);
}
g_option_context_free(parser);
g_strfreev(files);

Loading…
Cancel
Save