aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am8
-rw-r--r--src/ephy-shell.c29
-rw-r--r--src/ephy-shell.h2
3 files changed, 39 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 1d6f3c65d..d865eec3d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -106,6 +106,10 @@ libephymain_la_CFLAGS = \
$(EPIPHANY_DEPENDENCY_CFLAGS) \
$(AM_CFLAGS)
+if ENABLE_DBUS
+libephymain_la_CFLAGS += $(DBUS_CFLAGS)
+endif
+
epiphany_SOURCES = ephy-main.c
epiphany_CPPFLAGS = \
@@ -135,6 +139,10 @@ epiphany_LDADD = \
$(EPIPHANY_DEPENDENCY_LIBS) \
$(INTLLIBS)
+if ENABLE_DBUS
+epiphany_LDADD += $(DBUS_LIBS)
+endif
+
BUILT_SOURCES = \
$(CORBA_SOURCE) \
$(TYPES_SOURCE)
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 3ff22355d..333213721 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -44,6 +44,10 @@
#include "ephy-automation.h"
#include "print-dialog.h"
+#ifdef ENABLE_DBUS
+#include "ephy-dbus.h"
+#endif
+
#include <string.h>
#include <bonobo/bonobo-main.h>
#include <glib/gi18n.h>
@@ -67,6 +71,7 @@ struct _EphyShellPrivate
EggToolbarsModel *toolbars_model;
EggToolbarsModel *fs_toolbars_model;
EphyExtensionsManager *extensions_manager;
+ GObject *dbus_service;
GtkWidget *bme;
GtkWidget *history_window;
GObject *pdm_dialog;
@@ -413,6 +418,14 @@ ephy_shell_finalize (GObject *object)
g_object_unref (shell->priv->extensions_manager);
}
+#ifdef ENABLE_DBUS
+ LOG ("Shutting down DBUS service")
+ if (shell->priv->dbus_service)
+ {
+ g_object_unref (shell->priv->dbus_service);
+ }
+#endif
+
LOG ("Unref session manager")
if (shell->priv->session)
{
@@ -805,3 +818,19 @@ ephy_shell_get_print_setup_dialog (EphyShell *shell)
return shell->priv->print_setup_dialog;
}
+
+#ifdef ENABLE_DBUS
+GObject *
+ephy_shell_get_dbus_service (EphyShell *shell)
+{
+ g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+
+ if (shell->priv->dbus_service == NULL)
+ {
+ shell->priv->dbus_service = g_object_new (EPHY_TYPE_DBUS, NULL);
+ ephy_dbus_startup (EPHY_DBUS (shell->priv->dbus_service));
+ }
+
+ return G_OBJECT (shell->priv->dbus_service);
+}
+#endif
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index d807cd139..a9867fe97 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -139,6 +139,8 @@ GObject *ephy_shell_get_prefs_dialog (EphyShell *shell);
GObject *ephy_shell_get_print_setup_dialog (EphyShell *shell);
+GObject *ephy_shell_get_dbus_service (EphyShell *shell);
+
G_END_DECLS
#endif