diff options
author | Chris Toshok <toshok@ximian.com> | 2002-05-24 20:36:56 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-05-24 20:36:56 +0800 |
commit | 9529bae97d33cf727914fdbff77decc8da97cc33 (patch) | |
tree | 2575d4907e7c03cd31569b03be67381966784867 | |
parent | 5009d8d479665301efdec3beb784e252fa29527d (diff) | |
download | gsoc2013-evolution-9529bae97d33cf727914fdbff77decc8da97cc33.tar gsoc2013-evolution-9529bae97d33cf727914fdbff77decc8da97cc33.tar.gz gsoc2013-evolution-9529bae97d33cf727914fdbff77decc8da97cc33.tar.bz2 gsoc2013-evolution-9529bae97d33cf727914fdbff77decc8da97cc33.tar.lz gsoc2013-evolution-9529bae97d33cf727914fdbff77decc8da97cc33.tar.xz gsoc2013-evolution-9529bae97d33cf727914fdbff77decc8da97cc33.tar.zst gsoc2013-evolution-9529bae97d33cf727914fdbff77decc8da97cc33.zip |
[ fixes 90% of #25047 ] shamelessly lifted from
2002-05-24 Chris Toshok <toshok@ximian.com>
[ 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
-rw-r--r-- | shell/ChangeLog | 62 | ||||
-rw-r--r-- | shell/GNOME_Evolution_Shell.oaf.in | 35 | ||||
-rw-r--r-- | shell/Makefile.am | 4 | ||||
-rw-r--r-- | shell/e-folder-list.c | 126 | ||||
-rw-r--r-- | shell/e-shell-config-autocompletion.c | 127 | ||||
-rw-r--r-- | shell/e-shell-config-autocompletion.h | 34 | ||||
-rw-r--r-- | shell/e-shell-config-default-folders.c | 12 | ||||
-rw-r--r-- | shell/e-shell-config-default-folders.h | 5 | ||||
-rw-r--r-- | shell/e-shell-config-folder-settings.c | 83 | ||||
-rw-r--r-- | shell/e-shell-config-folder-settings.h | 32 | ||||
-rw-r--r-- | shell/e-shell-config-offline.c | 8 | ||||
-rw-r--r-- | shell/e-shell-config-offline.h | 5 | ||||
-rw-r--r-- | shell/e-shell-config.c | 15 | ||||
-rw-r--r-- | shell/glade/e-folder-list.glade | 11 | ||||
-rw-r--r-- | shell/glade/e-shell-config-default-folders.glade | 402 |
15 files changed, 653 insertions, 308 deletions
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 <toshok@ximian.com> + + [ 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 <ettore@ximian.com> * 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 @@ </oaf_attribute> </oaf_server> - <oaf_server iid="OAFIID:GNOME_Evolution_Shell_Config_DefaultFolders_Control" + <oaf_server iid="OAFIID:GNOME_Evolution_Shell_Config_FolderSettings_Control" type="factory" location="OAFIID:GNOME_Evolution_Shell_Config_Factory"> @@ -30,10 +30,10 @@ </oaf_attribute> <oaf_attribute name="evolution:config_item:title" type="string" - _value="Default Folders"/> + _value="Folder Settings"/> <oaf_attribute name="evolution:config_item:description" type="string" - _value="This page can be used to configure default folders"/> + _value="This page can be used to configure various folder settings"/> <oaf_attribute name="evolution:config_item:icon_name" type="string" value="folder-settings.png"/> @@ -45,34 +45,7 @@ </oaf_attribute> <oaf_attribute name="description" type="string" - _value="Configuration control for Evolution default folders."/> - </oaf_server> - - <oaf_server iid="OAFIID:GNOME_Evolution_Shell_Config_OfflineFolders_Control" - type="factory" - location="OAFIID:GNOME_Evolution_Shell_Config_Factory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/ConfigControl:1.0"/> - </oaf_attribute> - - <oaf_attribute name="evolution:config_item:title" type="string" - _value="Offline Folders"/> - - <oaf_attribute name="evolution:config_item:description" type="string" - _value="This page can be used to configure synchronization of folders for offline usage"/> - - <oaf_attribute name="evolution:config_item:icon_name" type="string" - value="folder-settings.png"/> - - <oaf_attribute name="evolution:config_item:priority" type="string" value="-9"/> - - <oaf_attribute name="evolution:config_item:type" type="stringv"> - <item value="shell"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Configuration control for Evolution's offline folders."/> + _value="Configuration control for Evolution folder settings."/> </oaf_server> </oaf_info> 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 <libgnomeui/gnome-canvas-rect-ellipse.h> #include "e-folder-list.h" #include <gal/e-table/e-table-memory-store.h> +#include <gal/widgets/e-unicode.h> #include <gal/widgets/e-gui-utils.h> #include <gal/widgets/e-option-menu.h> #include <libgnome/gnome-i18n.h> @@ -32,6 +33,7 @@ #include <gnome-xml/xmlmemory.h> #include <gal/util/e-xml-utils.h> #include <glade/glade.h> +#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\"" \ ">" \ " <ETableColumn model_col=\"0\"" \ + " expansion=\"0.0\"" \ + " cell=\"pixbuf\"" \ + " minimum_width=\"18\"" \ + " resizable=\"false\"" \ + " _title=\"icon\"" \ + " compare=\"string\"" \ + " search=\"string\"/>" \ + " <ETableColumn model_col=\"1\"" \ " expansion=\"1.0\"" \ " cell=\"string\"" \ " minimum_width=\"32\"" \ @@ -198,14 +263,16 @@ e_folder_list_class_init (EFolderListClass *klass) " search=\"string\"/>" \ " <ETableState>" \ " <column source=\"0\"/>" \ + " <column source=\"1\"/>" \ " <grouping>" \ - " <leaf column=\"0\" ascending=\"true\"/>" \ " </grouping>" \ " </ETableState>" \ "</ETableSpecification>" 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); } } @@ -287,33 +361,6 @@ remove_clicked (GtkButton *button, EFolderList *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) { gtk_signal_emit (GTK_OBJECT (efl), signals[OPTION_MENU_CHANGED], value); @@ -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 <clahey@ximian.com> + * Chris Toshok <toshok@ximian.com> + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + + +#include "e-shell-config-autocompletion.h" + +#include "e-folder-list.h" + +#include "Evolution.h" + +#include <bonobo-conf/Bonobo_Config.h> +#include <bonobo/bonobo-exception.h> + +#include <libgnome/gnome-i18n.h> +#include <gtk/gtkwidget.h> + + +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 <clahey@ximian.com> + * Chris Toshok <toshok@ximian.com> + */ + +#ifndef E_SHELL_CONFIG_AUTOCOMPLETION_H +#define E_SHELL_CONFIG_AUTOCOMPLETION_H + +#include "e-shell.h" + +#include <gtk/gtkwidget.h> +#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 <glade/glade-xml.h> @@ -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 <bonobo/bonobo-object.h> +#include <gtk/gtkwidget.h> +#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 <ettore@ximian.com> + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#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 <bonobo-conf/Bonobo_Config.h> +#include <bonobo/bonobo-exception.h> + +#include <libgnome/gnome-i18n.h> +#include <gtk/gtknotebook.h> +#include <gtk/gtklabel.h> + + +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 <ettore@ximian.com> + */ + +#ifndef E_SHELL_CONFIG_FOLDER_SETTINGS_H +#define E_SHELL_CONFIG_FOLDER_SETTINGS_H + +#include "e-shell.h" + +#include <bonobo/bonobo-object.h> + +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 <bonobo/bonobo-object.h> +#include <gtk/gtkwidget.h> +#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 @@ -105,19 +105,10 @@ <widget> <class>GtkButton</class> - <name>button-edit</name> - <can_default>True</can_default> - <can_focus>True</can_focus> - <label>_Edit</label> - <relief>GTK_RELIEF_NORMAL</relief> - </widget> - - <widget> - <class>GtkButton</class> <name>button-remove</name> <can_default>True</can_default> <can_focus>True</can_focus> - <label>_Remove</label> + <label>_Delete</label> <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget> 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 @@ <auto_shrink>False</auto_shrink> <widget> - <class>GtkVBox</class> - <name>default_folders_vbox</name> + <class>GtkTable</class> + <name>default_folders_table</name> + <border_width>4</border_width> + <rows>4</rows> + <columns>2</columns> <homogeneous>False</homogeneous> - <spacing>0</spacing> + <row_spacing>4</row_spacing> + <column_spacing>4</column_spacing> <widget> - <class>GtkFrame</class> - <name>default_folder_frame</name> - <label>Default Folders</label> - <label_xalign>0</label_xalign> - <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> + <class>GtkLabel</class> + <name>label1</name> + <label>_Mail:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> </child> + </widget> - <widget> - <class>GtkTable</class> - <name>table1</name> - <border_width>4</border_width> - <rows>4</rows> - <columns>2</columns> - <homogeneous>False</homogeneous> - <row_spacing>4</row_spacing> - <column_spacing>4</column_spacing> - - <widget> - <class>GtkLabel</class> - <name>label1</name> - <label>_Mail:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> - <class>GtkLabel</class> - <name>label4</name> - <label>_Tasks:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>3</top_attach> - <bottom_attach>4</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> + <widget> + <class>GtkLabel</class> + <name>label4</name> + <label>_Tasks:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> - <widget> - <class>GtkLabel</class> - <name>label3</name> - <label>_Contacts:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> + <widget> + <class>GtkLabel</class> + <name>label3</name> + <label>_Contacts:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> - <widget> - <class>GtkLabel</class> - <name>label2</name> - <label>C_alendar:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <child> - <left_attach>0</left_attach> - <right_attach>1</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> + <widget> + <class>GtkLabel</class> + <name>label2</name> + <label>C_alendar:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> - <widget> - <class>Custom</class> - <name>default_mail_button</name> - <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> - <int1>0</int1> - <int2>0</int2> - <last_modification_time>Wed, 10 Apr 2002 17:54:56 GMT</last_modification_time> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>True</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>True</yfill> - </child> - </widget> + <widget> + <class>Custom</class> + <name>default_mail_button</name> + <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Wed, 10 Apr 2002 17:54:56 GMT</last_modification_time> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> - <widget> - <class>Custom</class> - <name>default_contacts_button</name> - <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> - <int1>0</int1> - <int2>0</int2> - <last_modification_time>Wed, 10 Apr 2002 17:55:01 GMT</last_modification_time> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>True</yfill> - </child> - </widget> + <widget> + <class>Custom</class> + <name>default_contacts_button</name> + <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Wed, 10 Apr 2002 17:55:01 GMT</last_modification_time> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> - <widget> - <class>Custom</class> - <name>default_calendar_button</name> - <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> - <int1>0</int1> - <int2>0</int2> - <last_modification_time>Wed, 10 Apr 2002 17:55:06 GMT</last_modification_time> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>2</top_attach> - <bottom_attach>3</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>True</yfill> - </child> - </widget> + <widget> + <class>Custom</class> + <name>default_calendar_button</name> + <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Wed, 10 Apr 2002 17:55:06 GMT</last_modification_time> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> - <widget> - <class>Custom</class> - <name>default_tasks_button</name> - <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> - <int1>0</int1> - <int2>0</int2> - <last_modification_time>Wed, 10 Apr 2002 17:55:12 GMT</last_modification_time> - <child> - <left_attach>1</left_attach> - <right_attach>2</right_attach> - <top_attach>3</top_attach> - <bottom_attach>4</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>True</yfill> - </child> - </widget> - </widget> + <widget> + <class>Custom</class> + <name>default_tasks_button</name> + <creation_function>e_shell_config_default_folder_selector_button_new</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Wed, 10 Apr 2002 17:55:12 GMT</last_modification_time> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>3</top_attach> + <bottom_attach>4</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> </widget> </widget> </widget> |