Commit c9096ce9 authored by Elliot Lee's avatar Elliot Lee
Browse files

Add "Bonobo" to list of log domains to catch.



* src/ntl-main.c: Add "Bonobo" to list of log domains to catch.

* src/ntl-window.c: Do proper UIH setup for the menubar and
toolbar. Also switch to using the hpaned temporarily, to be able
to see/manipulate all the meta views.

* components/history/ntl-history-view.c: Implement client side of
menu merging properly.
parent bebdc608
2000-02-10 Elliot Lee <sopwith@redhat.com>
* src/ntl-main.c: Add "Bonobo" to list of log domains to catch.
* src/ntl-window.c: Do proper UIH setup for the menubar and
toolbar. Also switch to using the hpaned temporarily, to be able
to see/manipulate all the meta views.
* components/history/ntl-history-view.c: Implement client side of
menu merging properly.
2000-02-10 John Sullivan <sullivan@eazel.com>
Used directory item count hack when comparing by size, so
......
......@@ -136,6 +136,24 @@ do_destroy(GtkObject *obj)
gtk_main_quit();
}
static void
menu_setup(BonoboObject *ctl, HistoryView *hview)
{
Bonobo_UIHandler remote_uih;
GnomeUIInfo history_menu[] = {
GNOMEUIINFO_MENU_NEW_ITEM("_Do nothing", "Testing", NULL, NULL),
GNOMEUIINFO_END
};
remote_uih = bonobo_control_get_remote_ui_handler(BONOBO_CONTROL(ctl));
bonobo_ui_handler_set_container(hview->uih, remote_uih);
bonobo_ui_handler_menu_new_subtree(hview->uih, "/History", _("H_istory"), NULL, -1, BONOBO_UI_HANDLER_PIXMAP_NONE,
NULL, 0, 0);
bonobo_ui_handler_menu_add_tree(hview->uih, "/History",
bonobo_ui_handler_menu_parse_uiinfo_tree(history_menu));
}
static BonoboObject * make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *frame, *clist, *wtmp;
......@@ -152,6 +170,13 @@ static BonoboObject * make_obj(BonoboGenericFactory *Factory, const char *goad_i
object_count++;
ctl = nautilus_view_frame_get_bonobo_object(NAUTILUS_VIEW_FRAME(frame));
hview->uih = bonobo_ui_handler_new();
bonobo_control_set_ui_handler(BONOBO_CONTROL(ctl), hview->uih);
gtk_signal_connect(GTK_OBJECT(ctl), "set_frame", menu_setup, hview);
/* set description */
nautilus_meta_view_frame_set_label(NAUTILUS_META_VIEW_FRAME(frame),
_("History"));
/* create interface */
col_titles[0] = _("Path");
......@@ -172,30 +197,9 @@ static BonoboObject * make_obj(BonoboGenericFactory *Factory, const char *goad_i
gtk_signal_connect(GTK_OBJECT(frame), "notify_location_change", hyperbola_navigation_history_notify_location_change, hview);
gtk_signal_connect(GTK_OBJECT(clist), "select_row", hyperbola_navigation_history_select_row, hview);
/* set description */
nautilus_meta_view_frame_set_label(NAUTILUS_META_VIEW_FRAME(frame),
_("History"));
hview->view = (NautilusViewFrame *)frame;
hview->clist = (GtkCList *)clist;
#if 0
{
Bonobo_UIHandler remote_uih;
GnomeUIInfo history_menu[] = {
GNOMEUIINFO_MENU_NEW_ITEM("_New", "Testing", NULL, NULL),
GNOMEUIINFO_END
};
remote_uih = bonobo_control_get_remote_ui_handler(BONOBO_CONTROL(ctl));
hview->uih = bonobo_ui_handler_new();
bonobo_ui_handler_set_container(hview->uih, remote_uih);
bonobo_ui_handler_menu_add_tree(hview->uih, "/History",
bonobo_ui_handler_menu_parse_uiinfo_tree(history_menu));
}
#endif
return ctl;
}
......
......@@ -136,6 +136,24 @@ do_destroy(GtkObject *obj)
gtk_main_quit();
}
static void
menu_setup(BonoboObject *ctl, HistoryView *hview)
{
Bonobo_UIHandler remote_uih;
GnomeUIInfo history_menu[] = {
GNOMEUIINFO_MENU_NEW_ITEM("_Do nothing", "Testing", NULL, NULL),
GNOMEUIINFO_END
};
remote_uih = bonobo_control_get_remote_ui_handler(BONOBO_CONTROL(ctl));
bonobo_ui_handler_set_container(hview->uih, remote_uih);
bonobo_ui_handler_menu_new_subtree(hview->uih, "/History", _("H_istory"), NULL, -1, BONOBO_UI_HANDLER_PIXMAP_NONE,
NULL, 0, 0);
bonobo_ui_handler_menu_add_tree(hview->uih, "/History",
bonobo_ui_handler_menu_parse_uiinfo_tree(history_menu));
}
static BonoboObject * make_obj(BonoboGenericFactory *Factory, const char *goad_id, gpointer closure)
{
GtkWidget *frame, *clist, *wtmp;
......@@ -152,6 +170,13 @@ static BonoboObject * make_obj(BonoboGenericFactory *Factory, const char *goad_i
object_count++;
ctl = nautilus_view_frame_get_bonobo_object(NAUTILUS_VIEW_FRAME(frame));
hview->uih = bonobo_ui_handler_new();
bonobo_control_set_ui_handler(BONOBO_CONTROL(ctl), hview->uih);
gtk_signal_connect(GTK_OBJECT(ctl), "set_frame", menu_setup, hview);
/* set description */
nautilus_meta_view_frame_set_label(NAUTILUS_META_VIEW_FRAME(frame),
_("History"));
/* create interface */
col_titles[0] = _("Path");
......@@ -172,30 +197,9 @@ static BonoboObject * make_obj(BonoboGenericFactory *Factory, const char *goad_i
gtk_signal_connect(GTK_OBJECT(frame), "notify_location_change", hyperbola_navigation_history_notify_location_change, hview);
gtk_signal_connect(GTK_OBJECT(clist), "select_row", hyperbola_navigation_history_select_row, hview);
/* set description */
nautilus_meta_view_frame_set_label(NAUTILUS_META_VIEW_FRAME(frame),
_("History"));
hview->view = (NautilusViewFrame *)frame;
hview->clist = (GtkCList *)clist;
#if 0
{
Bonobo_UIHandler remote_uih;
GnomeUIInfo history_menu[] = {
GNOMEUIINFO_MENU_NEW_ITEM("_New", "Testing", NULL, NULL),
GNOMEUIINFO_END
};
remote_uih = bonobo_control_get_remote_ui_handler(BONOBO_CONTROL(ctl));
hview->uih = bonobo_ui_handler_new();
bonobo_ui_handler_set_container(hview->uih, remote_uih);
bonobo_ui_handler_menu_add_tree(hview->uih, "/History",
bonobo_ui_handler_menu_parse_uiinfo_tree(history_menu));
}
#endif
return ctl;
}
......
......@@ -59,7 +59,7 @@ main(int argc, char *argv[])
*/
if (getenv("NAUTILUS_DEBUG") != NULL)
nautilus_make_warnings_and_criticals_stop_in_debugger
(G_LOG_DOMAIN, g_log_domain_glib, "Gdk", "Gtk", "GnomeVFS", "GnomeUI", NULL);
(G_LOG_DOMAIN, g_log_domain_glib, "Gdk", "Gtk", "GnomeVFS", "GnomeUI", "Bonobo", NULL);
/* Initialize the services that we use. */
CORBA_exception_init(&ev);
......
......@@ -130,7 +130,7 @@ static void nautilus_window_goto_uri_cb (GtkWidget *widget,
static void nautilus_window_about_cb (GtkWidget *widget,
NautilusWindow *window);
#define CONTENTS_AS_HBOX 1
/* #define CONTENTS_AS_HBOX 1 */
/* milliseconds */
#define STATUSBAR_CLEAR_TIMEOUT 5000
......@@ -417,11 +417,14 @@ nautilus_window_constructed(NautilusWindow *window)
GnomeApp *app;
GtkWidget *location_bar_box, *statusbar;
GtkWidget *temp_frame, *zoom_control;
GtkWidget *toolbar;
app = GNOME_APP(window);
/* set up toolbar */
gnome_app_create_toolbar_with_data(app, toolbar_info, window);
toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data(GTK_TOOLBAR(toolbar), toolbar_info, app->accel_group, app);
gnome_app_set_toolbar(app, GTK_TOOLBAR(toolbar));
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
......@@ -486,7 +489,7 @@ nautilus_window_constructed(NautilusWindow *window)
#ifdef CONTENTS_AS_HBOX
gtk_box_pack_start(GTK_BOX(window->content_hbox), temp_frame, FALSE, FALSE, 0);
#else
gtk_paned_pack1(GTK_PANED(window->content_hbox), window->index_panel, TRUE, TRUE);
gtk_paned_pack1(GTK_PANED(window->content_hbox), temp_frame, TRUE, TRUE);
#endif
gtk_widget_show_all(window->content_hbox);
......@@ -494,8 +497,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* CORBA stuff */
window->ntl_viewwindow = impl_Nautilus_ViewWindow__create(window);
window->uih = bonobo_ui_handler_new();
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
/* set up menu bar */
gnome_app_create_menus_with_data(app, main_menu, window);
......@@ -519,6 +520,11 @@ nautilus_window_constructed(NautilusWindow *window)
gnome_app_install_menu_hints(app, main_menu); /* This has to go here
after the statusbar
creation */
bonobo_ui_handler_set_menubar(window->uih, app->menubar);
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
bonobo_ui_handler_set_toolbar(window->uih, "Main", toolbar);
}
static void
......
......@@ -130,7 +130,7 @@ static void nautilus_window_goto_uri_cb (GtkWidget *widget,
static void nautilus_window_about_cb (GtkWidget *widget,
NautilusWindow *window);
#define CONTENTS_AS_HBOX 1
/* #define CONTENTS_AS_HBOX 1 */
/* milliseconds */
#define STATUSBAR_CLEAR_TIMEOUT 5000
......@@ -417,11 +417,14 @@ nautilus_window_constructed(NautilusWindow *window)
GnomeApp *app;
GtkWidget *location_bar_box, *statusbar;
GtkWidget *temp_frame, *zoom_control;
GtkWidget *toolbar;
app = GNOME_APP(window);
/* set up toolbar */
gnome_app_create_toolbar_with_data(app, toolbar_info, window);
toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data(GTK_TOOLBAR(toolbar), toolbar_info, app->accel_group, app);
gnome_app_set_toolbar(app, GTK_TOOLBAR(toolbar));
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
......@@ -486,7 +489,7 @@ nautilus_window_constructed(NautilusWindow *window)
#ifdef CONTENTS_AS_HBOX
gtk_box_pack_start(GTK_BOX(window->content_hbox), temp_frame, FALSE, FALSE, 0);
#else
gtk_paned_pack1(GTK_PANED(window->content_hbox), window->index_panel, TRUE, TRUE);
gtk_paned_pack1(GTK_PANED(window->content_hbox), temp_frame, TRUE, TRUE);
#endif
gtk_widget_show_all(window->content_hbox);
......@@ -494,8 +497,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* CORBA stuff */
window->ntl_viewwindow = impl_Nautilus_ViewWindow__create(window);
window->uih = bonobo_ui_handler_new();
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
/* set up menu bar */
gnome_app_create_menus_with_data(app, main_menu, window);
......@@ -519,6 +520,11 @@ nautilus_window_constructed(NautilusWindow *window)
gnome_app_install_menu_hints(app, main_menu); /* This has to go here
after the statusbar
creation */
bonobo_ui_handler_set_menubar(window->uih, app->menubar);
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
bonobo_ui_handler_set_toolbar(window->uih, "Main", toolbar);
}
static void
......
......@@ -130,7 +130,7 @@ static void nautilus_window_goto_uri_cb (GtkWidget *widget,
static void nautilus_window_about_cb (GtkWidget *widget,
NautilusWindow *window);
#define CONTENTS_AS_HBOX 1
/* #define CONTENTS_AS_HBOX 1 */
/* milliseconds */
#define STATUSBAR_CLEAR_TIMEOUT 5000
......@@ -417,11 +417,14 @@ nautilus_window_constructed(NautilusWindow *window)
GnomeApp *app;
GtkWidget *location_bar_box, *statusbar;
GtkWidget *temp_frame, *zoom_control;
GtkWidget *toolbar;
app = GNOME_APP(window);
/* set up toolbar */
gnome_app_create_toolbar_with_data(app, toolbar_info, window);
toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data(GTK_TOOLBAR(toolbar), toolbar_info, app->accel_group, app);
gnome_app_set_toolbar(app, GTK_TOOLBAR(toolbar));
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
......@@ -486,7 +489,7 @@ nautilus_window_constructed(NautilusWindow *window)
#ifdef CONTENTS_AS_HBOX
gtk_box_pack_start(GTK_BOX(window->content_hbox), temp_frame, FALSE, FALSE, 0);
#else
gtk_paned_pack1(GTK_PANED(window->content_hbox), window->index_panel, TRUE, TRUE);
gtk_paned_pack1(GTK_PANED(window->content_hbox), temp_frame, TRUE, TRUE);
#endif
gtk_widget_show_all(window->content_hbox);
......@@ -494,8 +497,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* CORBA stuff */
window->ntl_viewwindow = impl_Nautilus_ViewWindow__create(window);
window->uih = bonobo_ui_handler_new();
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
/* set up menu bar */
gnome_app_create_menus_with_data(app, main_menu, window);
......@@ -519,6 +520,11 @@ nautilus_window_constructed(NautilusWindow *window)
gnome_app_install_menu_hints(app, main_menu); /* This has to go here
after the statusbar
creation */
bonobo_ui_handler_set_menubar(window->uih, app->menubar);
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
bonobo_ui_handler_set_toolbar(window->uih, "Main", toolbar);
}
static void
......
......@@ -130,7 +130,7 @@ static void nautilus_window_goto_uri_cb (GtkWidget *widget,
static void nautilus_window_about_cb (GtkWidget *widget,
NautilusWindow *window);
#define CONTENTS_AS_HBOX 1
/* #define CONTENTS_AS_HBOX 1 */
/* milliseconds */
#define STATUSBAR_CLEAR_TIMEOUT 5000
......@@ -417,11 +417,14 @@ nautilus_window_constructed(NautilusWindow *window)
GnomeApp *app;
GtkWidget *location_bar_box, *statusbar;
GtkWidget *temp_frame, *zoom_control;
GtkWidget *toolbar;
app = GNOME_APP(window);
/* set up toolbar */
gnome_app_create_toolbar_with_data(app, toolbar_info, window);
toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data(GTK_TOOLBAR(toolbar), toolbar_info, app->accel_group, app);
gnome_app_set_toolbar(app, GTK_TOOLBAR(toolbar));
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
......@@ -486,7 +489,7 @@ nautilus_window_constructed(NautilusWindow *window)
#ifdef CONTENTS_AS_HBOX
gtk_box_pack_start(GTK_BOX(window->content_hbox), temp_frame, FALSE, FALSE, 0);
#else
gtk_paned_pack1(GTK_PANED(window->content_hbox), window->index_panel, TRUE, TRUE);
gtk_paned_pack1(GTK_PANED(window->content_hbox), temp_frame, TRUE, TRUE);
#endif
gtk_widget_show_all(window->content_hbox);
......@@ -494,8 +497,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* CORBA stuff */
window->ntl_viewwindow = impl_Nautilus_ViewWindow__create(window);
window->uih = bonobo_ui_handler_new();
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
/* set up menu bar */
gnome_app_create_menus_with_data(app, main_menu, window);
......@@ -519,6 +520,11 @@ nautilus_window_constructed(NautilusWindow *window)
gnome_app_install_menu_hints(app, main_menu); /* This has to go here
after the statusbar
creation */
bonobo_ui_handler_set_menubar(window->uih, app->menubar);
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
bonobo_ui_handler_set_toolbar(window->uih, "Main", toolbar);
}
static void
......
......@@ -59,7 +59,7 @@ main(int argc, char *argv[])
*/
if (getenv("NAUTILUS_DEBUG") != NULL)
nautilus_make_warnings_and_criticals_stop_in_debugger
(G_LOG_DOMAIN, g_log_domain_glib, "Gdk", "Gtk", "GnomeVFS", "GnomeUI", NULL);
(G_LOG_DOMAIN, g_log_domain_glib, "Gdk", "Gtk", "GnomeVFS", "GnomeUI", "Bonobo", NULL);
/* Initialize the services that we use. */
CORBA_exception_init(&ev);
......
......@@ -130,7 +130,7 @@ static void nautilus_window_goto_uri_cb (GtkWidget *widget,
static void nautilus_window_about_cb (GtkWidget *widget,
NautilusWindow *window);
#define CONTENTS_AS_HBOX 1
/* #define CONTENTS_AS_HBOX 1 */
/* milliseconds */
#define STATUSBAR_CLEAR_TIMEOUT 5000
......@@ -417,11 +417,14 @@ nautilus_window_constructed(NautilusWindow *window)
GnomeApp *app;
GtkWidget *location_bar_box, *statusbar;
GtkWidget *temp_frame, *zoom_control;
GtkWidget *toolbar;
app = GNOME_APP(window);
/* set up toolbar */
gnome_app_create_toolbar_with_data(app, toolbar_info, window);
toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data(GTK_TOOLBAR(toolbar), toolbar_info, app->accel_group, app);
gnome_app_set_toolbar(app, GTK_TOOLBAR(toolbar));
window->btn_back = toolbar_info[0].widget;
window->btn_fwd = toolbar_info[1].widget;
nautilus_window_allow_stop(window, FALSE);
......@@ -486,7 +489,7 @@ nautilus_window_constructed(NautilusWindow *window)
#ifdef CONTENTS_AS_HBOX
gtk_box_pack_start(GTK_BOX(window->content_hbox), temp_frame, FALSE, FALSE, 0);
#else
gtk_paned_pack1(GTK_PANED(window->content_hbox), window->index_panel, TRUE, TRUE);
gtk_paned_pack1(GTK_PANED(window->content_hbox), temp_frame, TRUE, TRUE);
#endif
gtk_widget_show_all(window->content_hbox);
......@@ -494,8 +497,6 @@ nautilus_window_constructed(NautilusWindow *window)
/* CORBA stuff */
window->ntl_viewwindow = impl_Nautilus_ViewWindow__create(window);
window->uih = bonobo_ui_handler_new();
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
/* set up menu bar */
gnome_app_create_menus_with_data(app, main_menu, window);
......@@ -519,6 +520,11 @@ nautilus_window_constructed(NautilusWindow *window)
gnome_app_install_menu_hints(app, main_menu); /* This has to go here
after the statusbar
creation */
bonobo_ui_handler_set_menubar(window->uih, app->menubar);
bonobo_ui_handler_set_app(window->uih, app);
bonobo_ui_handler_set_statusbar(window->uih, statusbar);
bonobo_ui_handler_set_toolbar(window->uih, "Main", toolbar);
}
static void
......
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