Commit cd934261 authored by John Sullivan's avatar John Sullivan
Browse files

Two non-user-visible changes: (1) wire up history metaview to react to icon

theme changes (but no effect because Nautilus icon theme changes don't yet
trickle to metaview); (2) add "View as Text" to choices when viewing html (but
no effect because loading from http is currently broken).
parent 667c03d2
2000-02-24 John Sullivan <sullivan@eazel.com>
* src/ntl-uri-map.c: (my_notify_when_ready):
Added "View as Text" as an option for html pages. Untestable
right now because attempting to load html pages fails.
* components/history/ntl-history-view.c:
(install_icon): Removed bookmark parameter; now it determines that
from the other parameters.
(history_view_update_icons): New function, walks through list updating
the icon for each row.
(hyperbola_navigation_history_notify_location_change): Removed bookmark
parameter from install_icon call.
(make_obj): register to call history_view_update_icons
when nautilus_icon_factory emits "theme_changed" signal. This has
no current visible effect, because changing the theme in Nautilus
does not change the theme in the separate icon factory used in this
metaview. This is bugzilla bug #5.
2000-02-24 John Sullivan <sullivan@eazel.com>
Cleaned up after fix to bug 14 from yesterday.
......
......@@ -63,11 +63,13 @@ get_uri_from_row (GtkCList *clist, int row)
static void
install_icon (GtkCList *clist, const NautilusBookmark *bookmark, gint row)
install_icon (GtkCList *clist, gint row)
{
GdkPixmap *pixmap;
GdkBitmap *bitmap;
const NautilusBookmark *bookmark;
bookmark = get_bookmark_from_row (clist, row);
if (!nautilus_bookmark_get_pixmap_and_mask (bookmark,
NAUTILUS_ICON_SIZE_SMALLER,
&pixmap,
......@@ -83,6 +85,20 @@ install_icon (GtkCList *clist, const NautilusBookmark *bookmark, gint row)
bitmap);
}
static void
history_view_update_icons (HistoryView *history_view)
{
GtkCList *clist;
int row;
clist = history_view->clist;
for (row = 0; row < clist->rows; ++row)
{
install_icon (clist, row);
}
}
static void
hyperbola_navigation_history_notify_location_change (NautilusViewFrame *view,
Nautilus_NavigationInfo *loci,
......@@ -124,7 +140,7 @@ hyperbola_navigation_history_notify_location_change (NautilusViewFrame *view,
new_rownum,
bookmark,
(GtkDestroyNotify)gtk_object_unref);
install_icon (clist, bookmark, new_rownum);
install_icon (clist, new_rownum);
gtk_clist_columns_autosize(clist);
......@@ -242,6 +258,12 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
gtk_signal_connect(GTK_OBJECT(hview->view), "notify_location_change", hyperbola_navigation_history_notify_location_change, hview);
gtk_signal_connect(GTK_OBJECT(clist), "select_row", hyperbola_navigation_history_select_row, hview);
gtk_signal_connect_object_while_alive (nautilus_icon_factory_get (),
"theme_changed",
history_view_update_icons,
GTK_OBJECT (hview));
hview->clist = (GtkCList *)clist;
return BONOBO_OBJECT (hview->view);
......
......@@ -63,11 +63,13 @@ get_uri_from_row (GtkCList *clist, int row)
static void
install_icon (GtkCList *clist, const NautilusBookmark *bookmark, gint row)
install_icon (GtkCList *clist, gint row)
{
GdkPixmap *pixmap;
GdkBitmap *bitmap;
const NautilusBookmark *bookmark;
bookmark = get_bookmark_from_row (clist, row);
if (!nautilus_bookmark_get_pixmap_and_mask (bookmark,
NAUTILUS_ICON_SIZE_SMALLER,
&pixmap,
......@@ -83,6 +85,20 @@ install_icon (GtkCList *clist, const NautilusBookmark *bookmark, gint row)
bitmap);
}
static void
history_view_update_icons (HistoryView *history_view)
{
GtkCList *clist;
int row;
clist = history_view->clist;
for (row = 0; row < clist->rows; ++row)
{
install_icon (clist, row);
}
}
static void
hyperbola_navigation_history_notify_location_change (NautilusViewFrame *view,
Nautilus_NavigationInfo *loci,
......@@ -124,7 +140,7 @@ hyperbola_navigation_history_notify_location_change (NautilusViewFrame *view,
new_rownum,
bookmark,
(GtkDestroyNotify)gtk_object_unref);
install_icon (clist, bookmark, new_rownum);
install_icon (clist, new_rownum);
gtk_clist_columns_autosize(clist);
......@@ -242,6 +258,12 @@ make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
gtk_signal_connect(GTK_OBJECT(hview->view), "notify_location_change", hyperbola_navigation_history_notify_location_change, hview);
gtk_signal_connect(GTK_OBJECT(clist), "select_row", hyperbola_navigation_history_select_row, hview);
gtk_signal_connect_object_while_alive (nautilus_icon_factory_get (),
"theme_changed",
history_view_update_icons,
GTK_OBJECT (hview));
hview->clist = (GtkCList *)clist;
return BONOBO_OBJECT (hview->view);
......
......@@ -118,7 +118,10 @@ my_notify_when_ready(GnomeVFSAsyncHandle *ah, GnomeVFSResult result,
navinfo->default_content_iid = "ntl_web_browser";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Web Page"));
nautilus_view_identifier_new ("ntl_web_browser", "Web Page"));
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new ("embeddable:text-plain", "Text"));
}
else if(!strcmp(navinfo->navinfo.content_type, "text/plain"))
{
......
......@@ -118,7 +118,10 @@ my_notify_when_ready(GnomeVFSAsyncHandle *ah, GnomeVFSResult result,
navinfo->default_content_iid = "ntl_web_browser";
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new (navinfo->default_content_iid, "Web Page"));
nautilus_view_identifier_new ("ntl_web_browser", "Web Page"));
navinfo->content_identifiers = g_slist_append (
navinfo->content_identifiers,
nautilus_view_identifier_new ("embeddable:text-plain", "Text"));
}
else if(!strcmp(navinfo->navinfo.content_type, "text/plain"))
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment