[epiphany] Remove popup state from the statusbar



commit 36d9f9be4a55a44f6797716c4850341a348b75ad
Author: Xan Lopez <xan gnome org>
Date:   Thu May 13 13:17:09 2010 +0200

    Remove popup state from the statusbar
    
    The whole feature is kind of broken anyway. When we fix we'll figure
    out how to show it in the UI.

 doc/reference/epiphany-sections.txt |    1 -
 src/ephy-statusbar.c                |   91 -----------------------------------
 src/ephy-statusbar.h                |    4 --
 src/ephy-window.c                   |   22 +--------
 4 files changed, 1 insertions(+), 117 deletions(-)
---
diff --git a/doc/reference/epiphany-sections.txt b/doc/reference/epiphany-sections.txt
index a139b77..72479d9 100644
--- a/doc/reference/epiphany-sections.txt
+++ b/doc/reference/epiphany-sections.txt
@@ -219,7 +219,6 @@ ephy_location_action_set_address
 <TITLE>EphyStatusbar</TITLE>
 EphyStatusbar
 ephy_statusbar_new
-ephy_statusbar_set_popups_state
 ephy_statusbar_add_widget
 ephy_statusbar_remove_widget
 </SECTION>
diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c
index bf37eb2..1fbcb55 100644
--- a/src/ephy-statusbar.c
+++ b/src/ephy-statusbar.c
@@ -44,19 +44,8 @@ struct _EphyStatusbarPrivate
 {
 	GtkWidget *hbox;
 	GtkWidget *icon_container;
-
-	GtkWidget *popups_manager_icon;
-	GtkWidget *popups_manager_evbox;
 };
 
-enum
-{
-	LOCK_CLICKED,
-	LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL];
-
 G_DEFINE_TYPE (EphyStatusbar, ephy_statusbar, GTK_TYPE_STATUSBAR)
 
 static void
@@ -67,51 +56,6 @@ ephy_statusbar_class_init (EphyStatusbarClass *klass)
 	g_type_class_add_private (object_class, sizeof (EphyStatusbarPrivate));
 }
 
-static gboolean
-padlock_button_press_cb (GtkWidget *ebox,
-                         GdkEventButton *event,
-			 EphyStatusbar *statusbar)
-{
-        if (event->type == GDK_BUTTON_PRESS &&
-	    event->button == 1 /* left */ &&
-	    (event->state & gtk_accelerator_get_default_mod_mask ()) == 0)
-        {
-		g_signal_emit (statusbar, signals[LOCK_CLICKED], 0);
-
-                return TRUE;
-        }
-
-        return FALSE;
-}
-
-static void
-create_icon_frame (EphyStatusbar *statusbar,
-		   const char *stock_id,
-		   GCallback button_press_cb,
-		   GtkWidget **_evbox,
-		   GtkWidget **_icon)
-{
-	GtkWidget *evbox, *icon;
-
-	evbox = gtk_event_box_new ();
-	gtk_event_box_set_visible_window  (GTK_EVENT_BOX (evbox), FALSE);
-	if (button_press_cb)
-	{
-		gtk_widget_add_events (evbox, GDK_BUTTON_PRESS_MASK);
-		g_signal_connect (evbox, "button-press-event",
-				  G_CALLBACK (padlock_button_press_cb), statusbar);
-	}
-
-	icon = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
-	gtk_container_add (GTK_CONTAINER (evbox), icon);
-	gtk_widget_show (icon);
-
-	ephy_statusbar_add_widget (statusbar, evbox);
-
-	*_evbox = evbox;
-	*_icon = icon;
-}
-
 static void
 ephy_statusbar_init (EphyStatusbar *t)
 {
@@ -143,14 +87,6 @@ ephy_statusbar_init (EphyStatusbar *t)
 	gtk_container_add (GTK_CONTAINER (gstatusbar->frame), priv->hbox);
 	gtk_widget_show (priv->hbox);
 #endif
-
-	/* Create popup-blocked icon */
-	create_icon_frame (t,
-			   EPHY_STOCK_POPUPS,
-			   NULL,
-			   &priv->popups_manager_evbox,
-			   &priv->popups_manager_icon);
-	/* don't show priv->popups_manager_evbox yet */
 }
 
 /**
@@ -166,33 +102,6 @@ ephy_statusbar_new (void)
 	return GTK_WIDGET (g_object_new (EPHY_TYPE_STATUSBAR, NULL));
 }
 
-/**
- * ephy_statusbar_set_popups_state:
- * @statusbar: an #EphyStatusbar
- * @hidden: %TRUE if popups have been hidden
- * @tooltip: a string to display as tooltip, or %NULL
- *
- * Sets the statusbar's popup-blocker icon's tooltip and visibility.
- **/
-void
-ephy_statusbar_set_popups_state (EphyStatusbar *statusbar,
-				 gboolean hidden,
-				 const char *tooltip)
-{
-	EphyStatusbarPrivate *priv = statusbar->priv;
-
-	if (hidden)
-	{
-		gtk_widget_hide (priv->popups_manager_evbox);
-	}
-	else
-	{
-		gtk_widget_set_tooltip_text (priv->popups_manager_icon, tooltip);
-
-		gtk_widget_show (priv->popups_manager_evbox);
-	}
-}
-
 static void
 sync_visibility (GtkWidget *widget,
 		 GParamSpec *pspec,
diff --git a/src/ephy-statusbar.h b/src/ephy-statusbar.h
index 3299360..1cef654 100644
--- a/src/ephy-statusbar.h
+++ b/src/ephy-statusbar.h
@@ -58,10 +58,6 @@ GType         ephy_statusbar_get_type			(void);
 
 GtkWidget    *ephy_statusbar_new			(void);
 
-void          ephy_statusbar_set_popups_state		(EphyStatusbar *statusbar,
-							 gboolean hidden,
-							 const char *tooltip);
-
 void	      ephy_statusbar_add_widget			(EphyStatusbar *statusbar,
 							 GtkWidget *widget);
 
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 31502ee..4b394ae 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1762,27 +1762,7 @@ sync_tab_popup_windows (EphyWebView *view,
 			GParamSpec *pspec,
 			EphyWindow *window)
 {
-	guint num_popups = 0;
-	char *tooltip = NULL;
-
-	g_object_get (view,
-		      "hidden-popup-count", &num_popups,
-		      NULL);
-
-	if (num_popups > 0)
-	{
-		tooltip = g_strdup_printf (ngettext ("%d hidden popup window",
-						     "%d hidden popup windows",
-						     num_popups),
-					   num_popups);
-	}
-
-	ephy_statusbar_set_popups_state
-		(EPHY_STATUSBAR (window->priv->statusbar),
-		 tooltip == NULL,
-		 tooltip);
-
-	g_free (tooltip);
+	/* FIXME: show popup count somehow */
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]