diff options
author | Xan Lopez <xan@src.gnome.org> | 2007-10-22 02:09:23 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2007-10-22 02:09:23 +0800 |
commit | 568af9a8d3dfa62be38bce6204d0d13bf4fa9e1e (patch) | |
tree | 7841ea91598f3ed5b786dded227380096bb5ebce /src | |
parent | 1a1e303ced1a791dc691aeebb460a98ca3a1800d (diff) | |
download | gsoc2013-epiphany-568af9a8d3dfa62be38bce6204d0d13bf4fa9e1e.tar.gz gsoc2013-epiphany-568af9a8d3dfa62be38bce6204d0d13bf4fa9e1e.tar.zst gsoc2013-epiphany-568af9a8d3dfa62be38bce6204d0d13bf4fa9e1e.zip |
Move load-progress from EphyTab to EphyEmbed
svn path=/trunk/; revision=7544
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-tab.c | 61 | ||||
-rw-r--r-- | src/ephy-window.c | 20 | ||||
-rw-r--r-- | src/epiphany.defs | 6 |
3 files changed, 13 insertions, 74 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c index b7b4852ad..c8f718188 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -98,7 +98,6 @@ struct _EphyTabPrivate EphyTabNavigationFlags nav_flags; guint idle_resize_handler; - gint8 load_percent; /* Flags */ guint is_blank : 1; guint is_loading : 1; @@ -122,7 +121,6 @@ enum PROP_ADDRESS, PROP_ICON, PROP_ICON_ADDRESS, - PROP_LOAD_PROGRESS, PROP_LOAD_STATUS, PROP_MESSAGE, PROP_NAVIGATION, @@ -154,8 +152,6 @@ static void ephy_tab_set_load_status (EphyTab *tab, gboolean status); static void ephy_tab_set_link_message (EphyTab *tab, char *message); -static void ephy_tab_set_load_percent (EphyTab *tab, - int percent); static void ephy_tab_update_navigation_flags(EphyTab *tab, EphyEmbed *embed); static void ephy_tab_set_title (EphyTab *tab, @@ -231,7 +227,6 @@ ephy_tab_set_property (GObject *object, break; case PROP_ADDRESS: case PROP_ICON: - case PROP_LOAD_PROGRESS: case PROP_LOAD_STATUS: case PROP_MESSAGE: case PROP_NAVIGATION: @@ -262,9 +257,6 @@ ephy_tab_get_property (GObject *object, case PROP_ICON_ADDRESS: g_value_set_string (value, priv->icon_address); break; - case PROP_LOAD_PROGRESS: - g_value_set_int (value, priv->load_percent); - break; case PROP_LOAD_STATUS: g_value_set_boolean (value, priv->is_loading); break; @@ -404,16 +396,6 @@ ephy_tab_class_init (EphyTabClass *class) (G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB))); g_object_class_install_property (object_class, - PROP_LOAD_PROGRESS, - g_param_spec_int ("load-progress", - "Load progress", - "The tab's load progress in percent", - 0, - 100, - 0, - G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - - g_object_class_install_property (object_class, PROP_LOAD_STATUS, g_param_spec_boolean ("load-status", "Load status", @@ -1636,7 +1618,7 @@ build_progress_from_requests (EphyTab *tab, EphyEmbedNetState state) load_percent = build_load_percent (tab->priv->cur_requests, tab->priv->total_requests); - ephy_tab_set_load_percent (tab, load_percent); + ephy_embed_set_load_percent (ephy_tab_get_embed (tab), load_percent); } } @@ -1679,7 +1661,7 @@ ephy_tab_net_state_cb (EphyEmbed *embed, priv->total_requests = 0; priv->cur_requests = 0; - ephy_tab_set_load_percent (tab, 0); + ephy_embed_set_load_percent (ephy_tab_get_embed (tab), 0); ephy_tab_set_load_status (tab, TRUE); ephy_tab_update_navigation_flags (tab, embed); @@ -1695,7 +1677,7 @@ ephy_tab_net_state_cb (EphyEmbed *embed, g_object_freeze_notify (object); - ephy_tab_set_load_percent (tab, 100); + ephy_embed_set_load_percent (ephy_tab_get_embed (tab), 100); ephy_tab_set_load_status (tab, FALSE); ephy_tab_update_navigation_flags (tab, embed); @@ -1953,7 +1935,6 @@ ephy_tab_init (EphyTab *tab) tab->priv->cur_requests = 0; tab->priv->width = -1; tab->priv->height = -1; - tab->priv->load_percent = 0; tab->priv->is_loading = FALSE; priv->title = NULL; priv->is_blank = TRUE; @@ -2010,42 +1991,6 @@ ephy_tab_init (EphyTab *tab) tab, 0); } -/** - * ephy_tab_set_load_percent: - * @tab: an #EphyTab - * @percent: a percentage, from 0 to 100. - * - * Sets the load percentage. This will be displayed in the progressbar. - **/ -void -ephy_tab_set_load_percent (EphyTab *tab, int percent) -{ - g_return_if_fail (EPHY_IS_TAB (tab)); - - if (percent != tab->priv->load_percent) - { - tab->priv->load_percent = percent; - - g_object_notify (G_OBJECT (tab), "load-progress"); - } -} - -/** - * ephy_tab_get_load_percent: - * @tab: an #EphyTab - * - * Returns the page load percentage (displayed in the progressbar). - * - * Return value: a percentage from 0 to 100. - **/ -int -ephy_tab_get_load_percent (EphyTab *tab) -{ - g_return_val_if_fail (EPHY_IS_TAB (tab), 0); - - return tab->priv->load_percent; -} - static void ephy_tab_update_navigation_flags (EphyTab *tab, EphyEmbed *embed) { diff --git a/src/ephy-window.c b/src/ephy-window.c index efeb48605..0ee4a68f4 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1441,12 +1441,12 @@ sync_tab_icon (EphyTab *tab, } static void -sync_tab_load_progress (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) +sync_tab_load_progress (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *window) { if (window->priv->closing) return; ephy_statusbar_set_progress (EPHY_STATUSBAR (window->priv->statusbar), - ephy_tab_get_load_percent (tab)); + ephy_embed_get_load_percent (embed)); } static void @@ -2152,9 +2152,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) G_CALLBACK (sync_tab_icon), window); g_signal_handlers_disconnect_by_func (old_tab, - G_CALLBACK (sync_tab_load_progress), - window); - g_signal_handlers_disconnect_by_func (old_tab, G_CALLBACK (sync_tab_load_status), window); g_signal_handlers_disconnect_by_func (old_tab, @@ -2184,7 +2181,9 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) g_signal_handlers_disconnect_by_func (embed, G_CALLBACK (sync_tab_zoom), window); - + g_signal_handlers_disconnect_by_func (embed, + G_CALLBACK (sync_tab_load_progress), + window); g_signal_handlers_disconnect_by_func (embed, G_CALLBACK (tab_context_menu_cb), window); @@ -2202,10 +2201,10 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) sync_tab_security (embed, NULL, window); sync_tab_document_type (embed, NULL, window); sync_tab_zoom (embed, NULL, window); + sync_tab_load_progress (embed, NULL, window); sync_tab_address (new_tab, NULL, window); sync_tab_icon (new_tab, NULL, window); - sync_tab_load_progress (new_tab, NULL, window); sync_tab_load_status (new_tab, NULL, window); sync_tab_message (new_tab, NULL, window); sync_tab_navigation (new_tab, NULL, window); @@ -2219,9 +2218,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) g_signal_connect_object (new_tab, "notify::icon", G_CALLBACK (sync_tab_icon), window, 0); - g_signal_connect_object (new_tab, "notify::load-progress", - G_CALLBACK (sync_tab_load_progress), - window, 0); g_signal_connect_object (new_tab, "notify::load-status", G_CALLBACK (sync_tab_load_status), window, 0); @@ -2256,6 +2252,10 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab) g_signal_connect_object (embed, "size-to", G_CALLBACK (tab_size_to_cb), window, 0); + g_signal_connect_object (embed, "notify::load-progress", + G_CALLBACK (sync_tab_load_progress), + window, 0); + g_object_notify (G_OBJECT (window), "active-tab"); } diff --git a/src/epiphany.defs b/src/epiphany.defs index d9ea18035..ee0c10c5b 100644 --- a/src/epiphany.defs +++ b/src/epiphany.defs @@ -3356,12 +3356,6 @@ (return-type "const-char*") ) -(define-method get_load_percent - (of-object "EphyTab") - (c-name "ephy_tab_get_load_percent") - (return-type "int") -) - (define-method get_address (of-object "EphyTab") (c-name "ephy_tab_get_address") |