[Xfce4-commits] <midori:master> Render security status on the left side, no favicon

Christian Dywan noreply at xfce.org
Sat Apr 21 22:56:01 CEST 2012


Updating branch refs/heads/master
         to 1a5f96013d364498dfae584534f0834f8bccaf58 (commit)
       from 6bcf3d99121f982dc13c32978397b40ecedfc92c (commit)

commit 1a5f96013d364498dfae584534f0834f8bccaf58
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Apr 21 22:23:19 2012 +0200

    Render security status on the left side, no favicon
    
    Fixes: https://bugs.launchpad.net/midori/+bug/906575

 midori/midori-browser.c        |   15 -------
 midori/midori-locationaction.c |   91 +++++++++++++---------------------------
 2 files changed, 29 insertions(+), 77 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index aae2d11..996b88e 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -392,7 +392,6 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
         GtkAction* action = _action_by_name (browser, "Location");
         MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action);
         midori_location_action_set_text (location_action, browser->statusbar_text);
-        midori_location_action_set_icon (location_action, NULL);
         midori_location_action_set_secondary_icon (location_action, NULL);
         #endif
     }
@@ -411,8 +410,6 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
                 location_action, GTK_STOCK_JUMP_TO);
         midori_location_action_set_text (location_action,
             midori_view_get_display_uri (MIDORI_VIEW (view)));
-        midori_location_action_set_icon (location_action,
-            midori_view_get_icon (MIDORI_VIEW (view)));
         #endif
     }
     else
@@ -494,14 +491,9 @@ midori_view_notify_icon_cb (MidoriView*    view,
                             GParamSpec*    pspec,
                             MidoriBrowser* browser)
 {
-    GtkAction* action;
-
     if (midori_browser_get_current_tab (browser) != (GtkWidget*)view)
         return;
 
-    action = _action_by_name (browser, "Location");
-    midori_location_action_set_icon (MIDORI_LOCATION_ACTION (action),
-                                     midori_view_get_icon (view));
     if (sokoke_is_app_or_private ())
         gtk_window_set_icon (GTK_WINDOW (browser), midori_view_get_icon (view));
 }
@@ -519,9 +511,6 @@ midori_view_notify_load_status_cb (GtkWidget*      widget,
     uri = midori_view_get_display_uri (view);
     action = _action_by_name (browser, "Location");
 
-    if (load_status == MIDORI_LOAD_COMMITTED)
-        midori_location_action_add_uri (MIDORI_LOCATION_ACTION (action), uri);
-
     if (widget == midori_browser_get_current_tab (browser))
     {
         if (load_status == MIDORI_LOAD_COMMITTED)
@@ -3730,8 +3719,6 @@ _action_location_reset_uri (GtkAction*     action,
     {
         midori_location_action_set_text (MIDORI_LOCATION_ACTION (action),
             midori_view_get_display_uri (MIDORI_VIEW (view)));
-        midori_location_action_set_icon (MIDORI_LOCATION_ACTION (action),
-            midori_view_get_icon (MIDORI_VIEW (view)));
     }
 }
 
@@ -5053,8 +5040,6 @@ midori_browser_notebook_switch_page_after_cb (GtkWidget*       notebook,
     midori_browser_set_title (browser, midori_view_get_display_title (view));
     action = _action_by_name (browser, "Location");
     midori_location_action_set_text (MIDORI_LOCATION_ACTION (action), uri);
-    midori_location_action_set_icon (MIDORI_LOCATION_ACTION (action),
-                                     midori_view_get_icon (view));
     if (sokoke_is_app_or_private ())
         gtk_window_set_icon (GTK_WINDOW (browser), midori_view_get_icon (view));
 
diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index d7f97b2..3d1a1a4 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -838,8 +838,6 @@ midori_location_action_create_tool_item (GtkAction* action)
     hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry), mode);
     #else
     entry = gtk_icon_entry_new ();
-    gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
-         GTK_ICON_ENTRY_PRIMARY, GTK_STOCK_FILE);
     /* Work-around icon being activatable by default */
     gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
          GTK_ICON_ENTRY_PRIMARY, FALSE);
@@ -1508,7 +1506,7 @@ midori_location_action_get_text (MidoriLocationAction* location_action)
  * @location_action: a #MidoriLocationAction
  * @text: a string
  *
- * Sets the entry text to @text and, if applicable, updates the icon.
+ * Sets the entry text to @text.
  *
  * Since: 0.2.0
  **/
@@ -1517,7 +1515,6 @@ midori_location_action_set_text (MidoriLocationAction* location_action,
                                  const gchar*          text)
 {
     GSList* proxies;
-    GdkPixbuf* icon;
 
     g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
     g_return_if_fail (text != NULL);
@@ -1530,21 +1527,12 @@ midori_location_action_set_text (MidoriLocationAction* location_action,
     if (!(proxies = gtk_action_get_proxies (GTK_ACTION (location_action))))
         return;
 
-    if (!(icon = katze_load_cached_icon (location_action->uri, NULL)))
-        icon = g_object_ref (location_action->default_icon);
-
     for (; proxies != NULL; proxies = g_slist_next (proxies))
     if (GTK_IS_TOOL_ITEM (proxies->data))
     {
         GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
         gtk_entry_set_text (GTK_ENTRY (entry), text);
-        #if !HAVE_HILDON
-        gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (entry),
-            GTK_ICON_ENTRY_PRIMARY, icon);
-        #endif
     }
-
-    g_object_unref (icon);
 }
 
 /**
@@ -1554,33 +1542,12 @@ midori_location_action_set_text (MidoriLocationAction* location_action,
  *
  * Sets the icon shown on the left hand side.
  *
- * Note: Since 0.1.8 %NULL can be passed to indicate that the
- *     visible URI refers to a target, not the current location.
+ * Deprecated: 0.4.6: The left hand icon only shows security status.
  **/
 void
 midori_location_action_set_icon (MidoriLocationAction* location_action,
                                  GdkPixbuf*            icon)
 {
-    #if !HAVE_HILDON
-    GSList* proxies;
-
-    g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
-    g_return_if_fail (!icon || GDK_IS_PIXBUF (icon));
-
-    proxies = gtk_action_get_proxies (GTK_ACTION (location_action));
-
-    for (; proxies != NULL; proxies = g_slist_next (proxies))
-    if (GTK_IS_TOOL_ITEM (proxies->data))
-    {
-        GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
-        if (icon)
-            gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (entry),
-                GTK_ICON_ENTRY_PRIMARY, icon);
-        else
-            gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
-                GTK_ICON_ENTRY_PRIMARY, GTK_STOCK_JUMP_TO);
-    }
-    #endif
 }
 
 void
@@ -1593,32 +1560,24 @@ midori_location_action_add_uri (MidoriLocationAction* location_action,
     katze_assign (location_action->uri, g_strdup (uri));
 }
 
+/**
+ * midori_location_action_add_item:
+ * @location_action: a #MidoriLocationAction
+ * @icon: a #GdkPixbuf or %NULL
+ * @title: a string
+ *
+ * Adds the item to the location, historically this added it to
+ * completion suggestions and updated the left side icon.
+ *
+ * Deprecated: 0.4.6: The left hand icon only shows security status.
+ **/
+
 void
 midori_location_action_add_item (MidoriLocationAction* location_action,
                                  const gchar*          uri,
                                  GdkPixbuf*            icon,
                                  const gchar*          title)
 {
-    #if !HAVE_HILDON
-    GSList* proxies;
-    #endif
-
-    g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
-    g_return_if_fail (uri != NULL);
-    g_return_if_fail (title != NULL);
-    g_return_if_fail (!icon || GDK_IS_PIXBUF (icon));
-
-    #if !HAVE_HILDON
-    proxies = gtk_action_get_proxies (GTK_ACTION (location_action));
-
-    for (; proxies != NULL; proxies = g_slist_next (proxies))
-    if (GTK_IS_TOOL_ITEM (proxies->data))
-    {
-        GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
-        gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (entry),
-            GTK_ICON_ENTRY_PRIMARY, icon);
-    }
-    #endif
 }
 
 /**
@@ -1757,13 +1716,13 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
             #if !HAVE_HILDON
             if (gtk_icon_theme_has_icon (icon_theme, "channel-insecure-symbolic"))
                 gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
-                    GTK_ICON_ENTRY_SECONDARY, "channel-insecure-symbolic");
+                    GTK_ICON_ENTRY_PRIMARY, "channel-insecure-symbolic");
             else if (gtk_icon_theme_has_icon (icon_theme, "lock-insecure"))
                 gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
-                    GTK_ICON_ENTRY_SECONDARY, "lock-insecure");
+                    GTK_ICON_ENTRY_PRIMARY, "lock-insecure");
             else
                 gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
-                    GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_INFO);
+                    GTK_ICON_ENTRY_PRIMARY, GTK_STOCK_INFO);
             gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (entry),
                 GTK_ICON_ENTRY_SECONDARY, _("Not verified"));
             #endif
@@ -1777,20 +1736,28 @@ midori_location_action_set_security_hint (MidoriLocationAction* location_action,
             #if !HAVE_HILDON
             if (gtk_icon_theme_has_icon (icon_theme, "channel-secure-symbolic"))
                 gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
-                    GTK_ICON_ENTRY_SECONDARY, "channel-secure-symbolic");
+                    GTK_ICON_ENTRY_PRIMARY, "channel-secure-symbolic");
             else if (gtk_icon_theme_has_icon (icon_theme, "lock-secure"))
                 gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
-                    GTK_ICON_ENTRY_SECONDARY, "lock-secure");
+                    GTK_ICON_ENTRY_PRIMARY, "lock-secure");
             else
                 gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
                     GTK_ICON_ENTRY_SECONDARY, GTK_STOCK_DIALOG_AUTHENTICATION);
             gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (entry),
-                GTK_ICON_ENTRY_SECONDARY, _("Verified and encrypted connection"));
+                GTK_ICON_ENTRY_PRIMARY, _("Verified and encrypted connection"));
             #endif
         }
         else if (hint == MIDORI_SECURITY_NONE)
+        {
+            if (gtk_icon_theme_has_icon (icon_theme, "text-html-symbolic"))
+                gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
+                    GTK_ICON_ENTRY_PRIMARY, "text-html-symbolic");
+            else
+                gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
+                    GTK_ICON_ENTRY_PRIMARY, "text-html");
             gtk_icon_entry_set_tooltip (GTK_ICON_ENTRY (entry),
-                GTK_ICON_ENTRY_SECONDARY, NULL);
+                GTK_ICON_ENTRY_PRIMARY, _("Open, unencrypted connection"));
+        }
 
         {
         #if GTK_CHECK_VERSION (3, 0, 0)


More information about the Xfce4-commits mailing list