aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-06-29 15:37:55 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-06-29 15:37:55 +0800
commit3bedc38a9480532b83e4bfeb386f4bbd7b611b38 (patch)
tree1a33af67a5949913ca02be4c39d4f8acde34c436 /shell/main.c
parent31e562c685d59c22fa1f241aa549bf8867042657 (diff)
downloadgsoc2013-evolution-3bedc38a9480532b83e4bfeb386f4bbd7b611b38.tar.gz
gsoc2013-evolution-3bedc38a9480532b83e4bfeb386f4bbd7b611b38.tar.zst
gsoc2013-evolution-3bedc38a9480532b83e4bfeb386f4bbd7b611b38.zip
Implement saving of configuration information. Now when you run
Evolution it will display the same folder as the last time, and will hide/show the shortcut/folder bars as the last time. This uses GConf so I also put a GConf check into configure.in. svn path=/trunk/; revision=3787
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/shell/main.c b/shell/main.c
index 974c0d210b..f40361cda0 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -157,11 +157,14 @@ static gint
idle_cb (gpointer data)
{
GtkWidget *view;
+ GConfClient *gconf_client;
char *evolution_directory;
evolution_directory = (char *) data;
- shell = e_shell_new (evolution_directory);
+ gconf_client = gconf_client_new ();
+
+ shell = e_shell_new (evolution_directory, gconf_client);
g_free (evolution_directory);
if (shell == NULL) {
@@ -175,19 +178,26 @@ idle_cb (gpointer data)
gtk_signal_connect (GTK_OBJECT (shell), "destroy",
GTK_SIGNAL_FUNC (destroy_cb), NULL);
- view = e_shell_new_view (shell, STARTUP_URI);
- gtk_signal_connect (GTK_OBJECT (view), "delete_event",
- GTK_SIGNAL_FUNC (view_delete_event_cb), shell);
+ if (! e_shell_restore_from_settings (shell)) {
+ view = e_shell_new_view (shell, STARTUP_URI);
+ /* FIXME: Do this for all the shell views even when the shell
+ is restored. */
+ gtk_signal_connect (GTK_OBJECT (view), "delete_event",
+ GTK_SIGNAL_FUNC (view_delete_event_cb), shell);
+ }
if (!getenv ("EVOLVE_ME_HARDER"))
development_warning ();
+ gtk_object_unref (GTK_OBJECT (gconf_client));
+
return FALSE;
}
int
main (int argc, char **argv)
{
+ GConfError *err = NULL;
char *evolution_directory;
bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR);
@@ -199,6 +209,12 @@ main (int argc, char **argv)
gnome_window_icon_set_default_from_file (EVOLUTION_IMAGES "/evolution-inbox.png");
+ if (! gconf_init (argc, argv, &err)) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
+ _("Cannot initialize the configuration system."));
+ exit (1);
+ }
+
if (! bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) {
e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("Cannot initialize the Bonobo component system."));