FALSE,FALSE,6);
protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_STORE);
- combo = modest_combo_box_new (protos);
+ combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
g_signal_connect (G_OBJECT(combo), "changed",
FALSE,FALSE,0);
protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_TRANSPORT);
- combo = modest_combo_box_new (protos);
+ combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
g_signal_connect (G_OBJECT(combo), "changed",
{ "MessageReplyAll", NULL, N_("Reply to all"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_reply_all) },
{ "MessageForward", NULL, N_("_Forward"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_forward) },
{ "MessageDelete", NULL, N_("Delete message"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete) },
- { "MessageSendReceive", NULL, N_("Send and receive"), NULL, NULL, NULL },
+ { "MessageSendReceive", NULL, N_("Send and receive"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_send_receive) },
{ "MessageContents", NULL, N_("Retrieve contents"), NULL, NULL, NULL },
{ "MessageDetails", NULL, N_("Details..."), NULL, NULL, NULL },
protos = get_transports ();
- priv->from_field = modest_combo_box_new (protos);
+ priv->from_field = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
priv->to_field = gtk_entry_new_with_max_length (80);
return main_menu;
}
+
+static void
+set_msg (ModestMsgEditWindow *self, TnyMsg *msg)
+{
+ TnyHeader *header;
+ GtkTextBuffer *buf;
+ const gchar *to, *cc, *bcc, *subject;
+ ModestMsgEditWindowPrivate *priv;
+
+ g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (self));
+ g_return_if_fail (TNY_IS_MSG (msg));
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
+
+ header = tny_msg_get_header (msg);
+ to = tny_header_get_to (header);
+ cc = tny_header_get_cc (header);
+ bcc = tny_header_get_bcc (header);
+ subject = tny_header_get_subject (header);
+
+ if (to)
+ gtk_entry_set_text (GTK_ENTRY(priv->to_field), to);
+ if (cc)
+ gtk_entry_set_text (GTK_ENTRY(priv->cc_field), cc);
+ if (bcc)
+ gtk_entry_set_text (GTK_ENTRY(priv->bcc_field), bcc);
+ if (subject)
+ gtk_entry_set_text (GTK_ENTRY(priv->subject_field), subject);
+
+ buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW(priv->msg_body));
+ gtk_text_buffer_set_text (buf,
+ (const gchar *) modest_tny_msg_get_body (msg, FALSE),
+ -1);
+
+ /* TODO: lower priority, select in the From: combo to the
+ value that comes from msg <- not sure, should it be
+ allowed? */
+
+ /* TODO: set attachments */
+}
+
+
ModestWindow*
-modest_msg_edit_window_new (ModestEditType type)
+modest_msg_edit_window_new (TnyMsg *msg, const gchar *account_name)
{
GObject *obj;
ModestWindowPrivate *parent_priv;
GtkActionGroup *action_group;
GError *error = NULL;
- g_return_val_if_fail (type < MODEST_EDIT_TYPE_NUM, NULL);
+ g_return_val_if_fail (msg, NULL);
obj = g_object_new(MODEST_TYPE_MSG_EDIT_WINDOW, NULL);
g_signal_connect (G_OBJECT(obj), "delete-event",
G_CALLBACK(on_delete_event), obj);
+ modest_window_set_active_account (MODEST_WINDOW(obj), account_name);
return (ModestWindow*)obj;
}
-void
-modest_msg_edit_window_set_msg (ModestMsgEditWindow *self, TnyMsg *msg)
-{
- TnyHeader *header;
- GtkTextBuffer *buf;
- const gchar *to, *cc, *bcc, *subject;
- ModestMsgEditWindowPrivate *priv;
-
- g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (self));
- g_return_if_fail (TNY_IS_MSG (msg));
-
- priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
-
- header = tny_msg_get_header (msg);
- to = tny_header_get_to (header);
- cc = tny_header_get_cc (header);
- bcc = tny_header_get_bcc (header);
- subject = tny_header_get_subject (header);
-
- if (to)
- gtk_entry_set_text (GTK_ENTRY(priv->to_field), to);
- if (cc)
- gtk_entry_set_text (GTK_ENTRY(priv->cc_field), cc);
- if (bcc)
- gtk_entry_set_text (GTK_ENTRY(priv->bcc_field), bcc);
- if (subject)
- gtk_entry_set_text (GTK_ENTRY(priv->subject_field), subject);
-
- buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW(priv->msg_body));
- gtk_text_buffer_set_text (buf,
- (const gchar *) modest_tny_msg_get_body (msg, FALSE),
- -1);
-
- /* TODO: lower priority, select in the From: combo to the
- value that comes from msg <- not sure, should it be
- allowed? */
-
- /* TODO: set attachments */
-}
-
MsgData *
modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window)
{
ModestWindow *
-modest_msg_view_window_new (TnyMsg *msg)
+modest_msg_view_window_new (TnyMsg *msg, const gchar *account_name)
{
GObject *obj;
ModestMsgViewWindowPrivate *priv;
g_signal_connect (G_OBJECT(obj), "delete-event", G_CALLBACK(on_delete_event), obj);
- return (ModestWindow *) (obj);
+ modest_window_set_active_account (MODEST_WINDOW(obj), account_name);
+ return MODEST_WINDOW(obj);
}
gtk_box_pack_start (GTK_BOX(box), label, FALSE, FALSE, 0);
protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_SECURITY);
- priv->security = modest_combo_box_new (protos);
+ priv->security = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 6);
protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_AUTH);
- combo = modest_combo_box_new (protos);
+ combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
gtk_box_pack_start (GTK_BOX(hbox), combo, FALSE, FALSE, 0);
-/* modest-store-widget.h */
-/* insert (c)/licensing information) */
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef __MODEST_STORE_WIDGET_H__
#define __MODEST_STORE_WIDGET_H__
-/* modest-transport-widget.c */
-
-/* insert (c)/licensing information) */
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include <glib/gi18n.h>
#include <gtk/gtk.h>
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_AUTH);
- combo = modest_combo_box_new (protos);
+ combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
gtk_box_pack_start (GTK_BOX(hbox), combo, FALSE, FALSE,0);
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 6);
protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_AUTH);
- combo = modest_combo_box_new (protos);
+ combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
gtk_box_pack_start (GTK_BOX(hbox), combo, FALSE, FALSE, 0);
-/* modest-transport-widget.h */
-/* insert (c)/licensing information) */
+/* Copyright (c) 2006, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
#ifndef __MODEST_TRANSPORT_WIDGET_H__
#define __MODEST_TRANSPORT_WIDGET_H__