[epiphany/peas: 7/7] src/ephy-window: update for new extension manager
- From: Diego Escalante Urrelo <diegoe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/peas: 7/7] src/ephy-window: update for new extension manager
- Date: Sat, 2 Apr 2011 19:31:29 +0000 (UTC)
commit 8111b70a4d59186aaeab20e51d0447b44619529d
Author: Diego Escalante Urrelo <descalante igalia com>
Date: Sat Apr 2 14:26:27 2011 -0500
src/ephy-window: update for new extension manager
src/ephy-window.c | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 55614e8..3143458 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -44,9 +44,12 @@
#include "ephy-toolbar.h"
#include "popup-commands.h"
#include "ephy-encoding-menu.h"
+#include "ephy-extension.h"
+#include "ephy-extensions-manager.h"
+#include "ephy-session.h"
+#include "ephy-lockdown.h"
#include "ephy-tabs-menu.h"
#include "ephy-stock-icons.h"
-#include "ephy-extension.h"
#include "ephy-bookmarks-ui.h"
#include "ephy-link.h"
#include "ephy-gui.h"
@@ -448,6 +451,7 @@ struct _EphyWindowPrivate
guint idle_worker;
GtkWidget *entry;
GtkWidget *downloads_box;
+ PeasExtensionSet *extensions;
guint clear_progress_timeout_id;
@@ -2940,7 +2944,6 @@ notebook_page_added_cb (EphyNotebook *notebook,
EphyWindow *window)
{
EphyWindowPrivate *priv = window->priv;
- EphyExtension *manager;
LOG ("page-added notebook %p embed %p position %u\n", notebook, embed, position);
@@ -2963,8 +2966,7 @@ notebook_page_added_cb (EphyNotebook *notebook,
G_CALLBACK (embed_modal_alert_cb), window, G_CONNECT_AFTER);
/* Let the extensions attach themselves to the tab */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_attach_tab (manager, window, embed);
+ peas_extension_set_call (priv->extensions, "attach_tab", window, embed);
if (priv->present_on_insert)
{
@@ -2980,7 +2982,6 @@ notebook_page_removed_cb (EphyNotebook *notebook,
EphyWindow *window)
{
EphyWindowPrivate *priv = window->priv;
- EphyExtension *manager;
LOG ("page-removed notebook %p embed %p position %u\n", notebook, embed, position);
@@ -2988,9 +2989,7 @@ notebook_page_removed_cb (EphyNotebook *notebook,
g_return_if_fail (EPHY_IS_EMBED (embed));
- /* Let the extensions remove themselves from the tab */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_detach_tab (manager, window, embed);
+ peas_extension_set_call (priv->extensions, "detach_tab", window, embed);
#if 0
g_signal_handlers_disconnect_by_func (G_OBJECT (embed),
@@ -3217,13 +3216,10 @@ ephy_window_dispose (GObject *object)
/* Only do these once */
if (window->priv->closing == FALSE)
{
- EphyExtension *manager;
-
window->priv->closing = TRUE;
- /* Let the extensions detach themselves from the window */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_detach_window (manager, window);
+ peas_extension_set_call (priv->extensions, "detach_window", window);
+ ephy_session_detach_window (EPHY_SESSION (ephy_shell_get_session (ephy_shell)), window);
ephy_bookmarks_ui_detach_window (window);
g_signal_handlers_disconnect_by_func
@@ -3556,7 +3552,6 @@ ephy_window_constructor (GType type,
GObject *object;
EphyWindow *window;
EphyWindowPrivate *priv;
- EphyExtension *manager;
EphyEmbedSingle *single;
EggToolbarsModel *model;
GtkSettings *settings;
@@ -3672,8 +3667,12 @@ ephy_window_constructor (GType type,
FALSE, FALSE, 0);
/* Once the window is sufficiently created let the extensions attach to it */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_attach_window (manager, window);
+ priv->extensions = peas_extension_set_new (PEAS_ENGINE (ephy_shell_get_extensions_manager (ephy_shell)),
+ EPHY_TYPE_EXTENSION,
+ NULL);
+ peas_extension_set_call (priv->extensions, "attach_window", window);
+ ephy_session_attach_window (EPHY_SESSION (ephy_shell_get_session (ephy_shell)), window);
+ ephy_lockdown_attach_window (EPHY_LOCKDOWN (ephy_shell_get_lockdown (ephy_shell)), window);
ephy_bookmarks_ui_attach_window (window);
/* We only set the model now after attaching the extensions, so that
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]