[gthumb] added a _gtk_error_dialog_show function
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] added a _gtk_error_dialog_show function
- Date: Sat, 5 Feb 2011 13:14:42 +0000 (UTC)
commit ca34dc713f122e88f089c6bcc9ea57eef957b516
Author: Paolo Bacchilega <paobac src gnome org>
Date: Thu Feb 3 21:35:31 2011 +0100
added a _gtk_error_dialog_show function
gthumb/gtk-utils.c | 29 +++++++++++++++++++++++++++++
gthumb/gtk-utils.h | 4 ++++
2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gtk-utils.c b/gthumb/gtk-utils.c
index 337d711..3a93474 100644
--- a/gthumb/gtk-utils.c
+++ b/gthumb/gtk-utils.c
@@ -635,6 +635,35 @@ _gtk_error_dialog_run (GtkWindow *parent,
void
+_gtk_error_dialog_show (GtkWindow *parent,
+ const char *title,
+ const char *format,
+ ...)
+{
+ va_list args;
+ char *message;
+ GtkWidget *d;
+
+ va_start (args, format);
+ message = g_strdup_vprintf (format, args);
+ va_end (args);
+
+ d = _gtk_message_dialog_new (parent,
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_DIALOG_ERROR,
+ title,
+ message,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
+ g_signal_connect (d, "response", G_CALLBACK (error_dialog_response_cb), NULL);
+
+ gtk_window_present (GTK_WINDOW (d));
+
+ g_free (message);
+}
+
+
+void
_gtk_info_dialog_run (GtkWindow *parent,
const gchar *format,
...)
diff --git a/gthumb/gtk-utils.h b/gthumb/gtk-utils.h
index c01c8a7..e5f1706 100644
--- a/gthumb/gtk-utils.h
+++ b/gthumb/gtk-utils.h
@@ -76,6 +76,10 @@ _gtk_error_dialog_from_gerror_show (GtkWindow *parent,
void _gtk_error_dialog_run (GtkWindow *parent,
const gchar *format,
...) G_GNUC_PRINTF (2, 3);
+void _gtk_error_dialog_show (GtkWindow *parent,
+ const char *title,
+ const char *format,
+ ...) G_GNUC_PRINTF (3, 4);
void _gtk_info_dialog_run (GtkWindow *parent,
const gchar *format,
...) G_GNUC_PRINTF (2, 3);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]