From 9529bae97d33cf727914fdbff77decc8da97cc33 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Fri, 24 May 2002 12:36:56 +0000 Subject: [ fixes 90% of #25047 ] shamelessly lifted from 2002-05-24 Chris Toshok [ fixes 90% of #25047 ] * e-folder-list.c (get_folder_for_uri): shamelessly lifted from evolution-folder-selector-button.c. (create_display_string): modeled again after evolution-folder-selector-button.c, so we can give a little more context (and make the table look like the folder selector buttons.) (SPEC): add a pixbuf column, also remove the sorting behavior. (columns): add a pixbuf column and another string column (for the display string). (add_clicked): create the display string and get the proper pixbuf, and insert both. (edit_clicked): removed. (update_buttons): remove edit button handling from here. (e_folder_list_init): remove the hooking up of button-edit's "clicked" signal. (e_folder_list_construct): get a reference to the storage registry so we can look up folders. (e_folder_list_set_items): analogous change to add_clicked - get the display string and pixbuf and insert them. * glade/e-folder-list.glade: remove the edit button. * glade/e-shell-config-default-folders.glade: remove the frame/vbox, since we embed it in a notebook and the tab has the title already. * e-shell-config.c (config_control_factory_cb): the only config control we deal with here now is the folder settings control. * e-shell-config-default-folders.c (e_shell_config_default_folders_create_widget): rename e_shell_config_default_folders_create_control to this, return the widget, and take the config control to use as an arg. * e-shell-config-offline.c (e_shell_config_offline_create_widget): make an analogous change here as with default_folders_create_widget. * e-shell-config-default-folders.h (e_shell_config_default_folders_create_widget): track change to prototype. * e-shell-config-offline.h (e_shell_config_offline_create_widget): same. * GNOME_Evolution_Shell.oaf.in: remove the DefaultFolders and OfflineFolders controls and add a FolderSettings_Control. * Makefile.am (evolution_SOURCES): add e-shell-config-folder-settings.[ch] and e-shell-config-autocompletion.[ch]. * e-shell-config-folder-settings.[ch]: new files, embed (after a fashion) the default folder, offline, and autocompletion UI's in a notebook. * e-shell-config-autocompletion.[ch]: Basically copy over and shell-ize the addressbook autocompletion config control so it can be embedded more easily with the other folder settings. svn path=/trunk/; revision=17000 --- shell/ChangeLog | 62 ++++ shell/GNOME_Evolution_Shell.oaf.in | 35 +- shell/Makefile.am | 4 + shell/e-folder-list.c | 126 +++++-- shell/e-shell-config-autocompletion.c | 127 +++++++ shell/e-shell-config-autocompletion.h | 34 ++ shell/e-shell-config-default-folders.c | 12 +- shell/e-shell-config-default-folders.h | 5 +- shell/e-shell-config-folder-settings.c | 83 +++++ shell/e-shell-config-folder-settings.h | 32 ++ shell/e-shell-config-offline.c | 8 +- shell/e-shell-config-offline.h | 5 +- shell/e-shell-config.c | 15 +- shell/glade/e-folder-list.glade | 11 +- shell/glade/e-shell-config-default-folders.glade | 402 +++++++++++------------ 15 files changed, 653 insertions(+), 308 deletions(-) create mode 100644 shell/e-shell-config-autocompletion.c create mode 100644 shell/e-shell-config-autocompletion.h create mode 100644 shell/e-shell-config-folder-settings.c create mode 100644 shell/e-shell-config-folder-settings.h diff --git a/shell/ChangeLog b/shell/ChangeLog index ff6159fec6..86fea25bda 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,65 @@ +2002-05-24 Chris Toshok + + [ fixes 90% of #25047 ] + * e-folder-list.c (get_folder_for_uri): shamelessly lifted from + evolution-folder-selector-button.c. + (create_display_string): modeled again after + evolution-folder-selector-button.c, so we can give a little more + context (and make the table look like the folder selector + buttons.) + (SPEC): add a pixbuf column, also remove the sorting behavior. + (columns): add a pixbuf column and another string column (for the + display string). + (add_clicked): create the display string and get the proper + pixbuf, and insert both. + (edit_clicked): removed. + (update_buttons): remove edit button handling from here. + (e_folder_list_init): remove the hooking up of button-edit's + "clicked" signal. + (e_folder_list_construct): get a reference to the storage registry + so we can look up folders. + (e_folder_list_set_items): analogous change to add_clicked - get + the display string and pixbuf and insert them. + + * glade/e-folder-list.glade: remove the edit button. + + * glade/e-shell-config-default-folders.glade: remove the + frame/vbox, since we embed it in a notebook and the tab has the + title already. + + * e-shell-config.c (config_control_factory_cb): the only config + control we deal with here now is the folder settings control. + + * e-shell-config-default-folders.c + (e_shell_config_default_folders_create_widget): rename + e_shell_config_default_folders_create_control to this, return the + widget, and take the config control to use as an arg. + + * e-shell-config-offline.c (e_shell_config_offline_create_widget): + make an analogous change here as with + default_folders_create_widget. + + * e-shell-config-default-folders.h + (e_shell_config_default_folders_create_widget): track change to + prototype. + + * e-shell-config-offline.h (e_shell_config_offline_create_widget): same. + + * GNOME_Evolution_Shell.oaf.in: remove the DefaultFolders and + OfflineFolders controls and add a FolderSettings_Control. + + * Makefile.am (evolution_SOURCES): add + e-shell-config-folder-settings.[ch] and + e-shell-config-autocompletion.[ch]. + + * e-shell-config-folder-settings.[ch]: new files, embed (after a + fashion) the default folder, offline, and autocompletion UI's in a + notebook. + + * e-shell-config-autocompletion.[ch]: Basically copy over and + shell-ize the addressbook autocompletion config control so it can + be embedded more easily with the other folder settings. + 2002-05-23 Ettore Perazzoli * main.c (quit_box_new): Set @allow_shrink and @allow_grow to diff --git a/shell/GNOME_Evolution_Shell.oaf.in b/shell/GNOME_Evolution_Shell.oaf.in index e1da511b32..39a91abb49 100644 --- a/shell/GNOME_Evolution_Shell.oaf.in +++ b/shell/GNOME_Evolution_Shell.oaf.in @@ -21,7 +21,7 @@ - @@ -30,10 +30,10 @@ + _value="Folder Settings"/> + _value="This page can be used to configure various folder settings"/> @@ -45,34 +45,7 @@ - - - - - - - - - - - - - - - - - - - - - + _value="Configuration control for Evolution folder settings."/> diff --git a/shell/Makefile.am b/shell/Makefile.am index 275d9a54c1..95854f4f5a 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -152,10 +152,14 @@ evolution_SOURCES = \ e-shell-about-box.h \ e-shell-config.c \ e-shell-config.h \ + e-shell-config-autocompletion.c \ + e-shell-config-autocompletion.h \ e-shell-config-offline.c \ e-shell-config-offline.h \ e-shell-config-default-folders.c \ e-shell-config-default-folders.h \ + e-shell-config-folder-settings.c \ + e-shell-config-folder-settings.h \ e-shell-constants.h \ e-shell-folder-commands.c \ e-shell-folder-commands.h \ diff --git a/shell/e-folder-list.c b/shell/e-folder-list.c index 501523a49c..fcf29bc140 100644 --- a/shell/e-folder-list.c +++ b/shell/e-folder-list.c @@ -25,6 +25,7 @@ #include #include "e-folder-list.h" #include +#include #include #include #include @@ -32,6 +33,7 @@ #include #include #include +#include "Evolution.h" static GtkVBoxClass *parent_class = NULL; #define PARENT_TYPE (gtk_vbox_get_type ()) @@ -59,11 +61,66 @@ struct _EFolderListPrivate { GtkFrame *frame; ETableMemoryStore *model; EvolutionShellClient *client; + GNOME_Evolution_StorageRegistry corba_storage_registry; EOptionMenu *option_menu; char **possible_types; }; + +static GNOME_Evolution_Folder * +get_folder_for_uri (EFolderList *efl, + const char *uri) +{ + EFolderListPrivate *priv = efl->priv; + CORBA_Environment ev; + GNOME_Evolution_Folder *folder; + + CORBA_exception_init (&ev); + folder = GNOME_Evolution_StorageRegistry_getFolderByUri ( + priv->corba_storage_registry, uri, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + folder = CORBA_OBJECT_NIL; + CORBA_exception_free (&ev); + + return folder; +} + +static char * +create_display_string (EFolderList *efl, char *folder_uri, char *folder_name) +{ + char *storage_lname, *p; + char *label_text; + + storage_lname = NULL; + p = strchr (folder_uri, '/'); + if (p) { + p = strchr (p + 1, '/'); + if (p) { + GNOME_Evolution_Folder *storage_folder; + char *storage_uri; + + storage_uri = g_strndup (folder_uri, + p - folder_uri); + storage_folder = get_folder_for_uri (efl, storage_uri); + storage_lname = e_utf8_to_gtk_string (GTK_WIDGET(efl), storage_folder->displayName); + CORBA_free (storage_folder); + g_free (storage_uri); + } + } + + if (storage_lname) { + label_text = g_strdup_printf ("\"%s\" in \"%s\"", folder_name, + storage_lname); + g_free (storage_lname); + } else + label_text = g_strdup_printf ("\"%s\"", folder_name); + + return label_text; +} + + + static void e_folder_list_changed (EFolderList *efl) { @@ -189,6 +246,14 @@ e_folder_list_class_init (EFolderListClass *klass) " no-headers=\"true\"" \ ">" \ " " \ + " " \ " " \ " " \ + " " \ " " \ - " " \ " " \ " " \ "" static ETableMemoryStoreColumnInfo columns[] = { + E_TABLE_MEMORY_STORE_PIXBUF, + E_TABLE_MEMORY_STORE_STRING, E_TABLE_MEMORY_STORE_STRING, E_TABLE_MEMORY_STORE_STRING, E_TABLE_MEMORY_STORE_STRING, @@ -248,8 +315,15 @@ add_clicked (GtkButton *button, EFolderList *efl) &folder); if (folder != NULL) { - e_table_memory_store_insert (efl->priv->model, -1, NULL, folder->displayName, folder->evolutionUri, folder->physicalUri); + GdkPixbuf *pixbuf; + char *display_string = create_display_string (efl, folder->evolutionUri, folder->displayName); + + pixbuf = evolution_shell_client_get_pixbuf_for_type (efl->priv->client, folder->type, TRUE); + e_table_memory_store_insert (efl->priv->model, -1, NULL, pixbuf, display_string, + folder->displayName, folder->evolutionUri, folder->physicalUri); e_folder_list_changed (efl); + gdk_pixbuf_unref (pixbuf); + g_free (display_string); } } @@ -286,33 +360,6 @@ remove_clicked (GtkButton *button, EFolderList *efl) e_folder_list_changed (efl); } -static void -edit_clicked (GtkButton *button, EFolderList *efl) -{ - ETable *table; - GNOME_Evolution_Folder *folder; - int cursor_row; - - table = e_table_scrolled_get_table (efl->priv->scrolled_table); - cursor_row = e_table_get_cursor_row (table); - - if (cursor_row != -1) { - char *initial = e_table_model_value_at (E_TABLE_MODEL (efl->priv->model), 1, cursor_row); - evolution_shell_client_user_select_folder (efl->priv->client, - GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (efl))), - _("Edit this Folder"), - initial, - (const gchar **) efl->priv->possible_types, - &folder); - - if (folder != NULL) { - e_table_memory_store_remove (efl->priv->model, cursor_row); - e_table_memory_store_insert (efl->priv->model, -1, NULL, folder->displayName, folder->evolutionUri, folder->physicalUri); - e_folder_list_changed (efl); - } - } -} - static void optionmenu_changed (EOptionMenu *option_menu, int value, EFolderList *efl) { @@ -329,9 +376,7 @@ update_buttons (EFolderList *efl) table = e_table_scrolled_get_table (efl->priv->scrolled_table); cursor_row = e_table_get_cursor_row (table); selection_count = e_table_selected_count (table); - - e_glade_xml_set_sensitive (efl->priv->gui, "button-edit", cursor_row != -1); e_glade_xml_set_sensitive (efl->priv->gui, "button-remove", selection_count >= 1); } @@ -375,8 +420,6 @@ e_folder_list_init (EFolderList *efl) GTK_SIGNAL_FUNC (add_clicked), efl); e_glade_xml_connect_widget (gui, "button-remove", "clicked", GTK_SIGNAL_FUNC (remove_clicked), efl); - e_glade_xml_connect_widget (gui, "button-edit", "clicked", - GTK_SIGNAL_FUNC (edit_clicked), efl); e_glade_xml_connect_widget (gui, "custom-optionmenu", "changed", GTK_SIGNAL_FUNC (optionmenu_changed), efl); @@ -514,6 +557,7 @@ e_folder_list_construct (EFolderList *efl, EvolutionShellClient *client, char *x { efl->priv->client = client; bonobo_object_client_ref (BONOBO_OBJECT_CLIENT (efl->priv->client), NULL); + efl->priv->corba_storage_registry = evolution_shell_client_get_storage_registry_interface (client); e_folder_list_set_xml (efl, xml); return GTK_WIDGET (efl); } @@ -524,7 +568,21 @@ e_folder_list_set_items (EFolderList *efl, EFolderListItem *items) int i; e_table_memory_store_clear (efl->priv->model); for (i = 0; items[i].uri; i++) { - e_table_memory_store_insert (efl->priv->model, -1, NULL, items[i].display_name, items[i].uri, items[i].physical_uri); + GNOME_Evolution_Folder *folder; + GdkPixbuf *pixbuf; + char *display_string; + + display_string = create_display_string (efl, items[i].uri, items[i].display_name); + + folder = get_folder_for_uri (efl, items[i].uri); + pixbuf = evolution_shell_client_get_pixbuf_for_type (efl->priv->client, folder->type, TRUE); + + e_table_memory_store_insert (efl->priv->model, -1, NULL, + pixbuf, display_string, + items[i].display_name, items[i].uri, items[i].physical_uri); + CORBA_free (folder); + gdk_pixbuf_unref (pixbuf); + g_free (display_string); } } diff --git a/shell/e-shell-config-autocompletion.c b/shell/e-shell-config-autocompletion.c new file mode 100644 index 0000000000..819ab0ed7d --- /dev/null +++ b/shell/e-shell-config-autocompletion.c @@ -0,0 +1,127 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-shell-config-autocompletion.c - Configuration page for addressbook autocompletion. + * + * Copyright (C) 2002 Ximian, Inc. + * + * 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. + * + * 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. + * + * 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Chris Lahey + * Chris Toshok + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include "e-shell-config-autocompletion.h" + +#include "e-folder-list.h" + +#include "Evolution.h" + +#include +#include + +#include +#include + + +typedef struct { + EvolutionConfigControl *config_control; + + GtkWidget *control_widget; + + Bonobo_ConfigDatabase db; + EvolutionShellClient *shell_client; +} EvolutionAutocompletionConfig; + +static void +folder_list_changed_callback (EFolderList *efl, + EvolutionAutocompletionConfig *ac) +{ + evolution_config_control_changed (ac->config_control); +} + +static void +config_control_destroy_callback (EvolutionConfigControl *config_control, + EvolutionAutocompletionConfig *ac) +{ + bonobo_object_unref (BONOBO_OBJECT (ac->shell_client)); + g_free (ac); +} + + +static void +config_control_apply_callback (EvolutionConfigControl *config_control, + EvolutionAutocompletionConfig *ac) +{ + char *xml; + CORBA_Environment ev; + + CORBA_exception_init (&ev); + + xml = e_folder_list_get_xml (E_FOLDER_LIST (ac->control_widget)); + bonobo_config_set_string (ac->db, "/Addressbook/Completion/uris", xml, &ev); + g_free (xml); + + CORBA_exception_free (&ev); +} + +GtkWidget * +e_shell_config_autocompletion_create_widget (EShell *shell, EvolutionConfigControl *config_control) +{ + GNOME_Evolution_Shell shell_dup; + EvolutionAutocompletionConfig *ac; + char *xml; + CORBA_Environment ev; + static const char *possible_types[] = { "contacts", "ldap-contacts", NULL }; + + ac = g_new0 (EvolutionAutocompletionConfig, 1); + ac->db = e_shell_get_config_db (shell); + + CORBA_exception_init (&ev); + + shell_dup = CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (shell)), &ev); + ac->shell_client = evolution_shell_client_new (shell_dup); + + xml = bonobo_config_get_string (ac->db, "/Addressbook/Completion/uris", &ev); + + ac->control_widget = e_folder_list_new (ac->shell_client, + xml); + bonobo_object_client_unref (BONOBO_OBJECT_CLIENT (ac->shell_client), NULL); + g_free (xml); + + gtk_object_set (GTK_OBJECT (ac->control_widget), + "title", _("Extra Completion folders"), + "possible_types", possible_types, + NULL); + + gtk_widget_show (ac->control_widget); + + ac->config_control = config_control; + + gtk_signal_connect (GTK_OBJECT (ac->control_widget), "changed", + GTK_SIGNAL_FUNC (folder_list_changed_callback), ac); + gtk_signal_connect (GTK_OBJECT (ac->config_control), "apply", + GTK_SIGNAL_FUNC (config_control_apply_callback), ac); + gtk_signal_connect (GTK_OBJECT (ac->config_control), "destroy", + GTK_SIGNAL_FUNC (config_control_destroy_callback), ac); + + CORBA_exception_free (&ev); + + return ac->control_widget; +} + diff --git a/shell/e-shell-config-autocompletion.h b/shell/e-shell-config-autocompletion.h new file mode 100644 index 0000000000..46a65627a3 --- /dev/null +++ b/shell/e-shell-config-autocompletion.h @@ -0,0 +1,34 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-shell-config-autocompletion.c - Configuration page for addressbook autocompletion. + * + * Copyright (C) 2002 Ximian, Inc. + * + * 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. + * + * 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. + * + * 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Authors: Chris Lahey + * Chris Toshok + */ + +#ifndef E_SHELL_CONFIG_AUTOCOMPLETION_H +#define E_SHELL_CONFIG_AUTOCOMPLETION_H + +#include "e-shell.h" + +#include +#include "evolution-config-control.h" + +GtkWidget *e_shell_config_autocompletion_create_widget (EShell *shell, EvolutionConfigControl *config_control); + +#endif /* E_SHELL_CONFIG_AUTOCOMPLETION_H */ diff --git a/shell/e-shell-config-default-folders.c b/shell/e-shell-config-default-folders.c index 52a23837e3..7875cb4128 100644 --- a/shell/e-shell-config-default-folders.c +++ b/shell/e-shell-config-default-folders.c @@ -27,7 +27,6 @@ #include "e-shell-config-default-folders.h" -#include "evolution-config-control.h" #include "evolution-folder-selector-button.h" #include @@ -140,8 +139,8 @@ setup_folder_selector (EvolutionDefaultFolderConfig *dfc, dfc); } -BonoboObject * -e_shell_config_default_folders_create_control (EShell *shell) +GtkWidget* +e_shell_config_default_folders_create_widget (EShell *shell, EvolutionConfigControl *config_control) { GNOME_Evolution_Shell shell_dup; CORBA_Environment ev; @@ -175,17 +174,16 @@ e_shell_config_default_folders_create_control (EShell *shell) &dfc->tasks_uri, "/DefaultFolders/tasks_uri", tasks_types); - widget = glade_xml_get_widget (dfc->glade, "default_folders_vbox"); + widget = glade_xml_get_widget (dfc->glade, "default_folders_table"); gtk_widget_ref (widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_widget_show (widget); - dfc->config_control = evolution_config_control_new (widget); - gtk_widget_unref (widget); + dfc->config_control = config_control; gtk_signal_connect (GTK_OBJECT (dfc->config_control), "apply", GTK_SIGNAL_FUNC (config_control_apply_cb), dfc); gtk_signal_connect (GTK_OBJECT (dfc->config_control), "destroy", GTK_SIGNAL_FUNC (config_control_destroy_cb), dfc); - return BONOBO_OBJECT (dfc->config_control); + return widget; } diff --git a/shell/e-shell-config-default-folders.h b/shell/e-shell-config-default-folders.h index 57e39590c7..c5f4412a7a 100644 --- a/shell/e-shell-config-default-folders.h +++ b/shell/e-shell-config-default-folders.h @@ -26,8 +26,9 @@ #include "e-shell.h" -#include +#include +#include "evolution-config-control.h" -BonoboObject *e_shell_config_default_folders_create_control (EShell *shell); +GtkWidget *e_shell_config_default_folders_create_widget (EShell *shell, EvolutionConfigControl *config_control); #endif /* E_SHELL_CONFIG_DEFAULT_FOLDERS_H */ diff --git a/shell/e-shell-config-folder-settings.c b/shell/e-shell-config-folder-settings.c new file mode 100644 index 0000000000..25a3d1a3ff --- /dev/null +++ b/shell/e-shell-config-folder-settings.c @@ -0,0 +1,83 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-shell-config-folder-settings.c - Configuration page for folder settings. + * + * Copyright (C) 2002 Ximian, Inc. + * + * 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. + * + * 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. + * + * 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ettore Perazzoli + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include "e-shell-config-folder-settings.h" +#include "e-shell-config-offline.h" +#include "e-shell-config-autocompletion.h" +#include "e-shell-config-default-folders.h" + +#include "evolution-config-control.h" +#include "e-storage-set-view.h" + +#include "Evolution.h" + +#include +#include + +#include +#include +#include + + +static void +append_to_notebook (GtkWidget *notebook, char *label_str, + GtkWidget *child) +{ + GtkWidget *label; + + label = gtk_label_new (label_str); + + gtk_notebook_append_page (GTK_NOTEBOOK(notebook), child, label); + gtk_widget_show (label); + gtk_widget_show (child); +} + +BonoboObject * +e_shell_config_folder_settings_create_control (EShell *shell) +{ + GtkWidget *notebook; + EvolutionConfigControl *control; + + g_return_val_if_fail (E_IS_SHELL (shell), NULL); + + notebook = gtk_notebook_new (); + + control = evolution_config_control_new (notebook); + + append_to_notebook (notebook, _("Default Folders"), + e_shell_config_default_folders_create_widget (shell, control)); + + append_to_notebook (notebook, _("Offline Folders"), + e_shell_config_offline_create_widget (shell, control)); + + append_to_notebook (notebook, _("Autocompletion Folders"), + e_shell_config_autocompletion_create_widget (shell, control)); + + gtk_widget_show (notebook); + + return BONOBO_OBJECT (control); +} diff --git a/shell/e-shell-config-folder-settings.h b/shell/e-shell-config-folder-settings.h new file mode 100644 index 0000000000..9da0bc79be --- /dev/null +++ b/shell/e-shell-config-folder-settings.h @@ -0,0 +1,32 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-shell-config-folder-settings.h - Configuration page for folder settings. + * + * Copyright (C) 2002 Ximian, Inc. + * + * 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. + * + * 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. + * + * 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ettore Perazzoli + */ + +#ifndef E_SHELL_CONFIG_FOLDER_SETTINGS_H +#define E_SHELL_CONFIG_FOLDER_SETTINGS_H + +#include "e-shell.h" + +#include + +BonoboObject *e_shell_config_folder_settings_create_control (EShell *shell); + +#endif /* E_SHELL_CONFIG_FOLDER_SETTINGS_H */ diff --git a/shell/e-shell-config-offline.c b/shell/e-shell-config-offline.c index bc497fece6..79993365ea 100644 --- a/shell/e-shell-config-offline.c +++ b/shell/e-shell-config-offline.c @@ -169,8 +169,8 @@ storage_set_view_has_checkbox_func (EStorageSet *storage_set, return e_folder_get_can_sync_offline (folder); } -BonoboObject * -e_shell_config_offline_create_control (EShell *shell) +GtkWidget * +e_shell_config_offline_create_widget (EShell *shell, EvolutionConfigControl *control) { PageData *page_data; GtkWidget *scroll_frame; @@ -196,12 +196,12 @@ e_shell_config_offline_create_control (EShell *shell) gtk_container_add (GTK_CONTAINER (scroll_frame), page_data->storage_set_view); gtk_widget_show (scroll_frame); - page_data->config_control = evolution_config_control_new (scroll_frame); + page_data->config_control = control; gtk_signal_connect (GTK_OBJECT (page_data->config_control), "destroy", GTK_SIGNAL_FUNC (config_control_destroy_callback), page_data); gtk_signal_connect (GTK_OBJECT (page_data->config_control), "apply", GTK_SIGNAL_FUNC (config_control_apply_callback), page_data); - return BONOBO_OBJECT (page_data->config_control); + return scroll_frame; } diff --git a/shell/e-shell-config-offline.h b/shell/e-shell-config-offline.h index 8b7b0af222..fb1d9fb0fb 100644 --- a/shell/e-shell-config-offline.h +++ b/shell/e-shell-config-offline.h @@ -25,8 +25,9 @@ #include "e-shell.h" -#include +#include +#include "evolution-config-control.h" -BonoboObject *e_shell_config_offline_create_control (EShell *shell); +GtkWidget *e_shell_config_offline_create_widget (EShell *shell, EvolutionConfigControl *config_control); #endif /* E_SHELL_CONFIG_OFFLINE_H */ diff --git a/shell/e-shell-config.c b/shell/e-shell-config.c index 77f4804594..94fadeb5e8 100644 --- a/shell/e-shell-config.c +++ b/shell/e-shell-config.c @@ -24,8 +24,7 @@ #include "e-shell-config.h" -#include "e-shell-config-default-folders.h" -#include "e-shell-config-offline.h" +#include "e-shell-config-folder-settings.h" #include "evolution-config-control.h" #include "evolution-folder-selector-button.h" @@ -34,7 +33,7 @@ #define E_SHELL_CONFIG_FACTORY_OAFIID "OAFIID:GNOME_Evolution_Shell_Config_Factory" -#define E_SHELL_CONFIG_DEFAULT_FOLDERS_OAFIID "OAFIID:GNOME_Evolution_Shell_Config_DefaultFolders_Control" +#define E_SHELL_CONFIG_FOLDER_SETTINGS_OAFIID "OAFIID:GNOME_Evolution_Shell_Config_FolderSettings_Control" static BonoboObject * @@ -42,10 +41,12 @@ config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, gpointer shell) { - if (!strcmp (component_id, E_SHELL_CONFIG_DEFAULT_FOLDERS_OAFIID)) - return e_shell_config_default_folders_create_control (shell); - else - return e_shell_config_offline_create_control (shell); + if (!strcmp (component_id, E_SHELL_CONFIG_FOLDER_SETTINGS_OAFIID)) + return e_shell_config_folder_settings_create_control (shell); + else { + g_assert_not_reached(); + return NULL; + } } gboolean diff --git a/shell/glade/e-folder-list.glade b/shell/glade/e-folder-list.glade index 411a6da0ec..3d4ebbe98f 100644 --- a/shell/glade/e-folder-list.glade +++ b/shell/glade/e-folder-list.glade @@ -103,21 +103,12 @@ GTK_RELIEF_NORMAL - - GtkButton - button-edit - True - True - - GTK_RELIEF_NORMAL - - GtkButton button-remove True True - + GTK_RELIEF_NORMAL diff --git a/shell/glade/e-shell-config-default-folders.glade b/shell/glade/e-shell-config-default-folders.glade index 0730fec1ca..13e58ff437 100644 --- a/shell/glade/e-shell-config-default-folders.glade +++ b/shell/glade/e-shell-config-default-folders.glade @@ -25,229 +25,209 @@ False - GtkVBox - default_folders_vbox + GtkTable + default_folders_table + 4 + 4 + 2 False - 0 + 4 + 4 - GtkFrame - default_folder_frame - - 0 - GTK_SHADOW_ETCHED_IN + GtkLabel + label1 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 - 0 - True - True + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + - - GtkTable - table1 - 4 - 4 - 2 - False - 4 - 4 - - - GtkLabel - label1 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label4 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - False - - + + GtkLabel + label4 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + - - GtkLabel - label3 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - + + GtkLabel + label3 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + - - GtkLabel - label2 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - + + GtkLabel + label2 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + - - Custom - default_mail_button - e_shell_config_default_folder_selector_button_new - 0 - 0 - Wed, 10 Apr 2002 17:54:56 GMT - - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - True - - + + Custom + default_mail_button + e_shell_config_default_folder_selector_button_new + 0 + 0 + Wed, 10 Apr 2002 17:54:56 GMT + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + - - Custom - default_contacts_button - e_shell_config_default_folder_selector_button_new - 0 - 0 - Wed, 10 Apr 2002 17:55:01 GMT - - 1 - 2 - 1 - 2 - 0 - 0 - False - False - False - False - True - True - - + + Custom + default_contacts_button + e_shell_config_default_folder_selector_button_new + 0 + 0 + Wed, 10 Apr 2002 17:55:01 GMT + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + - - Custom - default_calendar_button - e_shell_config_default_folder_selector_button_new - 0 - 0 - Wed, 10 Apr 2002 17:55:06 GMT - - 1 - 2 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - - + + Custom + default_calendar_button + e_shell_config_default_folder_selector_button_new + 0 + 0 + Wed, 10 Apr 2002 17:55:06 GMT + + 1 + 2 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + - - Custom - default_tasks_button - e_shell_config_default_folder_selector_button_new - 0 - 0 - Wed, 10 Apr 2002 17:55:12 GMT - - 1 - 2 - 3 - 4 - 0 - 0 - False - False - False - False - True - True - - - + + Custom + default_tasks_button + e_shell_config_default_folder_selector_button_new + 0 + 0 + Wed, 10 Apr 2002 17:55:12 GMT + + 1 + 2 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + -- cgit v1.2.3