+void
+ghb_error_dialog(GtkMessageType type, const gchar *message, const gchar *cancel)
+{
+ GtkWidget *dialog;
+ GtkResponseType response;
+
+ // Toss up a warning dialog
+ dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ type, GTK_BUTTONS_NONE,
+ "%s", message);
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ cancel, GTK_RESPONSE_CANCEL, NULL);
+ response = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy (dialog);
+}
+
+void
+ghb_cancel_encode(signal_user_data_t *ud, const gchar *extra_msg)
+{
+ GtkWidget *dialog;
+ GtkResponseType response;
+
+ if (extra_msg == NULL) extra_msg = "";
+ // Toss up a warning dialog
+ dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
+ "%sYour movie will be lost if you don't continue encoding.",
+ extra_msg);
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ "Cancel Current and Stop", 1,
+ "Cancel Current, Start Next", 2,
+ "Finish Current, then Stop", 3,
+ "Continue Encoding", 4,
+ NULL);
+ response = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy (dialog);
+ switch (response)
+ {
+ case 1:
+ ghb_stop_queue();
+ ud->cancel_encode = GHB_CANCEL_ALL;
+ break;
+ case 2:
+ ghb_stop_queue();
+ ud->cancel_encode = GHB_CANCEL_CURRENT;
+ break;
+ case 3:
+ ud->cancel_encode = GHB_CANCEL_FINISH;
+ break;
+ case 4:
+ default:
+ ud->cancel_encode = GHB_CANCEL_NONE;
+ break;
+ }
+}
+