Yet more patches :)

Crispin Flowerday <[email protected]>
Newsgroups gmane.comp.web.galeon.devel
Message-ID <1057790765.15351.11.camel@drno>
Attached are another couple of patches:

1) Use the URL as the title for a page if there isn't one specified, and
don't save the about:blank pages in the window history menu

2) Add tooltips to the window history menu.

Cheers

Crispin
-- 
http://patches.theflowerdays.com
galeon_recent_visited_menu_statusbar.diff (text/x-patch, 1.3 KB)
Index: window-recent-history-menu.c
===================================================================
RCS file: /cvs/gnome/galeon/src/window-recent-history-menu.c,v
retrieving revision 1.3
diff -u -r1.3 window-recent-history-menu.c
--- window-recent-history-menu.c	27 Nov 2002 19:40:20 -0000	1.3
+++ window-recent-history-menu.c	9 Jul 2003 22:31:18 -0000
@@ -213,16 +213,21 @@
 		gchar *title_s;
 		gchar *title;
 		gchar *label;
+		gchar *url;
 		xmlChar *label_x;
-		galeon_window_recent_history_get_item (p->wrh, i, NULL, &title);
+		xmlChar *url_x;
+		galeon_window_recent_history_get_item (p->wrh, i, &url, &title);
 		title_s = gul_string_shorten (title, MAX_LABEL_LENGTH);
 		label = gul_string_new_num_accel (i, title_s, TRUE);
 		label_x = xmlEncodeSpecialChars (NULL, label);
+		url_x = xmlEncodeSpecialChars (NULL, url);
 		
 		g_string_append (xml, "<menuitem name=\"");
 		g_string_append (xml, verb);
 		g_string_append (xml, "\" label=\"");
 		g_string_append (xml, label_x);
+		g_string_append (xml, "\" tip=\"");
+		g_string_append (xml, url_x);
 		g_string_append (xml, "\" verb=\"");
 		g_string_append (xml, verb);
 		g_string_append (xml, "\"/>\n");
@@ -233,6 +238,8 @@
 		g_free (label);
 		g_free (title_s);
 		g_free (verb);
+		xmlFree (url_x);
+		g_free (url);
 	}
 	g_string_append (xml, "</placeholder>\n");
 	DEBUG_MSG (("\n%s\n", xml->str));
galeon_untitled_page_use_url.diff (text/x-patch, 1.3 KB)
Index: galeon-tab.c
===================================================================
RCS file: /cvs/gnome/galeon/src/galeon-tab.c,v
retrieving revision 1.96
diff -u -r1.96 galeon-tab.c
--- galeon-tab.c	8 Jul 2003 20:36:34 -0000	1.96
+++ galeon-tab.c	9 Jul 2003 22:30:52 -0000
@@ -532,7 +532,12 @@
 		galeon_window_update_control(tab->priv->window, PermissionControl);
 	}
 
-	galeon_window_site_visited(tab->priv->window, tab->priv->location, tab->priv->title);
+	if (strcmp(tab->priv->location,"about:blank"))
+	{
+		galeon_window_site_visited (tab->priv->window,
+					    tab->priv->location,
+					    tab->priv->title);
+	}
 }
 
 static void
@@ -557,10 +562,22 @@
 	if (*(tab->priv->title) == '\0')
 	{
 		g_free (tab->priv->title);
-		tab->priv->title = g_strdup (_("Untitled"));
+		if (!strcmp (tab->priv->location, "about:blank"))
+		{
+			tab->priv->title = g_strdup(_("Untitled"));
+		}
+		else
+		{
+			tab->priv->title = g_strdup (tab->priv->location);
+		}
+	}
+
+	if (strcmp(tab->priv->location,"about:blank"))
+	{
+		galeon_window_site_visited (tab->priv->window,
+					    tab->priv->location,
+					    tab->priv->title);
 	}
-	
-	galeon_window_site_visited (tab->priv->window, tab->priv->location, tab->priv->title);
 
 	galeon_window_set_tab_title (tab->priv->window, 
 			             tab, tab->priv->title);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.