aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2009-05-22 19:30:53 +0800
committerSrinivasa Ragavan <sragavan@novell.com>2009-05-22 20:13:57 +0800
commit9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0 (patch)
treef8ef1c6c1d8b2f84ea3e052564bb2f4750da3ad3 /composer
parent634b906db04504eb34ad75e2d080753b516a95f5 (diff)
downloadgsoc2013-evolution-9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0.tar
gsoc2013-evolution-9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0.tar.gz
gsoc2013-evolution-9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0.tar.bz2
gsoc2013-evolution-9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0.tar.lz
gsoc2013-evolution-9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0.tar.xz
gsoc2013-evolution-9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0.tar.zst
gsoc2013-evolution-9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0.zip
Johnny's composer changes for Anjal.
Diffstat (limited to 'composer')
-rw-r--r--composer/Makefile.am28
-rw-r--r--composer/e-composer-from-header.h2
-rw-r--r--composer/e-composer-header-table.c36
-rw-r--r--composer/e-composer-header.c89
-rw-r--r--composer/e-composer-header.h3
-rw-r--r--composer/e-composer-name-header.c28
-rw-r--r--composer/e-composer-name-header.h9
-rw-r--r--composer/e-composer-private.c79
-rw-r--r--composer/e-composer-text-header.c21
-rw-r--r--composer/e-composer-text-header.h11
-rw-r--r--composer/e-msg-composer.c38
-rw-r--r--composer/e-msg-composer.h5
12 files changed, 320 insertions, 29 deletions
diff --git a/composer/Makefile.am b/composer/Makefile.am
index 578805cc06..97debe59d0 100644
--- a/composer/Makefile.am
+++ b/composer/Makefile.am
@@ -5,6 +5,19 @@ errordir = $(privdatadir)/errors
@EVO_PLUGIN_RULE@
noinst_LTLIBRARIES = libcomposer.la
+libcomposerincludedir = $(privincludedir)/composer
+libcomposerinclude_HEADERS = \
+ e-composer-header.h \
+ e-composer-header-table.h \
+ e-composer-from-header.h \
+ e-composer-name-header.h \
+ e-composer-post-header.h \
+ e-composer-private.h \
+ e-composer-text-header.h \
+ e-composer-common.h \
+ e-composer-actions.h \
+ e-composer-autosave.h \
+ e-msg-composer.h
INCLUDES = \
-I$(top_srcdir) \
@@ -27,27 +40,18 @@ INCLUDES = \
libcomposer_la_SOURCES = \
$(IDL_GENERATED) \
$(HTML_EDITOR_GENERATED) \
+ $(libcomposerinclude_HEADERS) \
e-composer-actions.c \
- e-composer-actions.h \
e-composer-autosave.c \
- e-composer-autosave.h \
- e-composer-common.h \
e-composer-header.c \
- e-composer-header.h \
e-composer-header-table.c \
- e-composer-header-table.h \
e-composer-from-header.c \
- e-composer-from-header.h \
e-composer-name-header.c \
- e-composer-name-header.h \
e-composer-post-header.c \
- e-composer-post-header.h \
e-composer-private.c \
- e-composer-private.h \
e-composer-text-header.c \
- e-composer-text-header.h \
- e-msg-composer.c \
- e-msg-composer.h
+ e-msg-composer.c
+
uidir = $(evolutionuidir)
ui_DATA = evolution-composer.ui
diff --git a/composer/e-composer-from-header.h b/composer/e-composer-from-header.h
index 74fda9ae03..f8c6dc6f18 100644
--- a/composer/e-composer-from-header.h
+++ b/composer/e-composer-from-header.h
@@ -26,7 +26,7 @@
#include <libedataserver/e-account.h>
#include <libedataserver/e-account-list.h>
-#include "e-account-combo-box.h"
+#include <misc/e-account-combo-box.h>
#include "e-composer-header.h"
/* Standard GObject macros */
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index 267bfbf1e7..df96d763ba 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -31,6 +31,8 @@
#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))
@@ -68,6 +70,7 @@ struct _EComposerHeaderTablePrivate {
GtkWidget *signature_label;
GtkWidget *signature_combo_box;
ENameSelector *name_selector;
+ GtkHBox *actions_container;
};
static gpointer parent_class;
@@ -502,8 +505,16 @@ composer_header_table_constructor (GType type,
gtk_table_attach (
GTK_TABLE (object), 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) {
+ /* Pack the widgets to the end. Helps formatting when hiding the From field */
+ gtk_box_pack_end ((GtkBox *)priv->actions_container, priv->headers[ii]->action_widget,
+ FALSE, FALSE, 6);
+ }
}
+ if (composer_lite)
+ gtk_widget_show_all ((GtkWidget *)priv->actions_container);
+
ii = E_COMPOSER_HEADER_FROM;
/* Leave room in the "From" row for signature stuff. */
@@ -528,6 +539,19 @@ composer_header_table_constructor (GType type,
GTK_TABLE (object), priv->signature_combo_box,
3, 4, ii, ii + 1, 0, 0, 0, 3);
+ if (composer_lite) {
+ ii = E_COMPOSER_HEADER_TO;
+
+ /* Leave room for the action buttons. */
+ gtk_container_child_set (
+ GTK_CONTAINER (object),
+ priv->headers[ii]->input_widget,
+ "right-attach", 2, NULL);
+
+ gtk_table_attach (GTK_TABLE (object), (GtkWidget *)priv->actions_container, 2, 4, E_COMPOSER_HEADER_TO,
+ E_COMPOSER_HEADER_TO + 1, GTK_FILL, 0, 0, 3);
+ }
+
return object;
}
@@ -898,6 +922,8 @@ composer_header_table_init (EComposerHeaderTable *table)
name_selector = e_name_selector_new ();
table->priv->name_selector = name_selector;
+ table->priv->actions_container = (GtkHBox *)gtk_hbox_new (FALSE, 6);
+
header = e_composer_from_header_new (_("Fr_om:"));
composer_header_table_bind_header ("account", "changed", header);
composer_header_table_bind_header ("account-list", "refreshed", header);
@@ -907,21 +933,21 @@ composer_header_table_init (EComposerHeaderTable *table)
composer_header_table_from_changed_cb), table);
table->priv->headers[E_COMPOSER_HEADER_FROM] = header;
- header = e_composer_text_header_new_label (_("_Reply-To:"));
+ header = e_composer_text_header_new_label (_("_Reply-To:"), "");
composer_header_table_bind_header ("reply-to", "changed", header);
table->priv->headers[E_COMPOSER_HEADER_REPLY_TO] = header;
- header = e_composer_name_header_new (_("_To:"), name_selector);
+ header = e_composer_name_header_new_with_label (_("_To:"), name_selector);
e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_TO);
composer_header_table_bind_header ("destinations-to", "changed", header);
table->priv->headers[E_COMPOSER_HEADER_TO] = header;
- header = e_composer_name_header_new (_("_Cc:"), name_selector);
+ header = e_composer_name_header_new_with_action (_("_Cc:"), _("Show CC"), name_selector);
e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_CC);
composer_header_table_bind_header ("destinations-cc", "changed", header);
table->priv->headers[E_COMPOSER_HEADER_CC] = header;
- header = e_composer_name_header_new (_("_Bcc:"), name_selector);
+ header = e_composer_name_header_new_with_action (_("_Bcc:"), _("Show BCC"), name_selector);
e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_BCC);
composer_header_table_bind_header ("destinations-bcc", "changed", header);
table->priv->headers[E_COMPOSER_HEADER_BCC] = header;
@@ -930,7 +956,7 @@ composer_header_table_init (EComposerHeaderTable *table)
composer_header_table_bind_header ("post-to", "changed", header);
table->priv->headers[E_COMPOSER_HEADER_POST_TO] = header;
- header = e_composer_text_header_new_label (_("S_ubject:"));
+ header = e_composer_text_header_new_label (_("S_ubject:"), NULL);
composer_header_table_bind_header ("subject", "changed", header);
table->priv->headers[E_COMPOSER_HEADER_SUBJECT] = header;
diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c
index 272556969d..20967c6853 100644
--- a/composer/e-composer-header.c
+++ b/composer/e-composer-header.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
/*
*
* This program is free software; you can redistribute it and/or
@@ -28,6 +30,8 @@ enum {
PROP_0,
PROP_BUTTON,
PROP_LABEL,
+ PROP_ADDACTION,
+ PROP_ADDACTION_TEXT,
PROP_SENSITIVE,
PROP_VISIBLE
};
@@ -41,6 +45,8 @@ enum {
struct _EComposerHeaderPrivate {
gchar *label;
gboolean button;
+ gchar *addaction_text;
+ gboolean addaction; /*For Add button.*/
guint sensitive : 1;
guint visible : 1;
@@ -57,6 +63,20 @@ composer_header_button_clicked_cb (GtkButton *button,
g_signal_emit (header, signal_ids[CLICKED], 0);
}
+static void
+composer_header_addaction_clicked_cb (GtkButton *button,
+ EComposerHeader *header)
+{
+ gtk_widget_hide ((GtkWidget *)button);
+ e_composer_header_set_visible (header, TRUE);
+}
+
+static void
+link_clicked_cb (GtkLinkButton *button, const gchar *link_, gpointer user_data)
+{
+ return;
+}
+
static GObject *
composer_header_constructor (GType type,
guint n_construct_properties,
@@ -84,6 +104,27 @@ composer_header_constructor (GType type,
gtk_label_set_mnemonic_widget (
GTK_LABEL (widget), header->input_widget);
}
+
+ if (header->priv->addaction) {
+ GtkWidget *box, *tmp;
+ char *str;
+
+ header->action_widget = gtk_button_new ();
+ box = gtk_hbox_new (FALSE, 0);
+ tmp = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_BUTTON);
+ gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
+ tmp = gtk_label_new (NULL);
+ str = g_strdup_printf ("<span foreground='blue' underline='single' underline_color='blue' >%s</span>", header->priv->addaction_text);
+ gtk_label_set_markup((GtkLabel *)tmp, str);
+ gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3);
+ gtk_container_add((GtkContainer *)header->action_widget, box);
+ gtk_widget_show_all(header->action_widget);
+ g_signal_connect (
+ header->action_widget, "clicked",
+ G_CALLBACK (composer_header_addaction_clicked_cb),
+ header);
+ }
+
header->title_widget = g_object_ref_sink (widget);
g_free (header->priv->label);
@@ -107,6 +148,14 @@ composer_header_set_property (GObject *object,
priv->button = g_value_get_boolean (value);
return;
+ case PROP_ADDACTION: /* construct only */
+ priv->addaction = g_value_get_boolean (value);
+ return;
+
+ case PROP_ADDACTION_TEXT:/* construct only */
+ priv->addaction_text = g_value_dup_string (value);
+ return;
+
case PROP_LABEL: /* construct only */
priv->label = g_value_dup_string (value);
return;
@@ -127,6 +176,15 @@ composer_header_set_property (GObject *object,
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
+void
+e_composer_header_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ composer_header_set_property (object, property_id, value, pspec);
+}
+
static void
composer_header_get_property (GObject *object,
guint property_id,
@@ -142,6 +200,15 @@ composer_header_get_property (GObject *object,
g_value_set_boolean (value, priv->button);
return;
+ case PROP_ADDACTION: /* construct only */
+ g_value_set_boolean (value, priv->button);
+ return;
+
+ case PROP_ADDACTION_TEXT: /* construct only */
+ g_value_take_string (
+ value, priv->addaction_text);
+ return;
+
case PROP_LABEL: /* construct only */
g_value_take_string (
value, e_composer_header_get_label (
@@ -210,6 +277,28 @@ composer_header_class_init (EComposerHeaderClass *class)
g_object_class_install_property (
object_class,
+ PROP_ADDACTION,
+ g_param_spec_boolean (
+ "addaction",
+ NULL,
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_ADDACTION_TEXT,
+ g_param_spec_string (
+ "addaction_text",
+ NULL,
+ NULL,
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (
+ object_class,
PROP_LABEL,
g_param_spec_string (
"label",
diff --git a/composer/e-composer-header.h b/composer/e-composer-header.h
index db9582dc3f..126af5fb77 100644
--- a/composer/e-composer-header.h
+++ b/composer/e-composer-header.h
@@ -49,6 +49,7 @@ struct _EComposerHeader {
GObject parent;
GtkWidget *title_widget;
GtkWidget *input_widget;
+ GtkWidget *action_widget;
EComposerHeaderPrivate *priv;
};
@@ -64,6 +65,8 @@ void e_composer_header_set_sensitive (EComposerHeader *header,
gboolean e_composer_header_get_visible (EComposerHeader *header);
void e_composer_header_set_visible (EComposerHeader *header,
gboolean visible);
+void e_composer_header_set_property (GObject *object, guint property_id,
+ const GValue *value, GParamSpec *pspec);
void e_composer_header_set_title_tooltip
(EComposerHeader *header,
const gchar *tooltip);
diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c
index 5aab95d776..472208edd3 100644
--- a/composer/e-composer-name-header.c
+++ b/composer/e-composer-name-header.c
@@ -117,10 +117,12 @@ composer_name_header_constructor (GType type,
entry = E_NAME_SELECTOR_ENTRY (
e_name_selector_peek_section_list (
priv->name_selector, label));
+
e_name_selector_entry_set_contact_editor_func (
entry, e_contact_editor_new);
e_name_selector_entry_set_contact_list_editor_func (
entry, e_contact_list_editor_new);
+
g_signal_connect (
entry, "changed",
G_CALLBACK (composer_name_header_entry_changed_cb), object);
@@ -261,6 +263,32 @@ e_composer_name_header_new (const gchar *label,
"button", TRUE, "name-selector", name_selector, NULL);
}
+EComposerHeader *
+e_composer_name_header_new_with_label (const gchar *label,
+ ENameSelector *name_selector)
+{
+ return g_object_new (
+ E_TYPE_COMPOSER_NAME_HEADER, "label", label,
+ "button", FALSE, "name-selector", name_selector,
+ "addaction", FALSE, "visible", TRUE,
+ NULL);
+}
+
+EComposerHeader *
+e_composer_name_header_new_with_action (const gchar *label,
+ const gchar *action_label,
+ ENameSelector *name_selector)
+{
+ g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL);
+
+ return g_object_new (
+ E_TYPE_COMPOSER_NAME_HEADER, "label", label,
+ "button", FALSE, "name-selector", name_selector,
+ "addaction_text", action_label,
+ "addaction", action_label != NULL,
+ NULL);
+}
+
ENameSelector *
e_composer_name_header_get_name_selector (EComposerNameHeader *header)
{
diff --git a/composer/e-composer-name-header.h b/composer/e-composer-name-header.h
index f95c33fce3..af38666d59 100644
--- a/composer/e-composer-name-header.h
+++ b/composer/e-composer-name-header.h
@@ -62,6 +62,15 @@ struct _EComposerNameHeaderClass {
GType e_composer_name_header_get_type (void);
EComposerHeader * e_composer_name_header_new (const gchar *label,
ENameSelector *name_selector);
+/*No button. Just a label.*/
+EComposerHeader * e_composer_name_header_new_with_label (const gchar *label,
+ ENameSelector *name_selector);
+
+/*No button. Label with a Link button for show/hide.*/
+EComposerHeader * e_composer_name_header_new_with_action (const gchar *label,
+ const gchar *action,
+ ENameSelector *name_selector);
+
ENameSelector * e_composer_name_header_get_name_selector
(EComposerNameHeader *header);
EDestination ** e_composer_name_header_get_destinations
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index fe5b66ceee..ef151d024e 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -17,6 +17,7 @@
#include "e-composer-private.h"
#include "e-util/e-util-private.h"
+#include "e-util/e-icon-factory.h"
static void
composer_setup_charset_menu (EMsgComposer *composer)
@@ -88,6 +89,7 @@ e_composer_private_init (EMsgComposer *composer)
GtkWidget *widget;
GtkWidget *container;
GtkWidget *send_widget;
+ GtkWidget *exp_box;
const gchar *path;
gchar *filename;
gint ii;
@@ -96,6 +98,15 @@ e_composer_private_init (EMsgComposer *composer)
editor = GTKHTML_EDITOR (composer);
ui_manager = gtkhtml_editor_get_ui_manager (editor);
+ if (composer->lite) {
+ widget = gtkhtml_editor_get_managed_widget (editor, "/main-menu");
+ gtk_widget_hide (widget);
+ widget = gtkhtml_editor_get_managed_widget (editor, "/main-toolbar");
+ gtk_toolbar_set_style ((GtkToolbar *)widget, GTK_TOOLBAR_BOTH_HORIZ);
+ gtk_widget_hide (widget);
+
+ }
+
priv->charset_actions = gtk_action_group_new ("charset");
priv->composer_actions = gtk_action_group_new ("composer");
@@ -128,6 +139,64 @@ e_composer_private_init (EMsgComposer *composer)
send_widget = gtk_ui_manager_get_widget (ui_manager, path);
gtk_tool_item_set_is_important (GTK_TOOL_ITEM (send_widget), TRUE);
+ exp_box = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show(exp_box);
+ if (composer->lite) {
+ GtkWidget *tmp, *tmp1, *tmp_box;
+
+ tmp_box = gtk_hbox_new (FALSE, 0);
+
+ tmp = gtk_hbox_new (FALSE, 0);
+ tmp1 = gtk_image_new_from_pixbuf (e_icon_factory_get_icon("mail-send", E_ICON_SIZE_BUTTON));
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 0);
+ tmp1 = gtk_label_new_with_mnemonic (_("S_end"));
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 6);
+ gtk_widget_show_all(tmp);
+ gtk_widget_reparent (send_widget, tmp_box);
+ gtk_box_set_child_packing ((GtkBox *)tmp_box, send_widget, FALSE, FALSE, 6, GTK_PACK_END);
+ gtk_tool_item_set_is_important (GTK_TOOL_ITEM (send_widget), TRUE);
+ send_widget = gtk_bin_get_child ((GtkBin *)send_widget);
+ gtk_container_remove((GtkContainer *)send_widget, gtk_bin_get_child ((GtkBin *)send_widget));
+ gtk_container_add((GtkContainer *)send_widget, tmp);
+ gtk_button_set_relief ((GtkButton *)send_widget, GTK_RELIEF_NORMAL);
+
+ path = "/main-toolbar/pre-main-toolbar/save-draft";
+ send_widget = gtk_ui_manager_get_widget (ui_manager, path);
+ tmp = gtk_hbox_new (FALSE, 0);
+ tmp1 = gtk_image_new_from_pixbuf (e_icon_factory_get_icon(GTK_STOCK_SAVE, E_ICON_SIZE_BUTTON));
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 0);
+ tmp1 = gtk_label_new_with_mnemonic (_("Save draft"));
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 3);
+ gtk_widget_show_all(tmp);
+ gtk_widget_reparent (send_widget, tmp_box);
+ gtk_box_set_child_packing ((GtkBox *)tmp_box, send_widget, FALSE, FALSE, 6, GTK_PACK_END);
+ gtk_tool_item_set_is_important (GTK_TOOL_ITEM (send_widget), TRUE);
+ send_widget = gtk_bin_get_child ((GtkBin *)send_widget);
+ gtk_container_remove((GtkContainer *)send_widget, gtk_bin_get_child ((GtkBin *)send_widget));
+ gtk_container_add((GtkContainer *)send_widget, tmp);
+ gtk_button_set_relief ((GtkButton *)send_widget, GTK_RELIEF_NORMAL);
+
+ path = "/main-toolbar/pre-main-toolbar/attach";
+ send_widget = gtk_ui_manager_get_widget (ui_manager, path);
+ tmp = gtk_hbox_new (FALSE, 0);
+ tmp1 = gtk_image_new_from_pixbuf (e_icon_factory_get_icon("gtk-add", E_ICON_SIZE_BUTTON));
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 0);
+ tmp1 = gtk_label_new_with_mnemonic (_("Add attachment"));
+ gtk_box_pack_start ((GtkBox *)tmp, tmp1, FALSE, FALSE, 3);
+ gtk_widget_show_all(tmp);
+ gtk_widget_reparent (send_widget, tmp_box);
+ gtk_box_set_child_packing ((GtkBox *)tmp_box, send_widget, FALSE, FALSE, 6, GTK_PACK_START);
+ gtk_tool_item_set_is_important (GTK_TOOL_ITEM (send_widget), TRUE);
+ send_widget = gtk_bin_get_child ((GtkBin *)send_widget);
+ gtk_container_remove((GtkContainer *)send_widget, gtk_bin_get_child ((GtkBin *)send_widget));
+ gtk_container_add((GtkContainer *)send_widget, tmp);
+ gtk_button_set_relief ((GtkButton *)send_widget, GTK_RELIEF_NORMAL);
+
+ gtk_widget_show(tmp_box);
+ gtk_box_pack_end ((GtkBox *)exp_box, tmp_box, TRUE, TRUE, 0);
+ gtk_box_pack_end ((GtkBox *)editor->vbox, exp_box, FALSE, FALSE, 3);
+
+ }
composer_setup_charset_menu (composer);
if (error != NULL) {
@@ -139,11 +208,15 @@ e_composer_private_init (EMsgComposer *composer)
/* Construct the header table. */
container = editor->vbox;
-
+
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);
- gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 2);
+ if (composer->lite)
+ gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 0);
+ else
+ gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 2);
+
priv->header_table = g_object_ref (widget);
gtk_widget_show (widget);
@@ -154,6 +227,8 @@ e_composer_private_init (EMsgComposer *composer)
priv->attachment_paned = g_object_ref (widget);
gtk_widget_show (widget);
+ g_object_set_data ((GObject *)composer, "vbox", editor->vbox);
+
/* Reparent the scrolled window containing the GtkHTML widget
* into the content area of the top attachment pane. */
diff --git a/composer/e-composer-text-header.c b/composer/e-composer-text-header.c
index 2945720c90..e676ef941c 100644
--- a/composer/e-composer-text-header.c
+++ b/composer/e-composer-text-header.c
@@ -1,3 +1,7 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
+/*Modified for Anjal - Johnny Jacob <jjohnny@novell.com>*/
+
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,6 +25,11 @@
#define E_COMPOSER_TEXT_HEADER_GET_ENTRY(header) \
(GTK_ENTRY (E_COMPOSER_HEADER (header)->input_widget))
+struct _EComposerTextHeaderPrivate {
+ GtkLinkButton *linkbtn;
+ guint destination_index;
+};
+
static gpointer parent_class;
static void
@@ -99,19 +108,23 @@ e_composer_text_header_get_type (void)
}
EComposerHeader *
-e_composer_text_header_new_label (const gchar *label)
+e_composer_text_header_new_label (const gchar *label, const gchar *action_label)
{
return g_object_new (
E_TYPE_COMPOSER_TEXT_HEADER, "label", label,
- "button", FALSE, NULL);
+ "button", FALSE, "addaction", action_label && *action_label,
+ "addaction_text", action_label,
+ "visible", action_label == NULL, NULL);
}
EComposerHeader *
-e_composer_text_header_new_button (const gchar *label)
+e_composer_text_header_new_button (const gchar *label, const gchar *action_label)
{
return g_object_new (
E_TYPE_COMPOSER_TEXT_HEADER, "label", label,
- "button", TRUE, NULL);
+ "button", TRUE, "addaction", action_label != NULL,
+ "addaction_text", action_label,
+ "visible", action_label == NULL, NULL);
}
const gchar *
diff --git a/composer/e-composer-text-header.h b/composer/e-composer-text-header.h
index c0c4708595..79e972d3c6 100644
--- a/composer/e-composer-text-header.h
+++ b/composer/e-composer-text-header.h
@@ -57,10 +57,13 @@ struct _EComposerTextHeaderClass {
};
GType e_composer_text_header_get_type (void);
-EComposerHeader * e_composer_text_header_new_label
- (const gchar *label);
-EComposerHeader * e_composer_text_header_new_button
- (const gchar *label);
+
+EComposerHeader *
+e_composer_text_header_new_label (const gchar *label, const gchar *action_label);
+
+EComposerHeader *
+e_composer_text_header_new_button (const gchar *label, const gchar *action_label);
+
const gchar * e_composer_text_header_get_text (EComposerTextHeader *header);
void e_composer_text_header_set_text (EComposerTextHeader *header,
const gchar *text);
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 9b526f63ac..3bf82a229f 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -119,6 +119,8 @@ enum {
LAST_SIGNAL
};
+gboolean composer_lite = FALSE;
+
static gpointer parent_class;
static guint signals[LAST_SIGNAL];
@@ -1429,7 +1431,14 @@ msg_composer_update_preferences (GConfClient *client,
GError *error = NULL;
editor = GTKHTML_EDITOR (composer);
-
+
+ if (entry) {
+ if (strcmp(gconf_entry_get_key(entry), COMPOSER_GCONF_INLINE_SPELLING_KEY) != 0 &&
+ strcmp(gconf_entry_get_key(entry), COMPOSER_GCONF_MAGIC_LINKS_KEY) != 0 &&
+ strcmp(gconf_entry_get_key(entry), COMPOSER_GCONF_MAGIC_SMILEYS_KEY) != 0)
+ return;
+ }
+
enable = gconf_client_get_bool (
client, COMPOSER_GCONF_INLINE_SPELLING_KEY, &error);
if (error == NULL)
@@ -2146,6 +2155,7 @@ msg_composer_init (EMsgComposer *composer)
GtkHTML *html;
gint n_targets;
+ composer->lite = composer_lite;
composer->priv = E_MSG_COMPOSER_GET_PRIVATE (composer);
e_composer_private_init (composer);
@@ -2277,6 +2287,32 @@ e_msg_composer_new (void)
return g_object_new (E_TYPE_MSG_COMPOSER, NULL);
}
+
+void
+e_msg_composer_set_lite (void)
+{
+ composer_lite = TRUE;
+}
+
+gboolean
+e_msg_composer_get_lite (void)
+{
+ return composer_lite;
+}
+
+EMsgComposer *
+e_msg_composer_lite_new (void)
+{
+ EMsgComposer *composer;
+
+ /* Init lite-composer for ever for the session */
+ composer_lite = TRUE;
+
+ composer = e_msg_composer_new ();
+
+ return composer;
+}
+
static void
e_msg_composer_set_pending_body (EMsgComposer *composer,
gchar *text,
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 7a279ba230..bf712d2928 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -60,6 +60,7 @@ typedef struct _EMsgComposerPrivate EMsgComposerPrivate;
struct _EMsgComposer {
GtkhtmlEditor parent;
EMsgComposerPrivate *priv;
+ gboolean lite;
};
struct _EMsgComposerClass {
@@ -70,10 +71,14 @@ struct _EAttachmentBar;
GType e_msg_composer_get_type (void);
EMsgComposer * e_msg_composer_new (void);
+EMsgComposer * e_msg_composer_lite_new (void);
+
EMsgComposer * e_msg_composer_new_with_message (CamelMimeMessage *msg);
EMsgComposer * e_msg_composer_new_from_url (const gchar *url);
EMsgComposer * e_msg_composer_new_redirect (CamelMimeMessage *message,
const gchar *resent_from);
+void e_msg_composer_set_lite (void);
+gboolean e_msg_composer_get_lite (void);
void e_msg_composer_send (EMsgComposer *composer);
void e_msg_composer_save_draft (EMsgComposer *composer);