* all:
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 9 Feb 2007 13:19:18 +0000 (13:19 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 9 Feb 2007 13:19:18 +0000 (13:19 +0000)
  - update for modest_window / combo_box changes
  - take account param (edit/view window)

pmo-trunk-r808

src/maemo/modest-account-assistant.c
src/maemo/modest-main-window-ui.h
src/maemo/modest-msg-edit-window.c
src/maemo/modest-msg-view-window.c
src/maemo/modest-store-widget.c
src/maemo/modest-store-widget.h
src/maemo/modest-transport-widget.c
src/maemo/modest-transport-widget.h

index 41704e5..9d2a2d0 100644 (file)
@@ -309,7 +309,7 @@ add_receiving_page (ModestAccountAssistant *self)
                            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",
@@ -385,7 +385,7 @@ add_sending_page (ModestAccountAssistant *self)
                            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",
index 46e309e..1eda953 100644 (file)
@@ -58,7 +58,7 @@ static const GtkActionEntry modest_action_entries [] = {
        { "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 },
        
index 7026096..b5642a8 100644 (file)
@@ -195,7 +195,7 @@ init_window (ModestMsgEditWindow *obj)
 
                
        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);
@@ -272,8 +272,50 @@ menubar_to_menu (GtkUIManager *ui_manager)
        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;
@@ -281,7 +323,7 @@ modest_msg_edit_window_new (ModestEditType type)
        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);
 
@@ -335,49 +377,10 @@ modest_msg_edit_window_new (ModestEditType type)
        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)
 {
index 2a23c84..23a9151 100644 (file)
@@ -203,7 +203,7 @@ on_delete_event (GtkWidget *widget, GdkEvent *event, ModestMsgViewWindow *self)
 
 
 ModestWindow *
-modest_msg_view_window_new (TnyMsg *msg)
+modest_msg_view_window_new (TnyMsg *msg, const gchar *account_name)
 {
        GObject *obj;
        ModestMsgViewWindowPrivate *priv;
@@ -251,5 +251,6 @@ modest_msg_view_window_new (TnyMsg *msg)
 
        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);
 }
index dc97264..e6d38a8 100644 (file)
@@ -229,7 +229,7 @@ imap_pop_configuration (ModestStoreWidget *self)
        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);
@@ -246,7 +246,7 @@ imap_pop_configuration (ModestStoreWidget *self)
        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);
index b17d2f6..4fced5c 100644 (file)
@@ -1,5 +1,31 @@
-/* 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__
index b9cc626..aed6f45 100644 (file)
@@ -1,6 +1,31 @@
-/* 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>
@@ -161,7 +186,7 @@ smtp_configuration (ModestTransportWidget *self)
        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);
@@ -174,7 +199,7 @@ smtp_configuration (ModestTransportWidget *self)
        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);
index 73417ee..c42a353 100644 (file)
@@ -1,5 +1,32 @@
-/* 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__