aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-01-11 03:42:20 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-01-11 03:42:20 +0800
commit4a8c1c7323bbde12c2213228f272cdaf5f5039ab (patch)
tree3da90373bdf525b624c7a232e8947327e6932e88
parent794ff9b52787ef07f2750481c3f4934bd07c5dd1 (diff)
downloadgsoc2013-evolution-4a8c1c7323bbde12c2213228f272cdaf5f5039ab.tar.gz
gsoc2013-evolution-4a8c1c7323bbde12c2213228f272cdaf5f5039ab.tar.zst
gsoc2013-evolution-4a8c1c7323bbde12c2213228f272cdaf5f5039ab.zip
Updated for function rename.
2003-01-10 Jeffrey Stedfast <fejj@ximian.com> * component-factory.c (factory): Updated for function rename. * mail-config-factory.c (mail_config_control_factory_cb): Namespaced the function name. * folder-browser-ui.c (folder_browser_ui_add_global): Don't add the listener for show_preview here, it was moved into folder-browser.c so we could detach the listener when the folder-browser is destroyed. Also prevents a listener being added multiple times (which was possible? before). * folder-browser.c (folder_browser_destroy): Remove the gconf notify handler for show_preview. (show_preview_changed): Moved here from folder-browser-ui.c svn path=/trunk/; revision=19408
-rw-r--r--mail/ChangeLog15
-rw-r--r--mail/Makefile.am3
-rw-r--r--mail/component-factory.c20
-rw-r--r--mail/folder-browser-ui.c20
-rw-r--r--mail/folder-browser.c45
-rw-r--r--mail/folder-browser.h6
-rw-r--r--mail/mail-config-druid.c7
-rw-r--r--mail/mail-config-druid.h11
-rw-r--r--mail/mail-config-factory.c4
-rw-r--r--mail/mail-config-factory.h3
10 files changed, 81 insertions, 53 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index a3cc4760bf..1e0a3f46dd 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,20 @@
2003-01-10 Jeffrey Stedfast <fejj@ximian.com>
+ * component-factory.c (factory): Updated for function rename.
+
+ * mail-config-factory.c (mail_config_control_factory_cb):
+ Namespaced the function name.
+
+ * folder-browser-ui.c (folder_browser_ui_add_global): Don't add
+ the listener for show_preview here, it was moved into
+ folder-browser.c so we could detach the listener when the
+ folder-browser is destroyed. Also prevents a listener being added
+ multiple times (which was possible? before).
+
+ * folder-browser.c (folder_browser_destroy): Remove the gconf
+ notify handler for show_preview.
+ (show_preview_changed): Moved here from folder-browser-ui.c
+
* component-factory.c (storage_remove_folder): Fixed a situation
in which we could notify the shell listener twice.
diff --git a/mail/Makefile.am b/mail/Makefile.am
index dbdb944a0c..d37da97ff9 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -181,6 +181,9 @@ glade_DATA = mail-config.glade local-config.glade subscribe-dialog.glade message
etspecdir = $(datadir)/evolution/etspec/
etspec_DATA = mail-accounts.etspec message-list.etspec subscribe-dialog.etspec
+schemadir = $(GCONF_SCHEMA_FILE_DIR)
+schema_DATA = evolution-mail.schemas
+
iconsdir = $(datadir)/evolution/images
buttonsdir = $(datadir)/evolution/images/buttons
diff --git a/mail/component-factory.c b/mail/component-factory.c
index dfc1e97f17..b78465c6a5 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -20,19 +20,23 @@
* Boston, MA 02111-1307, USA.
*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
+#include <signal.h>
#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
+#include <camel/camel.h>
+
#include <bonobo/bonobo-generic-factory.h>
-#include <gal/widgets/e-gui-utils.h>
+#include <bonobo/bonobo-shlib-factory.h>
-#include "camel.h"
+#include <gal/widgets/e-gui-utils.h>
#include "Evolution.h"
#include "evolution-storage.h"
@@ -46,6 +50,8 @@
#include "mail.h"
#include "mail-config.h"
#include "mail-config-factory.h"
+#include "mail-preferences.h"
+#include "mail-composer-prefs.h"
#include "mail-tools.h"
#include "mail-ops.h"
#include "mail-offline-handler.h"
@@ -1593,14 +1599,6 @@ mail_storages_foreach (GHFunc func, gpointer data)
}
-
-#include <signal.h>
-
-#include <bonobo/bonobo-shlib-factory.h>
-#include "folder-info.h"
-#include "mail-preferences.h"
-#include "mail-composer-prefs.h"
-
#define FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ControlFactory"
#define MAIL_CONFIG_IID "OAFIID:GNOME_Evolution_MailConfig"
@@ -1630,7 +1628,7 @@ factory (BonoboGenericFactory *factory,
|| strcmp (component_id, MAIL_PREFERENCES_CONTROL_ID) == 0
|| strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID) == 0
|| strcmp (component_id, MAIL_FONT_PREFS_CONTROL_ID) == 0)
- return config_control_factory_cb(factory, component_id, evolution_shell_client_corba_objref (global_shell_client));
+ return mail_config_control_factory_cb (factory, component_id, evolution_shell_client_corba_objref (global_shell_client));
g_warning (FACTORY_ID ": Don't know what to do with %s", component_id);
return NULL;
diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c
index 295991bd04..22f305df25 100644
--- a/mail/folder-browser-ui.c
+++ b/mail/folder-browser-ui.c
@@ -602,17 +602,6 @@ folder_browser_ui_rm_list (FolderBrowser *fb)
folder_browser_ui_discard_view_menus (fb);
}
-static void
-show_preview_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
-{
- FolderBrowser *fb = user_data;
- gboolean show_preview;
-
- show_preview = gconf_client_get_bool (client, "/apps/evolution/mail/display/show_preview", NULL);
- bonobo_ui_component_set_prop (fb->uicomp, "/commands/ViewPreview", "state", show_preview ? "1" : "0", NULL);
- folder_browser_set_message_preview (fb, show_preview);
-}
-
void
folder_browser_ui_add_global (FolderBrowser *fb)
{
@@ -630,15 +619,6 @@ folder_browser_ui_add_global (FolderBrowser *fb)
gconf = gconf_client_get_default ();
/* (Pre)view toggle */
-
- /* watch the show_preview setting */
- gconf_client_add_dir (gconf, "/apps/evolution/mail/display/show_preview",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
- /* listen for changed events to the show_preview setting */
- gconf_client_notify_add (gconf, "/apps/evolution/mail/display/show_preview",
- show_preview_changed, fb, NULL, NULL);
-
show_preview = gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_preview", NULL);
bonobo_ui_component_set_prop (uic, "/commands/ViewPreview", "state", show_preview ? "1" : "0", NULL);
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 96e202e4b2..2bc5bc12f3 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -160,11 +160,14 @@ folder_browser_destroy (GtkObject *object)
{
FolderBrowser *folder_browser;
CORBA_Environment ev;
+ GConfClient *gconf;
folder_browser = FOLDER_BROWSER (object);
-
+
+ gconf = gconf_client_get_default ();
+
CORBA_exception_init (&ev);
-
+
if (folder_browser->seen_id != 0) {
gtk_timeout_remove (folder_browser->seen_id);
folder_browser->seen_id = 0;
@@ -194,12 +197,17 @@ folder_browser_destroy (GtkObject *object)
g_object_unref (folder_browser->view_menus);
folder_browser->view_menus = NULL;
}
-
+
if (folder_browser->paned_size_notify_id != 0) {
- gconf_client_notify_remove(gconf_client_get_default (), folder_browser->paned_size_notify_id);
+ gconf_client_notify_remove (gconf, folder_browser->paned_size_notify_id);
folder_browser->paned_size_notify_id = 0;
}
+ if (folder_browser->show_preview_notify_id != 0) {
+ gconf_client_notify_remove (gconf, folder_browser->show_preview_notify_id);
+ folder_browser->show_preview_notify_id = 0;
+ }
+
/* wait for all outstanding async events against us */
mail_async_event_destroy (folder_browser->async_event);
@@ -2339,12 +2347,23 @@ paned_size_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpoin
FolderBrowser *fb = user_data;
int paned_size;
- g_signal_handler_block (fb->message_list, fb->resize_id);
+ g_signal_handler_block (fb->message_list, fb->paned_resize_id);
paned_size = gconf_client_get_int (client, "/apps/evolution/mail/display/paned_size", NULL);
e_paned_set_position (E_PANED (fb->vpaned), paned_size);
- g_signal_handler_unblock (fb->message_list, fb->resize_id);
+ g_signal_handler_unblock (fb->message_list, fb->paned_resize_id);
+}
+
+static void
+show_preview_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+{
+ FolderBrowser *fb = user_data;
+ gboolean show_preview;
+
+ show_preview = gconf_client_get_bool (client, "/apps/evolution/mail/display/show_preview", NULL);
+ bonobo_ui_component_set_prop (fb->uicomp, "/commands/ViewPreview", "state", show_preview ? "1" : "0", NULL);
+ folder_browser_set_message_preview (fb, show_preview);
}
static void
@@ -2398,12 +2417,12 @@ folder_browser_gui_init (FolderBrowser *fb)
e_paned_add1 (E_PANED (fb->vpaned), GTK_WIDGET (fb->message_list));
gtk_widget_show (GTK_WIDGET (fb->message_list));
- fb->resize_id = g_signal_connect (fb->message_list, "size_allocate",
- G_CALLBACK (fb_resize_cb), fb);
+ fb->paned_resize_id = g_signal_connect (fb->message_list, "size_allocate",
+ G_CALLBACK (fb_resize_cb), fb);
gconf = gconf_client_get_default ();
- /* listen for updates */
+ /* paned size */
gconf_client_add_dir (gconf, "/apps/evolution/mail/display/paned_size",
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
@@ -2412,6 +2431,14 @@ folder_browser_gui_init (FolderBrowser *fb)
paned_size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
+ /* show preview-pane */
+ gconf_client_add_dir (gconf, "/apps/evolution/mail/display/show_preview",
+ GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
+ /* listen for changed events to the show_preview setting */
+ fb->show_preview_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display/show_preview",
+ show_preview_changed, fb, NULL, NULL);
+
e_paned_add2 (E_PANED (fb->vpaned), GTK_WIDGET (fb->mail_display));
e_paned_set_position (E_PANED (fb->vpaned), paned_size);
gtk_widget_show (GTK_WIDGET (fb->mail_display));
diff --git a/mail/folder-browser.h b/mail/folder-browser.h
index f50a1230de..4758937c90 100644
--- a/mail/folder-browser.h
+++ b/mail/folder-browser.h
@@ -59,9 +59,11 @@ struct _FolderBrowser {
guint loading_id;
guint seen_id;
- gulong resize_id;
+ gulong paned_resize_id;
guint paned_size_notify_id;
-
+
+ guint show_preview_notify_id;
+
/* a folder we are expunging, dont use other than to compare the pointer value */
CamelFolder *expunging;
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index c642bbe8f4..3ca9d05839 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -23,6 +23,7 @@
*
*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -45,12 +46,6 @@
#include "mail.h"
#include "mail-session.h"
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-widget.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-context.h>
-
#include <evolution-wizard.h>
static void mail_config_druid_class_init (MailConfigDruidClass *class);
diff --git a/mail/mail-config-druid.h b/mail/mail-config-druid.h
index a74073ae8c..f7bc37a2d9 100644
--- a/mail/mail-config-druid.h
+++ b/mail/mail-config-druid.h
@@ -28,11 +28,15 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
+#include <camel.h>
+#include <glade/glade.h>
#include <libgnomeui/gnome-druid.h>
#include <libgnomeui/gnome-file-entry.h>
-#include <glade/glade.h>
-#include <camel.h>
#include <bonobo/bonobo-listener.h>
+#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-widget.h>
+#include <bonobo/bonobo-generic-factory.h>
+#include <bonobo/bonobo-context.h>
#include "shell/Evolution.h"
#include "mail-account-gui.h"
@@ -82,6 +86,9 @@ char *mail_config_druid_get_transport_url (MailConfigDruid *druid);
gboolean mail_config_druid_get_save_transport_password (MailConfigDruid *druid);
gboolean mail_config_druid_get_transport_requires_auth (MailConfigDruid *druid);
+
+BonoboObject *evolution_mail_config_wizard_new (void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/mail/mail-config-factory.c b/mail/mail-config-factory.c
index c16f70c3ee..8780973535 100644
--- a/mail/mail-config-factory.c
+++ b/mail/mail-config-factory.c
@@ -33,8 +33,6 @@
#include "mail-config-factory.h"
-#include <bonobo/bonobo-generic-factory.h>
-
#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ConfigControlFactory"
static BonoboGenericFactory *factory = NULL;
@@ -63,7 +61,7 @@ config_control_apply_cb (EvolutionConfigControl *config_control, void *user_data
}
BonoboObject *
-config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data)
+mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data)
{
GNOME_Evolution_Shell shell = (GNOME_Evolution_Shell) user_data;
EvolutionConfigControl *control;
diff --git a/mail/mail-config-factory.h b/mail/mail-config-factory.h
index 09e6d72611..1a8993aacd 100644
--- a/mail/mail-config-factory.h
+++ b/mail/mail-config-factory.h
@@ -29,12 +29,15 @@ extern "C" {
#pragma }
#endif
+#include <bonobo/bonobo-generic-factory.h>
#include "evolution-config-control.h"
#include <shell/Evolution.h>
gboolean mail_config_register_factory (GNOME_Evolution_Shell shell);
+BonoboObject *mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data);
+
#ifdef __cplusplus
}
#endif