aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-14 07:47:32 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-14 07:47:32 +0800
commita94b49300fcf5b8dda47a794d2687467043d8c55 (patch)
treec40bb5aede1f87e4a3d83d9f645fbd2ab6785cdb /src
parent2dbc06a5454482f62bc1d1b656431b798c548c7e (diff)
downloadgsoc2013-epiphany-a94b49300fcf5b8dda47a794d2687467043d8c55.tar
gsoc2013-epiphany-a94b49300fcf5b8dda47a794d2687467043d8c55.tar.gz
gsoc2013-epiphany-a94b49300fcf5b8dda47a794d2687467043d8c55.tar.bz2
gsoc2013-epiphany-a94b49300fcf5b8dda47a794d2687467043d8c55.tar.lz
gsoc2013-epiphany-a94b49300fcf5b8dda47a794d2687467043d8c55.tar.xz
gsoc2013-epiphany-a94b49300fcf5b8dda47a794d2687467043d8c55.tar.zst
gsoc2013-epiphany-a94b49300fcf5b8dda47a794d2687467043d8c55.zip
Add favicon and lock icon to the entry. Fixes bug #116482 and bug #149506.
2005-01-14 Christian Persch <chpe@cvs.gnome.org> * lib/widgets/ephy-location-entry.c: (ephy_location_entry_set_tooltip), (ephy_location_entry_finalize), (ephy_location_entry_class_init), (modify_background), (entry_style_set_cb), (entry_realize_cb), (ephy_location_entry_construct_contents), (ephy_location_entry_init), (ephy_location_entry_set_favicon), (ephy_location_entry_set_show_lock), (ephy_location_entry_set_lock_stock), (ephy_location_entry_set_lock_tooltip): * lib/widgets/ephy-location-entry.h: * src/ephy-fullscreen-popup.c: (ephy_fullscreen_popup_constructor): * src/ephy-location-action.c: (sync_icon), (sync_lock_stock_id), (sync_lock_tooltip), (sync_show_lock), (connect_proxy), (ephy_location_action_set_property), (ephy_location_action_get_property), (ephy_location_action_class_init), (ephy_location_action_finalize): * src/ephy-toolbar.c: (ephy_toolbar_set_security_state), (ephy_toolbar_set_lock_visibility), (ephy_toolbar_constructor): * src/ephy-toolbar.h: * src/ephy-window.c: (sync_chromes_visibility): Add favicon and lock icon to the entry. Fixes bug #116482 and bug #149506. Change "Exit Fullscreen" to "Leave Fullscreen" as per HIG, part of bug #153270.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-fullscreen-popup.c2
-rw-r--r--src/ephy-location-action.c110
-rwxr-xr-xsrc/ephy-toolbar.c23
-rw-r--r--src/ephy-toolbar.h3
-rw-r--r--src/ephy-window.c2
5 files changed, 125 insertions, 15 deletions
diff --git a/src/ephy-fullscreen-popup.c b/src/ephy-fullscreen-popup.c
index ece03ba71..850f13908 100644
--- a/src/ephy-fullscreen-popup.c
+++ b/src/ephy-fullscreen-popup.c
@@ -279,7 +279,7 @@ ephy_fullscreen_popup_constructor (GType type,
gtk_box_pack_start (GTK_BOX (button_hbox), icon, FALSE, FALSE, 0);
gtk_widget_show (icon);
- label = gtk_label_new (_("Exit Fullscreen"));
+ label = gtk_label_new (_("Leave Fullscreen"));
gtk_box_pack_start (GTK_BOX (button_hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c
index 5cfa8714c..a111559ea 100644
--- a/src/ephy-location-action.c
+++ b/src/ephy-location-action.c
@@ -46,6 +46,9 @@ struct _EphyLocationActionPrivate
EphyBookmarks *bookmarks;
char *icon;
EphyFaviconCache *cache;
+ char *lock_stock_id;
+ char *lock_tooltip;
+ gboolean show_lock;
};
static void ephy_location_action_init (EphyLocationAction *action);
@@ -63,6 +66,9 @@ enum
PROP_ADDRESS,
PROP_EDITABLE,
PROP_ICON,
+ PROP_LOCK_STOCK,
+ PROP_LOCK_TOOLTIP,
+ PROP_SHOW_LOCK,
PROP_WINDOW
};
@@ -191,23 +197,52 @@ sync_icon (GtkAction *gaction,
EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
EphyLocationActionPrivate *priv = action->priv;
EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (proxy);
- GtkWidget *image;
GdkPixbuf *pixbuf;
- image = ephy_location_entry_get_image (entry);
pixbuf = ephy_favicon_cache_get (priv->cache, priv->icon);
+ ephy_location_entry_set_favicon (entry, pixbuf);
+
if (pixbuf != NULL)
{
- gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
g_object_unref (pixbuf);
}
- else
- {
- gtk_image_set_from_stock (GTK_IMAGE (image),
- GTK_STOCK_NEW,
- GTK_ICON_SIZE_MENU);
- }
+}
+
+static void
+sync_lock_stock_id (GtkAction *gaction,
+ GParamSpec *pspec,
+ GtkWidget *proxy)
+{
+ EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
+ EphyLocationActionPrivate *priv = action->priv;
+ EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (proxy);
+
+ ephy_location_entry_set_lock_stock (entry, priv->lock_stock_id);
+}
+
+static void
+sync_lock_tooltip (GtkAction *gaction,
+ GParamSpec *pspec,
+ GtkWidget *proxy)
+{
+ EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
+ EphyLocationActionPrivate *priv = action->priv;
+ EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (proxy);
+
+ ephy_location_entry_set_lock_tooltip (entry, priv->lock_tooltip);
+}
+
+static void
+sync_show_lock (GtkAction *gaction,
+ GParamSpec *pspec,
+ GtkWidget *proxy)
+{
+ EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
+ EphyLocationActionPrivate *priv = action->priv;
+ EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (proxy);
+
+ ephy_location_entry_set_show_lock (entry, priv->show_lock);
}
static char *
@@ -311,6 +346,15 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
sync_icon (action, NULL, proxy);
g_signal_connect_object (action, "notify::icon",
G_CALLBACK (sync_icon), proxy, 0);
+ sync_lock_stock_id (action, NULL, proxy);
+ g_signal_connect_object (action, "notify::lock-stock-id",
+ G_CALLBACK (sync_lock_stock_id), proxy, 0);
+ sync_lock_tooltip (action, NULL, proxy);
+ g_signal_connect_object (action, "notify::lock-tooltip",
+ G_CALLBACK (sync_lock_tooltip), proxy, 0);
+ sync_show_lock (action, NULL, proxy);
+ g_signal_connect_object (action, "notify::show-lock",
+ G_CALLBACK (sync_show_lock), proxy, 0);
entry = ephy_location_entry_get_entry (lentry);
g_signal_connect_object (entry, "activate",
@@ -368,6 +412,17 @@ ephy_location_action_set_property (GObject *object,
g_free (action->priv->icon);
action->priv->icon = g_value_dup_string (value);
break;
+ case PROP_LOCK_STOCK:
+ g_free (action->priv->lock_stock_id);
+ action->priv->lock_stock_id = g_value_dup_string (value);
+ break;
+ case PROP_LOCK_TOOLTIP:
+ g_free (action->priv->lock_tooltip);
+ action->priv->lock_tooltip = g_value_dup_string (value);
+ break;
+ case PROP_SHOW_LOCK:
+ action->priv->show_lock = g_value_get_boolean (value);
+ break;
case PROP_WINDOW:
action->priv->window = EPHY_WINDOW (g_value_get_object (value));
break;
@@ -393,6 +448,15 @@ ephy_location_action_get_property (GObject *object,
case PROP_ICON:
g_value_set_string (value, action->priv->icon);
break;
+ case PROP_LOCK_STOCK:
+ g_value_set_string (value, action->priv->lock_stock_id);
+ break;
+ case PROP_LOCK_TOOLTIP:
+ g_value_set_string (value, action->priv->lock_tooltip);
+ break;
+ case PROP_SHOW_LOCK:
+ g_value_set_boolean (value, action->priv->show_lock);
+ break;
case PROP_WINDOW:
/* not readable */
break;
@@ -439,6 +503,30 @@ ephy_location_action_class_init (EphyLocationActionClass *class)
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
+ PROP_LOCK_STOCK,
+ g_param_spec_string ("lock-stock-id",
+ "Lock Stock ID",
+ "Lock Stock ID",
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_LOCK_TOOLTIP,
+ g_param_spec_string ("lock-tooltip",
+ "Lock Tooltip",
+ "The icon",
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_SHOW_LOCK,
+ g_param_spec_boolean ("show-lock",
+ "Show Lock",
+ "Show Lock",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
PROP_WINDOW,
g_param_spec_object ("window",
"Window",
@@ -593,7 +681,9 @@ ephy_location_action_finalize (GObject *object)
g_list_free (priv->actions);
g_free (priv->address);
- g_free (action->priv->icon);
+ g_free (priv->icon);
+ g_free (priv->lock_stock_id);
+ g_free (priv->lock_tooltip);
g_object_unref (priv->cache);
G_OBJECT_CLASS (parent_class)->finalize (object);
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index e375a4edd..729322109 100755
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -73,6 +73,8 @@ struct _EphyToolbarPrivate
GtkToolItem *exit_button;
guint disable_arbitrary_url_notifier_id;
gulong set_focus_handler;
+ gboolean show_lock;
+ gboolean lock_visible;
gboolean fullscreen;
gboolean spinning;
};
@@ -498,18 +500,31 @@ ephy_toolbar_set_security_state (EphyToolbar *toolbar,
const char *stock_id,
const char *tooltip)
{
-#if 0
EphyToolbarPrivate *priv = toolbar->priv;
+ priv->show_lock = show_lock;
+
g_object_set (priv->actions[LOCATION_ACTION],
- "lock-show", show_lock,
"lock-stock-id", stock_id,
"lock-tooltip", tooltip,
+ "show-lock", priv->lock_visible && priv->show_lock,
NULL);
-#endif
}
void
+ephy_toolbar_set_lock_visibility (EphyToolbar *toolbar,
+ gboolean visible)
+{
+ EphyToolbarPrivate *priv = toolbar->priv;
+
+ priv->lock_visible = visible;
+
+ g_object_set (priv->actions[LOCATION_ACTION],
+ "show-lock", priv->lock_visible && priv->show_lock,
+ NULL);
+}
+
+void
ephy_toolbar_set_spinning (EphyToolbar *toolbar,
gboolean spinning)
{
@@ -637,7 +652,7 @@ ephy_toolbar_constructor (GType type,
gtk_toolbar_insert (gtoolbar, priv->sep_item, -1);
priv->exit_button = gtk_tool_button_new_from_stock (GTK_STOCK_QUIT);
- gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->exit_button), _("Exit Fullscreen"));
+ gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->exit_button), _("Leave Fullscreen"));
gtk_tool_item_set_is_important (priv->exit_button, TRUE);
g_signal_connect (priv->exit_button, "clicked",
G_CALLBACK (exit_button_clicked_cb), toolbar);
diff --git a/src/ephy-toolbar.h b/src/ephy-toolbar.h
index 26338dbfd..a1dbd205f 100644
--- a/src/ephy-toolbar.h
+++ b/src/ephy-toolbar.h
@@ -88,6 +88,9 @@ void ephy_toolbar_set_security_state (EphyToolbar *toolbar,
const char *stock_id,
const char *tooltip);
+void ephy_toolbar_set_lock_visibility (EphyToolbar *toolbar,
+ gboolean visible);
+
void ephy_toolbar_set_spinning (EphyToolbar *toolbar,
gboolean spinning);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 79be6fba2..0588b27a1 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -548,6 +548,8 @@ sync_chromes_visibility (EphyWindow *window)
g_object_set (priv->bookmarksbar, "visible", show_bookmarksbar, NULL);
g_object_set (priv->statusbar, "visible", show_statusbar, NULL);
+ ephy_toolbar_set_lock_visibility (priv->toolbar, !show_statusbar);
+
if (priv->fullscreen_popup != NULL)
{
g_object_set (priv->fullscreen_popup, "visible", !show_toolbar, NULL);