diff options
Diffstat (limited to 'my-evolution')
-rw-r--r-- | my-evolution/ChangeLog | 36 | ||||
-rw-r--r-- | my-evolution/GNOME_Evolution_Summary.oaf.in | 2 | ||||
-rw-r--r-- | my-evolution/e-summary-mail.c | 79 | ||||
-rw-r--r-- | my-evolution/e-summary-preferences.c | 20 | ||||
-rw-r--r-- | my-evolution/e-summary-shown.c | 38 | ||||
-rw-r--r-- | my-evolution/e-summary-shown.h | 1 | ||||
-rw-r--r-- | my-evolution/e-summary-table.c | 6 | ||||
-rw-r--r-- | my-evolution/e-summary-weather.c | 25 |
8 files changed, 153 insertions, 54 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 916b65d6f1..74ca19640f 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,39 @@ +2002-04-22 Iain Holmes <iain@ximian.com> + + * e-summary-mail.c: Remove the shown and mode bits from the + ESummaryMail structure. + (e_summary_mail_generate_html): USe the folder_store list instead + of the blank one in mail-> + (new_folder_cb): Allow all mail folders now. + (update_folder_cb): Get the uri correctly. + (mail_change_notify): Remove debugging spew. + (e_summary_mail_reconfigure): Comment out the part that adds a + protocol to the front of a uri. + (insert_path_recur): If there is no toplevel, guess if from the + folder path. Not sure if it works for everything. + (add_storage_to_table): Store the whole of the sorted list, + and resort it every time. + (make_toplevel): I18n the titles, and remove the debugging. + (e_summary_mail_fill_list): Store the sortewd list. + + * e-summary_preferences.c (fill_rdf_etable): Create a new entry + to add to the shown list. + + * e-summary-shown.c (make_table): take a title for the table. + Generate the spec from that table. + (e_tree_model_node_append): Freeze the tree before adding the + node. + (e_summary_shown_add_node): Take an expanded boolean. + + * e-summary-table.c: Make the SPEC set the width correctly. + (e_summary_table_add_node): Freeze the table. + + * e-summary-weather.c (is_weather_shown): Search the global_prefs + to see if the node is shown. + (e_summary_weather_fill_etable): Set the expanded state on all to + FALSE except for leaf nodes.. + Create a new entry for shown rows. + 2002-04-08 Dan Winship <danw@ximian.com> * component-factory.c (create_view): Add view_info arg but don't diff --git a/my-evolution/GNOME_Evolution_Summary.oaf.in b/my-evolution/GNOME_Evolution_Summary.oaf.in index 615e73aec0..dca74ad860 100644 --- a/my-evolution/GNOME_Evolution_Summary.oaf.in +++ b/my-evolution/GNOME_Evolution_Summary.oaf.in @@ -57,7 +57,7 @@ <oaf_attribute name="evolution:config_item:icon_name" type="string" value="evolution-today.png"/> - <oaf_attribute name="evolution:config_item:type" type="stringv"> + <oaf_attribute name="evolution:config_item:priority" type="stringv"> <item value="summary"/> </oaf_attribute> diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c index aa9753619c..2c21c5f8c5 100644 --- a/my-evolution/e-summary-mail.c +++ b/my-evolution/e-summary-mail.c @@ -69,10 +69,9 @@ struct _ESummaryMail { GSList *storage_list; GHashTable *folders; -#endif GList *shown; ESummaryMailMode mode; - +#endif char *html; }; @@ -154,7 +153,7 @@ e_summary_mail_generate_html (ESummary *summary) g_free (s); g_string_append (string, "</a></b></dt><dd><table numcols=\"2\" width=\"100%\">"); - for (p = mail->shown; p; p = p->next) { + for (p = folder_store->shown; p; p = p->next) { folder_gen_html (summary, p->data, string); } @@ -173,11 +172,11 @@ e_summary_mail_get_html (ESummary *summary) { /* Only regenerate HTML when it's needed */ e_summary_mail_generate_html (summary); - + if (summary->mail == NULL) { return NULL; } - + return summary->mail->html; } @@ -215,10 +214,7 @@ new_folder_cb (EvolutionStorageListener *listener, ESummaryMailFolder *mail_folder; GList *p; - /* Don't care about non mail */ - if (strcmp (folder->type, "mail") != 0 || - (strncmp (folder->physicalUri, "file://", 7) != 0 && - strncmp (folder->physicalUri, "vfolder", 7) != 0)) { + if (strcmp (folder->type, "mail") != 0) { return; } @@ -251,18 +247,26 @@ update_folder_cb (EvolutionStorageListener *listener, StorageInfo *si) { char *evolution_dir; - static char *proto = NULL; + char *proto; char *uri; /* Make this static, saves having to recompute it each time */ - if (proto == NULL) { + if (strcmp (si->name, _("VFolders")) == 0) { + evolution_dir = gnome_util_prepend_user_home ("evolution/vfolder"); + uri = g_strdup_printf ("vfolder:%s#%s", evolution_dir, + path + 1); + g_free (evolution_dir); + } else if (strcmp (si->name, _("Local Folders")) == 0) { evolution_dir = gnome_util_prepend_user_home ("evolution/local"); - proto = g_strconcat ("file://", evolution_dir, NULL); g_free (evolution_dir); + uri = e_path_to_physical (proto, path); + } else { + uri = g_strconcat (si->name, path, NULL); } - uri = e_path_to_physical (proto, path); + g_print ("path: %s\n", path); + g_print ("uri: %s\n", uri); e_summary_mail_get_info (uri, folder_store->listener); g_free (uri); @@ -307,7 +311,6 @@ mail_change_notify (BonoboListener *listener, ESummaryMailFolder *folder; GList *p; - g_print ("Yo!\n"); count = arg->_value; folder = g_hash_table_lookup (folder_store->folders, count->path); @@ -341,7 +344,7 @@ e_summary_mail_protocol (ESummary *summary, static gboolean e_summary_folder_register_storage (const char *name, - GNOME_Evolution_Storage corba_storage) + GNOME_Evolution_Storage corba_storage) { GNOME_Evolution_StorageListener corba_listener; StorageInfo *si; @@ -410,6 +413,7 @@ storage_notify (BonoboListener *listener, CORBA_Environment ev2; nr = arg->_value; + switch (nr->type) { case GNOME_Evolution_StorageRegistry_STORAGE_CREATED: /* These need to be special cased because they're special */ @@ -518,13 +522,15 @@ e_summary_mail_reconfigure (void) ESummaryMailFolder *folder; char *uri; +#if 0 if (strncmp (p->data, "file://", 7) == 0 || strncmp (p->data, "vfolder:", 8) == 0) { uri = g_strdup (p->data); } else { uri = g_strconcat ("file://", p->data, NULL); } - +#endif + uri = g_strdup (p->data); folder = g_hash_table_lookup (folder_store->folders, uri); if (folder != NULL) { if (folder->init == FALSE) { @@ -642,6 +648,27 @@ insert_path_recur (ESummaryTable *est, parent_node = g_hash_table_lookup (hash_table, parent_path); if (parent_node == NULL) { + if (si->toplevel == NULL) { + char *third_slash; + /* Generate the toplevel from the path */ + + if (strncmp (path, "imap://", 7) == 0) { + /* IMAP */ + third_slash = strchr (path + 8, '/'); + if (third_slash == NULL) { + /* EEk */ + si->toplevel = g_strdup (path + 8); + } else { + si->toplevel = g_strndup (path, third_slash - path); + } + } else { + /* FIXME: Not sure I like this, but... */ + si->toplevel = g_strdup (path); + } + + g_print ("Generated toplevel as %s\n", si->toplevel); + } + if (strcmp (si->toplevel, path) == 0) { /* Insert root */ children = e_summary_table_get_num_children (est, NULL); @@ -707,11 +734,13 @@ add_storage_to_table (ESummaryTable *est, GList *p; path_hash = g_hash_table_new (g_str_hash, g_str_equal); - p = g_list_sort (si->folders, str_compare); + si->folders = g_list_sort (si->folders, str_compare); - for (; p; p = p->next) { + g_print ("Adding %s\n", si->name); + for (p = si->folders; p; p = p->next) { ESummaryMailFolder *folder = p->data; + g_print ("folder->path: %s\n", folder->path); insert_path_recur (est, si, path_hash, folder->path); } @@ -726,15 +755,14 @@ make_toplevel (StorageInfo *si) return; } - if (strcmp (si->name, "VFolders") == 0) { + if (strcmp (si->name, _("VFolders")) == 0) { si->toplevel = g_strdup_printf ("vfolder:%s/evolution/vfolder", g_get_home_dir ()); - } else if (strcmp (si->name, "Local Folders") == 0) { + } else if (strcmp (si->name, _("Local Folders")) == 0) { si->toplevel = g_strdup_printf ("file://%s/evolution/local", g_get_home_dir ()); } else { - g_warning ("Unknown folder name... EEEEEEKEKEKEKEE!"); - si->toplevel = g_strdup ("Dunno"); + si->toplevel = NULL; } } @@ -747,10 +775,11 @@ e_summary_mail_fill_list (ESummaryTable *est) g_return_if_fail (folder_store != NULL); - p = g_slist_sort (folder_store->storage_list, sort_storages); - for (; p; p = p->next) { + folder_store->storage_list = g_slist_sort (folder_store->storage_list, + sort_storages); + for (p = folder_store->storage_list; p; p = p->next) { StorageInfo *si = p->data; - + if (si->toplevel == NULL) { make_toplevel (si); } diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index 447812b317..00bb7484ff 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -466,7 +466,7 @@ static struct _RDFInfo rdfs[] = { {"http://barrapunto.com/gnome.rdf", "Barrapunto GNOME", FALSE,}, {"http://www.bsdtoday.com/backend/bt.rdf", "BSD Today", FALSE}, {"http://beyond2000.com/b2k.rdf", "Beyond 2000", FALSE}, - {"http://www.cnn.com/cnn.rss", "CNN", FALSE}, + {"http://www.cnn.com/cnn.rss", "CNN", FALSE}, {"http://www.debianplanet.org/debianplanet/backend.php", "Debian Planet", FALSE}, {"http://www.dictionary.com/wordoftheday/wotd.rss", N_("Dictionary.com Word of the Day"), FALSE}, {"http://www.dvdreview.com/rss/newschannel.rss", "DVD Review", FALSE}, @@ -599,10 +599,15 @@ fill_rdf_etable (GtkWidget *widget, entry->name = g_strdup (rdfs[i].name); entry->showable = TRUE; - e_summary_shown_add_node (ess, TRUE, entry, NULL, NULL); + e_summary_shown_add_node (ess, TRUE, entry, NULL, TRUE, NULL); if (rdf_is_shown (pd, rdfs[i].url) == TRUE) { - e_summary_shown_add_node (ess, FALSE, entry, NULL, NULL); + entry = g_new (ESummaryShownModelEntry, 1); + entry->location = g_strdup (rdfs[i].url); + entry->name = g_strdup (rdfs[i].name); + entry->showable = TRUE; + + e_summary_shown_add_node (ess, FALSE, entry, NULL, TRUE, NULL); } pd->rdf->known = g_list_append (pd->rdf->known, &rdfs[i]); @@ -658,10 +663,15 @@ fill_rdf_etable (GtkWidget *widget, entry->name = g_strdup (info->name); entry->showable = TRUE; - e_summary_shown_add_node (ess, TRUE, entry, NULL, NULL); + e_summary_shown_add_node (ess, TRUE, entry, NULL, TRUE, NULL); if (rdf_is_shown (pd, tokens[0]) == TRUE) { - e_summary_shown_add_node (ess, FALSE, entry, NULL, NULL); + entry = g_new (ESummaryShownModelEntry, 1); + entry->location = g_strdup (info->url); + entry->name = g_strdup (info->name); + entry->showable = TRUE; + + e_summary_shown_add_node (ess, FALSE, entry, NULL, TRUE, NULL); } g_strfreev (tokens); diff --git a/my-evolution/e-summary-shown.c b/my-evolution/e-summary-shown.c index 42f6bf83f5..3e1d939c34 100644 --- a/my-evolution/e-summary-shown.c +++ b/my-evolution/e-summary-shown.c @@ -56,7 +56,7 @@ /* Needs to be filled in before use */ #define SPEC "<ETableSpecification cursor-mode=\"line\" draw-focus=\"true\"> \ -<ETableColumn model_col=\"0\" _title=\" \" resizable=\"true\" cell=\"tree-string\" compare=\"string\"/> \ +<ETableColumn model_col=\"0\" _title=\"%s\" resizable=\"true\" cell=\"tree-string\" compare=\"string\"/> \ <ETableState> \ <column source=\"0\"/> \ <grouping></grouping> \ @@ -348,7 +348,7 @@ maybe_move_to_shown (ETreePath path, new_entry->showable = entry->showable; new_entry->ref_count = 0; - e_summary_shown_add_node (shown, FALSE, new_entry, NULL, NULL); + e_summary_shown_add_node (shown, FALSE, new_entry, NULL, TRUE, NULL); gtk_signal_emit (GTK_OBJECT (shown), shown_signals[ITEM_CHANGED]); g_print ("Added %s\n", entry->name); } @@ -397,12 +397,14 @@ remove_clicked (GtkWidget *button, static TableData * make_table (GHashTable *data_model, + const char *title, GtkSignalFunc callback, gpointer closure) { TableData *td; ETreeMemory *etmm; ETree *tree; + char *real_spec; td = g_new (TableData, 1); td->etm = e_tree_memory_callbacks_new (icon_at, @@ -432,8 +434,10 @@ make_table (GHashTable *data_model, e_tree_memory_set_expanded_default (etmm, TRUE); td->root = e_tree_memory_node_insert (etmm, NULL, 0, NULL); - - td->etable = e_tree_scrolled_new (td->etm, NULL, SPEC, NULL); + + real_spec = g_strdup_printf (SPEC, title); + td->etable = e_tree_scrolled_new (td->etm, NULL, real_spec, NULL); + g_free (real_spec); tree = e_tree_scrolled_get_tree (E_TREE_SCROLLED (td->etable)); e_tree_root_node_set_visible (tree, FALSE); @@ -456,7 +460,7 @@ e_summary_shown_init (ESummaryShown *shown) priv = g_new (ESummaryShownPrivate, 1); shown->priv = priv; - priv->all = make_table (shown->all_model, GTK_SIGNAL_FUNC (all_selection_changed), shown); + priv->all = make_table (shown->all_model, _("All"), GTK_SIGNAL_FUNC (all_selection_changed), shown); gtk_box_pack_start (GTK_BOX (shown), priv->all->etable, TRUE, TRUE, 0); gtk_widget_show (priv->all->etable); @@ -464,13 +468,15 @@ e_summary_shown_init (ESummaryShown *shown) vbox = gtk_vbox_new (TRUE, 0); gtk_box_pack_start (GTK_BOX (shown), vbox, FALSE, FALSE, 0); - priv->add = gtk_button_new_with_label (_("Add->")); + /* Fixme: nice GFX version */ + priv->add = gtk_button_new_with_label (_("Add ->")); gtk_widget_set_sensitive (priv->add, FALSE); gtk_box_pack_start (GTK_BOX (vbox), priv->add, TRUE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (priv->add), "clicked", GTK_SIGNAL_FUNC (add_clicked), shown); - - priv->remove = gtk_button_new_with_label (_("<-Remove")); + + /* Fixme: Ditto */ + priv->remove = gtk_button_new_with_label (_("<- Remove")); gtk_widget_set_sensitive (priv->remove, FALSE); gtk_box_pack_start (GTK_BOX (vbox), priv->remove, TRUE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (priv->remove), "clicked", @@ -478,7 +484,7 @@ e_summary_shown_init (ESummaryShown *shown) gtk_widget_show_all (vbox); - priv->shown = make_table (shown->shown_model, GTK_SIGNAL_FUNC (shown_selection_changed), shown); + priv->shown = make_table (shown->shown_model, _("Shown"), GTK_SIGNAL_FUNC (shown_selection_changed), shown); gtk_box_pack_start (GTK_BOX (shown), priv->shown->etable, TRUE, TRUE, 0); gtk_widget_show (priv->shown->etable); @@ -503,11 +509,16 @@ e_tree_model_node_append (ETreeModel *etm, { ETreeMemory *etmm; int position; - + ETreePath path; + position = e_tree_model_node_get_children (etm, parent, NULL); etmm = E_TREE_MEMORY (etm); - return e_tree_memory_node_insert (etmm, parent, position, data); + e_tree_memory_freeze (etmm); + path = e_tree_memory_node_insert (etmm, parent, position, data); + e_tree_memory_thaw (etmm); + + return path; } ETreePath @@ -515,11 +526,13 @@ e_summary_shown_add_node (ESummaryShown *shown, gboolean all, ESummaryShownModelEntry *entry, ETreePath parent, + gboolean expanded, gpointer data) { TableData *td; ETreePath path; ETreeMemory *etmm; + ETree *tree; GHashTable *model; g_return_val_if_fail (IS_E_SUMMARY_SHOWN (shown), NULL); @@ -539,6 +552,9 @@ e_summary_shown_add_node (ESummaryShown *shown, etmm = E_TREE_MEMORY (td->etm); path = e_tree_model_node_append (td->etm, parent, data); + tree = e_tree_scrolled_get_tree (E_TREE_SCROLLED (td->etable)); + e_tree_node_set_expanded (tree, path, expanded); + entry->path = path; g_hash_table_insert (model, path, entry); diff --git a/my-evolution/e-summary-shown.h b/my-evolution/e-summary-shown.h index d834874f0c..af9684c671 100644 --- a/my-evolution/e-summary-shown.h +++ b/my-evolution/e-summary-shown.h @@ -66,6 +66,7 @@ ETreePath e_summary_shown_add_node (ESummaryShown *shown, gboolean all, ESummaryShownModelEntry *entry, ETreePath parent, + gboolean expanded, gpointer data); void e_summary_shown_remove_node (ESummaryShown *shown, gboolean all, diff --git a/my-evolution/e-summary-table.c b/my-evolution/e-summary-table.c index da2bf64f5b..297da365e3 100644 --- a/my-evolution/e-summary-table.c +++ b/my-evolution/e-summary-table.c @@ -61,8 +61,8 @@ char *headers[COLS] = { #endif #define SPEC "<ETableSpecification cursor-mode=\"line\" draw-focus=\"true\"> \ -<ETableColumn model_col=\"0\" _title=\"Shown\" resizable=\"true\" cell=\"tricell\" compare=\"integer\"/> \ -<ETableColumn model_col=\"1\" _title=\"Name\" minimum_width=\"20\" resizable=\"true\" cell=\"render-name\" compare=\"string\"/> \ +<ETableColumn model_col=\"0\" _title=\"Shown\" minimum_width=\"20\" resizable=\"false\" cell=\"tricell\" compare=\"integer\"/> \ +<ETableColumn model_col=\"1\" _title=\"Name\" resizable=\"true\" minimum-width=\"32\" cell=\"render-name\" compare=\"string\"/> \ <ETableState> \ <column source=\"0\"/> \ <column source=\"1\"/> \ @@ -421,7 +421,9 @@ e_summary_table_add_node (ESummaryTable *table, } etmm = E_TREE_MEMORY (table->priv->etm); + e_tree_memory_freeze (etmm); p = e_tree_memory_node_insert (etmm, path, position, node_data); + e_tree_memory_thaw (etmm); return p; } diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index 0b8e183125..c5396e7225 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -646,15 +646,14 @@ e_summary_weather_code_to_name (const char *code) } static gboolean -is_weather_shown (ESummaryWeather *weather, - const char *code) +is_weather_shown (const char *code) { GList *p; + ESummaryPrefs *global_preferences; - for (p = weather->weathers; p; p = p->next) { - Weather *w = p->data; - - if (strcmp (w->location, code) == 0) { + global_preferences = e_summary_preferences_get_global (); + for (p = global_preferences->stations; p; p = p->next) { + if (strcmp (p->data, code) == 0) { return TRUE; } } @@ -697,7 +696,7 @@ e_summary_weather_fill_etable (ESummaryShown *ess) entry->name = g_strdup (region_name); entry->showable = FALSE; - region = e_summary_shown_add_node (ess, TRUE, entry, NULL, NULL); + region = e_summary_shown_add_node (ess, TRUE, entry, NULL, FALSE, NULL); gnome_config_get_vector (states_key, &nstates, &states); @@ -716,7 +715,7 @@ e_summary_weather_fill_etable (ESummaryShown *ess) entry->name = g_strdup (state_name); entry->showable = FALSE; - state = e_summary_shown_add_node (ess, TRUE, entry, region, NULL); + state = e_summary_shown_add_node (ess, TRUE, entry, region, FALSE, NULL); location = NULL; iter = gnome_config_init_iterator (state_path); @@ -736,8 +735,14 @@ e_summary_weather_fill_etable (ESummaryShown *ess) entry->name = g_strdup (locdata[0]); entry->showable = TRUE; - location = e_summary_shown_add_node (ess, TRUE, entry, state, NULL); - + location = e_summary_shown_add_node (ess, TRUE, entry, state, TRUE, NULL); + /* FIXME: Show the showns here */ + if (is_weather_shown (locdata[1]) == TRUE) { + entry = g_new (ESummaryShownModelEntry, 1); + entry->location = g_strdup (locdata[1]); + entry->name = g_strdup (locdata[0]); + location = e_summary_shown_add_node (ess, FALSE, entry, NULL, TRUE, NULL); + } g_strfreev (locdata); } |