diff options
-rw-r--r-- | shell/ChangeLog | 17 | ||||
-rw-r--r-- | shell/e-setup.c | 27 | ||||
-rw-r--r-- | shell/e-setup.h | 5 | ||||
-rw-r--r-- | shell/e-shell-constants.h | 6 | ||||
-rw-r--r-- | shell/e-shell-view.c | 2 | ||||
-rw-r--r-- | shell/e-shell.c | 2 | ||||
-rw-r--r-- | shell/e-shortcuts.c | 10 |
7 files changed, 60 insertions, 9 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index a8323cd1e4..4be49021f9 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,11 +1,24 @@ 2002-04-09 Dan Winship <danw@ximian.com> + * e-setup.c (e_setup_check_db): New. Check that things that need + to be in the config db are. Right now it sets up the default + folders. + + * e-shell.c (e_shell_construct): Call e_setup_check_db after + getting the config db. + (impl_Shell_handleURI): Handle "default:" URIs by looking up the + default folders in the config db. + * main.c (idle_cb): Check for "default:" URIs and treat them the same way as "evolution:" URIs. If the shell fails to display all of the requested URIs, fall back to the default URI (Summary). - * e-shell.c (impl_Shell_handleURI): Handle "default:" URIs by - looking up the default folders in the config db. + * e-shell-constants.h: Add E_SUMMARY_URI, E_LOCAL_INBOX_URI, etc. + + * e-shortcuts.c (e_shortcuts_add_default_group): Use + E_LOCAL_INBOX_URI, etc. + + * e-shell-view.c: #define FALLBACK_URI to E_SUMMARY_URI 2002-04-09 Dan Winship <danw@ximian.com> diff --git a/shell/e-setup.c b/shell/e-setup.c index 31c16eca2b..088aa010c2 100644 --- a/shell/e-setup.c +++ b/shell/e-setup.c @@ -41,6 +41,7 @@ #include <gal/widgets/e-gui-utils.h> #include "e-local-folder.h" +#include "e-shell-constants.h" #include "e-setup.h" @@ -413,3 +414,29 @@ e_setup (const char *evolution_directory) Check if it is up to date. */ return check_evolution_directory (evolution_directory); } + + +void +e_setup_check_db (Bonobo_ConfigDatabase db) +{ + gboolean def; + + if (bonobo_config_get_string_with_default (db, "/DefaultFolder/mail_path", NULL, &def) == NULL) { + bonobo_config_set_string (db, "/DefaultFolder/mail_path", + E_LOCAL_INBOX_URI, NULL); + bonobo_config_set_string (db, "/DefaultFolder/mail_uri", + E_LOCAL_INBOX_URI, NULL); + bonobo_config_set_string (db, "/DefaultFolder/contacts_path", + E_LOCAL_CONTACTS_URI, NULL); + bonobo_config_set_string (db, "/DefaultFolder/contacts_uri", + E_LOCAL_CONTACTS_URI, NULL); + bonobo_config_set_string (db, "/DefaultFolder/calendar_path", + E_LOCAL_CALENDAR_URI, NULL); + bonobo_config_set_string (db, "/DefaultFolder/calendar_uri", + E_LOCAL_CALENDAR_URI, NULL); + bonobo_config_set_string (db, "/DefaultFolder/tasks_path", + E_LOCAL_TASKS_URI, NULL); + bonobo_config_set_string (db, "/DefaultFolder/tasks_uri", + E_LOCAL_TASKS_URI, NULL); + } +} diff --git a/shell/e-setup.h b/shell/e-setup.h index 3355dc90ad..37144eadc7 100644 --- a/shell/e-setup.h +++ b/shell/e-setup.h @@ -24,7 +24,10 @@ #define _E_SETUP_H #include <glib.h> +#include <bonobo-conf/bonobo-config-database.h> -gboolean e_setup (const char *evolution_directory); +gboolean e_setup (const char *evolution_directory); + +void e_setup_check_db (Bonobo_ConfigDatabase db); #endif /* _E_SETUP_H */ diff --git a/shell/e-shell-constants.h b/shell/e-shell-constants.h index b7382bed67..0d5e5f37d4 100644 --- a/shell/e-shell-constants.h +++ b/shell/e-shell-constants.h @@ -38,4 +38,10 @@ #define E_LOCAL_STORAGE_NAME "local" #define E_SUMMARY_STORAGE_NAME "summary" +#define E_SUMMARY_URI "evolution:/summary" +#define E_LOCAL_INBOX_URI "evolution:/local/Inbox" +#define E_LOCAL_CONTACTS_URI "evolution:/local/Contacts" +#define E_LOCAL_CALENDAR_URI "evolution:/local/Calendar" +#define E_LOCAL_TASKS_URI "evolution:/local/Tasks" + #endif diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 901e599a3d..0125004d8a 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -169,7 +169,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; /* URI to display when the currently displayed folder is removed from the storage. */ -#define FALLBACK_URI "evolution:/local/Inbox" +#define FALLBACK_URI E_SUMMARY_URI /* The icons for the offline/online status. */ diff --git a/shell/e-shell.c b/shell/e-shell.c index a05e53e665..0284318910 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -57,6 +57,7 @@ #include "e-corba-storage-registry.h" #include "e-folder-type-registry.h" #include "e-local-storage.h" +#include "e-setup.h" #include "e-shell-constants.h" #include "e-shell-corba-icon-utils.h" #include "e-shell-folder-selection-dialog.h" @@ -1244,6 +1245,7 @@ e_shell_construct (EShell *shell, CORBA_exception_free (&ev); return E_SHELL_CONSTRUCT_RESULT_NOCONFIGDB; } + e_setup_check_db (priv->db); CORBA_exception_free (&ev); diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c index b231bc4df2..fffedfbaf3 100644 --- a/shell/e-shortcuts.c +++ b/shell/e-shortcuts.c @@ -1028,19 +1028,19 @@ e_shortcuts_add_default_group (EShortcuts *shortcuts) /* FIXME: Inbox shortcut should point to something else for people who won't care about using /Local Folders/Inbox */ utf = e_utf8_from_locale_string (_("Summary")); - e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/summary", utf, 0, "summary"); + e_shortcuts_add_shortcut (shortcuts, 0, -1, E_SUMMARY_URI, utf, 0, "summary"); g_free (utf); utf = e_utf8_from_locale_string (_("Inbox")); - e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Inbox", utf, 0, "mail"); + e_shortcuts_add_shortcut (shortcuts, 0, -1, E_LOCAL_INBOX_URI, utf, 0, "mail"); g_free (utf); utf = e_utf8_from_locale_string (_("Calendar")); - e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Calendar", utf, 0, "calendar"); + e_shortcuts_add_shortcut (shortcuts, 0, -1, E_LOCAL_CALENDAR_URI, utf, 0, "calendar"); g_free (utf); utf = e_utf8_from_locale_string (_("Tasks")); - e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Tasks", utf, 0, "tasks"); + e_shortcuts_add_shortcut (shortcuts, 0, -1, E_LOCAL_TASKS_URI, utf, 0, "tasks"); g_free (utf); utf = e_utf8_from_locale_string (_("Contacts")); - e_shortcuts_add_shortcut (shortcuts, 0, -1, "evolution:/local/Contacts", utf, 0, "contacts"); + e_shortcuts_add_shortcut (shortcuts, 0, -1, E_LOCAL_CONTACTS_URI, utf, 0, "contacts"); g_free (utf); } |