aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog13
-rw-r--r--addressbook/backend/pas/pas-backend-file.c18
-rw-r--r--addressbook/gui/component/addressbook-component.c22
-rw-r--r--addressbook/gui/search/e-addressbook-search-dialog.c1
4 files changed, 49 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 6b26a56023..c6d5a8bd00 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,18 @@
2001-01-25 Christopher James Lahey <clahey@helixcode.com>
+ * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): Made
+ this only add the initial VCard if it finds a file
+ "create-initial" in the directory it's creating the database in.
+
+ * gui/component/addressbook-component.c (factory_fn): Added a
+ create_folder function.
+
+ * gui/search/e-addressbook-search-dialog.c
+ (e_addressbook_search_dialog_init): Fixed an unused variable
+ warning.
+
+2001-01-25 Christopher James Lahey <clahey@helixcode.com>
+
* gui/widgets/e-addressbook-view.c
(e_addressbook_view_setup_menus): Setup the view collection
properly and handle the "display_view" signal.
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index b4a0555e76..f9e2c53a2d 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -8,6 +8,7 @@
#include "config.h"
#include <gtk/gtksignal.h>
+#include <gnome.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
@@ -1291,9 +1292,20 @@ pas_backend_file_load_uri (PASBackend *backend,
bf->priv->file_db = dbopen (filename, O_RDWR | O_CREAT, 0666, DB_HASH, NULL);
if (bf->priv->file_db) {
- char *id;
- id = do_create(backend, INITIAL_VCARD, NULL);
- g_free (id);
+ char *create_initial_file;
+ char *dir;
+
+ dir = g_dirname(filename);
+ create_initial_file = g_concat_dir_and_file(dir, "create-initial");
+
+ if (g_file_exists(create_initial_file)) {
+ char *id;
+ id = do_create(backend, INITIAL_VCARD, NULL);
+ g_free (id);
+ }
+
+ g_free(create_initial_file);
+ g_free(dir);
}
}
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index fbd7424e96..129a2f2d97 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -76,6 +76,26 @@ create_view (EvolutionShellComponent *shell_component,
return EVOLUTION_SHELL_COMPONENT_OK;
}
+static void
+create_folder (EvolutionShellComponent *shell_component,
+ const char *physical_uri,
+ const char *type,
+ const GNOME_Evolution_ShellComponentListener listener,
+ void *closure)
+{
+ CORBA_Environment ev;
+ GNOME_Evolution_ShellComponentListener_Result result;
+
+ if (g_strcasecmp (type, "contacts") != 0)
+ result = GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE;
+ else
+ result = GNOME_Evolution_ShellComponentListener_OK;
+
+ CORBA_exception_init(&ev);
+ GNOME_Evolution_ShellComponentListener_notifyResult(listener, result, &ev);
+ CORBA_exception_free(&ev);
+}
+
static int owner_count = 0;
static void
@@ -111,7 +131,7 @@ factory_fn (BonoboGenericFactory *factory,
{
EvolutionShellComponent *shell_component;
- shell_component = evolution_shell_component_new (folder_types, create_view, NULL, NULL, NULL, NULL, NULL);
+ shell_component = evolution_shell_component_new (folder_types, create_view, create_folder, NULL, NULL, NULL, NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set",
GTK_SIGNAL_FUNC (owner_set_cb), NULL);
diff --git a/addressbook/gui/search/e-addressbook-search-dialog.c b/addressbook/gui/search/e-addressbook-search-dialog.c
index 94ba32644d..20ac9c7413 100644
--- a/addressbook/gui/search/e-addressbook-search-dialog.c
+++ b/addressbook/gui/search/e-addressbook-search-dialog.c
@@ -139,7 +139,6 @@ button_press (GtkWidget *widget, int button, EAddressbookSearchDialog *dialog)
static void
e_addressbook_search_dialog_init (EAddressbookSearchDialog *view)
{
- GtkWidget *button;
GnomeDialog *dialog = GNOME_DIALOG (view);
gtk_window_set_policy(GTK_WINDOW(view), FALSE, TRUE, FALSE);