aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-08-09 07:12:59 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-09 07:12:59 +0800
commit278c1fa77ba74f70a8d55e6d679f73372034fb14 (patch)
treebaff39d35a883b802328488a8ab037ff2585e2db /shell/e-shell.c
parent7903e73970cbf89f4a49c5f7083b205b8670d0be (diff)
downloadgsoc2013-evolution-278c1fa77ba74f70a8d55e6d679f73372034fb14.tar
gsoc2013-evolution-278c1fa77ba74f70a8d55e6d679f73372034fb14.tar.gz
gsoc2013-evolution-278c1fa77ba74f70a8d55e6d679f73372034fb14.tar.bz2
gsoc2013-evolution-278c1fa77ba74f70a8d55e6d679f73372034fb14.tar.lz
gsoc2013-evolution-278c1fa77ba74f70a8d55e6d679f73372034fb14.tar.xz
gsoc2013-evolution-278c1fa77ba74f70a8d55e6d679f73372034fb14.tar.zst
gsoc2013-evolution-278c1fa77ba74f70a8d55e6d679f73372034fb14.zip
Work through more compilation errors.
Rewrite EMultiConfigDialog to not use ETable. svn path=/branches/kill-bonobo/; revision=35942
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r--shell/e-shell.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 43c30363f7..2fe703f077 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -24,10 +24,12 @@
#include "e-shell-module.h"
#include "e-shell-registry.h"
+#include "e-shell-settings-dialog.h"
#define SHUTDOWN_TIMEOUT 500 /* milliseconds */
static GList *active_windows;
+static GtkWidget *preferences;
static gboolean
shell_window_delete_event_cb (EShellWindow *shell_window)
@@ -121,3 +123,55 @@ e_shell_create_window (void)
return E_SHELL_WINDOW (shell_window);
}
+
+gboolean
+e_shell_handle_uri (const gchar *uri)
+{
+ EShellModule *shell_module;
+ GFile *file;
+ gchar *scheme;
+
+ g_return_val_if_fail (uri != NULL, FALSE);
+
+ file = g_file_new_for_uri (uri);
+ scheme = g_file_get_uri_scheme (file);
+ g_object_unref (file);
+
+ if (scheme == NULL)
+ return FALSE;
+
+ shell_module = e_shell_registry_get_module_by_scheme (scheme);
+
+ /* Scheme lookup failed so try looking up the shell module by
+ * name. Note, we only open a shell window if the URI refers
+ * to a shell module by name, not by scheme. */
+ if (shell_module == NULL) {
+ EShellWindow *shell_window;
+
+ shell_module = e_shell_registry_get_module_by_name (scheme);
+
+ if (shell_module == NULL)
+ return FALSE;
+
+ shell_window = e_shell_create_window ();
+ /* FIXME Set window to appropriate view. */
+ }
+
+ return e_shell_module_handle_uri (shell_module, uri);
+}
+
+void
+e_shell_show_preferences (GtkWindow *parent)
+{
+ if (preferences != NULL) {
+ gtk_window_present (GTK_WINDOW (preferences));
+ return;
+ }
+
+ preferences = e_shell_settings_dialog_new ();
+ /* FIXME e_shell_settings_dialog_show_type (...); */
+
+ gtk_window_set_transient_for (GTK_WINDOW (preferences), parent);
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (preferences), TRUE);
+ gtk_widget_show (preferences);
+}