Commit 3fd015a8 authored by Elliot Lee's avatar Elliot Lee
Browse files

The whole wazoo. It would work, except for a bug I blame on gnome-vfs.



The whole wazoo. It would work, except for a bug I blame on gnome-vfs.
parent 65c2e7dd
......@@ -4,3 +4,7 @@ INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GNOMEUI_CFLAGS) $(BONOBO_CFLAGS)
LDADD=$(top_builddir)/libnautilus/libnautilus.la $(BONOBO_LIBS) $(GNOMEUI_LIBS)
ntl_history_view_SOURCES=ntl-history-view.c
goaddir=$(sysconfdir)/CORBA/servers
goad_DATA=ntl-history-view.goad
EXTRA_DIST=$(goad_DATA)
......@@ -25,14 +25,20 @@ AM_PATH_GLIB(1.2.0,,
AC_MSG_ERROR([
*** GLIB 1.2.0 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org/.]))
AM_PATH_GNOME(1.0.0,,AC_MSG_ERROR([*** GNOME 1.0.0 or better is
required.]), gdk_pixbuf gnorba bonobo)
required.]), gdk_pixbuf gnorba bonobo vfspthread)
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
AC_SUBST(GNORBA_CFLAGS)
AC_SUBST(GNORBA_LIBS)
AC_SUBST(BONOBO_CFLAGS)
AC_SUBST(BONOBO_LIBS)
VFS_CFLAGS="$VFSPTHREAD_CFLAGS"
VFS_LIBS="$VFSPTHREAD_LIBS"
AC_SUBST(VFS_CFLAGS)
AC_SUBST(VFS_LIBS)
AM_PATH_LIBGLADE(,AC_MSG_ERROR([*** Libglade 0.7 or better is needed.]), gnome)
dnl Checks for typedefs, structures, and compiler characteristics.
......
......@@ -9,6 +9,7 @@ libnautilusincludedir=$(includedir)/libnautilus
libnautilusinclude_HEADERS= \
ntl-view-client.h \
ntl-meta-view-client.h \
ntl-content-view-client.h \
nautilus.h \
gnome-icon-container-dnd.h \
gnome-icon-container-layout.h \
......@@ -22,6 +23,7 @@ libnautilusinclude_HEADERS= \
libnautilus_la_SOURCES=$(nautilus_idl_sources) \
ntl-view-client.c \
ntl-meta-view-client.c \
ntl-content-view-client.c \
gnome-icon-container-dnd.c \
gnome-icon-container-layout.c \
gnome-icon-container.c \
......
......@@ -150,9 +150,10 @@ impl_Nautilus_View__create(NautilusViewClient *view, CORBA_Environment * ev)
newservant->servant.vepv = view_class->vepv;
if(!newservant->servant.vepv->GNOME_Unknown_epv)
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv();
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
newservant->view = view;
retval = gnome_object_new_from_servant(newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
......@@ -302,6 +303,7 @@ nautilus_view_client_init (NautilusViewClient *view)
CORBA_exception_init(&ev);
view->view_client = impl_Nautilus_View__create(view, &ev);
gnome_object_add_interface(view->control, view->view_client);
CORBA_exception_free(&ev);
}
......
......@@ -9,6 +9,7 @@ libnautilusincludedir=$(includedir)/libnautilus
libnautilusinclude_HEADERS= \
ntl-view-client.h \
ntl-meta-view-client.h \
ntl-content-view-client.h \
nautilus.h \
gnome-icon-container-dnd.h \
gnome-icon-container-layout.h \
......@@ -22,6 +23,7 @@ libnautilusinclude_HEADERS= \
libnautilus_la_SOURCES=$(nautilus_idl_sources) \
ntl-view-client.c \
ntl-meta-view-client.c \
ntl-content-view-client.c \
gnome-icon-container-dnd.c \
gnome-icon-container-layout.c \
gnome-icon-container.c \
......
......@@ -150,9 +150,10 @@ impl_Nautilus_View__create(NautilusViewClient *view, CORBA_Environment * ev)
newservant->servant.vepv = view_class->vepv;
if(!newservant->servant.vepv->GNOME_Unknown_epv)
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv();
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
newservant->view = view;
retval = gnome_object_new_from_servant(newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
......@@ -302,6 +303,7 @@ nautilus_view_client_init (NautilusViewClient *view)
CORBA_exception_init(&ev);
view->view_client = impl_Nautilus_View__create(view, &ev);
gnome_object_add_interface(view->control, view->view_client);
CORBA_exception_free(&ev);
}
......
......@@ -9,6 +9,7 @@ libnautilusincludedir=$(includedir)/libnautilus
libnautilusinclude_HEADERS= \
ntl-view-client.h \
ntl-meta-view-client.h \
ntl-content-view-client.h \
nautilus.h \
gnome-icon-container-dnd.h \
gnome-icon-container-layout.h \
......@@ -22,6 +23,7 @@ libnautilusinclude_HEADERS= \
libnautilus_la_SOURCES=$(nautilus_idl_sources) \
ntl-view-client.c \
ntl-meta-view-client.c \
ntl-content-view-client.c \
gnome-icon-container-dnd.c \
gnome-icon-container-layout.c \
gnome-icon-container.c \
......
......@@ -150,9 +150,10 @@ impl_Nautilus_View__create(NautilusViewClient *view, CORBA_Environment * ev)
newservant->servant.vepv = view_class->vepv;
if(!newservant->servant.vepv->GNOME_Unknown_epv)
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv();
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
newservant->view = view;
retval = gnome_object_new_from_servant(newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
......@@ -302,6 +303,7 @@ nautilus_view_client_init (NautilusViewClient *view)
CORBA_exception_init(&ev);
view->view_client = impl_Nautilus_View__create(view, &ev);
gnome_object_add_interface(view->control, view->view_client);
CORBA_exception_free(&ev);
}
......
......@@ -150,9 +150,10 @@ impl_Nautilus_View__create(NautilusViewClient *view, CORBA_Environment * ev)
newservant->servant.vepv = view_class->vepv;
if(!newservant->servant.vepv->GNOME_Unknown_epv)
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv();
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
newservant->view = view;
retval = gnome_object_new_from_servant(newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
......@@ -302,6 +303,7 @@ nautilus_view_client_init (NautilusViewClient *view)
CORBA_exception_init(&ev);
view->view_client = impl_Nautilus_View__create(view, &ev);
gnome_object_add_interface(view->control, view->view_client);
CORBA_exception_free(&ev);
}
......
......@@ -150,9 +150,10 @@ impl_Nautilus_View__create(NautilusViewClient *view, CORBA_Environment * ev)
newservant->servant.vepv = view_class->vepv;
if(!newservant->servant.vepv->GNOME_Unknown_epv)
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv();
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
newservant->view = view;
retval = gnome_object_new_from_servant(newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
......@@ -302,6 +303,7 @@ nautilus_view_client_init (NautilusViewClient *view)
CORBA_exception_init(&ev);
view->view_client = impl_Nautilus_View__create(view, &ev);
gnome_object_add_interface(view->control, view->view_client);
CORBA_exception_free(&ev);
}
......
......@@ -150,9 +150,10 @@ impl_Nautilus_View__create(NautilusViewClient *view, CORBA_Environment * ev)
newservant->servant.vepv = view_class->vepv;
if(!newservant->servant.vepv->GNOME_Unknown_epv)
newservant->servant.vepv->GNOME_Unknown_epv = gnome_object_get_epv();
newservant->view = view;
servant_init_func((PortableServer_Servant) newservant, ev);
newservant->view = view;
retval = gnome_object_new_from_servant(newservant);
gtk_signal_connect(GTK_OBJECT(retval), "destroy", GTK_SIGNAL_FUNC(impl_Nautilus_View__destroy), newservant);
......@@ -302,6 +303,7 @@ nautilus_view_client_init (NautilusViewClient *view)
CORBA_exception_init(&ev);
view->view_client = impl_Nautilus_View__create(view, &ev);
gnome_object_add_interface(view->control, view->view_client);
CORBA_exception_free(&ev);
}
......
......@@ -5,6 +5,7 @@ bin_PROGRAMS=nautilus
INCLUDES=-I$(top_srcdir) -I$(top_builddir) \
$(BONOBO_CFLAGS) $(GNORBA_CFLAGS) \
$(GNOMEUI_CFLAGS) $(GDK_PIXBUF_CFLAGS) \
$(VFS_CFLAGS) \
-DVERSION="\"$(VERSION)\""
LDADD= file-manager/libntl-file-manager.la \
......@@ -12,7 +13,8 @@ LDADD= file-manager/libntl-file-manager.la \
$(BONOBO_LIBS) \
$(GNORBA_LIBS) \
$(GNOMEUI_LIBS) \
$(GDK_PIXBUF_LIBS)
$(GDK_PIXBUF_LIBS) \
$(VFS_LIBS)
nautilus_SOURCES= \
ntl-content-view.h \
......@@ -29,3 +31,7 @@ nautilus_SOURCES= \
ntl-window.c \
explorer-location-bar.h \
explorer-location-bar.c
goaddir=$(sysconfdir)/CORBA/servers
goad_DATA=nautilus.goad
EXTRA_DIST=$(goad_DATA)
\ No newline at end of file
......@@ -485,6 +485,7 @@ setup_flist (FMDirectoryView *view,
static void
real_location_change(NautilusViewClient *directory_view, Nautilus_NavigationInfo *nav_context)
{
g_message("Directory view is loading URL %s", nav_context->requested_uri);
fm_directory_view_load_uri(FM_DIRECTORY_VIEW(directory_view), nav_context->requested_uri);
}
......@@ -525,13 +526,15 @@ static void
class_init (FMDirectoryViewClass *class)
{
GtkObjectClass *object_class;
NautilusViewClientClass *vc;
object_class = GTK_OBJECT_CLASS (class);
vc = NAUTILUS_VIEW_CLIENT_CLASS (class);
parent_class = gtk_type_class (gtk_type_parent(object_class->type));
object_class->destroy = destroy;
parent_class->notify_location_change = real_location_change;
vc->notify_location_change = real_location_change;
}
static void
......@@ -559,6 +562,7 @@ init (FMDirectoryView *directory_view)
GTK_POLICY_AUTOMATIC);
gtk_scroll_frame_set_shadow_type (GTK_SCROLL_FRAME(directory_view->scroll_frame), GTK_SHADOW_IN);
gtk_widget_show(directory_view->scroll_frame);
gtk_container_add(GTK_CONTAINER(directory_view), directory_view->scroll_frame);
fm_directory_view_set_mode (directory_view, FM_DIRECTORY_VIEW_MODE_ICONS);
}
......
......@@ -57,6 +57,8 @@ typedef struct _FMDirectoryViewClass FMDirectoryViewClass;
#define FM_IS_DIRECTORY_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), FM_TYPE_DIRECTORY_VIEW))
struct _FMDirectoryView {
NautilusContentViewClient parent;
FMDirectoryViewMode mode;
GtkWidget *scroll_frame;
......
......@@ -36,6 +36,7 @@ nautilus_navinfo_new(NautilusNavigationInfo *navinfo,
const char *referring_content_type,
GtkWidget *requesting_view)
{
const char *meta_keys[] = {"icon-filename", NULL};
memset(navinfo, 0, sizeof(*navinfo));
navinfo->navinfo.requested_uri = nri->requested_uri;
......@@ -45,7 +46,13 @@ nautilus_navinfo_new(NautilusNavigationInfo *navinfo,
navinfo->requesting_view = requesting_view;
navinfo->navinfo.content_type = gnome_mime_type_of_file(navinfo->navinfo.requested_uri);
navinfo->vfs_fileinfo = gnome_vfs_file_info_new();
gnome_vfs_get_file_info(navinfo->navinfo.requested_uri,
navinfo->vfs_fileinfo,
GNOME_VFS_FILE_INFO_GETMIMETYPE
|GNOME_VFS_FILE_INFO_FOLLOWLINKS,
meta_keys);
navinfo->navinfo.content_type = gnome_vfs_file_info_get_mime_type(navinfo->vfs_fileinfo);
/* Given a content type and a URI, what do we do? Basically the "expert system" below
tries to answer that question
......@@ -67,6 +74,10 @@ nautilus_navinfo_new(NautilusNavigationInfo *navinfo,
Find if the user has specified any default(s) globally, modify selection.
Find if the user has specified any default(s) per-page, modify selection.
*/
g_message("Content type of %s is %s",
navinfo->navinfo.requested_uri,
navinfo->navinfo.content_type);
if(!strcmp(navinfo->navinfo.content_type, "text/html"))
{
navinfo->content_iid = "embeddable:explorer-html-component";
......@@ -81,12 +92,11 @@ nautilus_navinfo_new(NautilusNavigationInfo *navinfo,
}
return NULL;
return navinfo;
}
void
nautilus_navinfo_free(NautilusNavigationInfo *navinfo)
{
g_free(navinfo->navinfo.content_type);
g_free(navinfo->content_iid);
gnome_vfs_file_info_destroy(navinfo->vfs_fileinfo);
}
......@@ -54,7 +54,10 @@ nautilus_make_object(GnomeGenericFactory *gfact, const char *goad_id, gpointer c
return GNOME_OBJECT(theobj);
if(NAUTILUS_IS_VIEW_CLIENT(theobj))
return nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(theobj));
{
gtk_widget_show(GTK_WIDGET(theobj));
return nautilus_view_client_get_gnome_object(NAUTILUS_VIEW_CLIENT(theobj));
}
gtk_object_destroy(theobj);
......@@ -74,6 +77,8 @@ int main(int argc, char *argv[])
orb = gnome_CORBA_init_with_popt_table("nautilus", VERSION, &argc, argv, options, 0, &ctx, GNORBA_INIT_SERVER_FUNC, &ev);
bonobo_init(orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
g_thread_init(NULL);
gnome_vfs_init();
gfact = gnome_generic_factory_new_multi("nautilus_factory", nautilus_make_object, NULL);
......
......@@ -93,8 +93,8 @@ impl_Nautilus_ViewWindow__create(NautilusWindow *window)
static void nautilus_window_class_init (NautilusWindowClass *klass);
static void nautilus_window_init (NautilusWindow *window);
static void nautilus_window_destroy (NautilusWindow *window);
static void nautilus_window_back (NautilusWindow *window);
static void nautilus_window_fwd (NautilusWindow *window);
static void nautilus_window_back (GtkWidget *btn, NautilusWindow *window);
static void nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window);
static void nautilus_window_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
......@@ -363,7 +363,7 @@ nautilus_window_constructed(NautilusWindow *window)
gtk_button_set_relief(GTK_BUTTON(window->btn_back), GTK_RELIEF_NONE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_container_add(GTK_CONTAINER(window->btn_back), wtmp);
gtk_signal_connect(GTK_OBJECT(window->btn_back), "clicked", nautilus_window_back, NULL);
gtk_signal_connect(GTK_OBJECT(window->btn_back), "clicked", nautilus_window_back, window);
wtmp = gnome_stock_pixmap_widget(GTK_WIDGET(window), GNOME_STOCK_PIXMAP_FORWARD);
window->btn_fwd = gtk_button_new();
......@@ -651,7 +651,8 @@ nautilus_window_change_location(NautilusWindow *window,
g_slist_foreach(window->uris_next, (GFunc)g_free, NULL);
g_slist_free(window->uris_next); window->uris_next = NULL;
}
window->uris_prev = g_slist_prepend(window->uris_prev, append_val);
if(append_val)
window->uris_prev = g_slist_prepend(window->uris_prev, append_val);
}
gtk_widget_set_sensitive(window->btn_back, window->uris_prev?TRUE:FALSE);
gtk_widget_set_sensitive(window->btn_fwd, window->uris_next?TRUE:FALSE);
......@@ -661,7 +662,7 @@ nautilus_window_change_location(NautilusWindow *window,
signum = gtk_signal_lookup("notify_location_change", nautilus_view_get_type());
/* If we need to load a different IID, do that before sending the location change request */
if(strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) {
if(!window->content_view || strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) {
NautilusView *new_view;
if(requesting_view == window->content_view)
......@@ -819,6 +820,9 @@ nautilus_window_save_state(NautilusWindow *window, const char *config_path)
void
nautilus_window_set_initial_state(NautilusWindow *window)
{
nautilus_window_goto_url(NULL, "file://localhost/", (GtkWidget *)window);
#if 0
GSList *cur;
GtkRequisition sreq;
GdkGeometry geo;
......@@ -850,6 +854,7 @@ nautilus_window_set_initial_state(NautilusWindow *window)
#ifndef CONTENTS_AS_HBOX
gtk_paned_set_position(GTK_PANED(window->content_hbox), MAX(400, GTK_WIDGET(window->content_view)->requisition.width));
#endif
#endif
}
void
......@@ -913,7 +918,7 @@ nautilus_window_load_state(NautilusWindow *window, const char *config_path)
}
static void
nautilus_window_back (NautilusWindow *window)
nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
{
Nautilus_NavigationRequestInfo nri;
......@@ -927,7 +932,7 @@ nautilus_window_back (NautilusWindow *window)
}
static void
nautilus_window_fwd (NautilusWindow *window)
nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
{
Nautilus_NavigationRequestInfo nri;
......
......@@ -93,8 +93,8 @@ impl_Nautilus_ViewWindow__create(NautilusWindow *window)
static void nautilus_window_class_init (NautilusWindowClass *klass);
static void nautilus_window_init (NautilusWindow *window);
static void nautilus_window_destroy (NautilusWindow *window);
static void nautilus_window_back (NautilusWindow *window);
static void nautilus_window_fwd (NautilusWindow *window);
static void nautilus_window_back (GtkWidget *btn, NautilusWindow *window);
static void nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window);
static void nautilus_window_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
......@@ -363,7 +363,7 @@ nautilus_window_constructed(NautilusWindow *window)
gtk_button_set_relief(GTK_BUTTON(window->btn_back), GTK_RELIEF_NONE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_container_add(GTK_CONTAINER(window->btn_back), wtmp);
gtk_signal_connect(GTK_OBJECT(window->btn_back), "clicked", nautilus_window_back, NULL);
gtk_signal_connect(GTK_OBJECT(window->btn_back), "clicked", nautilus_window_back, window);
wtmp = gnome_stock_pixmap_widget(GTK_WIDGET(window), GNOME_STOCK_PIXMAP_FORWARD);
window->btn_fwd = gtk_button_new();
......@@ -651,7 +651,8 @@ nautilus_window_change_location(NautilusWindow *window,
g_slist_foreach(window->uris_next, (GFunc)g_free, NULL);
g_slist_free(window->uris_next); window->uris_next = NULL;
}
window->uris_prev = g_slist_prepend(window->uris_prev, append_val);
if(append_val)
window->uris_prev = g_slist_prepend(window->uris_prev, append_val);
}
gtk_widget_set_sensitive(window->btn_back, window->uris_prev?TRUE:FALSE);
gtk_widget_set_sensitive(window->btn_fwd, window->uris_next?TRUE:FALSE);
......@@ -661,7 +662,7 @@ nautilus_window_change_location(NautilusWindow *window,
signum = gtk_signal_lookup("notify_location_change", nautilus_view_get_type());
/* If we need to load a different IID, do that before sending the location change request */
if(strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) {
if(!window->content_view || strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) {
NautilusView *new_view;
if(requesting_view == window->content_view)
......@@ -819,6 +820,9 @@ nautilus_window_save_state(NautilusWindow *window, const char *config_path)
void
nautilus_window_set_initial_state(NautilusWindow *window)
{
nautilus_window_goto_url(NULL, "file://localhost/", (GtkWidget *)window);
#if 0
GSList *cur;
GtkRequisition sreq;
GdkGeometry geo;
......@@ -850,6 +854,7 @@ nautilus_window_set_initial_state(NautilusWindow *window)
#ifndef CONTENTS_AS_HBOX
gtk_paned_set_position(GTK_PANED(window->content_hbox), MAX(400, GTK_WIDGET(window->content_view)->requisition.width));
#endif
#endif
}
void
......@@ -913,7 +918,7 @@ nautilus_window_load_state(NautilusWindow *window, const char *config_path)
}
static void
nautilus_window_back (NautilusWindow *window)
nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
{
Nautilus_NavigationRequestInfo nri;
......@@ -927,7 +932,7 @@ nautilus_window_back (NautilusWindow *window)
}
static void
nautilus_window_fwd (NautilusWindow *window)
nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
{
Nautilus_NavigationRequestInfo nri;
......
......@@ -93,8 +93,8 @@ impl_Nautilus_ViewWindow__create(NautilusWindow *window)
static void nautilus_window_class_init (NautilusWindowClass *klass);
static void nautilus_window_init (NautilusWindow *window);
static void nautilus_window_destroy (NautilusWindow *window);
static void nautilus_window_back (NautilusWindow *window);
static void nautilus_window_fwd (NautilusWindow *window);
static void nautilus_window_back (GtkWidget *btn, NautilusWindow *window);
static void nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window);
static void nautilus_window_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
......@@ -363,7 +363,7 @@ nautilus_window_constructed(NautilusWindow *window)
gtk_button_set_relief(GTK_BUTTON(window->btn_back), GTK_RELIEF_NONE);
gtk_widget_set_sensitive(window->btn_back, FALSE);
gtk_container_add(GTK_CONTAINER(window->btn_back), wtmp);
gtk_signal_connect(GTK_OBJECT(window->btn_back), "clicked", nautilus_window_back, NULL);
gtk_signal_connect(GTK_OBJECT(window->btn_back), "clicked", nautilus_window_back, window);
wtmp = gnome_stock_pixmap_widget(GTK_WIDGET(window), GNOME_STOCK_PIXMAP_FORWARD);
window->btn_fwd = gtk_button_new();
......@@ -651,7 +651,8 @@ nautilus_window_change_location(NautilusWindow *window,
g_slist_foreach(window->uris_next, (GFunc)g_free, NULL);
g_slist_free(window->uris_next); window->uris_next = NULL;
}
window->uris_prev = g_slist_prepend(window->uris_prev, append_val);
if(append_val)
window->uris_prev = g_slist_prepend(window->uris_prev, append_val);
}
gtk_widget_set_sensitive(window->btn_back, window->uris_prev?TRUE:FALSE);
gtk_widget_set_sensitive(window->btn_fwd, window->uris_next?TRUE:FALSE);
......@@ -661,7 +662,7 @@ nautilus_window_change_location(NautilusWindow *window,
signum = gtk_signal_lookup("notify_location_change", nautilus_view_get_type());
/* If we need to load a different IID, do that before sending the location change request */
if(strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) {
if(!window->content_view || strcmp(NAUTILUS_VIEW(window->content_view)->iid, loci->content_iid)) {
NautilusView *new_view;
if(requesting_view == window->content_view)
......@@ -819,6 +820,9 @@ nautilus_window_save_state(NautilusWindow *window, const char *config_path)
void
nautilus_window_set_initial_state(NautilusWindow *window)
{
nautilus_window_goto_url(NULL, "file://localhost/", (GtkWidget *)window);
#if 0
GSList *cur;
GtkRequisition sreq;
GdkGeometry geo;
......@@ -850,6 +854,7 @@ nautilus_window_set_initial_state(NautilusWindow *window)
#ifndef CONTENTS_AS_HBOX
gtk_paned_set_position(GTK_PANED(window->content_hbox), MAX(400, GTK_WIDGET(window->content_view)->requisition.width));
#endif
#endif
}
void
......@@ -913,7 +918,7 @@ nautilus_window_load_state(NautilusWindow *window, const char *config_path)
}
static void
nautilus_window_back (NautilusWindow *window)
nautilus_window_back (GtkWidget *btn, NautilusWindow *window)
{
Nautilus_NavigationRequestInfo nri;
......@@ -927,7 +932,7 @@ nautilus_window_back (NautilusWindow *window)
}
static void
nautilus_window_fwd (NautilusWindow *window)
nautilus_window_fwd (GtkWidget *btn, NautilusWindow *window)
{
Nautilus_NavigationRequestInfo nri;
......
......@@ -439,12 +439,13 @@ nautilus_view_load_client(NautilusView *view, const char *iid)
{
g_free(view->iid); view->iid = NULL;
gtk_container_remove(GTK_CONTAINER(view), view->client); view->client = NULL;
CORBA_Object_release(view->view_client, &ev);
}
view->client = gnome_bonobo_widget_new_subdoc((char *)iid, NAUTILUS_WINDOW(view->main_window)->uih);
view->client = gnome_bonobo_widget_new_control((char *)iid);
g_return_if_fail(view->client);
CORBA_exception_init(&ev);
CORBA_Object_release(view->view_client, &ev);
frame = gnome_bonobo_widget_get_control_frame(GNOME_BONOBO_WIDGET(view->client));
gnome_object_add_interface(GNOME_OBJECT(frame), view->view_frame);
view->view_client = GNOME_Unknown_query_interface(gnome_control_frame_get_control(GNOME_CONTROL_FRAME(frame)),
......@@ -467,9 +468,9 @@ nautilus_view_notify_location_change(NautilusView *view,
CORBA_Environment ev;
CORBA_exception_init(&ev);
g_return_if_fail(!CORBA_Object_is_nil(view->view_client, &ev));
Nautilus_View_notify_location_change(view->view_client, nav_context, &ev);
if(!CORBA_Object_is_nil(view->view_client, &ev))
Nautilus_View_notify_location_change(view->view_client, nav_context, &ev);
CORBA_exception_free(&ev);
}
......@@ -480,9 +481,9 @@ nautilus_view_notify_selection_change(NautilusView *view,
{
CORBA_Environment ev;
CORBA_exception_init(&ev);
g_return_if_fail(!CORBA_Object_is_nil(view->view_client, &ev));
Nautilus_View_notify_selection_change(view->view_client, nav_context, &ev);
if(!CORBA_Object_is_nil(view->view_client, &ev))
Nautilus_View_notify_selection_change(view->view_client, nav_context, &ev);
CORBA_exception_free(&ev);
}
......
Markdown is supported
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