From 800d438285ec852a357c2703a931a5c139b09cf2 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 21 Jul 2006 17:25:53 +0000 Subject: Add our options in a custom tab in the print dialogue. 2006-07-21 Christian Persch * data/epiphany.schemas.in: * data/glade/print.glade: * embed/mozilla/GeckoPrintService.cpp: * embed/mozilla/GeckoPrintService.h: * lib/ephy-gui.c: (ephy_gui_message_dialog_get_content_box), (ephy_gui_message_dialog_set_wrap_mode), (checkbutton_toggled_cb), (ephy_gui_connect_checkbutton_to_gconf): * lib/ephy-gui.h: Add our options in a custom tab in the print dialogue. --- lib/ephy-gui.c | 43 +++++++++++++++++++++++++++++++++++++++++++ lib/ephy-gui.h | 13 ++++++++++--- 2 files changed, 53 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c index d69a9dca3..09d60d830 100644 --- a/lib/ephy-gui.c +++ b/lib/ephy-gui.c @@ -38,6 +38,7 @@ #include #include #include +#include #include @@ -494,3 +495,45 @@ ephy_gui_message_dialog_get_content_box (GtkWidget *dialog) return container; } + +/* Until bug #345349 is fixed */ +void +ephy_gui_message_dialog_set_wrap_mode (GtkMessageDialog *dialog, + PangoWrapMode wrap_mode) +{ + GtkContainer *container; + GList *children, *l; + + container = GTK_CONTAINER (dialog->label->parent); + g_return_if_fail (GTK_IS_CONTAINER (container)); + + children = gtk_container_get_children (container); + for (l = children; l != NULL; l = l->next) + { + GtkWidget *child = l->data; + + if (GTK_IS_LABEL (child)) + { + g_print ("Setting wrap mode on label %p\n", child); + gtk_label_set_line_wrap_mode (GTK_LABEL (child), + wrap_mode); + } + } +} + +static void +checkbutton_toggled_cb (GtkToggleButton *button, + const char *pref) +{ + eel_gconf_set_boolean (pref, gtk_toggle_button_get_active (button)); +} + +void +ephy_gui_connect_checkbutton_to_gconf (GtkWidget *widget, + const char *pref) +{ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), + eel_gconf_get_boolean (pref)); + g_signal_connect (widget, "toggled", + G_CALLBACK (checkbutton_toggled_cb), (gpointer) pref); +} diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h index 10b681fbe..d989b06e6 100644 --- a/lib/ephy-gui.h +++ b/lib/ephy-gui.h @@ -21,12 +21,13 @@ #ifndef EPHY_GUI_H #define EPHY_GUI_H +#include +#include #include -#include +#include #include +#include #include -#include -#include G_BEGIN_DECLS @@ -78,6 +79,12 @@ void ephy_gui_window_update_user_time (GtkWidget *window, GtkWidget *ephy_gui_message_dialog_get_content_box (GtkWidget *dialog); +void ephy_gui_message_dialog_set_wrap_mode (GtkMessageDialog *dialog, + PangoWrapMode wrap_mode); + +void ephy_gui_connect_checkbutton_to_gconf (GtkWidget *widget, + const char *pref); + G_END_DECLS #endif -- cgit v1.2.3