aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-gui.c43
-rw-r--r--lib/ephy-gui.h13
2 files changed, 53 insertions, 3 deletions
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 <gtk/gtkmain.h>
#include <gtk/gtktreeselection.h>
#include <gtk/gtktoolbar.h>
+#include <gtk/gtktogglebutton.h>
#include <unistd.h>
@@ -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 <gdk/gdkkeysyms.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtkmenu.h>
-#include <gtk/gtktreeview.h>
+#include <gtk/gtkmessagedialog.h>
#include <gtk/gtktreeviewcolumn.h>
+#include <gtk/gtktreeview.h>
#include <gtk/gtkwindow.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gdk/gdkkeysyms.h>
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