[evolution/relayout-composer: 1/3] Use e_msg_composer_get_lite() instead of a global variable or struct fields
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/relayout-composer: 1/3] Use e_msg_composer_get_lite() instead of a global variable or struct fields
- Date: Fri, 30 Apr 2010 22:36:24 +0000 (UTC)
commit abd1b7ef77b5dc8ff7ff1c6c405aaf448828c1b9
Author: Federico Mena Quintero <federico novell com>
Date: Fri Apr 30 15:30:58 2010 -0500
Use e_msg_composer_get_lite() instead of a global variable or struct fields
This will also make 'grep' easier when we remove the lite stuff
by refactoring.
Signed-off-by: Federico Mena Quintero <federico novell com>
composer/e-composer-header-table.c | 17 ++++++++---------
composer/e-composer-private.c | 8 ++++----
composer/e-msg-composer.c | 1 -
composer/e-msg-composer.h | 1 -
4 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index f62dc37..bb2c9e7 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -26,14 +26,13 @@
#include "e-util/gconf-bridge.h"
#include "widgets/misc/e-signature-combo-box.h"
+#include "e-msg-composer.h"
#include "e-composer-private.h"
#include "e-composer-from-header.h"
#include "e-composer-name-header.h"
#include "e-composer-post-header.h"
#include "e-composer-text-header.h"
-extern gboolean composer_lite;
-
#define E_COMPOSER_HEADER_TABLE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_COMPOSER_HEADER_TABLE, EComposerHeaderTablePrivate))
@@ -159,7 +158,7 @@ composer_header_table_notify_header (EComposerHeader *header,
{
GtkWidget *parent;
- if (composer_lite && strcmp (property_name, "destinations-to") == 0)
+ if (e_msg_composer_get_lite () && strcmp (property_name, "destinations-to") == 0)
parent = g_object_get_data (
G_OBJECT (header->input_widget), "parent");
else
@@ -174,7 +173,7 @@ composer_header_table_notify_widget (GtkWidget *widget,
{
GtkWidget *parent;
- if (composer_lite) {
+ if (e_msg_composer_get_lite ()) {
parent = gtk_widget_get_parent (widget);
parent = g_object_get_data (G_OBJECT (parent), "pdata");
} else
@@ -509,7 +508,7 @@ composer_header_table_constructor (GType type,
gtk_table_attach (
GTK_TABLE (object), priv->headers[ii]->title_widget,
0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, 3);
- if (composer_lite && ii == E_COMPOSER_HEADER_TO) {
+ if (e_msg_composer_get_lite () && ii == E_COMPOSER_HEADER_TO) {
GtkWidget *box = gtk_hbox_new (FALSE, 0);
g_object_set_data (
G_OBJECT (priv->headers[ii]->input_widget),
@@ -532,7 +531,7 @@ composer_header_table_constructor (GType type,
priv->headers[ii]->input_widget, 1, 4,
ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3);
}
- if (composer_lite && priv->headers[ii]->action_widget) {
+ if (e_msg_composer_get_lite () && priv->headers[ii]->action_widget) {
/* Pack the widgets to the end. Helps formatting
* when hiding the From field. */
gtk_box_pack_end (
@@ -542,7 +541,7 @@ composer_header_table_constructor (GType type,
}
}
- if (composer_lite)
+ if (e_msg_composer_get_lite ())
gtk_widget_show_all ((GtkWidget *)priv->actions_container);
ii = E_COMPOSER_HEADER_FROM;
@@ -561,13 +560,13 @@ composer_header_table_constructor (GType type,
priv->signature_combo_box, "visible");
/* Now add the signature stuff. */
- if (!composer_lite) {
+ if (!e_msg_composer_get_lite ()) {
gtk_table_attach (
GTK_TABLE (object), priv->signature_label,
2, 3, ii, ii + 1, 0, 0, 0, 3);
gtk_table_attach (
GTK_TABLE (object), priv->signature_combo_box,
- 3, 4, ii, ii + 1, composer_lite ? GTK_FILL: 0, 0, 0, 3);
+ 3, 4, ii, ii + 1, e_msg_composer_get_lite () ? GTK_FILL: 0, 0, 0, 3);
} else {
GtkWidget *box = gtk_hbox_new (FALSE, 0);
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index b48f9b6..ba022f3 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -145,7 +145,7 @@ e_composer_private_constructed (EMsgComposer *composer)
html = gtkhtml_editor_get_html (editor);
ui_manager = gtkhtml_editor_get_ui_manager (editor);
- if (composer->lite) {
+ if (e_msg_composer_get_lite ()) {
widget = gtkhtml_editor_get_managed_widget (editor, "/main-menu");
gtk_widget_hide (widget);
widget = gtkhtml_editor_get_managed_widget (editor, "/main-toolbar");
@@ -243,7 +243,7 @@ e_composer_private_constructed (EMsgComposer *composer)
widget = e_composer_header_table_new ();
gtk_container_set_border_width (GTK_CONTAINER (widget), 6);
gtk_box_pack_start (GTK_BOX (editor->vbox), widget, FALSE, FALSE, 0);
- if (composer->lite)
+ if (e_msg_composer_get_lite ())
gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 0);
else
gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 2);
@@ -253,7 +253,7 @@ e_composer_private_constructed (EMsgComposer *composer)
/* Construct the attachment paned. */
- if (composer->lite) {
+ if (e_msg_composer_get_lite ()) {
e_attachment_paned_set_default_height (75); /* short attachment bar for Anjal */
e_attachment_icon_view_set_default_icon_size (GTK_ICON_SIZE_BUTTON);
}
@@ -262,7 +262,7 @@ e_composer_private_constructed (EMsgComposer *composer)
priv->attachment_paned = g_object_ref (widget);
gtk_widget_show (widget);
- if (composer->lite) {
+ if (e_msg_composer_get_lite ()) {
GtkWidget *tmp, *tmp1, *tmp_box, *container;
GtkWidget *combo;
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 308d7e8..ca8e487 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2145,7 +2145,6 @@ msg_composer_class_init (EMsgComposerClass *class)
static void
msg_composer_init (EMsgComposer *composer)
{
- composer->lite = composer_lite;
composer->priv = E_MSG_COMPOSER_GET_PRIVATE (composer);
}
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index c55237c..19f21b7 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -63,7 +63,6 @@ typedef struct _EMsgComposerPrivate EMsgComposerPrivate;
struct _EMsgComposer {
GtkhtmlEditor parent;
EMsgComposerPrivate *priv;
- gboolean lite;
};
struct _EMsgComposerClass {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]