diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-08-21 18:24:31 +0200 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-08-21 18:24:31 +0200 |
commit | a2b4de80a94b4e049f1d2a7ef00a174865b5c9ec (patch) | |
tree | 8a022249f6fefacb0f62505e08dd27291a96bb52 /eel/eel-gtk-extensions.c | |
parent | 394cb741c3e59df66f924771d4ef68866e602faa (diff) | |
download | nautilus-a2b4de80a94b4e049f1d2a7ef00a174865b5c9ec.tar.gz |
[eel] add an utility to pack details into a message dialog
So that we can remove EelAlertDialog.
Diffstat (limited to 'eel/eel-gtk-extensions.c')
-rw-r--r-- | eel/eel-gtk-extensions.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c index 376a92f1d..57b98215c 100644 --- a/eel/eel-gtk-extensions.c +++ b/eel/eel-gtk-extensions.c @@ -32,16 +32,17 @@ #include "eel-gdk-pixbuf-extensions.h" #include "eel-glib-extensions.h" #include "eel-gnome-extensions.h" +#include "eel-marshal.h" #include "eel-string.h" + #include <X11/Xlib.h> #include <X11/Xatom.h> #include <gdk/gdk.h> #include <gdk/gdkprivate.h> #include <gdk/gdkx.h> #include <gtk/gtk.h> +#include <glib/gi18n-lib.h> #include <math.h> -#include "eel-marshal.h" -#include "eel-marshal.c" /* This number is fairly arbitrary. Long enough to show a pretty long * menu title, but not so long to make a menu grotesquely wide. @@ -467,3 +468,25 @@ eel_gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view, GUINT_TO_POINTER (button_press_id)); } } + +void +eel_gtk_message_dialog_set_details_label (GtkMessageDialog *dialog, + const gchar *details_text) +{ + GtkWidget *content_area, *expander, *label; + + content_area = gtk_message_dialog_get_message_area (dialog); + expander = gtk_expander_new_with_mnemonic (_("Show more _details")); + gtk_expander_set_spacing (GTK_EXPANDER (expander), 6); + + label = gtk_label_new (details_text); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + gtk_label_set_selectable (GTK_LABEL (label), TRUE); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + + gtk_container_add (GTK_CONTAINER (expander), label); + gtk_box_pack_start (GTK_BOX (content_area), expander, FALSE, FALSE, 0); + + gtk_widget_show (label); + gtk_widget_show (expander); +} |