[evolution/webkit-composer: 24/72] Fix runtime warnings and widget layouting



commit 79d5e129d11356075291b1c8b64c595062973008
Author: Dan VrÃtil <dvratil redhat com>
Date:   Wed Aug 29 15:43:41 2012 +0200

    Fix runtime warnings and widget layouting

 composer/e-composer-actions.c             |    6 +++---
 composer/e-composer-header-table.c        |    3 ---
 composer/e-composer-private.c             |   19 ++++++++++---------
 plugins/external-editor/external-editor.c |    6 ++++--
 4 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c
index 02d2832..3d25601 100644
--- a/composer/e-composer-actions.c
+++ b/composer/e-composer-actions.c
@@ -533,17 +533,17 @@ e_composer_actions_init (EMsgComposer *composer)
 	/* FIXME WEBKIT Make sure this works */
 	g_object_bind_property (
 		editor_widget, "editable",
-		e_editor_get_action (editor, "edit"), "sensitive",
+		e_editor_get_action (editor, "edit-menu"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 	g_object_bind_property (
 		editor_widget, "editable",
-		e_editor_get_action (editor, "format"), "sensitive",
+		e_editor_get_action (editor, "format-menu"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 	g_object_bind_property (
 		editor_widget, "editable",
-		e_editor_get_action (editor, "insert"), "sensitive",
+		e_editor_get_action (editor, "insert-menu"), "sensitive",
 		G_BINDING_SYNC_CREATE);
 
 #if defined (HAVE_NSS)
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index 1290a67..5a0311b 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -49,9 +49,6 @@
 	  "carbon copy of the message without appearing " \
 	  "in the recipient list of the message")
 
-#define E_COMPOSER_HEADER_TABLE_GET_PRIVATE(obj) \
-	(G_TYPE_INSTANCE_GET_PRIVATE \
-	((obj), E_TYPE_COMPOSER_HEADER_TABLE, EComposerHeaderTablePrivate))
 
 struct _EComposerHeaderTablePrivate {
 	EComposerHeader *headers[E_COMPOSER_NUM_HEADERS];
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 5f9371e..3b512dc 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -262,28 +262,27 @@ e_composer_private_constructed (EMsgComposer *composer)
 	priv->focus_tracker = focus_tracker;
 
 	container = gtk_hbox_new (FALSE, 0);
+	gtk_widget_set_hexpand (container, TRUE);
+	gtk_widget_show (container);
 	e_editor_window_pack_above (E_EDITOR_WINDOW (composer), container);
 
 	/* Construct the activity bar. */
-
 	widget = e_activity_bar_new ();
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	priv->activity_bar = g_object_ref (widget);
 	/* EActivityBar controls its own visibility. */
 
 	/* Construct the alert bar for errors. */
-
 	widget = e_alert_bar_new ();
 	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 	priv->alert_bar = g_object_ref (widget);
 	/* EAlertBar controls its own visibility. */
 
 	/* Construct the header table. */
-
 	widget = e_composer_header_table_new (shell, registry);
 	gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
-	gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
-	e_editor_window_pack_above (E_EDITOR_WINDOW (composer), widget);
+	gtk_widget_set_hexpand (widget, TRUE);
+	gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
 	/* FIXME WEBKIT
 	if (small_screen_mode)
 		gtk_box_reorder_child (GTK_BOX (container), widget, 1);
@@ -408,14 +407,16 @@ e_composer_private_constructed (EMsgComposer *composer)
 	priv->gallery_icon_view = g_object_ref (widget);
 	g_free (gallery_path);
 
-	g_signal_connect (
-		composer, "notify::html-mode",
-		G_CALLBACK (composer_update_gallery_visibility), NULL);
-
+	g_signal_connect_swapped (
+		editor_widget, "notify::mode",
+		G_CALLBACK (composer_update_gallery_visibility), composer);
 	g_signal_connect_swapped (
 		ACTION (PICTURE_GALLERY), "toggled",
 		G_CALLBACK (composer_update_gallery_visibility), composer);
 
+	/* Initial sync */
+	composer_update_gallery_visibility (composer);
+
 	/* XXX What is this for? */
 	/* FIXME WEBKIT Yes, what is this for?
 	g_object_set_data (G_OBJECT (composer), "vbox", editor->vbox);
diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c
index f1c641e..e4df314 100644
--- a/plugins/external-editor/external-editor.c
+++ b/plugins/external-editor/external-editor.c
@@ -151,17 +151,19 @@ enable_disable_composer (EMsgComposer *composer,
                          gboolean enable)
 {
 	EEditor *editor;
+	EEditorWidget *editor_widget;
 	GtkAction *action;
 	GtkActionGroup *action_group;
 
 	g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
 	editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+	editor_widget = e_editor_get_editor_widget (editor);
 
 	if (enable) {
-		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor), TRUE);
+		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), TRUE);
 	} else {
-		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor), FALSE);
+		webkit_web_view_set_editable (WEBKIT_WEB_VIEW (editor_widget), FALSE);
 	}
 
 	action = E_EDITOR_ACTION_EDIT_MENU (editor);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]