X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=gtk%2Fsrc%2Fcallbacks.c;h=54a5d0ca223f11ce3ff2a4d07f3bd2ba26475e7c;hb=fed44d08dd83d311d2d36aa518633966280b45dd;hp=4d14b12a68366aab43da714a4cae6120aa1d87a5;hpb=bff5799461349873d699b07618b6838cf9f1b2d2;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 4d14b12a..54a5d0ca 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1886,6 +1886,22 @@ ghb_message_dialog(GtkMessageType type, const gchar *message, const gchar *no, c return TRUE; } +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); +} + gboolean ghb_cancel_encode(const gchar *extra_msg) { @@ -3300,10 +3316,14 @@ ghb_is_cd(GDrive *gd) LibHalDriveType dtype; device = g_drive_get_identifier(gd, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE); + if (device == NULL) + return FALSE; halDrive = libhal_drive_from_device_file (hal_ctx, device); + g_free(device); + if (halDrive == NULL) + return FALSE; dtype = libhal_drive_get_type(halDrive); libhal_drive_free(halDrive); - g_free(device); return (dtype == LIBHAL_DRIVE_TYPE_CDROM); #else return FALSE;