aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2011-06-21 06:17:06 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2011-06-24 05:34:19 +0800
commit8415cf6da16201127aadb7853e3969ed824de919 (patch)
treeabcad2d97255a661ec6daa4c78f5a03009816567 /src/ephy-shell.c
parent3af15cdbcd31a7ac4eda748ae83180a228d30a80 (diff)
downloadgsoc2013-epiphany-8415cf6da16201127aadb7853e3969ed824de919.tar
gsoc2013-epiphany-8415cf6da16201127aadb7853e3969ed824de919.tar.gz
gsoc2013-epiphany-8415cf6da16201127aadb7853e3969ed824de919.tar.bz2
gsoc2013-epiphany-8415cf6da16201127aadb7853e3969ed824de919.tar.lz
gsoc2013-epiphany-8415cf6da16201127aadb7853e3969ed824de919.tar.xz
gsoc2013-epiphany-8415cf6da16201127aadb7853e3969ed824de919.tar.zst
gsoc2013-epiphany-8415cf6da16201127aadb7853e3969ed824de919.zip
Implement GtkApplication based activation and uniqueness
This replaces the existing dbus-glib activation and uniqueness code. The changes are kept to the minimum necessary to make all the features work, but there are still some optimizations possible (like doing most of the initialization in ephy_application_startup() when we know we are not remoting). These changes are left for later to avoid making this patch huge. Command-line parameter parsing is done in the main method and parameters are passed to the application through a EphyApplicationStartupContext structure, which is later passed as a GVariant to the primare instance. This way we avoid moving the GOption code out of the place where it's intended to run: in the main() method. Based in work by Alexandre Mazari. https://bugzilla.gnome.org/show_bug.cgi?id=637334
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 6a246ee76..7c6f6d6c8 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -72,6 +72,7 @@ struct _EphyShellPrivate
EggToolbarsModel *toolbars_model;
EggToolbarsModel *fs_toolbars_model;
EphyExtensionsManager *extensions_manager;
+ EphyApplication *application;
#ifdef ENABLE_NETWORK_MANAGER
EphyNetworkManager *nm_proxy;
#endif
@@ -212,6 +213,8 @@ ephy_shell_init (EphyShell *shell)
ephy_shell = shell;
g_object_add_weak_pointer (G_OBJECT(ephy_shell),
(gpointer *)ptr);
+
+ shell->priv->application = ephy_application_new ();
}
static void
@@ -304,6 +307,13 @@ ephy_shell_dispose (GObject *object)
}
#endif /* ENABLE_NETWORK_MANAGER */
+ if (priv->application != NULL)
+ {
+ LOG ("Unref application");
+ g_object_unref (priv->application);
+ priv->application = NULL;
+ }
+
G_OBJECT_CLASS (ephy_shell_parent_class)->dispose (object);
}
@@ -805,6 +815,22 @@ ephy_shell_get_prefs_dialog (EphyShell *shell)
return shell->priv->prefs_dialog;
}
+/**
+ * ephy_shell_get_application:
+ * @shell: A #EphyApplication
+ *
+ * Gets the #EphyApplication for @shell
+ *
+ * Returns: (transfer none): a #EphyApplication
+ **/
+EphyApplication *
+ephy_shell_get_application (EphyShell *shell)
+{
+ g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+
+ return shell->priv->application;
+}
+
void
_ephy_shell_create_instance (void)
{