From 8781122643884eea343afc4117d6d05f2ff95392 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 4 Aug 2008 18:45:12 +0000 Subject: Use G_STRLOC or G_STRFUNC instead of deprecated G_GNUC_PRETTY_FUNCTION. 2008-08-04 Matthew Barnes * mail/em-migrate.c (migrate_to_db): * mail/em-network-prefs.c (notify_proxy_type_changed), (widget_entry_changed_cb): * mail/em-subscribe-editor.c (sub_fill_level), (sub_queue_fill_level), (sub_row_expanded): * mail/mail-vfolder.c: Use G_STRLOC or G_STRFUNC instead of deprecated G_GNUC_PRETTY_FUNCTION. svn path=/trunk/; revision=35904 --- mail/em-subscribe-editor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mail/em-subscribe-editor.c') diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index 23aca40c4d..8a5e3fd0dd 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -312,8 +312,8 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in e_dlist_addtail(&sub->pending, (EDListNode *)node); } } else { - d(printf("%s:%d:%s: fi->flags & CAMEL_FOLDER_NOINFERIORS=%d\t node->path=[%p]\n", - __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__, fi->flags & CAMEL_FOLDER_NOINFERIORS, + d(printf("%s:%s: fi->flags & CAMEL_FOLDER_NOINFERIORS=%d\t node->path=[%p]\n", + G_STRLOC, G_STRFUNC, fi->flags & CAMEL_FOLDER_NOINFERIORS, node->path)); } @@ -408,7 +408,7 @@ sub_queue_fill_level(EMSubscribe *sub, EMSubscribeNode *node) struct _emse_folderinfo_msg *m; int id; - d(printf("%s:%d:%s: Starting get folderinfo of '%s'\n", __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__, + d(printf("%s:%s: Starting get folderinfo of '%s'\n", G_STRLOC, G_STRFUNC, node?node->info->full_name:"")); m = mail_msg_new (&sub_folderinfo_info); @@ -501,7 +501,7 @@ sub_row_expanded(GtkTreeView *tree, GtkTreeIter *iter, GtkTreePath *path, EMSubs char *row_name; gtk_tree_model_get(model, iter, 1, &row_name, -1); - d(printf("%s:%d:%s: row-expanded '%s'\n", __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__, + d(printf("%s:%s: row-expanded '%s'\n", G_STRLOC, G_STRFUNC, row_name?row_name:"")); /* Do we really need to fetch the children for this row? */ -- cgit v1.2.3 From 79d878670a311644f188f671cbc4e60193100558 Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Tue, 16 Sep 2008 10:52:29 +0000 Subject: License changes from GPL to LGPL svn path=/trunk/; revision=36344 --- mail/em-subscribe-editor.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'mail/em-subscribe-editor.c') diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index 8a5e3fd0dd..3eb738cd8d 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -1,23 +1,22 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- - * em-subscribe-editor.c * - * - * Authors: Michael Zucchi - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * +/* * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Authors: + * Michael Zucchi + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * */ -- cgit v1.2.3 From 324695cd77e3a654b24963dd6bc07c37f6f30644 Mon Sep 17 00:00:00 2001 From: Norman Wang Date: Mon, 22 Dec 2008 03:11:09 +0000 Subject: ** Fix for bug #558337 2008-12-22 Norman Wang ** Fix for bug #558337 * mail/em-subscribe-editor.c: Create a wrapper class MailMsgListNode of _zsubscribe_msg message. The MailMsgListNode class is the subclass of EDListNode class. So the _zsubscribe_msg can be added into the EDList. svn path=/trunk/; revision=36922 --- mail/em-subscribe-editor.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'mail/em-subscribe-editor.c') diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index 3eb738cd8d..a6ce5d7485 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -111,6 +111,12 @@ struct _EMSubscribeNode { GtkTreePath *path; }; +typedef struct _MailMsgListNode MailMsgListNode; +struct _MailMsgListNode { + EDListNode node; + MailMsg *msg; +}; + static void sub_editor_busy(EMSubscribeEditor *se, int dir); static int sub_queue_fill_level(EMSubscribe *sub, EMSubscribeNode *node); static void sub_selection_changed(GtkTreeSelection *selection, EMSubscribe *sub); @@ -185,6 +191,7 @@ sub_folder_done (struct _zsubscribe_msg *m) GtkTreeModel *model; EMSubscribeNode *node; gboolean subscribed, issub; + MailMsgListNode *msgListNode; m->sub->subscribe_id = -1; if (m->sub->cancel) @@ -209,10 +216,13 @@ sub_folder_done (struct _zsubscribe_msg *m) } /* queue any further ones, or if out, update the ui */ - next = (struct _zsubscribe_msg *)e_dlist_remhead(&m->sub->subscribe); - if (next) { + msgListNode = (MailMsgListNode *) e_dlist_remhead(&m->sub->subscribe); + if (msgListNode) { + next = (struct _zsubscribe_msg *) msgListNode->msg; + /* Free the memory of the MailMsgListNode which won't be used anymore. */ + g_free(msgListNode); next->sub->subscribe_id = next->base.seq; - mail_msg_unordered_push (next); + mail_msg_unordered_push (next); } else { /* should it go off the model instead? */ sub_selection_changed(gtk_tree_view_get_selection(m->sub->tree), m->sub); @@ -239,6 +249,7 @@ static int sub_subscribe_folder (EMSubscribe *sub, EMSubscribeNode *node, int state, const char *spath) { struct _zsubscribe_msg *m; + MailMsgListNode *msgListNode; int id; m = mail_msg_new (&sub_subscribe_folder_info); @@ -254,8 +265,10 @@ sub_subscribe_folder (EMSubscribe *sub, EMSubscribeNode *node, int state, const d(printf("running subscribe folder '%s'\n", spath)); mail_msg_unordered_push (m); } else { + msgListNode = g_malloc0(sizeof(MailMsgListNode)); + msgListNode->msg = (MailMsg *) m; d(printf("queueing subscribe folder '%s'\n", spath)); - e_dlist_addtail(&sub->subscribe, (EDListNode *)m); + e_dlist_addtail(&sub->subscribe, (EDListNode *)msgListNode); } return id; @@ -541,6 +554,7 @@ static void sub_destroy(GtkWidget *w, EMSubscribe *sub) { struct _zsubscribe_msg *m; + MailMsgListNode *msgListNode; d(printf("subscribe closed\n")); sub->cancel = TRUE; @@ -551,8 +565,12 @@ sub_destroy(GtkWidget *w, EMSubscribe *sub) if (sub->subscribe_id != -1) mail_msg_cancel(sub->subscribe_id); - while ( (m = (struct _zsubscribe_msg *)e_dlist_remhead(&sub->subscribe)) ) + while ( (msgListNode = (MailMsgListNode *)e_dlist_remhead(&sub->subscribe))) { + m = (struct _zsubscribe_msg *) msgListNode->msg; + /* Free the memory of MailMsgListNode which won't be used anymore. */ + g_free(msgListNode); mail_msg_unref(m); + } sub_unref(sub); } -- cgit v1.2.3 From 610cdfa9fd132feda1398c778d5c11643cd6618e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 25 Feb 2009 11:20:20 +0000 Subject: ** Fix for bug #572268 2009-02-25 Milan Crha ** Fix for bug #572268 * em-subscribe-editor.c: (sub_fill_level): Do not duplicate "Loading..." node when adding to existing node. svn path=/trunk/; revision=37330 --- mail/em-subscribe-editor.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'mail/em-subscribe-editor.c') diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index a6ce5d7485..bca062b096 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -288,6 +288,8 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in /* first, fill a level up */ fi = info; while (fi) { + gboolean known = FALSE; + if ((node = g_hash_table_lookup(sub->folders, fi->full_name)) == NULL) { gboolean state; @@ -301,6 +303,7 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in g_hash_table_insert(sub->folders, fi->full_name, node); } else if (node->path) { gtk_tree_model_get_iter(gtk_tree_view_get_model(sub->tree), &iter, node->path); + known = TRUE; } d(printf("flags & CAMEL_FOLDER_NOCHILDREN=%d, f & CAMEL_FOLDER_NOINFERIORS=%d\t fi->full_name=[%s], node->path=%p\n", @@ -315,9 +318,11 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in sub_fill_level(sub, fi->child, &iter, FALSE); } else if (!(fi->flags & CAMEL_FOLDER_NOCHILDREN)) { GtkTreeIter new_iter; - d(printf("flags: CAMEL_FOLDER_NOCHILDREN is not set '%s'\n", fi->full_name)); - gtk_tree_store_append(treestore, &new_iter, &iter); - gtk_tree_store_set(treestore, &new_iter, 0, 0, 1, "Loading...", 2, NULL, -1); + d(printf("flags: CAMEL_FOLDER_NOCHILDREN is not set '%s', known:%d\n", fi->full_name, known?1:0)); + if (!known) { + gtk_tree_store_append(treestore, &new_iter, &iter); + gtk_tree_store_set(treestore, &new_iter, 0, 0, 1, "Loading...", 2, NULL, -1); + } } else { if (pending) -- cgit v1.2.3 From 8a072ffc7c0ddcde472877a51ace0bb14f86fb0a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 24 Apr 2009 11:45:21 +0200 Subject: GN-bug #572348 - Removed deprecated Gtk+ symbols Some still left, because those gone in kill-bonobo branch. --- mail/em-subscribe-editor.c | 77 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 23 deletions(-) (limited to 'mail/em-subscribe-editor.c') diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index bca062b096..724b9b4874 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -59,9 +59,8 @@ struct _EMSubscribeEditor { GtkDialog *dialog; GtkWidget *vbox; /* where new stores are added */ - GtkWidget *optionmenu; + GtkWidget *combobox; GtkWidget *none_selected; /* 'please select a xxx' message */ - GtkWidget *none_selected_item; GtkWidget *progress; }; @@ -357,7 +356,7 @@ sub_folderinfo_exec (struct _emse_folderinfo_msg *m) if (m->seq == m->sub->seq) { camel_operation_register(m->base.cancel); - m->info = camel_store_get_folder_info(m->sub->store, m->node?m->node->info->full_name:pub_full_name, CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, &m->base.ex); + m->info = camel_store_get_folder_info(m->sub->store, m->node?m->node->info->full_name:pub_full_name, CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, &m->base.ex); camel_operation_unregister(m->base.cancel); } } @@ -729,20 +728,31 @@ sub_editor_got_store(char *uri, CamelStore *store, void *data) } static void -sub_editor_menu_changed(GtkWidget *w, EMSubscribeEditor *se) +sub_editor_combobox_changed (GtkWidget *w, EMSubscribeEditor *se) { int i, n; struct _EMSubscribe *sub; - d(printf("menu changed\n")); + d(printf("combobox changed\n")); i = 1; - n = gtk_option_menu_get_history((GtkOptionMenu *)se->optionmenu); - if (n == 0) - gtk_widget_show(se->none_selected); - else { - gtk_widget_hide(se->none_selected); - gtk_widget_hide(se->none_selected_item); + n = gtk_combo_box_get_active (GTK_COMBO_BOX (se->combobox)); + if (n == 0) { + gtk_widget_show (se->none_selected); + } else { + GtkTreeIter iter; + GtkTreeModel *model; + + gtk_widget_hide (se->none_selected); + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (se->combobox)); + if (gtk_tree_model_get_iter_first (model, &iter)) { + /* hide the first item */ + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + 1, FALSE, + -1); + } } se->current = NULL; @@ -815,7 +825,10 @@ GtkDialog *em_subscribe_editor_new(void) EAccountList *accounts; EIterator *iter; GladeXML *xml; - GtkWidget *menu, *w; + GtkWidget *w; + GtkCellRenderer *cell; + GtkListStore *store; + GtkTreeIter gtiter; char *gladefile; se = g_malloc0(sizeof(*se)); @@ -859,12 +872,27 @@ GtkDialog *em_subscribe_editor_new(void) w = glade_xml_get_widget(xml, "refresh_button"); g_signal_connect(w, "clicked", G_CALLBACK(sub_editor_refresh), se); - /* setup stores menu */ - se->optionmenu = glade_xml_get_widget(xml, "store_menu"); - menu = gtk_menu_new(); - se->none_selected_item = w = gtk_menu_item_new_with_label(_("No server has been selected")); - gtk_widget_show(w); - gtk_menu_shell_append ((GtkMenuShell *)menu, w); + /* setup stores combobox */ + se->combobox = glade_xml_get_widget (xml, "store_combobox"); + store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); + gtk_combo_box_set_model (GTK_COMBO_BOX (se->combobox), GTK_TREE_MODEL (store)); + g_object_unref (store); + + gtk_cell_layout_clear (GTK_CELL_LAYOUT (se->combobox)); + + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (se->combobox), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (se->combobox), cell, + "text", 0, + "visible", 1, + NULL); + + gtk_list_store_append (store, >iter); + gtk_list_store_set ( + store, >iter, + 0, _("No server has been selected"), + 1, TRUE, + -1); accounts = mail_config_get_accounts (); for (iter = e_list_get_iterator ((EList *) accounts); @@ -875,9 +903,12 @@ GtkDialog *em_subscribe_editor_new(void) /* setup url table, and store table? */ if (account->enabled && account->source->url) { d(printf("adding account '%s'\n", account->name)); - w = gtk_menu_item_new_with_label(account->name); - gtk_menu_shell_append ((GtkMenuShell *)menu, w); - gtk_widget_show(w); + gtk_list_store_append (store, >iter); + gtk_list_store_set ( + store, >iter, + 0, account->name, + 1, TRUE, + -1); e_dlist_addtail(&se->stores, (EDListNode *)subscribe_new(se, account->source->url)); } else { d(printf("not adding account '%s'\n", account->name)); @@ -885,8 +916,8 @@ GtkDialog *em_subscribe_editor_new(void) } g_object_unref(iter); - gtk_option_menu_set_menu((GtkOptionMenu *)se->optionmenu, menu); - g_signal_connect(se->optionmenu, "changed", G_CALLBACK(sub_editor_menu_changed), se); + gtk_combo_box_set_active (GTK_COMBO_BOX (se->combobox), 0); + g_signal_connect(se->combobox, "changed", G_CALLBACK(sub_editor_combobox_changed), se); if (window_size.width == 0) { /* initialize @window_size with the previous session's size */ -- cgit v1.2.3