diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-31 12:11:14 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-03-25 02:55:24 +0800 |
commit | 5399f35bbce8f4e5775fa96b795c527002c48969 (patch) | |
tree | bc7c1975f639b8c829d44b9c6b6fb72f6a04368c /shell/main.c | |
parent | 617e766a48fa928e450b1717b12b981129e5c1c4 (diff) | |
download | gsoc2013-evolution-5399f35bbce8f4e5775fa96b795c527002c48969.tar gsoc2013-evolution-5399f35bbce8f4e5775fa96b795c527002c48969.tar.gz gsoc2013-evolution-5399f35bbce8f4e5775fa96b795c527002c48969.tar.bz2 gsoc2013-evolution-5399f35bbce8f4e5775fa96b795c527002c48969.tar.lz gsoc2013-evolution-5399f35bbce8f4e5775fa96b795c527002c48969.tar.xz gsoc2013-evolution-5399f35bbce8f4e5775fa96b795c527002c48969.tar.zst gsoc2013-evolution-5399f35bbce8f4e5775fa96b795c527002c48969.zip |
Port EShell to GtkApplication.
Diffstat (limited to 'shell/main.c')
-rw-r--r-- | shell/main.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/shell/main.c b/shell/main.c index f9c9651e49..a27b6b9495 100644 --- a/shell/main.c +++ b/shell/main.c @@ -84,6 +84,8 @@ #include <libical/ical.h> #endif +#define APPLICATION_ID "org.gnome.Evolution" + #define SKIP_WARNING_DIALOG_KEY \ "/apps/evolution/shell/skip_warning_dialog" @@ -257,7 +259,7 @@ idle_cb (gchar **uris) } /* If another Evolution process is running, we're done. */ - if (unique_app_is_running (UNIQUE_APP (shell))) + if (g_application_get_is_remote (G_APPLICATION (shell))) gtk_main_quit (); return FALSE; @@ -324,7 +326,8 @@ quit_signal (gint sig) g_print ("Received quit signal...\n"); shell = e_shell_get_default (); - if (shell) + + if (shell != NULL) e_shell_quit (shell, E_SHELL_QUIT_OPTION); } @@ -411,10 +414,12 @@ create_default_shell (void) { EShell *shell; GConfClient *client; - gboolean online = TRUE; + GApplicationFlags flags; const gchar *key; + gboolean online = TRUE; + gboolean is_meego = FALSE; + gboolean small_screen = FALSE; GError *error = NULL; - gboolean is_meego = FALSE, small_screen = FALSE; client = gconf_client_get_default (); @@ -457,9 +462,13 @@ create_default_shell (void) g_clear_error (&error); } - shell = g_object_new ( - E_TYPE_SHELL, - "name", "org.gnome.Evolution", + flags = G_APPLICATION_HANDLES_OPEN | + G_APPLICATION_HANDLES_COMMAND_LINE; + + shell = g_initable_new ( + E_TYPE_SHELL, NULL, &error, + "application-id", APPLICATION_ID, + "flags", flags, "geometry", geometry, "module-directory", EVOLUTION_MODULEDIR, "meego-mode", is_meego, @@ -468,6 +477,10 @@ create_default_shell (void) "online", online, NULL); + /* Failure to register is fatal. */ + if (error != NULL) + g_error ("%s", error->message); + if (force_online) e_shell_lock_network_available (shell); @@ -571,9 +584,9 @@ main (gint argc, gchar **argv) exit (1); } - #ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING +#ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN); - #endif +#endif #ifdef G_OS_WIN32 path = g_build_path (";", _e_get_bindir (), g_getenv ("PATH"), NULL); @@ -622,6 +635,7 @@ main (gint argc, gchar **argv) setlocale (LC_ALL, "C"); } #endif + if (start_online && start_offline) { g_printerr ( _("%s: --online and --offline cannot be used " |