From 4cbcd49a8bed07221be190b80e84e23f0ad7d449 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Wed, 27 Jun 2001 21:22:37 +0000 Subject: Bump required gal version for new accessors in ETree. 2001-06-27 Peter Williams * configure.in (gal): Bump required gal version for new accessors in ETree. mail: 2001-06-27 Peter Williams * folder-browser-ui.c: Uncomment EditSelectThread. Yaay! * mail-callbacks.c (select_thread): New function. Self-explanatory name. Implementation is a little hairy. * mail-callbacks.h: Prototype it here. * mail-callbacks.c (invert_selection): Here too. (select_all): Here too. * subscribe-dialog.c (subscribe_select_all): Update to use new ETree accessors. (subscribe_invert_selection): Here too. calendar: 2001-06-27 Peter Williams * conduits/*/Makefile.am (INCLUDES): More srcdir != builddir fixes. svn path=/trunk/; revision=10544 --- ChangeLog | 5 +++ calendar/ChangeLog | 5 +++ calendar/conduits/calendar/Makefile.am | 1 + calendar/conduits/todo/Makefile.am | 1 + configure.in | 2 +- mail/ChangeLog | 16 +++++++ mail/folder-browser-ui.c | 2 +- mail/mail-callbacks.c | 79 +++++++++++++++++++++++++++++++++- mail/mail-callbacks.h | 1 + mail/subscribe-dialog.c | 10 +++-- 10 files changed, 115 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 084238eec9..29be7d7a44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-06-27 Peter Williams + + * configure.in (gal): Bump required gal version for new accessors + in ETree. + 2001-06-24 Chris Toshok * configure.in: add addressbook/gui/contact-list-editor, and diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 88c3b15666..406be67f9e 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2001-06-27 Peter Williams + + * conduits/*/Makefile.am (INCLUDES): More srcdir != builddir + fixes. + 2001-06-27 Rodrigo Moya * gui/e-calendar-table.c (selection_received): fixed diff --git a/calendar/conduits/calendar/Makefile.am b/calendar/conduits/calendar/Makefile.am index bfe253c6c4..0a71acb974 100644 --- a/calendar/conduits/calendar/Makefile.am +++ b/calendar/conduits/calendar/Makefile.am @@ -1,6 +1,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/calendar \ + -I$(top_builddir)/calendar/cal-client \ -I$(top_srcdir)/libical/src/libical \ -I$(top_builddir)/libical/src/libical \ -I$(top_srcdir)/e-util \ diff --git a/calendar/conduits/todo/Makefile.am b/calendar/conduits/todo/Makefile.am index 7e91c80c3e..90cc75b3bd 100644 --- a/calendar/conduits/todo/Makefile.am +++ b/calendar/conduits/todo/Makefile.am @@ -1,6 +1,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/calendar \ + -I$(top_builddir)/calendar/cal-client \ -I$(top_srcdir)/libical/src/libical \ -I$(top_builddir)/libical/src/libical \ -I$(top_srcdir)/e-util \ diff --git a/configure.in b/configure.in index 12c4e0187c..49874d944c 100644 --- a/configure.in +++ b/configure.in @@ -498,7 +498,7 @@ EVO_CHECK_LIB(Bonobo, bonobox, 1.0.3) EVO_CHECK_LIB(OAF, oaf, 0.6.2) EVO_CHECK_LIB(libglade, libglade, 0.14) EVO_CHECK_LIB(gdk-pixbuf with GNOME canvas support, gnomecanvaspixbuf, 0.9.0) -EVO_CHECK_LIB(GAL, gal, 0.8.99.2) +EVO_CHECK_LIB(GAL, gal, 0.8.99.5) dnl FIXME: really a post-0.9.3 version (as of April 25) is needed for dnl changes in Editor.idl (menesis) EVO_CHECK_LIB(GtkHTML, gtkhtml, 0.9.3) diff --git a/mail/ChangeLog b/mail/ChangeLog index 8bd080d2a6..66a40e9df5 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,19 @@ +2001-06-27 Peter Williams + + * folder-browser-ui.c: Uncomment EditSelectThread. Yaay! + + * mail-callbacks.c (select_thread): New function. Self-explanatory + name. Implementation is a little hairy. + + * mail-callbacks.h: Prototype it here. + + * mail-callbacks.c (invert_selection): Here too. + (select_all): Here too. + + * subscribe-dialog.c (subscribe_select_all): Update to use new + ETree accessors. + (subscribe_invert_selection): Here too. + 2001-06-27 jacob berkman * folder-browser.c (save_cursor_pos): work around an e-tree bug diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c index 2a72b349fe..31b4b94140 100644 --- a/mail/folder-browser-ui.c +++ b/mail/folder-browser-ui.c @@ -83,7 +83,7 @@ static BonoboUIVerb list_verbs [] = { BONOBO_UI_UNSAFE_VERB ("EditPaste", folder_browser_paste), BONOBO_UI_UNSAFE_VERB ("EditInvertSelection", invert_selection), BONOBO_UI_UNSAFE_VERB ("EditSelectAll", select_all), -/* BONOBO_UI_UNSAFE_VERB ("EditSelectThread", select_thread),*/ + BONOBO_UI_UNSAFE_VERB ("EditSelectThread", select_thread), BONOBO_UI_UNSAFE_VERB ("ChangeFolderProperties", configure_folder), BONOBO_UI_UNSAFE_VERB ("FolderExpunge", expunge_folder), /* HideDeleted is a toggle */ diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 7c3db7b418..a51f573482 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -979,11 +979,85 @@ select_all (BonoboUIComponent *uih, void *user_data, const char *path) { FolderBrowser *fb = FOLDER_BROWSER (user_data); MessageList *ml = fb->message_list; + ESelectionModel *etsm = e_tree_get_selection_model (ml->tree); if (ml->folder == NULL) return; - e_tree_select_all (ml->tree); + e_selection_model_select_all (etsm); +} + +/* Thread selection */ + +typedef struct thread_select_info { + MessageList *ml; + GPtrArray *paths; +} thread_select_info_t; + +static gboolean +select_node (ETreeModel *tm, ETreePath path, gpointer user_data) +{ + thread_select_info_t *tsi = (thread_select_info_t *) user_data; + + g_ptr_array_add (tsi->paths, path); + return FALSE; /*not done yet*/ +} + +static void +thread_select_foreach (ETreePath path, gpointer user_data) +{ + thread_select_info_t *tsi = (thread_select_info_t *) user_data; + ETreeModel *tm = tsi->ml->model; + ETreePath node; + + /* @path part of the initial selection. If it has children, + * we select them as well. If it doesn't, we select its siblings and + * their children (ie, the current node must be inside the thread + * that the user wants to mark. + */ + + if (e_tree_model_node_get_first_child (tm, path)) + node = path; + else { + node = e_tree_model_node_get_parent (tm, path); + + /* Let's make an exception: if no parent, then we're about + * to mark the whole tree. No. */ + if (e_tree_model_node_is_root (tm, node)) + node = path; + } + + e_tree_model_node_traverse (tm, node, select_node, tsi); +} + +void +select_thread (BonoboUIComponent *uih, void *user_data, const char *path) +{ + FolderBrowser *fb = FOLDER_BROWSER (user_data); + MessageList *ml = fb->message_list; + ETreeSelectionModel *selection_model; + thread_select_info_t tsi; + int i; + + if (ml->folder == NULL) + return; + + /* For every selected item, select the thread containing it. + * We can't alter the selection while iterating through it, + * so build up a list of paths. + */ + + tsi.ml = ml; + tsi.paths = g_ptr_array_new (); + + e_tree_selected_path_foreach (ml->tree, thread_select_foreach, &tsi); + + selection_model = E_TREE_SELECTION_MODEL (e_tree_get_selection_model (ml->tree)); + + for (i = 0; i < tsi.paths->len; i++) + e_tree_selection_model_add_to_selection (selection_model, + tsi.paths->pdata[i]); + g_ptr_array_free (tsi.paths, TRUE); } void @@ -991,11 +1065,12 @@ invert_selection (BonoboUIComponent *uih, void *user_data, const char *path) { FolderBrowser *fb = FOLDER_BROWSER (user_data); MessageList *ml = fb->message_list; + ESelectionModel *etsm = e_tree_get_selection_model (ml->tree); if (ml->folder == NULL) return; - e_tree_invert_selection (ml->tree); + e_selection_model_invert_selection (etsm); } /* flag all selected messages. Return number flagged */ diff --git a/mail/mail-callbacks.h b/mail/mail-callbacks.h index 2d82995180..e96b5d1ff9 100644 --- a/mail/mail-callbacks.h +++ b/mail/mail-callbacks.h @@ -81,6 +81,7 @@ void search_msg (GtkWidget *widget, gpointer user_data); void load_images (GtkWidget *widget, gpointer user_data); void select_all (BonoboUIComponent *uih, void *user_data, const char *path); +void select_thread (BonoboUIComponent *uih, void *user_data, const char *path); void invert_selection (BonoboUIComponent *uih, void *user_data, const char *path); void mark_as_seen (BonoboUIComponent *uih, void *user_data, const char *path); void mark_all_as_seen (BonoboUIComponent *uih, void *user_data, const char *path); diff --git a/mail/subscribe-dialog.c b/mail/subscribe-dialog.c index 0ba539c84e..117e7cbfd0 100644 --- a/mail/subscribe-dialog.c +++ b/mail/subscribe-dialog.c @@ -422,8 +422,10 @@ subscribe_select_all (BonoboUIComponent *uic, { SubscribeDialog *sc = (SubscribeDialog*)user_data; ETreeScrolled *scrolled = E_TREE_SCROLLED (sc->folder_etree); - - e_tree_select_all (e_tree_scrolled_get_tree(scrolled)); + ETree *tree = e_tree_scrolled_get_tree (scrolled); + ESelectionModel *esm = e_tree_get_selection_model (E_TREE (tree)); + + e_selection_model_select_all (E_SELECTION_MODEL (esm)); } static void @@ -432,8 +434,10 @@ subscribe_invert_selection (BonoboUIComponent *uic, { SubscribeDialog *sc = (SubscribeDialog*)user_data; ETreeScrolled *scrolled = E_TREE_SCROLLED (sc->folder_etree); + ETree *tree = e_tree_scrolled_get_tree (scrolled); + ESelectionModel *esm = e_tree_get_selection_model (E_TREE (tree)); - e_tree_invert_selection (e_tree_scrolled_get_tree(scrolled)); + e_selection_model_invert_selection (E_SELECTION_MODEL (esm)); } static void -- cgit v1.2.3