From 85939a287cbb2b9c789581ddc6d529dd24d2c870 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 12 Oct 2005 19:45:07 +0000 Subject: Remove the "network-status" signal from the embed single, and make it a 2005-10-12 Christian Persch * embed/ephy-embed-single.c: (ephy_embed_single_iface_init), (ephy_embed_single_set_network_status), (ephy_embed_single_get_network_status): * embed/ephy-embed-single.h: * embed/mozilla/EphySingle.cpp: * embed/mozilla/EphySingle.h: * embed/mozilla/mozilla-embed-single.cpp: * src/ephy-window.c: (sync_tab_icon), (sync_network_status), (ephy_window_dispose), (ephy_window_init): * src/epiphany.defs: * src/window-commands.c: (window_cmd_file_work_offline): Remove the "network-status" signal from the embed single, and make it a property instead. Keep track of the network status in EphySingle, and emit property notification when it changes. --- embed/ephy-embed-single.c | 50 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'embed/ephy-embed-single.c') diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index 8fb7141ed..ca78fed11 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -51,7 +51,7 @@ ephy_embed_single_get_type (void) } static void -ephy_embed_single_iface_init (gpointer g_class) +ephy_embed_single_iface_init (gpointer g_iface) { static gboolean initialised = FALSE; @@ -103,23 +103,6 @@ ephy_embed_single_iface_init (gpointer g_class) G_TYPE_STRING, G_TYPE_STRING); -/** - * EphyEmbedSingle::network-status: - * @single: - * @offline: the network status - * - * The ::network-status signal is emitted when the network status changes. - **/ - g_signal_new ("network-status", - EPHY_TYPE_EMBED_SINGLE, - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EphyEmbedSingleIface, network_status), - NULL, NULL, - g_cclosure_marshal_VOID__BOOLEAN, - G_TYPE_NONE, - 1, - G_TYPE_BOOLEAN); - /** * EphyEmbedSingle::add-sidebar: * @single: @@ -189,6 +172,19 @@ ephy_embed_single_iface_init (gpointer g_class) G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE, G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE); +/** + * EphyEmbedSingle::network-status: + * + * Whether the network is on-line. + */ + g_object_interface_install_property + (g_iface, + g_param_spec_boolean ("network-status", + "network-status", + "network-status", + FALSE, + G_PARAM_READABLE)); + initialised = TRUE; } } @@ -228,31 +224,33 @@ ephy_embed_single_clear_auth_cache (EphyEmbedSingle *single) } /** - * ephy_embed_single_set_offline_mode: + * ephy_embed_single_get_nework_status: * @single: the #EphyEmbedSingle - * @offline: %TRUE to disable networking + * @offline: %TRUE if the network is on-line * * Sets the state of the network connection. **/ void -ephy_embed_single_set_offline_mode (EphyEmbedSingle *single, - gboolean offline) +ephy_embed_single_set_network_status (EphyEmbedSingle *single, + gboolean status) { EphyEmbedSingleIface *iface = EPHY_EMBED_SINGLE_GET_IFACE (single); - iface->set_offline_mode (single, offline); + iface->set_network_status (single, status); } /** - * ephy_embed_single_get_offline_mode: + * ephy_embed_single_get_network_status: * @single: the #EphyEmbedSingle * * Gets the state of the network connection. + * + * Returns: %TRUE iff the network is on-line. **/ gboolean -ephy_embed_single_get_offline_mode (EphyEmbedSingle *single) +ephy_embed_single_get_network_status (EphyEmbedSingle *single) { EphyEmbedSingleIface *iface = EPHY_EMBED_SINGLE_GET_IFACE (single); - return iface->get_offline_mode (single); + return iface->get_network_status (single); } /** -- cgit v1.2.3