aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2002-03-19 21:25:33 +0800
committerIain Holmes <iain@src.gnome.org>2002-03-19 21:25:33 +0800
commit84e13e55846950db7a5ab1debebdf9e3fd977343 (patch)
tree70929a45e6c411730f4c2c40a0432e398768966b
parent02b379173a834e87d0db9ba141e725f26c1ed1cb (diff)
downloadgsoc2013-evolution-84e13e55846950db7a5ab1debebdf9e3fd977343.tar
gsoc2013-evolution-84e13e55846950db7a5ab1debebdf9e3fd977343.tar.gz
gsoc2013-evolution-84e13e55846950db7a5ab1debebdf9e3fd977343.tar.bz2
gsoc2013-evolution-84e13e55846950db7a5ab1debebdf9e3fd977343.tar.lz
gsoc2013-evolution-84e13e55846950db7a5ab1debebdf9e3fd977343.tar.xz
gsoc2013-evolution-84e13e55846950db7a5ab1debebdf9e3fd977343.tar.zst
gsoc2013-evolution-84e13e55846950db7a5ab1debebdf9e3fd977343.zip
Move the preferences from a per-view setting to a global setting
svn path=/trunk/; revision=16205
-rw-r--r--my-evolution/ChangeLog22
-rw-r--r--my-evolution/component-factory.c8
-rw-r--r--my-evolution/e-summary-factory.c5
-rw-r--r--my-evolution/e-summary-factory.h4
-rw-r--r--my-evolution/e-summary-mail.c3
-rw-r--r--my-evolution/e-summary-preferences.c36
-rw-r--r--my-evolution/e-summary-preferences.h2
-rw-r--r--my-evolution/e-summary.c9
-rw-r--r--my-evolution/e-summary.h5
9 files changed, 58 insertions, 36 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index b646f0e252..f53ea9b3da 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,3 +1,25 @@
+2002-03-19 Iain Holmes <iain@ximian.com>
+
+ * component-factory.c: Create a global_preferences structure.
+ (create_view): Pass in the global_preferences to the view.
+ (create_component): Initialise the preferences.
+
+ * e-summary-factory.[ch] (e_summary_factory_new_control): Take a prefs
+ structure and pass it to the view creation.
+
+ * e-summary-mail: Remove some debug spew.
+
+ * e-summary-preferences.[ch]: Create a global_preferences structure.
+ (e_summary_preferences_init): just return the prefs instead of adding
+ a pointer to it.
+ (config_control_destroy_cb): Remove the old_prefs stuff.
+ (factory_fn): Ditto.
+
+ * e-summary.[ch] (e_summary_init): Don't initialise the preferences
+ here.
+ (e_summary_new): Take a preferences structure and keep a pointer to
+ it.
+
2002-03-15 Iain Holmes <iain@ximian.com>
* Makefile.am: Add the e-summary-shown.[ch] files.
diff --git a/my-evolution/component-factory.c b/my-evolution/component-factory.c
index d194e061dc..2059df50ee 100644
--- a/my-evolution/component-factory.c
+++ b/my-evolution/component-factory.c
@@ -33,12 +33,14 @@
#include "e-summary-factory.h"
#include "e-summary-offline-handler.h"
+#include "e-summary.h"
#include "component-factory.h"
#include <gal/widgets/e-gui-utils.h>
#define COMPONENT_ID "OAFIID:GNOME_Evolution_Summary_ShellComponent"
static gint running_objects = 0;
+static ESummaryPrefs *global_preferences = NULL;
static const EvolutionShellComponentFolderType folder_types[] = {
{ "summary", "evolution-today.png", N_("Summary"), N_("Folder containing the Evolution Summary"), FALSE, NULL, NULL },
@@ -70,7 +72,7 @@ create_view (EvolutionShellComponent *shell,
shell_client = evolution_shell_component_get_owner (shell);
corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
control = e_summary_factory_new_control (physical_uri, corba_shell,
- offline_handler);
+ offline_handler, global_preferences);
if (!control)
return EVOLUTION_SHELL_COMPONENT_NOTFOUND;
@@ -118,6 +120,10 @@ create_component (void)
running_objects++;
+ if (global_preferences == NULL) {
+ global_preferences = e_summary_preferences_init ();
+ }
+
shell_component = evolution_shell_component_new (folder_types,
NULL,
create_view,
diff --git a/my-evolution/e-summary-factory.c b/my-evolution/e-summary-factory.c
index cdf813aaf7..bda75452ab 100644
--- a/my-evolution/e-summary-factory.c
+++ b/my-evolution/e-summary-factory.c
@@ -126,12 +126,13 @@ control_destroy_cb (BonoboControl *control,
BonoboControl *
e_summary_factory_new_control (const char *uri,
const GNOME_Evolution_Shell shell,
- ESummaryOfflineHandler *handler)
+ ESummaryOfflineHandler *handler,
+ ESummaryPrefs *global_preferences)
{
BonoboControl *control;
GtkWidget *summary;
- summary = e_summary_new (shell);
+ summary = e_summary_new (shell, global_preferences);
if (summary == NULL) {
return NULL;
}
diff --git a/my-evolution/e-summary-factory.h b/my-evolution/e-summary-factory.h
index 9d413979fe..f159d55f0d 100644
--- a/my-evolution/e-summary-factory.h
+++ b/my-evolution/e-summary-factory.h
@@ -24,9 +24,11 @@
#define __E_SUMMARY_FACTORY_H__
#include "e-summary-offline-handler.h"
+#include "e-summary.h"
BonoboControl *e_summary_factory_new_control (const char *uri,
const GNOME_Evolution_Shell shell,
- ESummaryOfflineHandler *handler);
+ ESummaryOfflineHandler *handler,
+ ESummaryPrefs *preferences);
#endif
diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c
index 3d5c378c6f..aff5061cc8 100644
--- a/my-evolution/e-summary-mail.c
+++ b/my-evolution/e-summary-mail.c
@@ -201,14 +201,11 @@ new_folder_cb (EvolutionStorageListener *listener,
GList *p;
/* Don't care about non mail */
- g_print ("Folder->physicalUri: %s...", folder->physicalUri);
if (strcmp (folder->type, "mail") != 0 ||
(strncmp (folder->physicalUri, "file://", 7) != 0 &&
strncmp (folder->physicalUri, "vfolder", 7) != 0)) {
- g_print ("rejected\n");
return;
}
- g_print ("accepted\n");
mail = summary->mail;
mail_folder = g_new (ESummaryMailFolder, 1);
diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c
index 9b8f63dfa0..bf3e4159e6 100644
--- a/my-evolution/e-summary-preferences.c
+++ b/my-evolution/e-summary-preferences.c
@@ -49,9 +49,9 @@
#include "evolution-config-control.h"
-
#define FACTORY_ID "OAFIID:GNOME_Evolution_Summary_ConfigControlFactory"
+static ESummaryPrefs *global_preferences = NULL;
static void
make_initial_mail_list (ESummaryPrefs *prefs)
@@ -363,22 +363,22 @@ e_summary_preferences_copy (ESummaryPrefs *prefs)
return prefs_copy;
}
-void
-e_summary_preferences_init (ESummary *summary)
+ESummaryPrefs *
+e_summary_preferences_init (void)
{
ESummaryPrefs *prefs;
- g_return_if_fail (summary != NULL);
- g_return_if_fail (IS_E_SUMMARY (summary));
-
- summary->preferences = g_new0 (ESummaryPrefs, 1);
- summary->old_prefs = NULL;
-
- if (e_summary_preferences_restore (summary->preferences) == TRUE) {
- return;
+ if (global_preferences != NULL) {
+ return global_preferences;
+ }
+
+ prefs = g_new0 (ESummaryPrefs, 1);
+ global_preferences = prefs;
+
+ if (e_summary_preferences_restore (prefs) == TRUE) {
+ return prefs;
}
- prefs = summary->preferences;
/* Defaults */
/* Mail */
@@ -396,6 +396,8 @@ e_summary_preferences_init (ESummary *summary)
prefs->days = E_SUMMARY_CALENDAR_ONE_DAY;
prefs->show_tasks = E_SUMMARY_CALENDAR_ALL_TASKS;
+
+ return prefs;
}
struct _MailPage {
@@ -1204,11 +1206,6 @@ config_control_destroy_cb (EvolutionConfigControl *config_control,
pd = (PropertyData *) data;
- if (pd->summary->old_prefs != NULL) {
- e_summary_preferences_free (pd->summary->old_prefs);
- pd->summary->old_prefs = NULL;
- }
-
e_summary_preferences_save (pd->summary->preferences);
free_property_dialog (pd);
}
@@ -1228,11 +1225,6 @@ factory_fn (BonoboGenericFactory *generic_factory,
gtk_object_ref (GTK_OBJECT (summary));
pd->summary = summary;
- if (summary->old_prefs != NULL)
- e_summary_preferences_free (summary->old_prefs);
-
- summary->old_prefs = e_summary_preferences_copy (summary->preferences);
-
pd->xml = glade_xml_new (EVOLUTION_GLADEDIR "/my-evolution.glade", NULL);
g_return_val_if_fail (pd->xml != NULL, NULL);
diff --git a/my-evolution/e-summary-preferences.h b/my-evolution/e-summary-preferences.h
index fe226995a9..df5e28ac30 100644
--- a/my-evolution/e-summary-preferences.h
+++ b/my-evolution/e-summary-preferences.h
@@ -30,7 +30,7 @@ gboolean e_summary_preferences_restore (ESummaryPrefs *prefs);
void e_summary_preferences_save (ESummaryPrefs *prefs);
void e_summary_preferences_free (ESummaryPrefs *prefs);
ESummaryPrefs *e_summary_preferences_copy (ESummaryPrefs *prefs);
-void e_summary_preferences_init (ESummary *summary);
+ESummaryPrefs *e_summary_preferences_init (void);
gboolean e_summary_preferences_register_config_control_factory (ESummary *summary);
diff --git a/my-evolution/e-summary.c b/my-evolution/e-summary.c
index 2b85958f74..f5945aeda2 100644
--- a/my-evolution/e-summary.c
+++ b/my-evolution/e-summary.c
@@ -494,8 +494,6 @@ e_summary_init (ESummary *summary)
priv->protocol_hash = NULL;
priv->connections = NULL;
- e_summary_preferences_init (summary);
-
CORBA_exception_init (&ev);
db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
@@ -529,13 +527,16 @@ E_MAKE_TYPE (e_summary, "ESummary", ESummary, e_summary_class_init,
e_summary_init, PARENT_TYPE);
GtkWidget *
-e_summary_new (const GNOME_Evolution_Shell shell)
+e_summary_new (const GNOME_Evolution_Shell shell,
+ ESummaryPrefs *prefs)
{
ESummary *summary;
summary = gtk_type_new (e_summary_get_type ());
summary->shell = shell;
-
+ /* Just get a pointer to the global preferences */
+ summary->preferences = prefs;
+
e_summary_add_protocol_listener (summary, "evolution", e_summary_evolution_protocol_listener, summary);
e_summary_mail_init (summary, shell);
diff --git a/my-evolution/e-summary.h b/my-evolution/e-summary.h
index 703d38a747..ad3e72d925 100644
--- a/my-evolution/e-summary.h
+++ b/my-evolution/e-summary.h
@@ -102,7 +102,7 @@ struct _ESummary {
GtkVBox parent;
ESummaryPrefs *preferences;
- ESummaryPrefs *old_prefs;
+/* ESummaryPrefs *old_prefs; */
ESummaryMail *mail;
ESummaryCalendar *calendar;
@@ -127,7 +127,8 @@ struct _ESummaryClass {
GtkType e_summary_get_type (void);
-GtkWidget *e_summary_new (const GNOME_Evolution_Shell shell);
+GtkWidget *e_summary_new (const GNOME_Evolution_Shell shell,
+ ESummaryPrefs *prefs);
void e_summary_print (BonoboUIComponent *component,
gpointer user_data,