aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-test-component.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-05-11 00:54:23 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-05-11 00:54:23 +0800
commitc1b5780b8a6b033d800fc96deb87012631049090 (patch)
tree2aa2ddf4607dd58e6b8bd8c38e2cc44c1d1a2aa9 /shell/evolution-test-component.c
parentcf18d0940f9abbe8bb032d08a0fb33067def30d7 (diff)
downloadgsoc2013-evolution-c1b5780b8a6b033d800fc96deb87012631049090.tar
gsoc2013-evolution-c1b5780b8a6b033d800fc96deb87012631049090.tar.gz
gsoc2013-evolution-c1b5780b8a6b033d800fc96deb87012631049090.tar.bz2
gsoc2013-evolution-c1b5780b8a6b033d800fc96deb87012631049090.tar.lz
gsoc2013-evolution-c1b5780b8a6b033d800fc96deb87012631049090.tar.xz
gsoc2013-evolution-c1b5780b8a6b033d800fc96deb87012631049090.tar.zst
gsoc2013-evolution-c1b5780b8a6b033d800fc96deb87012631049090.zip
Added some tests for the custom storage.
* evolution-test-component.c: Added some tests for the custom storage. * evolution-storage.c: New signal DISCOVER_SHARED_FOLDER. (impl_Storage_asyncXferFolder): Renamed from impl_Storage_async_xfer_folder. (impl_Storage_asyncRemoveFolder): Renamed from impl_Storage_async_remove_folder. (impl_Storage_asyncCreateFolder): Renamed from impl_Storage_async_create_folder. (impl_Storage_asyncOpenFolder): Renamed from impl_storage_async_open_folder. (impl_Storage_addListener): Renamed from impl_Storage_add_listener. (impl_Storage_removeListener): Renamed from impl_Storage_remove_listener. (impl_Storage_asyncDiscoverSharedFolder): New, implementation for ::asyncDiscoverSharedFolder. (evolution_storage_get_epv): Install the CORBA method here. (class_init): Set up the "discover_shared_folder" signal here. (e_marshal_NONE__POINTER_POINTER): Yet Another Marshaller. Die die die. * Evolution-Storage.idl (Storage::asyncDiscoverSharedFolder): New method. (StorageListener::notifySharedFolderDiscovered): New method. * e-shell-view-menu.c (command_open_other_users_folder): New, implementation for the FileOpenOtherUsersFolder verb. * Makefile.am: Generate stubs and skels for Evolution::Addressbook::SelectNames as well. * glade/e-shell-shared-folder-picker-dialog.glade: New. svn path=/trunk/; revision=16746
Diffstat (limited to 'shell/evolution-test-component.c')
-rw-r--r--shell/evolution-test-component.c84
1 files changed, 81 insertions, 3 deletions
diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c
index d083248395..58056de5d4 100644
--- a/shell/evolution-test-component.c
+++ b/shell/evolution-test-component.c
@@ -27,8 +27,10 @@
#endif
#include "evolution-shell-component.h"
+
#include "evolution-activity-client.h"
#include "evolution-config-control.h"
+#include "evolution-storage.h"
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-generic-factory.h>
@@ -56,7 +58,7 @@ static EvolutionShellClient *parent_shell = NULL;
static int timeout_id = 0;
-/* Test the configuration control. */
+/* TEST #1: Configuration Control. */
static BonoboObject *
create_configuration_page (void)
@@ -94,7 +96,7 @@ register_configuration_control_factory (void)
}
-/* Test the ::Shortcut interface. */
+/* TEST #2: The ::Shortcut interface. */
static void
spit_out_shortcuts (EvolutionShellClient *shell_client)
@@ -146,7 +148,7 @@ spit_out_shortcuts (EvolutionShellClient *shell_client)
}
-/* Test the multiple folder selector. */
+/* TEST #4: The multiple folder selector. */
static void
dialog_clicked_callback (GnomeDialog *dialog,
@@ -257,6 +259,80 @@ create_new_folder_selector (EvolutionShellComponent *shell_component)
}
+/* TEST #5: Test custom storage. */
+
+static int
+shared_folder_discovery_timeout_callback (void *data)
+{
+ CORBA_Environment ev;
+ Bonobo_Listener listener;
+ CORBA_any any;
+ GNOME_Evolution_Storage_DiscoverSharedFolderResult result;
+
+ listener = (Bonobo_Listener) data;
+
+ result.result = GNOME_Evolution_Storage_OK;
+ result.storagePath = "/Shared Folders/The Public Folder";
+ result.physicalURI = "blah://bleh.net:3764/bluh/bleh/blih";
+ result.type = "test";
+
+ any._type = TC_GNOME_Evolution_Storage_DiscoverSharedFolderResult;
+ any._value = &result;
+
+ CORBA_exception_init (&ev);
+
+ Bonobo_Listener_event (listener, "result", &any, &ev);
+ if (BONOBO_EX (&ev))
+ g_warning ("Cannot report result for shared folder discovery -- %s",
+ BONOBO_EX_ID (&ev));
+
+ CORBA_Object_release (listener, &ev);
+
+ CORBA_exception_free (&ev);
+
+ return FALSE;
+}
+
+static void
+storage_discover_shared_folder_callback (EvolutionStorage *storage,
+ const char *user,
+ const char *folder_name,
+ Bonobo_Listener listener,
+ void *data)
+{
+ CORBA_Environment ev;
+ Bonobo_Listener listener_copy;
+
+ CORBA_exception_init (&ev);
+ listener_copy = CORBA_Object_duplicate (listener, &ev);
+ CORBA_exception_free (&ev);
+
+ g_timeout_add (1000, shared_folder_discovery_timeout_callback, listener_copy);
+}
+
+static void
+setup_custom_storage (EvolutionShellClient *shell_client)
+{
+ EvolutionStorage *the_storage;
+ EvolutionStorageResult result;
+
+ the_storage = evolution_storage_new ("TestStorage", TRUE);
+
+ gtk_signal_connect (GTK_OBJECT (the_storage), "discover_shared_folder",
+ GTK_SIGNAL_FUNC (storage_discover_shared_folder_callback), shell_client);
+
+ result = evolution_storage_register_on_shell (the_storage, BONOBO_OBJREF (shell_client));
+ if (result != EVOLUTION_STORAGE_OK) {
+ g_warning ("Cannot register storage on the shell.");
+ bonobo_object_unref (BONOBO_OBJECT (the_storage));
+ return;
+ }
+
+ evolution_storage_new_folder (the_storage, "/FirstFolder", "FirstFolder", "mail", "file:///tmp/blah", "", 0);
+ evolution_storage_new_folder (the_storage, "/SecondFolder", "SecondFolder", "calendar", "file:///tmp/bleh", "", 0);
+}
+
+
/* Callbacks. */
static void
@@ -432,6 +508,8 @@ owner_set_callback (EvolutionShellComponent *shell_component,
g_warning ("Shell doesn't have a ::Activity interface -- weird!");
spit_out_shortcuts (shell_client);
+
+ setup_custom_storage (shell_client);
}
static int