* Displays a modal message dialog which will be destroyed automatically. * Use for warnings which don't need a response. * * @type: The @GtkMessageType for the dialog * @title: The title of the dialog * @message: The detail text of the dialog */
| 4024 | * @message: The detail text of the dialog |
| 4025 | */ |
| 4026 | void |
| 4027 | ghb_alert_dialog_show (GtkMessageType type, const char *title, |
| 4028 | const char *format, ...) |
| 4029 | { |
| 4030 | GtkWindow *parent; |
| 4031 | GtkWidget *dialog; |
| 4032 | char *message; |
| 4033 | va_list args; |
| 4034 | |
| 4035 | parent = gtk_application_get_active_window(GTK_APPLICATION(g_application_get_default())); |
| 4036 | |
| 4037 | dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, |
| 4038 | type, GTK_BUTTONS_CLOSE, "%s", title); |
| 4039 | |
| 4040 | if (format != NULL) |
| 4041 | { |
| 4042 | va_start(args, format); |
| 4043 | message = g_strdup_vprintf(format, args); |
| 4044 | va_end(args); |
| 4045 | gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s", message); |
| 4046 | g_free(message); |
| 4047 | } |
| 4048 | g_signal_connect(dialog, "response", G_CALLBACK(message_dialog_destroy), NULL); |
| 4049 | gtk_widget_set_visible(dialog, TRUE); |
| 4050 | } |
| 4051 | |
| 4052 | GtkWidget * |
| 4053 | ghb_cancel_dialog_new (GtkWindow *parent, const char *title, const char *message, |
no outgoing calls
no test coverage detected