mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
Cut over to HEAD of Bonobo. This check-in includes all the changes
needed to compile and run, but there are many things wrong visually that may take a while to get fixed. * src/nautilus-window-menus.c: (file_menu_new_window_callback), (file_menu_close_window_callback), (file_menu_close_all_windows_callback), (file_menu_toggle_find_mode_callback), (file_menu_web_search_callback), (edit_menu_undo_callback), (edit_menu_cut_callback), (edit_menu_copy_callback), (edit_menu_paste_callback), (edit_menu_clear_callback), (go_menu_back_callback), (go_menu_forward_callback), (go_menu_up_callback), (go_menu_home_callback), (go_menu_forget_history_callback), (view_menu_reload_callback), (view_menu_show_hide_sidebar_callback), (view_menu_show_hide_tool_bar_callback), (view_menu_show_hide_location_bar_callback), (view_menu_show_hide_status_bar_callback), (nautilus_window_update_show_hide_menu_items), (view_menu_zoom_in_callback), (view_menu_zoom_out_callback), (view_menu_zoom_normal_callback), (bookmarks_menu_add_bookmark_callback), (bookmarks_menu_edit_bookmarks_callback), (user_level_customize_callback), (customize_callback), (change_appearance_callback), (help_menu_about_nautilus_callback), (help_menu_nautilus_feedback_callback), (switch_to_user_level), (user_level_menu_item_callback), (append_placeholder), (append_separator), (append_bookmark_to_menu), (create_menu_item_from_node), (remove_bookmarks_after), (remove_underline_accelerator_from_menu_title), (new_top_level_menu), (add_user_level_menu_item), (nautilus_window_initialize_menus), (nautilus_window_update_find_menu_item), (update_user_level_menu_items), (convert_verb_to_user_level), (convert_user_level_to_verb), (update_preferences_dialog_title): * src/nautilus-window.c: (nautilus_window_clear_status), (nautilus_window_set_status), (install_status_bar), (nautilus_window_constructed), (nautilus_window_set_arg), (nautilus_window_get_arg), (nautilus_window_destroy), (nautilus_window_allow_back), (nautilus_window_allow_forward), (nautilus_window_allow_up), (nautilus_window_allow_reload), (nautilus_window_zoom_level_changed_callback), (nautilus_window_set_content_view_widget), (show_dock_item), (hide_dock_item), (dock_item_showing), (nautilus_window_hide_tool_bar), (nautilus_window_show_tool_bar), (nautilus_window_tool_bar_showing), (nautilus_window_hide_status_bar), (nautilus_window_show_status_bar), (nautilus_window_status_bar_showing): Convert to new API. Some is disabled with #ifdef UIH. * Makefile.am: * configure.in: Turned off build of the idl directory, build components after src. * components/adapter/main.c: * components/notes/nautilus-notes.c: * components/sample/main.c: * libnautilus-extensions/nautilus-font-picker.c: * libnautilus-extensions/nautilus-global-preferences.c: * libnautilus-extensions/nautilus-password-dialog.c: * libnautilus-extensions/nautilus-preferences-item.c: * libnautilus/nautilus-undo-transaction.c: * libnautilus/nautilus-undo.c: * src/nautilus-application.c: * src/nautilus-history-frame.c: * src/nautilus-link-set-window.c: * src/nautilus-main.c: * src/nautilus-shell.c: * src/nautilus-sidebar.c: * src/nautilus-view-frame-corba.c: * src/nautilus-zoomable-frame-corba.c: * test/test-nautilus-font-picker.c: * test/test-nautilus-image.c: (create_font_picker_frame): * test/test-nautilus-label.c: (create_font_picker_frame): * test/test-nautilus-preferences.c: * test/test-nautilus-widgets.c: (radio_group_load_it_up): Fixed includes. * test/test-nautilus-image.c: (create_font_picker_frame): * test/test-nautilus-label.c: (create_font_picker_frame): * test/test-nautilus-widgets.c: (radio_group_load_it_up): Turned off localization of some strings in tests. * components/adapter/nautilus-adapter-control-embed-strategy.c: (nautilus_adapter_control_embed_strategy_new): * components/adapter/nautilus-adapter-control-embed-strategy.h: * components/adapter/nautilus-adapter-embed-strategy.c: (nautilus_adapter_embed_strategy_get): * components/adapter/nautilus-adapter-embed-strategy.h: * components/adapter/nautilus-adapter-embeddable-embed-strategy.c: (nautilus_adapter_embeddable_embed_strategy_new): * components/adapter/nautilus-adapter-embeddable-embed-strategy.h: Embedding code now deals with Bonobo_UIContainer, not Bonobo_UIHandler. * components/adapter/nautilus-adapter.c: (nautilus_adapter_new): This code not only had to be changed to deal with the Bonobo_UIContainer instead of Bonobo_UIHandler, but it also needed to deal with the containing item (was remote_ui_handler), not the local component. * components/adapter/nautilus-adapter-embeddable-embed-strategy.c: (nautilus_adapter_embeddable_embed_strategy_new): * components/adapter/nautilus-adapter.c: BonoboContainer was renamed BonoboItemContainer. * components/history/nautilus-history-view.c: Remove unused BonoboUIHandler * field. * components/loser/content/Makefile.am: * components/loser/sidebar/Makefile.am: * components/mozilla/Makefile.am: * components/sample/Makefile.am: * src/Makefile.am: * src/file-manager/Makefile.am: Added the necessary defines and build rules to install ui.xml files and locate them from the C code. * src/file-manager/nautilus-directory-view-ui.xml: * src/file-manager/nautilus-icon-view-ui.xml: * src/file-manager/nautilus-search-list-view-ui.xml: * src/nautilus-shell-ui.xml: Added definitions of user interface. * components/loser/content/nautilus-content-loser-ui.xml: * components/loser/sidebar/nautilus-sidebar-loser-ui.xml: * components/mozilla/nautilus-mozilla-ui.xml: * components/sample/nautilus-sample-content-view-ui.xml: Added empty placeholders for user interface. * components/loser/content/nautilus-content-loser.c: (loser_merge_bonobo_items_callback): * components/loser/sidebar/nautilus-sidebar-loser.c: (loser_merge_bonobo_items_callback): * components/mozilla/nautilus-mozilla-content-view.c: (mozilla_merge_bonobo_items_callback): * components/sample/nautilus-sample-content-view.c: (sample_merge_bonobo_items_callback): Use nautilus_view_set_up_ui to get the user interface from a ui.xml file. Put #ifdef UIH around old code to make the items work that still needs to be visited. * libnautilus-extensions/nautilus-bonobo-extensions.c: * libnautilus-extensions/nautilus-bonobo-extensions.h: * libnautilus-extensions/nautilus-undo-manager.c: * libnautilus-extensions/nautilus-undo-manager.h: * libnautilus/nautilus-clipboard.c: (add_menu_items_callback), (remove_menu_items_callback), (nautilus_clipboard_set_up_editable_from_bonobo_control): * libnautilus/nautilus-clipboard.h: Wrapped code in ifdef UIH to disable it until it can be converted to the new Bonobo. * libnautilus-extensions/nautilus-caption-table.h: * libnautilus-extensions/nautilus-caption.h: * libnautilus-extensions/nautilus-font-picker.h: * libnautilus-extensions/nautilus-preferences-group.h: * libnautilus-extensions/nautilus-preferences-item.h: * libnautilus-extensions/nautilus-radio-button-group.h: * src/nautilus-about.h: Got rid of any cases where headers include the omnibus header <gnome.h>. These made the conversion process harder, which is why we fixed them. * libnautilus/libnautilus.h: Got rid of cases where headers include the omnibus header <bonobo.h>. * libnautilus/nautilus-view.h: * libnautilus/nautilus-view.c: (nautilus_view_set_up_ui): Added a helper function to make it easy for Nautilus components to load their UI and get it attached to the Nautilus:View object. * nautilus.spec.in: Install the nautilus-*-ui.xml files too. * src/file-manager/fm-directory-view.h: * src/file-manager/fm-directory-view.c: (bonobo_menu_select_all_callback), (bonobo_menu_empty_trash_callback), (bonobo_control_activate_callback): Convert to new API. (fm_directory_view_get_bonobo_ui_container): Name and purpose changed slightly for new API. (fm_directory_view_real_merge_menus): Merge with new API. (fm_directory_view_real_update_menus): Disabled this code for now. * src/file-manager/fm-icon-view.c: (fm_icon_view_destroy): Destroy icon view's own component at destroy time. (context_menu_layout_radio_item_callback), (append_one_context_menu_layout_item), (fm_icon_view_create_background_context_menu_items), (update_layout_menus): Convert to new API, disable some with #ifdef UIH. (get_sort_criterion_by_verb), (set_sort_criterion_by_verb), (sort_callback): Convert to new API. (fm_icon_view_merge_menus): Merge with new API, creating our own UI component separate from the directory view's. (fm_icon_view_update_menus): Disable with #ifdef UIH. * src/file-manager/fm-search-list-view.h: * src/file-manager/fm-search-list-view.c: (fm_search_list_view_initialize_class), (fm_search_list_view_initialize), (real_destroy), (indexing_info_callback), (real_merge_menus), (real_update_menus): Add code necessary to use a separate UI component, and disabled the actual menu set-up code with #ifdef UIH. This required adding a details struct. * src/nautilus-desktop-window.c: (realize): Turned off the code that hides the desktop elements. * src/nautilus-window-private.h: * src/nautilus-view-frame.h: * src/nautilus-view-frame.c: (nautilus_view_frame_destroy), (nautilus_view_frame_new), (nautilus_view_frame_load_client): * src/nautilus-window-manage-views.c: (load_content_view), (nautilus_window_set_sidebar_panels): Change to use Bonobo_UIContainer instead of Bonobo_UIHandler. * src/nautilus-window-toolbars.c: (remember_buttons), (nautilus_window_initialize_toolbars): Leave this code around and change it enough to compile and run, even though it's creating a second, invisible toolbar. * src/nautilus-window.h: Change to be a BonoboWin subclass instead of a GnomeApp subclass.
This commit is contained in:
parent
c6e4a790c8
commit
2ae47c7563
229
ChangeLog
229
ChangeLog
|
@ -1,3 +1,232 @@
|
|||
2000-10-05 Darin Adler <darin@eazel.com>
|
||||
|
||||
Cut over to HEAD of Bonobo. This check-in includes all the changes
|
||||
needed to compile and run, but there are many things wrong
|
||||
visually that may take a while to get fixed.
|
||||
|
||||
* src/nautilus-window-menus.c: (file_menu_new_window_callback),
|
||||
(file_menu_close_window_callback),
|
||||
(file_menu_close_all_windows_callback),
|
||||
(file_menu_toggle_find_mode_callback),
|
||||
(file_menu_web_search_callback), (edit_menu_undo_callback),
|
||||
(edit_menu_cut_callback), (edit_menu_copy_callback),
|
||||
(edit_menu_paste_callback), (edit_menu_clear_callback),
|
||||
(go_menu_back_callback), (go_menu_forward_callback),
|
||||
(go_menu_up_callback), (go_menu_home_callback),
|
||||
(go_menu_forget_history_callback), (view_menu_reload_callback),
|
||||
(view_menu_show_hide_sidebar_callback),
|
||||
(view_menu_show_hide_tool_bar_callback),
|
||||
(view_menu_show_hide_location_bar_callback),
|
||||
(view_menu_show_hide_status_bar_callback),
|
||||
(nautilus_window_update_show_hide_menu_items),
|
||||
(view_menu_zoom_in_callback), (view_menu_zoom_out_callback),
|
||||
(view_menu_zoom_normal_callback),
|
||||
(bookmarks_menu_add_bookmark_callback),
|
||||
(bookmarks_menu_edit_bookmarks_callback),
|
||||
(user_level_customize_callback), (customize_callback),
|
||||
(change_appearance_callback), (help_menu_about_nautilus_callback),
|
||||
(help_menu_nautilus_feedback_callback), (switch_to_user_level),
|
||||
(user_level_menu_item_callback), (append_placeholder),
|
||||
(append_separator), (append_bookmark_to_menu),
|
||||
(create_menu_item_from_node), (remove_bookmarks_after),
|
||||
(remove_underline_accelerator_from_menu_title),
|
||||
(new_top_level_menu), (add_user_level_menu_item),
|
||||
(nautilus_window_initialize_menus),
|
||||
(nautilus_window_update_find_menu_item),
|
||||
(update_user_level_menu_items), (convert_verb_to_user_level),
|
||||
(convert_user_level_to_verb), (update_preferences_dialog_title):
|
||||
* src/nautilus-window.c: (nautilus_window_clear_status),
|
||||
(nautilus_window_set_status), (install_status_bar),
|
||||
(nautilus_window_constructed), (nautilus_window_set_arg),
|
||||
(nautilus_window_get_arg), (nautilus_window_destroy),
|
||||
(nautilus_window_allow_back), (nautilus_window_allow_forward),
|
||||
(nautilus_window_allow_up), (nautilus_window_allow_reload),
|
||||
(nautilus_window_zoom_level_changed_callback),
|
||||
(nautilus_window_set_content_view_widget), (show_dock_item),
|
||||
(hide_dock_item), (dock_item_showing),
|
||||
(nautilus_window_hide_tool_bar), (nautilus_window_show_tool_bar),
|
||||
(nautilus_window_tool_bar_showing),
|
||||
(nautilus_window_hide_status_bar),
|
||||
(nautilus_window_show_status_bar),
|
||||
(nautilus_window_status_bar_showing):
|
||||
Convert to new API. Some is disabled with #ifdef UIH.
|
||||
|
||||
* Makefile.am:
|
||||
* configure.in:
|
||||
Turned off build of the idl directory, build components after src.
|
||||
|
||||
* components/adapter/main.c:
|
||||
* components/notes/nautilus-notes.c:
|
||||
* components/sample/main.c:
|
||||
* libnautilus-extensions/nautilus-font-picker.c:
|
||||
* libnautilus-extensions/nautilus-global-preferences.c:
|
||||
* libnautilus-extensions/nautilus-password-dialog.c:
|
||||
* libnautilus-extensions/nautilus-preferences-item.c:
|
||||
* libnautilus/nautilus-undo-transaction.c:
|
||||
* libnautilus/nautilus-undo.c:
|
||||
* src/nautilus-application.c:
|
||||
* src/nautilus-history-frame.c:
|
||||
* src/nautilus-link-set-window.c:
|
||||
* src/nautilus-main.c:
|
||||
* src/nautilus-shell.c:
|
||||
* src/nautilus-sidebar.c:
|
||||
* src/nautilus-view-frame-corba.c:
|
||||
* src/nautilus-zoomable-frame-corba.c:
|
||||
* test/test-nautilus-font-picker.c:
|
||||
* test/test-nautilus-image.c: (create_font_picker_frame):
|
||||
* test/test-nautilus-label.c: (create_font_picker_frame):
|
||||
* test/test-nautilus-preferences.c:
|
||||
* test/test-nautilus-widgets.c: (radio_group_load_it_up):
|
||||
Fixed includes.
|
||||
|
||||
* test/test-nautilus-image.c: (create_font_picker_frame):
|
||||
* test/test-nautilus-label.c: (create_font_picker_frame):
|
||||
* test/test-nautilus-widgets.c: (radio_group_load_it_up):
|
||||
Turned off localization of some strings in tests.
|
||||
|
||||
* components/adapter/nautilus-adapter-control-embed-strategy.c:
|
||||
(nautilus_adapter_control_embed_strategy_new):
|
||||
* components/adapter/nautilus-adapter-control-embed-strategy.h:
|
||||
* components/adapter/nautilus-adapter-embed-strategy.c:
|
||||
(nautilus_adapter_embed_strategy_get):
|
||||
* components/adapter/nautilus-adapter-embed-strategy.h:
|
||||
* components/adapter/nautilus-adapter-embeddable-embed-strategy.c:
|
||||
(nautilus_adapter_embeddable_embed_strategy_new):
|
||||
* components/adapter/nautilus-adapter-embeddable-embed-strategy.h:
|
||||
Embedding code now deals with Bonobo_UIContainer, not
|
||||
Bonobo_UIHandler.
|
||||
|
||||
* components/adapter/nautilus-adapter.c: (nautilus_adapter_new):
|
||||
This code not only had to be changed to deal with the
|
||||
Bonobo_UIContainer instead of Bonobo_UIHandler, but it also needed
|
||||
to deal with the containing item (was remote_ui_handler), not the
|
||||
local component.
|
||||
|
||||
* components/adapter/nautilus-adapter-embeddable-embed-strategy.c:
|
||||
(nautilus_adapter_embeddable_embed_strategy_new):
|
||||
* components/adapter/nautilus-adapter.c:
|
||||
BonoboContainer was renamed BonoboItemContainer.
|
||||
|
||||
* components/history/nautilus-history-view.c:
|
||||
Remove unused BonoboUIHandler * field.
|
||||
|
||||
* components/loser/content/Makefile.am:
|
||||
* components/loser/sidebar/Makefile.am:
|
||||
* components/mozilla/Makefile.am:
|
||||
* components/sample/Makefile.am:
|
||||
* src/Makefile.am:
|
||||
* src/file-manager/Makefile.am:
|
||||
Added the necessary defines and build rules to install ui.xml
|
||||
files and locate them from the C code.
|
||||
|
||||
* src/file-manager/nautilus-directory-view-ui.xml:
|
||||
* src/file-manager/nautilus-icon-view-ui.xml:
|
||||
* src/file-manager/nautilus-search-list-view-ui.xml:
|
||||
* src/nautilus-shell-ui.xml:
|
||||
Added definitions of user interface.
|
||||
|
||||
* components/loser/content/nautilus-content-loser-ui.xml:
|
||||
* components/loser/sidebar/nautilus-sidebar-loser-ui.xml:
|
||||
* components/mozilla/nautilus-mozilla-ui.xml:
|
||||
* components/sample/nautilus-sample-content-view-ui.xml:
|
||||
Added empty placeholders for user interface.
|
||||
|
||||
* components/loser/content/nautilus-content-loser.c:
|
||||
(loser_merge_bonobo_items_callback):
|
||||
* components/loser/sidebar/nautilus-sidebar-loser.c:
|
||||
(loser_merge_bonobo_items_callback):
|
||||
* components/mozilla/nautilus-mozilla-content-view.c:
|
||||
(mozilla_merge_bonobo_items_callback):
|
||||
* components/sample/nautilus-sample-content-view.c:
|
||||
(sample_merge_bonobo_items_callback):
|
||||
Use nautilus_view_set_up_ui to get the user interface from a
|
||||
ui.xml file. Put #ifdef UIH around old code to make the items work
|
||||
that still needs to be visited.
|
||||
|
||||
* libnautilus-extensions/nautilus-bonobo-extensions.c:
|
||||
* libnautilus-extensions/nautilus-bonobo-extensions.h:
|
||||
* libnautilus-extensions/nautilus-undo-manager.c:
|
||||
* libnautilus-extensions/nautilus-undo-manager.h:
|
||||
* libnautilus/nautilus-clipboard.c: (add_menu_items_callback),
|
||||
(remove_menu_items_callback),
|
||||
(nautilus_clipboard_set_up_editable_from_bonobo_control):
|
||||
* libnautilus/nautilus-clipboard.h:
|
||||
Wrapped code in ifdef UIH to disable it until it can be converted
|
||||
to the new Bonobo.
|
||||
|
||||
* libnautilus-extensions/nautilus-caption-table.h:
|
||||
* libnautilus-extensions/nautilus-caption.h:
|
||||
* libnautilus-extensions/nautilus-font-picker.h:
|
||||
* libnautilus-extensions/nautilus-preferences-group.h:
|
||||
* libnautilus-extensions/nautilus-preferences-item.h:
|
||||
* libnautilus-extensions/nautilus-radio-button-group.h:
|
||||
* src/nautilus-about.h:
|
||||
Got rid of any cases where headers include the omnibus header
|
||||
<gnome.h>. These made the conversion process harder, which is why
|
||||
we fixed them.
|
||||
|
||||
* libnautilus/libnautilus.h:
|
||||
Got rid of cases where headers include the omnibus header
|
||||
<bonobo.h>.
|
||||
|
||||
* libnautilus/nautilus-view.h:
|
||||
* libnautilus/nautilus-view.c: (nautilus_view_set_up_ui):
|
||||
Added a helper function to make it easy for Nautilus components to
|
||||
load their UI and get it attached to the Nautilus:View object.
|
||||
|
||||
* nautilus.spec.in: Install the nautilus-*-ui.xml files too.
|
||||
|
||||
* src/file-manager/fm-directory-view.h:
|
||||
* src/file-manager/fm-directory-view.c:
|
||||
(bonobo_menu_select_all_callback),
|
||||
(bonobo_menu_empty_trash_callback),
|
||||
(bonobo_control_activate_callback): Convert to new API.
|
||||
(fm_directory_view_get_bonobo_ui_container): Name and purpose
|
||||
changed slightly for new API.
|
||||
(fm_directory_view_real_merge_menus): Merge with new API.
|
||||
(fm_directory_view_real_update_menus): Disabled this code for now.
|
||||
|
||||
* src/file-manager/fm-icon-view.c: (fm_icon_view_destroy): Destroy
|
||||
icon view's own component at destroy time.
|
||||
(context_menu_layout_radio_item_callback),
|
||||
(append_one_context_menu_layout_item),
|
||||
(fm_icon_view_create_background_context_menu_items),
|
||||
(update_layout_menus): Convert to new API, disable some with
|
||||
#ifdef UIH.
|
||||
(get_sort_criterion_by_verb),
|
||||
(set_sort_criterion_by_verb), (sort_callback): Convert to new API.
|
||||
(fm_icon_view_merge_menus): Merge with new API, creating our own
|
||||
UI component separate from the directory view's.
|
||||
(fm_icon_view_update_menus): Disable with #ifdef UIH.
|
||||
|
||||
* src/file-manager/fm-search-list-view.h:
|
||||
* src/file-manager/fm-search-list-view.c:
|
||||
(fm_search_list_view_initialize_class),
|
||||
(fm_search_list_view_initialize), (real_destroy),
|
||||
(indexing_info_callback), (real_merge_menus), (real_update_menus):
|
||||
Add code necessary to use a separate UI component, and disabled
|
||||
the actual menu set-up code with #ifdef UIH. This required adding
|
||||
a details struct.
|
||||
|
||||
* src/nautilus-desktop-window.c: (realize): Turned off the code
|
||||
that hides the desktop elements.
|
||||
|
||||
* src/nautilus-window-private.h:
|
||||
* src/nautilus-view-frame.h:
|
||||
* src/nautilus-view-frame.c: (nautilus_view_frame_destroy),
|
||||
(nautilus_view_frame_new), (nautilus_view_frame_load_client):
|
||||
* src/nautilus-window-manage-views.c: (load_content_view),
|
||||
(nautilus_window_set_sidebar_panels):
|
||||
Change to use Bonobo_UIContainer instead of Bonobo_UIHandler.
|
||||
|
||||
* src/nautilus-window-toolbars.c: (remember_buttons),
|
||||
(nautilus_window_initialize_toolbars): Leave this code around and
|
||||
change it enough to compile and run, even though it's creating a
|
||||
second, invisible toolbar.
|
||||
|
||||
* src/nautilus-window.h: Change to be a BonoboWin subclass instead
|
||||
of a GnomeApp subclass.
|
||||
|
||||
2000-10-05 Ramiro Estrugo <ramiro@eazel.com>
|
||||
|
||||
* nautilus.spec.in:
|
||||
|
|
|
@ -3,7 +3,6 @@ NULL=
|
|||
SUBDIRS = \
|
||||
data \
|
||||
icons \
|
||||
idl \
|
||||
intl \
|
||||
cut-n-paste-code \
|
||||
librsvg \
|
||||
|
@ -11,10 +10,10 @@ SUBDIRS = \
|
|||
libnautilus-adapter \
|
||||
libnautilus-extensions \
|
||||
helper-utilities \
|
||||
components \
|
||||
po \
|
||||
src \
|
||||
components \
|
||||
test \
|
||||
po \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST= \
|
||||
|
|
|
@ -26,17 +26,18 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <libgnome/gnome-defs.h> /* must come before gnome-init.h */
|
||||
#include <libgnomeui/gnome-init.h> /* must come before liboaf.h */
|
||||
#include <liboaf/liboaf.h>
|
||||
|
||||
#include "nautilus-adapter-factory-server.h"
|
||||
#include <bonobo/bonobo-generic-factory.h>
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include "nautilus-adapter-factory-server.h"
|
||||
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnomevfs/gnome-vfs-init.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define META_FACTORY_IID "OAFIID:nautilus_adapter_factory_generic_factory:8e62e106-807d-4d37-b14a-00dc82ecf88f"
|
||||
#define FACTORY_OBJECT_IID "OAFIID:nautilus_adapter_factory:fd24ecfc-0a6e-47ab-bc53-69d7487c6ad4"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "nautilus-adapter-embed-strategy-private.h"
|
||||
|
||||
#include <gtk/gtkobject.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-macros.h>
|
||||
#include <bonobo/bonobo-control.h>
|
||||
|
||||
|
@ -114,8 +115,8 @@ activate_uri_callback (BonoboControlFrame *frame,
|
|||
}
|
||||
|
||||
NautilusAdapterEmbedStrategy *
|
||||
nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
|
||||
Bonobo_UIHandler uih)
|
||||
nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
|
||||
Bonobo_UIContainer ui_container)
|
||||
{
|
||||
NautilusAdapterControlEmbedStrategy *strategy;
|
||||
|
||||
|
@ -124,7 +125,7 @@ nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
|
|||
gtk_object_sink (GTK_OBJECT (strategy));
|
||||
|
||||
strategy->details->control = control;
|
||||
strategy->details->control_frame = bonobo_control_frame_new(uih);
|
||||
strategy->details->control_frame = bonobo_control_frame_new (ui_container);
|
||||
|
||||
bonobo_control_frame_bind_to_control (strategy->details->control_frame, control);
|
||||
|
||||
|
@ -136,7 +137,6 @@ nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
|
|||
return NAUTILUS_ADAPTER_EMBED_STRATEGY (strategy);
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
nautilus_adapter_control_embed_strategy_get_widget (NautilusAdapterEmbedStrategy *abstract_strategy)
|
||||
{
|
||||
|
|
|
@ -49,8 +49,8 @@ typedef struct {
|
|||
/* GtkObject support */
|
||||
GtkType nautilus_adapter_control_embed_strategy_get_type (void);
|
||||
|
||||
NautilusAdapterEmbedStrategy *nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
|
||||
Bonobo_UIHandler uih);
|
||||
NautilusAdapterEmbedStrategy *nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
|
||||
Bonobo_UIContainer ui_container);
|
||||
|
||||
|
||||
#endif /* NAUTILUS_ADAPTER_CONTROL_EMBED_STRATEGY_H */
|
||||
|
|
|
@ -33,14 +33,15 @@
|
|||
#include "nautilus-adapter-embeddable-embed-strategy.h"
|
||||
#include "nautilus-adapter-embed-strategy-private.h"
|
||||
|
||||
#include <gtk/gtkobject.h>
|
||||
#include <bonobo/bonobo-client-site.h>
|
||||
#include <bonobo/bonobo-item-container.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-macros.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <bonobo.h>
|
||||
|
||||
struct NautilusAdapterEmbeddableEmbedStrategyDetails {
|
||||
BonoboObjectClient *embeddable_wrapper;
|
||||
BonoboContainer *container;
|
||||
BonoboItemContainer *container;
|
||||
BonoboClientSite *client_site;
|
||||
BonoboViewFrame *view_frame;
|
||||
GtkWidget *client_widget;
|
||||
|
@ -117,10 +118,9 @@ activate_uri_callback (BonoboControlFrame *frame,
|
|||
uri);
|
||||
}
|
||||
|
||||
|
||||
NautilusAdapterEmbedStrategy *
|
||||
nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
||||
Bonobo_UIHandler uih)
|
||||
nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
||||
Bonobo_UIContainer ui_container)
|
||||
{
|
||||
NautilusAdapterEmbeddableEmbedStrategy *strategy;
|
||||
|
||||
|
@ -130,13 +130,13 @@ nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
|||
|
||||
strategy->details->embeddable_wrapper = bonobo_object_client_from_corba (embeddable);
|
||||
|
||||
strategy->details->container = bonobo_container_new ();
|
||||
strategy->details->container = bonobo_item_container_new ();
|
||||
strategy->details->client_site = bonobo_client_site_new (strategy->details->container);
|
||||
|
||||
bonobo_client_site_bind_embeddable (strategy->details->client_site, strategy->details->embeddable_wrapper);
|
||||
bonobo_container_add (strategy->details->container, BONOBO_OBJECT (strategy->details->client_site));
|
||||
bonobo_item_container_add (strategy->details->container, BONOBO_OBJECT (strategy->details->client_site));
|
||||
|
||||
strategy->details->view_frame = bonobo_client_site_new_view (strategy->details->client_site, uih);
|
||||
strategy->details->view_frame = bonobo_client_site_new_view (strategy->details->client_site, ui_container);
|
||||
strategy->details->client_widget = bonobo_view_frame_get_wrapper (strategy->details->view_frame);
|
||||
|
||||
bonobo_wrapper_set_visibility (BONOBO_WRAPPER (strategy->details->client_widget), FALSE);
|
||||
|
@ -150,7 +150,6 @@ nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
|||
return NAUTILUS_ADAPTER_EMBED_STRATEGY (strategy);
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
nautilus_adapter_embeddable_embed_strategy_get_widget (NautilusAdapterEmbedStrategy *abstract_strategy)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ typedef struct {
|
|||
GtkType nautilus_adapter_embeddable_embed_strategy_get_type (void);
|
||||
|
||||
NautilusAdapterEmbedStrategy *nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
||||
Bonobo_UIHandler uih);
|
||||
Bonobo_UIContainer ui_container);
|
||||
|
||||
|
||||
#endif /* NAUTILUS_ADAPTER_EMBEDDABLE_EMBED_STRATEGY_H */
|
||||
|
|
|
@ -95,10 +95,9 @@ nautilus_adapter_embed_strategy_destroy (GtkObject *object)
|
|||
|
||||
|
||||
|
||||
|
||||
NautilusAdapterEmbedStrategy *
|
||||
nautilus_adapter_embed_strategy_get (Bonobo_Unknown component,
|
||||
Bonobo_UIHandler uih)
|
||||
nautilus_adapter_embed_strategy_get (Bonobo_Unknown component,
|
||||
Bonobo_UIContainer ui_container)
|
||||
{
|
||||
Bonobo_Control control;
|
||||
Bonobo_Embeddable embeddable;
|
||||
|
@ -113,7 +112,7 @@ nautilus_adapter_embed_strategy_get (Bonobo_Unknown component,
|
|||
if (ev._major == CORBA_NO_EXCEPTION && !CORBA_Object_is_nil (control, &ev)) {
|
||||
CORBA_exception_free (&ev);
|
||||
|
||||
return nautilus_adapter_control_embed_strategy_new (control, uih);
|
||||
return nautilus_adapter_control_embed_strategy_new (control, ui_container);
|
||||
}
|
||||
|
||||
embeddable = Bonobo_Unknown_query_interface (component,
|
||||
|
@ -122,7 +121,7 @@ nautilus_adapter_embed_strategy_get (Bonobo_Unknown component,
|
|||
if (ev._major == CORBA_NO_EXCEPTION && !CORBA_Object_is_nil (embeddable, &ev)) {
|
||||
CORBA_exception_free (&ev);
|
||||
|
||||
return nautilus_adapter_embeddable_embed_strategy_new (embeddable, uih);
|
||||
return nautilus_adapter_embeddable_embed_strategy_new (embeddable, ui_container);
|
||||
}
|
||||
|
||||
CORBA_exception_free (&ev);
|
||||
|
@ -130,7 +129,6 @@ nautilus_adapter_embed_strategy_get (Bonobo_Unknown component,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
GtkWidget *
|
||||
nautilus_adapter_embed_strategy_get_widget (NautilusAdapterEmbedStrategy *strategy)
|
||||
{
|
||||
|
|
|
@ -59,8 +59,8 @@ typedef struct {
|
|||
GtkType nautilus_adapter_embed_strategy_get_type (void);
|
||||
|
||||
/* Instantiates the proper concrete subclass */
|
||||
NautilusAdapterEmbedStrategy *nautilus_adapter_embed_strategy_get (Bonobo_Unknown component,
|
||||
Bonobo_UIHandler uih);
|
||||
NautilusAdapterEmbedStrategy *nautilus_adapter_embed_strategy_get (Bonobo_Unknown component,
|
||||
Bonobo_UIContainer ui_container);
|
||||
|
||||
GtkWidget *nautilus_adapter_embed_strategy_get_widget (NautilusAdapterEmbedStrategy *strategy);
|
||||
|
||||
|
|
|
@ -33,14 +33,15 @@
|
|||
#include "nautilus-adapter-embeddable-embed-strategy.h"
|
||||
#include "nautilus-adapter-embed-strategy-private.h"
|
||||
|
||||
#include <gtk/gtkobject.h>
|
||||
#include <bonobo/bonobo-client-site.h>
|
||||
#include <bonobo/bonobo-item-container.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-macros.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <bonobo.h>
|
||||
|
||||
struct NautilusAdapterEmbeddableEmbedStrategyDetails {
|
||||
BonoboObjectClient *embeddable_wrapper;
|
||||
BonoboContainer *container;
|
||||
BonoboItemContainer *container;
|
||||
BonoboClientSite *client_site;
|
||||
BonoboViewFrame *view_frame;
|
||||
GtkWidget *client_widget;
|
||||
|
@ -117,10 +118,9 @@ activate_uri_callback (BonoboControlFrame *frame,
|
|||
uri);
|
||||
}
|
||||
|
||||
|
||||
NautilusAdapterEmbedStrategy *
|
||||
nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
||||
Bonobo_UIHandler uih)
|
||||
nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
||||
Bonobo_UIContainer ui_container)
|
||||
{
|
||||
NautilusAdapterEmbeddableEmbedStrategy *strategy;
|
||||
|
||||
|
@ -130,13 +130,13 @@ nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
|||
|
||||
strategy->details->embeddable_wrapper = bonobo_object_client_from_corba (embeddable);
|
||||
|
||||
strategy->details->container = bonobo_container_new ();
|
||||
strategy->details->container = bonobo_item_container_new ();
|
||||
strategy->details->client_site = bonobo_client_site_new (strategy->details->container);
|
||||
|
||||
bonobo_client_site_bind_embeddable (strategy->details->client_site, strategy->details->embeddable_wrapper);
|
||||
bonobo_container_add (strategy->details->container, BONOBO_OBJECT (strategy->details->client_site));
|
||||
bonobo_item_container_add (strategy->details->container, BONOBO_OBJECT (strategy->details->client_site));
|
||||
|
||||
strategy->details->view_frame = bonobo_client_site_new_view (strategy->details->client_site, uih);
|
||||
strategy->details->view_frame = bonobo_client_site_new_view (strategy->details->client_site, ui_container);
|
||||
strategy->details->client_widget = bonobo_view_frame_get_wrapper (strategy->details->view_frame);
|
||||
|
||||
bonobo_wrapper_set_visibility (BONOBO_WRAPPER (strategy->details->client_widget), FALSE);
|
||||
|
@ -150,7 +150,6 @@ nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
|||
return NAUTILUS_ADAPTER_EMBED_STRATEGY (strategy);
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
nautilus_adapter_embeddable_embed_strategy_get_widget (NautilusAdapterEmbedStrategy *abstract_strategy)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ typedef struct {
|
|||
GtkType nautilus_adapter_embeddable_embed_strategy_get_type (void);
|
||||
|
||||
NautilusAdapterEmbedStrategy *nautilus_adapter_embeddable_embed_strategy_new (Bonobo_Embeddable embeddable,
|
||||
Bonobo_UIHandler uih);
|
||||
Bonobo_UIContainer ui_container);
|
||||
|
||||
|
||||
#endif /* NAUTILUS_ADAPTER_EMBEDDABLE_EMBED_STRATEGY_H */
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "nautilus-adapter-embed-strategy.h"
|
||||
|
||||
#include <bonobo/bonobo-control.h>
|
||||
#include <bonobo/bonobo-container.h>
|
||||
#include <bonobo/bonobo-item-container.h>
|
||||
#include <bonobo/bonobo-view-frame.h>
|
||||
#include <bonobo/bonobo-object-client.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
@ -155,8 +155,7 @@ nautilus_adapter_new (Bonobo_Unknown component)
|
|||
|
||||
/* Get the class to handle embedding this kind of component. */
|
||||
adapter->details->embed_strategy = nautilus_adapter_embed_strategy_get
|
||||
(component, bonobo_object_corba_objref (BONOBO_OBJECT (bonobo_control_get_ui_handler
|
||||
(control))));
|
||||
(component, bonobo_control_get_remote_ui_container (control));
|
||||
|
||||
if (adapter->details->embed_strategy == NULL) {
|
||||
gtk_object_unref (GTK_OBJECT (adapter));
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <bonobo/bonobo-generic-factory.h>
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <gnome.h>
|
||||
#include <libnautilus/libnautilus.h>
|
||||
#include <libnautilus/nautilus-view-component.h>
|
||||
|
@ -42,7 +44,6 @@ typedef struct {
|
|||
|
||||
gint notify_count;
|
||||
gint press_row;
|
||||
BonoboUIHandler *uih;
|
||||
} HistoryView;
|
||||
|
||||
#define HISTORY_VIEW_COLUMN_ICON 0
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
NULL=
|
||||
|
||||
CPPFLAGS = \
|
||||
-DPREFIX=\"$(prefix)\"
|
||||
-DG_LOG_DOMAIN=\"Nautilus-Test\"
|
||||
-DPREFIX=\"$(prefix)\" \
|
||||
-DG_LOG_DOMAIN=\"Nautilus-Test\" \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
-DICON_DIR=\"$(datadir)/pixmaps/nautilus\"
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
|
@ -14,10 +16,10 @@ INCLUDES = \
|
|||
$(NULL)
|
||||
|
||||
oafdir = $(datadir)/oaf
|
||||
oaf_DATA = nautilus-content-loser.oafinfo
|
||||
|
||||
oaf_DATA = \
|
||||
nautilus-content-loser.oafinfo
|
||||
|
||||
uidir = $(datadir)/gnome/ui
|
||||
ui_DATA = nautilus-content-loser-ui.xml
|
||||
|
||||
bin_PROGRAMS = \
|
||||
nautilus-content-loser
|
||||
|
@ -36,4 +38,4 @@ nautilus_content_loser_LDADD = \
|
|||
$(VFS_LIBS) \
|
||||
$(OAF_LIBS)
|
||||
|
||||
EXTRA_DIST = $(oaf_DATA)
|
||||
EXTRA_DIST = $(oaf_DATA) $(ui_DATA)
|
||||
|
|
1
components/loser/content/nautilus-content-loser-ui.xml
Normal file
1
components/loser/content/nautilus-content-loser-ui.xml
Normal file
|
@ -0,0 +1 @@
|
|||
<Root/>
|
|
@ -180,6 +180,7 @@ loser_load_location_callback (NautilusView *nautilus_view,
|
|||
nautilus_content_loser_maybe_fail ("post-done");
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
static void
|
||||
bonobo_loser_callback (BonoboUIHandler *ui_handler, gpointer user_data, const char *path)
|
||||
{
|
||||
|
@ -205,32 +206,34 @@ bonobo_loser_callback (BonoboUIHandler *ui_handler, gpointer user_data, const ch
|
|||
gtk_label_set_text (GTK_LABEL (view), label_text);
|
||||
g_free (label_text);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
loser_merge_bonobo_items_callback (BonoboObject *control, gboolean state, gpointer user_data)
|
||||
{
|
||||
NautilusContentLoser *view;
|
||||
BonoboUIHandler *local_ui_handler;
|
||||
Bonobo_UIHandler remote_ui_handler;
|
||||
BonoboUIComponent *ui_component;
|
||||
GdkPixbuf *pixbuf;
|
||||
#ifdef UIH
|
||||
BonoboUIHandlerPixmapType pixmap_type;
|
||||
char *path;
|
||||
#endif
|
||||
|
||||
nautilus_content_loser_maybe_fail ("pre-merge");
|
||||
|
||||
g_assert (NAUTILUS_IS_CONTENT_LOSER (user_data));
|
||||
|
||||
view = NAUTILUS_CONTENT_LOSER (user_data);
|
||||
local_ui_handler = bonobo_control_get_ui_handler (BONOBO_CONTROL (control));
|
||||
|
||||
if (state) {
|
||||
/* Tell the Nautilus window to merge our bonobo_ui_handler items with its ones */
|
||||
remote_ui_handler = bonobo_control_get_remote_ui_handler (BONOBO_CONTROL (control));
|
||||
bonobo_ui_handler_set_container (local_ui_handler, remote_ui_handler);
|
||||
bonobo_object_release_unref (remote_ui_handler, NULL);
|
||||
ui_component = nautilus_view_set_up_ui (NAUTILUS_VIEW (view),
|
||||
DATADIR,
|
||||
"nautilus-content-loser-ui.xml",
|
||||
"nautilus-content-loser");
|
||||
|
||||
/* Load test pixbuf */
|
||||
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-directory-24.png");
|
||||
#ifdef UIH
|
||||
if (pixbuf != NULL)
|
||||
pixmap_type = BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA;
|
||||
else
|
||||
|
@ -274,6 +277,9 @@ loser_merge_bonobo_items_callback (BonoboObject *control, gboolean state, gpoint
|
|||
bonobo_loser_callback, /* callback function */
|
||||
view); /* callback function's data */
|
||||
g_free (path);
|
||||
#endif
|
||||
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
} else {
|
||||
/* Do nothing. */
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
CPPFLAGS = \
|
||||
-DPREFIX=\"$(prefix)\"
|
||||
-DG_LOG_DOMAIN=\"Nautilus-Test\"
|
||||
-DPREFIX=\"$(prefix)\" \
|
||||
-DG_LOG_DOMAIN=\"Nautilus-Test\" \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
-DICON_DIR=\"$(datadir)/pixmaps/nautilus\"
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
|
@ -11,10 +13,10 @@ INCLUDES = \
|
|||
$(GNOMEUI_CFLAGS)
|
||||
|
||||
oafdir = $(datadir)/oaf
|
||||
oaf_DATA = nautilus-sidebar-loser.oafinfo
|
||||
|
||||
oaf_DATA = \
|
||||
nautilus-sidebar-loser.oafinfo
|
||||
|
||||
uidir = $(datadir)/gnome/ui
|
||||
ui_DATA = nautilus-sidebar-loser-ui.xml
|
||||
|
||||
bin_PROGRAMS = \
|
||||
nautilus-sidebar-loser
|
||||
|
@ -33,4 +35,4 @@ nautilus_sidebar_loser_LDADD = \
|
|||
$(VFS_LIBS) \
|
||||
$(OAF_LIBS)
|
||||
|
||||
EXTRA_DIST = $(oaf_DATA)
|
||||
EXTRA_DIST = $(oaf_DATA) $(ui_DATA)
|
||||
|
|
1
components/loser/sidebar/nautilus-sidebar-loser-ui.xml
Normal file
1
components/loser/sidebar/nautilus-sidebar-loser-ui.xml
Normal file
|
@ -0,0 +1 @@
|
|||
<Root/>
|
|
@ -183,6 +183,7 @@ loser_load_location_callback (NautilusView *nautilus_view,
|
|||
nautilus_sidebar_loser_maybe_fail ("post-done");
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
static void
|
||||
bonobo_loser_callback (BonoboUIHandler *ui_handler, gpointer user_data, const char *path)
|
||||
{
|
||||
|
@ -208,32 +209,34 @@ bonobo_loser_callback (BonoboUIHandler *ui_handler, gpointer user_data, const ch
|
|||
gtk_label_set_text (GTK_LABEL (view), label_text);
|
||||
g_free (label_text);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
loser_merge_bonobo_items_callback (BonoboObject *control, gboolean state, gpointer user_data)
|
||||
{
|
||||
NautilusSidebarLoser *view;
|
||||
BonoboUIHandler *local_ui_handler;
|
||||
Bonobo_UIHandler remote_ui_handler;
|
||||
BonoboUIComponent *ui_component;
|
||||
GdkPixbuf *pixbuf;
|
||||
#ifdef UIH
|
||||
BonoboUIHandlerPixmapType pixmap_type;
|
||||
char *path;
|
||||
#endif
|
||||
|
||||
nautilus_sidebar_loser_maybe_fail ("pre-merge");
|
||||
|
||||
g_assert (NAUTILUS_IS_SIDEBAR_LOSER (user_data));
|
||||
|
||||
view = NAUTILUS_SIDEBAR_LOSER (user_data);
|
||||
local_ui_handler = bonobo_control_get_ui_handler (BONOBO_CONTROL (control));
|
||||
|
||||
if (state) {
|
||||
/* Tell the Nautilus window to merge our bonobo_ui_handler items with its ones */
|
||||
remote_ui_handler = bonobo_control_get_remote_ui_handler (BONOBO_CONTROL (control));
|
||||
bonobo_ui_handler_set_container (local_ui_handler, remote_ui_handler);
|
||||
bonobo_object_release_unref (remote_ui_handler, NULL);
|
||||
ui_component = nautilus_view_set_up_ui (NAUTILUS_VIEW (view),
|
||||
DATADIR,
|
||||
"nautilus-sidebar-loser-ui.xml",
|
||||
"nautilus-sidebar-loser");
|
||||
|
||||
/* Load test pixbuf */
|
||||
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-directory-24.png");
|
||||
pixbuf = gdk_pixbuf_new_from_file (ICON_DIR "/i-directory-24.png");
|
||||
#ifdef UIH
|
||||
if (pixbuf != NULL)
|
||||
pixmap_type = BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA;
|
||||
else
|
||||
|
@ -277,6 +280,9 @@ loser_merge_bonobo_items_callback (BonoboObject *control, gboolean state, gpoint
|
|||
bonobo_loser_callback, /* callback function */
|
||||
view); /* callback function's data */
|
||||
g_free (path);
|
||||
#endif
|
||||
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
} else {
|
||||
/* Do nothing. */
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ SUBDIRS = eazel-protocol-handler
|
|||
CPPFLAGS = \
|
||||
-DPREFIX=\"$(prefix)\" \
|
||||
-DG_LOG_DOMAIN=\"Nautilus-Mozilla\" \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
$(MOZILLA_COMPONENT_DEBUG_FLAGS) \
|
||||
$(NULL)
|
||||
|
||||
|
@ -52,9 +53,13 @@ nautilus_mozilla_content_view_LDADD = \
|
|||
$(NULL)
|
||||
|
||||
oafdir = $(datadir)/oaf
|
||||
|
||||
oaf_DATA = \
|
||||
nautilus-mozilla-content-view.oafinfo \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = $(oaf_DATA) $(NULL)
|
||||
uidir = $(datadir)/gnome/ui
|
||||
ui_DATA = \
|
||||
nautilus-mozilla-ui.xml \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = $(oaf_DATA) $(ui_DATA)
|
||||
|
|
|
@ -485,6 +485,8 @@ mozilla_load_location_callback (NautilusView *nautilus_view,
|
|||
nautilus_mozilla_content_view_load_uri (view, location);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
bonobo_mozilla_callback (BonoboUIHandler *ui_handler, gpointer user_data, const char *path)
|
||||
{
|
||||
|
@ -540,22 +542,24 @@ bonobo_mozilla_callback (BonoboUIHandler *ui_handler, gpointer user_data, const
|
|||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
mozilla_merge_bonobo_items_callback (BonoboObject *control, gboolean state, gpointer user_data)
|
||||
{
|
||||
NautilusMozillaContentView *view;
|
||||
BonoboUIHandler *local_ui_handler;
|
||||
Bonobo_UIHandler remote_ui_handler;
|
||||
BonoboUIComponent *ui_component;
|
||||
|
||||
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
|
||||
local_ui_handler = bonobo_control_get_ui_handler (BONOBO_CONTROL (control));
|
||||
|
||||
if (state) {
|
||||
/* Tell the Nautilus window to merge our bonobo_ui_handler items with its ones */
|
||||
remote_ui_handler = bonobo_control_get_remote_ui_handler (BONOBO_CONTROL (control));
|
||||
bonobo_ui_handler_set_container (local_ui_handler, remote_ui_handler);
|
||||
bonobo_object_release_unref (remote_ui_handler, NULL);
|
||||
/* Load the UI from the XML file. */
|
||||
ui_component = nautilus_view_set_up_ui (NAUTILUS_VIEW (view),
|
||||
DATADIR,
|
||||
"nautilus-mozilla-ui.xml",
|
||||
"nautilus-mozilla");
|
||||
|
||||
#ifdef UIH
|
||||
/*
|
||||
* Create our mozilla menu item.
|
||||
*
|
||||
|
@ -592,6 +596,7 @@ mozilla_merge_bonobo_items_callback (BonoboObject *control, gboolean state, gpoi
|
|||
0, /* accelerator key modifiers */
|
||||
bonobo_mozilla_callback, /* callback function */
|
||||
view); /* callback function's data */
|
||||
#endif
|
||||
} else {
|
||||
/* Do nothing. */
|
||||
}
|
||||
|
|
1
components/mozilla/nautilus-mozilla-ui.xml
Normal file
1
components/mozilla/nautilus-mozilla-ui.xml
Normal file
|
@ -0,0 +1 @@
|
|||
<Root/>
|
|
@ -27,18 +27,20 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <libnautilus/libnautilus.h>
|
||||
#include <libnautilus-extensions/nautilus-metadata.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
|
||||
#include <bonobo/bonobo-generic-factory.h>
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <ctype.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libnautilus-extensions/nautilus-background.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <libnautilus-extensions/nautilus-file.h>
|
||||
#include <libnautilus-extensions/nautilus-metadata.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-signal-handlers.h>
|
||||
#include <libnautilus/libnautilus.h>
|
||||
#include <libnautilus/nautilus-clipboard.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
#include <libnautilus-extensions/nautilus-background.h>
|
||||
#include <libnautilus-extensions/nautilus-file.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <libnautilus/nautilus-clipboard.h>
|
||||
|
||||
#define NOTES_DEFAULT_BACKGROUND_COLOR "rgb:FFFF/FFFF/BBBB"
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
CPPFLAGS = \
|
||||
-DPREFIX=\"$(prefix)\" \
|
||||
-DG_LOG_DOMAIN=\"Nautilus-Sample\" \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
-DICON_DIR=\"$(datadir)/pixmaps/nautilus\"
|
||||
|
||||
INCLUDES = \
|
||||
|
@ -11,9 +12,10 @@ INCLUDES = \
|
|||
$(OAF_CFLAGS)
|
||||
|
||||
oafdir = $(datadir)/oaf
|
||||
oaf_DATA = nautilus-sample-content-view.oafinfo
|
||||
|
||||
oaf_DATA = \
|
||||
nautilus-sample-content-view.oafinfo
|
||||
uidir = $(datadir)/gnome/ui
|
||||
ui_DATA = nautilus-sample-content-view-ui.xml
|
||||
|
||||
bin_PROGRAMS = \
|
||||
nautilus-sample-content-view
|
||||
|
@ -29,4 +31,4 @@ nautilus_sample_content_view_LDADD = \
|
|||
$(BONOBO_LIBS) \
|
||||
$(OAF_LIBS)
|
||||
|
||||
EXTRA_DIST = $(oaf_DATA)
|
||||
EXTRA_DIST = $(oaf_DATA) $(ui_DATA)
|
||||
|
|
|
@ -27,14 +27,16 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <libgnome/gnome-defs.h> /* must come before gnome-init.h */
|
||||
#include <libgnomeui/gnome-init.h> /* must come before liboaf.h */
|
||||
#include <liboaf/liboaf.h>
|
||||
|
||||
#include "nautilus-sample-content-view.h"
|
||||
#include <bonobo/bonobo-generic-factory.h>
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include "nautilus-sample-content-view.h"
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define FACTORY_IID "OAFIID:nautilus_sample_content_view_factory:3df6b028-be44-4a18-95c3-7720f50ca0c5"
|
||||
#define VIEW_IID "OAFIID:nautilus_sample_content_view:45c746bc-7d64-4346-90d5-6410463b43ae"
|
||||
|
|
1
components/sample/nautilus-sample-content-view-ui.xml
Normal file
1
components/sample/nautilus-sample-content-view-ui.xml
Normal file
|
@ -0,0 +1 @@
|
|||
<Root/>
|
|
@ -187,6 +187,8 @@ sample_load_location_callback (NautilusView *nautilus_view,
|
|||
nautilus_view_report_load_complete (nautilus_view);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
bonobo_sample_callback (BonoboUIHandler *ui_handler, gpointer user_data, const char *path)
|
||||
{
|
||||
|
@ -211,28 +213,31 @@ bonobo_sample_callback (BonoboUIHandler *ui_handler, gpointer user_data, const c
|
|||
g_free (label_text);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
sample_merge_bonobo_items_callback (BonoboControl *control, gboolean state, gpointer user_data)
|
||||
{
|
||||
NautilusSampleContentView *view;
|
||||
BonoboUIHandler *ui_handler;
|
||||
Bonobo_UIHandler remote_ui_handler;
|
||||
BonoboUIComponent *ui_component;
|
||||
GdkPixbuf *pixbuf;
|
||||
#ifdef UIH
|
||||
BonoboUIHandlerPixmapType pixmap_type;
|
||||
#endif
|
||||
|
||||
g_assert (BONOBO_IS_CONTROL (control));
|
||||
|
||||
view = NAUTILUS_SAMPLE_CONTENT_VIEW (user_data);
|
||||
ui_handler = bonobo_control_get_ui_handler (control);
|
||||
|
||||
if (state) {
|
||||
/* Tell the Nautilus window to merge our bonobo_ui_handler items with its ones */
|
||||
remote_ui_handler = bonobo_control_get_remote_ui_handler (BONOBO_CONTROL (control));
|
||||
bonobo_ui_handler_set_container (ui_handler, remote_ui_handler);
|
||||
bonobo_object_release_unref (remote_ui_handler, NULL);
|
||||
ui_component = nautilus_view_set_up_ui (NAUTILUS_VIEW (view),
|
||||
DATADIR,
|
||||
"nautilus-sample-content-view-ui.xml",
|
||||
"nautilus-sample-content-view");
|
||||
|
||||
/* Load test pixbuf (used for both menu item and toolbar). */
|
||||
pixbuf = gdk_pixbuf_new_from_file (ICON_DIR "/i-directory-24.png");
|
||||
#ifdef UIH
|
||||
if (pixbuf != NULL) {
|
||||
pixmap_type = BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA;
|
||||
} else {
|
||||
|
@ -268,6 +273,9 @@ sample_merge_bonobo_items_callback (BonoboControl *control, gboolean state, gpoi
|
|||
0, /* accelerator key modifiers */
|
||||
bonobo_sample_callback, /* callback function */
|
||||
view); /* callback function's data */
|
||||
#endif
|
||||
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
||||
|
||||
/* Note that we do nothing if state is FALSE. Nautilus content
|
||||
|
|
|
@ -584,7 +584,6 @@ data/emblems/Makefile
|
|||
data/linksets/Makefile
|
||||
data/fonts/Makefile
|
||||
data/fonts/urw/Makefile
|
||||
idl/Makefile
|
||||
cut-n-paste-code/Makefile
|
||||
cut-n-paste-code/widgets/Makefile
|
||||
cut-n-paste-code/widgets/e-paned/Makefile
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-bonobo-extensions.h"
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
/**
|
||||
* nautilus_bonobo_ui_handler_menu_toggle_appearance
|
||||
*
|
||||
|
@ -56,3 +58,5 @@ nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
|
|||
bonobo_ui_handler_menu_set_callback (uih, path, saved_callback,
|
||||
saved_callback_data, saved_destroy_notify);
|
||||
}
|
||||
|
||||
#endif /* UIH */
|
||||
|
|
|
@ -27,11 +27,10 @@
|
|||
#ifndef NAUTILUS_BONOBO_EXTENSIONS_H
|
||||
#define NAUTILUS_BONOBO_EXTENSIONS_H
|
||||
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
|
||||
#ifdef UIH
|
||||
void nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
|
||||
const char *path,
|
||||
gboolean new_value);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* NAUTILUS_BONOBO_EXTENSIONS_H */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define NAUTILUS_CAPTION_TABLE_H
|
||||
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
|
||||
/*
|
||||
* NautilusCaptionTable is a GtkTable sublass that allows you to painlessly
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#ifndef NAUTILUS_CAPTION_H
|
||||
#define NAUTILUS_CAPTION_H
|
||||
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libnautilus-extensions/nautilus-string-list.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkentry.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
|
||||
static const gint FONT_PICKER_SPACING = 10;
|
||||
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
#ifndef NAUTILUS_FONT_PICKER_H
|
||||
#define NAUTILUS_FONT_PICKER_H
|
||||
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <libnautilus-extensions/nautilus-scalable-font.h>
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <gconf/gconf.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
#include <gtk/gtkbox.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
|
||||
/* Constants */
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "nautilus-caption-table.h"
|
||||
|
||||
#include <libgnomeui/gnome-stock.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#define NAUTILUS_PREFERENCES_GROUP_H
|
||||
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences-item.h>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <libgnomevfs/gnome-vfs.h>
|
||||
|
||||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
||||
#include "nautilus-radio-button-group.h"
|
||||
#include "nautilus-string-picker.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#define NAUTILUS_PREFERENCES_ITEM_H
|
||||
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gnome.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
|
||||
/*
|
||||
* NautilusRadioButtonGroup is a collection of radio buttons
|
||||
|
|
|
@ -59,7 +59,9 @@ typedef struct {
|
|||
} UndoManagerServant;
|
||||
|
||||
typedef struct {
|
||||
#ifdef UIH
|
||||
BonoboUIHandler *handler;
|
||||
#endif /* UIH */
|
||||
char *path;
|
||||
char *no_undo_menu_item_label;
|
||||
char *no_undo_menu_item_hint;
|
||||
|
@ -344,6 +346,7 @@ nautilus_undo_manager_add_interface (NautilusUndoManager *manager, BonoboObject
|
|||
bonobo_object_add_interface (object, BONOBO_OBJECT (context));
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
static void
|
||||
update_undo_menu_item (NautilusUndoManager *manager,
|
||||
UndoMenuHandlerConnection *connection)
|
||||
|
@ -371,7 +374,7 @@ update_undo_menu_item (NautilusUndoManager *manager,
|
|||
(manager->details->transaction, &ev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(connection->handler, connection->path,
|
||||
menu_item != NULL);
|
||||
|
@ -438,3 +441,4 @@ nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (NautilusUndoManager *m
|
|||
FALSE, FALSE,
|
||||
GTK_OBJECT (handler));
|
||||
}
|
||||
#endif /* UIH */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef NAUTILUS_UNDO_MANAGER_H
|
||||
#define NAUTILUS_UNDO_MANAGER_H
|
||||
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
#include <bonobo/bonobo-object.h>
|
||||
|
||||
#define NAUTILUS_TYPE_UNDO_MANAGER \
|
||||
(nautilus_undo_manager_get_type ())
|
||||
|
@ -57,6 +57,7 @@ NautilusUndoManager *nautilus_undo_manager_new (v
|
|||
/* Undo operations. */
|
||||
void nautilus_undo_manager_undo (NautilusUndoManager *undo_manager);
|
||||
|
||||
#ifdef UIH
|
||||
/* Connect the manager to a particular menu item. */
|
||||
void nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (NautilusUndoManager *manager,
|
||||
BonoboUIHandler *handler,
|
||||
|
@ -64,6 +65,8 @@ void nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (N
|
|||
const char *no_undo_menu_item_label,
|
||||
const char *no_undo_menu_item_hint);
|
||||
|
||||
#endif
|
||||
|
||||
/* Attach the undo manager to a Gtk object so that object and the widgets inside it can participate in undo. */
|
||||
void nautilus_undo_manager_attach (NautilusUndoManager *manager,
|
||||
GtkObject *object);
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-bonobo-extensions.h"
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
/**
|
||||
* nautilus_bonobo_ui_handler_menu_toggle_appearance
|
||||
*
|
||||
|
@ -56,3 +58,5 @@ nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
|
|||
bonobo_ui_handler_menu_set_callback (uih, path, saved_callback,
|
||||
saved_callback_data, saved_destroy_notify);
|
||||
}
|
||||
|
||||
#endif /* UIH */
|
||||
|
|
|
@ -27,11 +27,10 @@
|
|||
#ifndef NAUTILUS_BONOBO_EXTENSIONS_H
|
||||
#define NAUTILUS_BONOBO_EXTENSIONS_H
|
||||
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
|
||||
#ifdef UIH
|
||||
void nautilus_bonobo_ui_handler_menu_set_toggle_appearance (BonoboUIHandler *uih,
|
||||
const char *path,
|
||||
gboolean new_value);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* NAUTILUS_BONOBO_EXTENSIONS_H */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define NAUTILUS_CAPTION_TABLE_H
|
||||
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
|
||||
/*
|
||||
* NautilusCaptionTable is a GtkTable sublass that allows you to painlessly
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#ifndef NAUTILUS_CAPTION_H
|
||||
#define NAUTILUS_CAPTION_H
|
||||
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
#include <libnautilus-extensions/nautilus-string-list.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkentry.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
|
||||
static const gint FONT_PICKER_SPACING = 10;
|
||||
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
#ifndef NAUTILUS_FONT_PICKER_H
|
||||
#define NAUTILUS_FONT_PICKER_H
|
||||
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <libnautilus-extensions/nautilus-scalable-font.h>
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <gconf/gconf.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
#include <gtk/gtkbox.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
|
||||
/* Constants */
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "nautilus-caption-table.h"
|
||||
|
||||
#include <libgnomeui/gnome-stock.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#define NAUTILUS_PREFERENCES_GROUP_H
|
||||
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences-item.h>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <libgnomevfs/gnome-vfs.h>
|
||||
|
||||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
|
||||
#include "nautilus-radio-button-group.h"
|
||||
#include "nautilus-string-picker.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#define NAUTILUS_PREFERENCES_ITEM_H
|
||||
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <gnome.h>
|
||||
#include <libnautilus-extensions/nautilus-preferences.h>
|
||||
|
||||
BEGIN_GNOME_DECLS
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnome/gnome-defs.h>
|
||||
|
||||
/*
|
||||
* NautilusRadioButtonGroup is a collection of radio buttons
|
||||
|
|
|
@ -59,7 +59,9 @@ typedef struct {
|
|||
} UndoManagerServant;
|
||||
|
||||
typedef struct {
|
||||
#ifdef UIH
|
||||
BonoboUIHandler *handler;
|
||||
#endif /* UIH */
|
||||
char *path;
|
||||
char *no_undo_menu_item_label;
|
||||
char *no_undo_menu_item_hint;
|
||||
|
@ -344,6 +346,7 @@ nautilus_undo_manager_add_interface (NautilusUndoManager *manager, BonoboObject
|
|||
bonobo_object_add_interface (object, BONOBO_OBJECT (context));
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
static void
|
||||
update_undo_menu_item (NautilusUndoManager *manager,
|
||||
UndoMenuHandlerConnection *connection)
|
||||
|
@ -371,7 +374,7 @@ update_undo_menu_item (NautilusUndoManager *manager,
|
|||
(manager->details->transaction, &ev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(connection->handler, connection->path,
|
||||
menu_item != NULL);
|
||||
|
@ -438,3 +441,4 @@ nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (NautilusUndoManager *m
|
|||
FALSE, FALSE,
|
||||
GTK_OBJECT (handler));
|
||||
}
|
||||
#endif /* UIH */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef NAUTILUS_UNDO_MANAGER_H
|
||||
#define NAUTILUS_UNDO_MANAGER_H
|
||||
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
#include <bonobo/bonobo-object.h>
|
||||
|
||||
#define NAUTILUS_TYPE_UNDO_MANAGER \
|
||||
(nautilus_undo_manager_get_type ())
|
||||
|
@ -57,6 +57,7 @@ NautilusUndoManager *nautilus_undo_manager_new (v
|
|||
/* Undo operations. */
|
||||
void nautilus_undo_manager_undo (NautilusUndoManager *undo_manager);
|
||||
|
||||
#ifdef UIH
|
||||
/* Connect the manager to a particular menu item. */
|
||||
void nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (NautilusUndoManager *manager,
|
||||
BonoboUIHandler *handler,
|
||||
|
@ -64,6 +65,8 @@ void nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (N
|
|||
const char *no_undo_menu_item_label,
|
||||
const char *no_undo_menu_item_hint);
|
||||
|
||||
#endif
|
||||
|
||||
/* Attach the undo manager to a Gtk object so that object and the widgets inside it can participate in undo. */
|
||||
void nautilus_undo_manager_attach (NautilusUndoManager *manager,
|
||||
GtkObject *object);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef LIBNAUTILUS_H
|
||||
#define LIBNAUTILUS_H
|
||||
|
||||
#include <bonobo.h>
|
||||
#include <libnautilus/nautilus-view-component.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <libgnome/gnome-defs.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
|
||||
#ifdef UIH
|
||||
static void
|
||||
cut_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer callback_data,
|
||||
|
@ -95,6 +96,8 @@ add_menu_item (BonoboUIHandler *ui_handler,
|
|||
BONOBO_UI_HANDLER_PIXMAP_NONE, NULL, 0, 0,
|
||||
callback, callback_data);
|
||||
}
|
||||
#endif /* UIH */
|
||||
|
||||
/*
|
||||
static void
|
||||
set_paste_sensitive_if_clipboard_contains_data (BonoboUIHandler *ui_handler)
|
||||
|
@ -114,6 +117,8 @@ add_menu_items_callback (GtkWidget *widget,
|
|||
GdkEventAny *event,
|
||||
gpointer callback_data)
|
||||
{
|
||||
#ifdef UIH
|
||||
|
||||
BonoboUIHandler *local_ui_handler;
|
||||
Bonobo_UIHandler remote_ui_handler;
|
||||
|
||||
|
@ -145,7 +150,7 @@ add_menu_items_callback (GtkWidget *widget,
|
|||
_("C_lear Text"),
|
||||
_("Removes the selected text without putting it on the clipboard"),
|
||||
clear_callback, widget);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -153,6 +158,7 @@ remove_menu_items_callback (GtkWidget *widget,
|
|||
GdkEventAny *event,
|
||||
gpointer callback_data)
|
||||
{
|
||||
#ifdef UIH
|
||||
BonoboUIHandler *ui_handler;
|
||||
|
||||
g_assert (GTK_IS_EDITABLE (widget));
|
||||
|
@ -167,6 +173,7 @@ remove_menu_items_callback (GtkWidget *widget,
|
|||
NAUTILUS_MENU_PATH_PASTE_ITEM);
|
||||
bonobo_ui_handler_menu_remove (ui_handler,
|
||||
NAUTILUS_MENU_PATH_CLEAR_ITEM);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -216,13 +223,9 @@ void
|
|||
nautilus_clipboard_set_up_editable_from_bonobo_control (GtkEditable *target,
|
||||
BonoboControl *control)
|
||||
{
|
||||
BonoboUIHandler *ui_handler;
|
||||
|
||||
g_return_if_fail (GTK_IS_EDITABLE (target));
|
||||
g_return_if_fail (BONOBO_IS_CONTROL (control));
|
||||
|
||||
ui_handler = bonobo_control_get_ui_handler (control);
|
||||
|
||||
/* Attach code to add menus when it gets the focus. */
|
||||
gtk_signal_connect_while_alive
|
||||
(GTK_OBJECT (target), "focus_in_event",
|
||||
|
|
|
@ -34,6 +34,8 @@ void nautilus_clipboard_set_up_editable_from_bonobo_control (GtkEditable *ta
|
|||
BonoboControl *control);
|
||||
|
||||
/* Containing application should use this. It could be moved out of libnautilus. */
|
||||
#ifdef UIH
|
||||
void nautilus_clipboard_set_up_host_ui_handler (BonoboUIHandler *ui_handler);
|
||||
#endif
|
||||
|
||||
#endif /* NAUTILUS_CLIPBOARD_H */
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "nautilus-undo-private.h"
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-macros.h>
|
||||
#include <libnautilus/nautilus-bonobo-workarounds.h>
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
#include "nautilus-undo-private.h"
|
||||
#include "nautilus-undo-transaction.h"
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <libgnomeui/gnome-canvas.h>
|
||||
|
||||
#define NAUTILUS_UNDO_MANAGER_DATA "Nautilus undo manager"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "nautilus-undo.h"
|
||||
#include <bonobo/bonobo-control.h>
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <bonobo/bonobo-ui-util.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libnautilus-extensions/nautilus-gtk-macros.h>
|
||||
|
||||
|
@ -469,3 +470,26 @@ nautilus_view_get_bonobo_control (NautilusView *view)
|
|||
|
||||
return view->details->control;
|
||||
}
|
||||
|
||||
BonoboUIComponent *
|
||||
nautilus_view_set_up_ui (NautilusView *view,
|
||||
const char *datadir,
|
||||
const char *ui_file_name,
|
||||
const char *application_name)
|
||||
{
|
||||
BonoboUIComponent *ui_component;
|
||||
Bonobo_UIContainer ui_container;
|
||||
|
||||
/* Get the UI component that's pre-made by the control. */
|
||||
ui_component = bonobo_control_get_ui_component (view->details->control);
|
||||
|
||||
/* Connect the UI component to the control frame's UI container. */
|
||||
ui_container = bonobo_control_get_remote_ui_container (view->details->control);
|
||||
bonobo_ui_component_set_container (ui_component, ui_container);
|
||||
bonobo_object_release_unref (ui_container, NULL);
|
||||
|
||||
/* Set up the UI from an XML file. */
|
||||
bonobo_ui_util_set_ui (ui_component, datadir, ui_file_name, application_name);
|
||||
|
||||
return ui_component;
|
||||
}
|
||||
|
|
|
@ -91,6 +91,12 @@ void nautilus_view_set_title (NautilusView
|
|||
Nautilus_URIList *nautilus_uri_list_from_g_list (GList *list);
|
||||
GList * nautilus_shallow_g_list_from_uri_list (const Nautilus_URIList *uri_list);
|
||||
|
||||
/* Simpler API for setting up and getting the UI component. */
|
||||
BonoboUIComponent *nautilus_view_set_up_ui (NautilusView *view,
|
||||
const char *datadir,
|
||||
const char *ui_xml_file_name,
|
||||
const char *application_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
|
|
@ -26,7 +26,7 @@ Requires: ORBit >= 0.5.1
|
|||
Requires: oaf >= 0.3.0
|
||||
Requires: gnome-vfs >= 0.1
|
||||
Requires: gdk-pixbuf >= 0.8.0
|
||||
Requires: bonobo >= 0.15
|
||||
Requires: bonobo >= 0.20
|
||||
Requires: popt >= 1.5
|
||||
|
||||
%description
|
||||
|
@ -147,6 +147,7 @@ fi
|
|||
%{prefix}/share/pixmaps/nautilus/vector/*.svg
|
||||
%{prefix}/share/pixmaps/nautilus/vector/*.xml
|
||||
%{prefix}/share/pixmaps/nautilus/throbber/*.png
|
||||
%{prefix}/share/gnome/ui/nautilus-*-ui.xml
|
||||
|
||||
%files devel
|
||||
|
||||
|
|
|
@ -142,8 +142,10 @@ nautilus_shell_interface_idl_stamp: nautilus-shell-interface.idl $(top_srcdir)/l
|
|||
TESTS=check-nautilus
|
||||
|
||||
oafdir = $(datadir)/oaf
|
||||
oaf_DATA = \
|
||||
nautilus.oafinfo
|
||||
oaf_DATA = nautilus.oafinfo
|
||||
|
||||
uidir = $(datadir)/gnome/ui
|
||||
ui_DATA = nautilus-shell-ui.xml
|
||||
|
||||
CLEANFILES = \
|
||||
$(nautilus_shell_interface_idl_sources) \
|
||||
|
@ -155,6 +157,7 @@ EXTRA_DIST = \
|
|||
nautilus-shell-interface.idl \
|
||||
$(oaf_DATA) \
|
||||
run-nautilus \
|
||||
$(ui_DATA) \
|
||||
$(NULL)
|
||||
|
||||
install-data-hook: run-nautilus
|
||||
|
|
|
@ -44,12 +44,11 @@ noinst_HEADERS = \
|
|||
nautilus-trash-monitor.h \
|
||||
$(NULL)
|
||||
|
||||
uidir = $(datadir)/gnome/ui
|
||||
ui_DATA = \
|
||||
nautilus-directory-view-ui.xml \
|
||||
nautilus-icon-view-ui.xml \
|
||||
nautilus-search-list-view-ui.xml \
|
||||
$(NULL)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
EXTRA_DIST = $(ui_DATA)
|
||||
|
|
|
@ -743,7 +743,9 @@ create_link_callback (gpointer ignored, gpointer callback_data)
|
|||
}
|
||||
|
||||
static void
|
||||
bonobo_menu_select_all_callback (BonoboUIHandler *ui_handler, gpointer callback_data, const char *path)
|
||||
bonobo_menu_select_all_callback (BonoboUIComponent *component,
|
||||
gpointer callback_data,
|
||||
const char *verb)
|
||||
{
|
||||
g_assert (FM_IS_DIRECTORY_VIEW (callback_data));
|
||||
|
||||
|
@ -751,7 +753,9 @@ bonobo_menu_select_all_callback (BonoboUIHandler *ui_handler, gpointer callback_
|
|||
}
|
||||
|
||||
static void
|
||||
bonobo_menu_empty_trash_callback (BonoboUIHandler *ui_handler, gpointer callback_data, const char *path)
|
||||
bonobo_menu_empty_trash_callback (BonoboUIComponent *component,
|
||||
gpointer callback_data,
|
||||
const char *verb)
|
||||
{
|
||||
g_assert (FM_IS_DIRECTORY_VIEW (callback_data));
|
||||
|
||||
|
@ -804,20 +808,12 @@ static void
|
|||
bonobo_control_activate_callback (BonoboObject *control, gboolean state, gpointer callback_data)
|
||||
{
|
||||
FMDirectoryView *view;
|
||||
BonoboUIHandler *local_ui_handler;
|
||||
Bonobo_UIHandler remote_ui_handler;
|
||||
|
||||
g_assert (FM_IS_DIRECTORY_VIEW (callback_data));
|
||||
|
||||
view = FM_DIRECTORY_VIEW (callback_data);
|
||||
|
||||
local_ui_handler = bonobo_control_get_ui_handler (BONOBO_CONTROL (control));
|
||||
|
||||
if (state) {
|
||||
remote_ui_handler = bonobo_control_get_remote_ui_handler (BONOBO_CONTROL (control));
|
||||
bonobo_ui_handler_set_container (local_ui_handler, remote_ui_handler);
|
||||
bonobo_object_release_unref (remote_ui_handler, NULL);
|
||||
|
||||
/* Add new menu items and perhaps whole menus */
|
||||
fm_directory_view_merge_menus (view);
|
||||
/* Set initial sensitivity, wording, toggle state, etc. */
|
||||
|
@ -1946,22 +1942,22 @@ fm_directory_view_get_selection (FMDirectoryView *view)
|
|||
}
|
||||
|
||||
/**
|
||||
* fm_directory_view_get_bonobo_ui_handler:
|
||||
* fm_directory_view_get_bonobo_ui_container:
|
||||
*
|
||||
* Get the BonoboUIHandler for this FMDirectoryView.
|
||||
* Get the BonoboUIContainer for this FMDirectoryView.
|
||||
* This is normally called only by subclasses in order to
|
||||
* install and modify bonobo menus and such.
|
||||
* @view: FMDirectoryView of interest.
|
||||
*
|
||||
* Return value: BonoboUIHandler for this view.
|
||||
* Return value: BonoboUIContainer for this view.
|
||||
*
|
||||
**/
|
||||
BonoboUIHandler *
|
||||
fm_directory_view_get_bonobo_ui_handler (FMDirectoryView *view)
|
||||
Bonobo_UIContainer
|
||||
fm_directory_view_get_bonobo_ui_container (FMDirectoryView *view)
|
||||
{
|
||||
g_return_val_if_fail (FM_IS_DIRECTORY_VIEW (view), NULL);
|
||||
|
||||
return bonobo_control_get_ui_handler (get_bonobo_control (view));
|
||||
return bonobo_control_get_remote_ui_container (get_bonobo_control (view));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3003,6 +2999,8 @@ fm_directory_view_real_create_selection_context_menu_items (FMDirectoryView *vie
|
|||
remove_custom_icons_callback);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
insert_bonobo_menu_item (FMDirectoryView *view,
|
||||
BonoboUIHandler *ui_handler,
|
||||
|
@ -3260,15 +3258,38 @@ reset_bonobo_open_with_menu (FMDirectoryView *view, BonoboUIHandler *ui_handler,
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* UIH */
|
||||
|
||||
static void
|
||||
fm_directory_view_real_merge_menus (FMDirectoryView *view)
|
||||
{
|
||||
BonoboUIComponent *ui_component;
|
||||
GList *selection;
|
||||
BonoboUIHandler *ui_handler;
|
||||
BonoboUIVerb verbs [] = {
|
||||
BONOBO_UI_VERB ("New Folder", (BonoboUIVerbFn)new_folder_callback),
|
||||
BONOBO_UI_VERB ("Open", (BonoboUIVerbFn)open_callback),
|
||||
BONOBO_UI_VERB ("OpenNew", (BonoboUIVerbFn)open_in_new_window_callback),
|
||||
BONOBO_UI_VERB ("OtherApplication", (BonoboUIVerbFn)other_application_callback),
|
||||
BONOBO_UI_VERB ("OtherViewer", (BonoboUIVerbFn)other_viewer_callback),
|
||||
BONOBO_UI_VERB ("Show Properties", (BonoboUIVerbFn)open_properties_window_callback),
|
||||
BONOBO_UI_VERB ("Trash", (BonoboUIVerbFn)trash_callback),
|
||||
BONOBO_UI_VERB ("Duplicate", (BonoboUIVerbFn)duplicate_callback),
|
||||
BONOBO_UI_VERB ("Create Link", (BonoboUIVerbFn)create_link_callback),
|
||||
BONOBO_UI_VERB ("Empty Trash", bonobo_menu_empty_trash_callback),
|
||||
BONOBO_UI_VERB ("Select All", bonobo_menu_select_all_callback),
|
||||
BONOBO_UI_VERB ("Remove Custom Icons", (BonoboUIVerbFn)remove_custom_icons_callback),
|
||||
BONOBO_UI_VERB_END
|
||||
};
|
||||
|
||||
ui_component = nautilus_view_set_up_ui (view->details->nautilus_view,
|
||||
NAUTILUS_DATADIR,
|
||||
"nautilus-directory-view-ui.xml",
|
||||
"nautilus");
|
||||
bonobo_ui_component_add_verb_list_with_data (ui_component, verbs, view);
|
||||
|
||||
selection = fm_directory_view_get_selection (view);
|
||||
ui_handler = fm_directory_view_get_bonobo_ui_handler (view);
|
||||
|
||||
#ifdef UIH
|
||||
insert_bonobo_menu_item
|
||||
(view,
|
||||
ui_handler, selection,
|
||||
|
@ -3368,10 +3389,13 @@ fm_directory_view_real_merge_menus (FMDirectoryView *view)
|
|||
"settings_changed",
|
||||
schedule_update_menus,
|
||||
GTK_OBJECT (view));
|
||||
#endif /* UIH */
|
||||
|
||||
nautilus_file_list_free (selection);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
update_one_menu_item (FMDirectoryView *view,
|
||||
BonoboUIHandler *ui_handler,
|
||||
|
@ -3387,9 +3411,12 @@ update_one_menu_item (FMDirectoryView *view,
|
|||
g_free (label_string);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
fm_directory_view_real_update_menus (FMDirectoryView *view)
|
||||
{
|
||||
#ifdef UIH
|
||||
BonoboUIHandler *handler;
|
||||
GList *selection;
|
||||
|
||||
|
@ -3425,6 +3452,7 @@ fm_directory_view_real_update_menus (FMDirectoryView *view)
|
|||
NAUTILUS_MENU_PATH_SELECT_ALL_ITEM);
|
||||
|
||||
nautilus_file_list_free (selection);
|
||||
#endif
|
||||
}
|
||||
|
||||
static GtkMenu *
|
||||
|
|
|
@ -25,16 +25,16 @@
|
|||
#ifndef FM_DIRECTORY_VIEW_H
|
||||
#define FM_DIRECTORY_VIEW_H
|
||||
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
#include <gtk/gtkmenu.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
#include <gtk/gtkscrolledwindow.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <libnautilus-extensions/nautilus-background.h>
|
||||
#include <libnautilus-extensions/nautilus-directory.h>
|
||||
#include <libnautilus-extensions/nautilus-file.h>
|
||||
#include <libnautilus-extensions/nautilus-icon-container.h>
|
||||
#include <libnautilus-extensions/nautilus-link.h>
|
||||
#include <libnautilus-extensions/nautilus-string-list.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
|
||||
typedef struct FMDirectoryView FMDirectoryView;
|
||||
typedef struct FMDirectoryViewClass FMDirectoryViewClass;
|
||||
|
@ -343,7 +343,7 @@ gboolean fm_directory_view_confirm_multiple_windows (FMDirectoryView *
|
|||
void fm_directory_view_queue_file_change (FMDirectoryView *view,
|
||||
NautilusFile *file);
|
||||
void fm_directory_view_notify_selection_changed (FMDirectoryView *view);
|
||||
BonoboUIHandler *fm_directory_view_get_bonobo_ui_handler (FMDirectoryView *view);
|
||||
Bonobo_UIContainer fm_directory_view_get_bonobo_ui_container (FMDirectoryView *view);
|
||||
NautilusStringList *fm_directory_view_get_emblem_names_to_exclude (FMDirectoryView *view);
|
||||
NautilusDirectory *fm_directory_view_get_model (FMDirectoryView *view);
|
||||
NautilusBackground *fm_directory_view_get_background (FMDirectoryView *view);
|
||||
|
|
|
@ -24,12 +24,14 @@
|
|||
|
||||
#include <config.h>
|
||||
#include "fm-icon-view.h"
|
||||
#include "fm-desktop-icon-view.h"
|
||||
|
||||
#include "fm-desktop-icon-view.h"
|
||||
#include "fm-error-reporting.h"
|
||||
#include "fm-icon-text-window.h"
|
||||
#include <bonobo/bonobo-ui-util.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenu.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
|
@ -62,7 +64,6 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* Paths to use when creating & referring to Bonobo menu items */
|
||||
|
@ -100,8 +101,8 @@ static void fm_icon_view_set_directory_tighter_layout(FMIconView *icon_view,
|
|||
NautilusDirectory *directory,
|
||||
gboolean tighter_layout);
|
||||
static gboolean real_supports_auto_layout (FMIconView *view);
|
||||
static void set_sort_criterion_by_path (FMIconView *icon_view,
|
||||
const char *path);
|
||||
static void set_sort_criterion_by_verb (FMIconView *icon_view,
|
||||
const char *verb);
|
||||
static gboolean set_sort_reversed (FMIconView *icon_view,
|
||||
gboolean new_value);
|
||||
static void sort_direction_callback (gpointer ignored,
|
||||
|
@ -116,7 +117,7 @@ NAUTILUS_DEFINE_CLASS_BOILERPLATE (FMIconView, fm_icon_view, FM_TYPE_DIRECTORY_V
|
|||
typedef struct {
|
||||
NautilusFileSortType sort_type;
|
||||
const char *metadata_text;
|
||||
const char *menu_path;
|
||||
const char *verb;
|
||||
const char *menu_label;
|
||||
const char *menu_hint;
|
||||
} SortCriterion;
|
||||
|
@ -136,35 +137,35 @@ static const SortCriterion sort_criteria[] = {
|
|||
{
|
||||
NAUTILUS_FILE_SORT_BY_NAME,
|
||||
"name",
|
||||
"/View/Lay Out/Sort by Name",
|
||||
"Sort by Name",
|
||||
N_("by _Name"),
|
||||
N_("Keep icons sorted by name in rows")
|
||||
},
|
||||
{
|
||||
NAUTILUS_FILE_SORT_BY_SIZE,
|
||||
"size",
|
||||
"/View/Lay Out/Sort by Size",
|
||||
"Sort by Size",
|
||||
N_("by _Size"),
|
||||
N_("Keep icons sorted by size in rows")
|
||||
},
|
||||
{
|
||||
NAUTILUS_FILE_SORT_BY_TYPE,
|
||||
"type",
|
||||
"/View/Lay Out/Sort by Type",
|
||||
"Sort by Type",
|
||||
N_("by _Type"),
|
||||
N_("Keep icons sorted by type in rows")
|
||||
},
|
||||
{
|
||||
NAUTILUS_FILE_SORT_BY_MTIME,
|
||||
"modification date",
|
||||
"/View/Lay Out/Sort by Modification Date",
|
||||
"Sort by Modification Date",
|
||||
N_("by Modification _Date"),
|
||||
N_("Keep icons sorted by modification date in rows")
|
||||
},
|
||||
{
|
||||
NAUTILUS_FILE_SORT_BY_EMBLEMS,
|
||||
"emblems",
|
||||
"/View/Lay Out/Sort by Emblems",
|
||||
"Sort by Emblems",
|
||||
N_("by _Emblems"),
|
||||
N_("Keep icons sorted by emblems in rows")
|
||||
}
|
||||
|
@ -187,6 +188,8 @@ struct FMIconViewDetails
|
|||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo/GTK menu bug. */
|
||||
gboolean updating_toggle_menu_item;
|
||||
|
||||
BonoboUIComponent *ui;
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -196,6 +199,10 @@ fm_icon_view_destroy (GtkObject *object)
|
|||
|
||||
icon_view = FM_ICON_VIEW (object);
|
||||
|
||||
if (icon_view->details->ui != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (icon_view->details->ui));
|
||||
}
|
||||
|
||||
if (icon_view->details->react_to_icon_change_idle_id != 0) {
|
||||
gtk_idle_remove (icon_view->details->react_to_icon_change_idle_id);
|
||||
}
|
||||
|
@ -497,7 +504,7 @@ static void
|
|||
context_menu_layout_radio_item_callback (GtkWidget *menu_item, gpointer user_data)
|
||||
{
|
||||
FMIconView *icon_view;
|
||||
const char *menu_path;
|
||||
const char *verb;
|
||||
|
||||
icon_view = FM_ICON_VIEW (user_data);
|
||||
|
||||
|
@ -506,13 +513,13 @@ context_menu_layout_radio_item_callback (GtkWidget *menu_item, gpointer user_dat
|
|||
return;
|
||||
}
|
||||
|
||||
menu_path = (const char *)gtk_object_get_data (GTK_OBJECT (menu_item), "menu_path");
|
||||
g_assert (menu_path != NULL);
|
||||
verb = (const char *)gtk_object_get_data (GTK_OBJECT (menu_item), "verb");
|
||||
g_assert (verb != NULL);
|
||||
|
||||
if (strcmp (menu_path, MENU_PATH_MANUAL_LAYOUT) == 0) {
|
||||
if (strcmp (verb, "Manual Layout") == 0) {
|
||||
manual_layout_callback (menu_item, user_data);
|
||||
} else {
|
||||
set_sort_criterion_by_path (icon_view, menu_path);
|
||||
set_sort_criterion_by_verb (icon_view, verb);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -520,7 +527,7 @@ static GtkMenuItem *
|
|||
append_one_context_menu_layout_item (FMIconView *view,
|
||||
GtkMenu *menu,
|
||||
GtkRadioMenuItem *item_in_group,
|
||||
const char *menu_path,
|
||||
const char *verb,
|
||||
const char *menu_label)
|
||||
{
|
||||
GtkWidget *menu_item;
|
||||
|
@ -535,9 +542,9 @@ append_one_context_menu_layout_item (FMIconView *view,
|
|||
/* Match appearance of Bonobo menu items, where unchosen items are still marked. */
|
||||
gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
|
||||
|
||||
/* Attach menu_path to menu item so we can check it in the callback. */
|
||||
gtk_object_set_data_full (GTK_OBJECT (menu_item), "menu_path",
|
||||
g_strdup (menu_path), g_free);
|
||||
/* Attach verb to menu item so we can check it in the callback. */
|
||||
gtk_object_set_data_full (GTK_OBJECT (menu_item), "verb",
|
||||
g_strdup (verb), g_free);
|
||||
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate", context_menu_layout_radio_item_callback, view);
|
||||
|
@ -724,7 +731,7 @@ fm_icon_view_create_background_context_menu_items (FMDirectoryView *view,
|
|||
NULL);
|
||||
manual_item = GTK_RADIO_MENU_ITEM (append_one_context_menu_layout_item
|
||||
(icon_view, layout_submenu, NULL,
|
||||
MENU_PATH_MANUAL_LAYOUT, manual_item_label));
|
||||
"Manual Layout", manual_item_label));
|
||||
g_free (manual_item_label);
|
||||
if (!is_auto_layout) {
|
||||
gtk_check_menu_item_set_active
|
||||
|
@ -736,10 +743,10 @@ fm_icon_view_create_background_context_menu_items (FMDirectoryView *view,
|
|||
for (i = 0; i < NAUTILUS_N_ELEMENTS (sort_criteria); i++) {
|
||||
toggle_item = append_one_context_menu_layout_item
|
||||
(icon_view, layout_submenu, manual_item,
|
||||
sort_criteria[i].menu_path,
|
||||
sort_criteria[i].verb,
|
||||
sort_criteria[i].menu_label);
|
||||
if (is_auto_layout && strcmp (icon_view->details->sort->menu_path,
|
||||
sort_criteria[i].menu_path) == 0) {
|
||||
if (is_auto_layout && strcmp (icon_view->details->sort->verb,
|
||||
sort_criteria[i].verb) == 0) {
|
||||
gtk_check_menu_item_set_active
|
||||
(GTK_CHECK_MENU_ITEM (toggle_item), TRUE);
|
||||
}
|
||||
|
@ -828,8 +835,7 @@ fm_icon_view_file_changed (FMDirectoryView *view, NautilusFile *file)
|
|||
static void
|
||||
update_layout_menus (FMIconView *view)
|
||||
{
|
||||
const char *path;
|
||||
BonoboUIHandler *ui_handler;
|
||||
const char *verb;
|
||||
gboolean is_auto_layout;
|
||||
|
||||
if (!view->details->menus_ready) {
|
||||
|
@ -837,18 +843,17 @@ update_layout_menus (FMIconView *view)
|
|||
}
|
||||
|
||||
is_auto_layout = fm_icon_view_using_auto_layout (view);
|
||||
ui_handler = fm_directory_view_get_bonobo_ui_handler
|
||||
(FM_DIRECTORY_VIEW (view));
|
||||
|
||||
if (fm_icon_view_supports_auto_layout (view)) {
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo/GTK menu bug. */
|
||||
view->details->updating_toggle_menu_item = TRUE;
|
||||
|
||||
/* Mark sort criterion. */
|
||||
path = MENU_PATH_MANUAL_LAYOUT;
|
||||
verb = "Manual Layout";
|
||||
if (is_auto_layout) {
|
||||
path = view->details->sort->menu_path;
|
||||
verb = view->details->sort->verb;
|
||||
}
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_radio_state (ui_handler, path, TRUE);
|
||||
|
||||
/* Set the checkmark for the "reversed order" item */
|
||||
|
@ -866,14 +871,17 @@ update_layout_menus (FMIconView *view)
|
|||
/* Tighter Layout is only relevant for auto layout */
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(ui_handler, MENU_PATH_TIGHTER_LAYOUT, is_auto_layout);
|
||||
#endif
|
||||
|
||||
view->details->updating_toggle_menu_item = FALSE;
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
/* Clean Up is only relevant for manual layout */
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(ui_handler, MENU_PATH_CLEAN_UP, !is_auto_layout);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1095,13 +1103,13 @@ get_sort_criterion_by_metadata_text (const char *metadata_text)
|
|||
}
|
||||
|
||||
static const SortCriterion *
|
||||
get_sort_criterion_by_menu_path (const char *path)
|
||||
get_sort_criterion_by_verb (const char *verb)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Figure out what the new sort setting should be. */
|
||||
for (i = 0; i < NAUTILUS_N_ELEMENTS (sort_criteria); i++) {
|
||||
if (strcmp (sort_criteria[i].menu_path, path) == 0) {
|
||||
if (strcmp (sort_criteria[i].verb, verb) == 0) {
|
||||
return &sort_criteria[i];
|
||||
}
|
||||
}
|
||||
|
@ -1337,6 +1345,8 @@ fm_icon_view_get_selection (FMDirectoryView *view)
|
|||
return list;
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
insert_bonobo_menu_item (FMIconView *view,
|
||||
BonoboUIHandler *ui_handler,
|
||||
|
@ -1395,18 +1405,20 @@ insert_bonobo_menu_item (FMIconView *view,
|
|||
bonobo_ui_handler_menu_set_sensitivity (ui_handler, path, sensitive);
|
||||
}
|
||||
|
||||
#endif /* UIH */
|
||||
|
||||
static void
|
||||
set_sort_criterion_by_path (FMIconView *icon_view, const char *path)
|
||||
set_sort_criterion_by_verb (FMIconView *icon_view, const char *verb)
|
||||
{
|
||||
g_assert (FM_IS_ICON_VIEW (icon_view));
|
||||
g_assert (path != NULL);
|
||||
g_assert (verb != NULL);
|
||||
|
||||
set_sort_criterion (icon_view, get_sort_criterion_by_menu_path (path));
|
||||
set_sort_criterion (icon_view, get_sort_criterion_by_verb (verb));
|
||||
nautilus_icon_container_sort (get_icon_container (icon_view));
|
||||
}
|
||||
|
||||
static void
|
||||
sort_callback (BonoboUIHandler *handler, gpointer user_data, const char *path)
|
||||
sort_callback (BonoboUIComponent *component, gpointer user_data, const char *verb)
|
||||
{
|
||||
FMIconView *icon_view;
|
||||
|
||||
|
@ -1417,7 +1429,7 @@ sort_callback (BonoboUIHandler *handler, gpointer user_data, const char *path)
|
|||
return;
|
||||
}
|
||||
|
||||
set_sort_criterion_by_path (icon_view, path);
|
||||
set_sort_criterion_by_verb (icon_view, verb);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1502,31 +1514,30 @@ fm_icon_view_start_renaming_item (FMDirectoryView *view, const char *uri)
|
|||
(get_icon_container (FM_ICON_VIEW (view)));
|
||||
}
|
||||
|
||||
static int
|
||||
get_next_position (BonoboUIHandler *ui_handler, const char *path)
|
||||
{
|
||||
int position;
|
||||
|
||||
position = bonobo_ui_handler_menu_get_pos (ui_handler, path);
|
||||
/**
|
||||
* FIXME bugzilla.eazel.com 2527: this is a workaround for a Bonobo bug in
|
||||
* which asking for the position of the last item returns -1.
|
||||
* This code can be removed when the bug is fixed in Bonobo.
|
||||
*/
|
||||
if (position < 0) {
|
||||
return position;
|
||||
}
|
||||
|
||||
return ++position;
|
||||
}
|
||||
|
||||
static void
|
||||
fm_icon_view_merge_menus (FMDirectoryView *view)
|
||||
{
|
||||
GList *selection;
|
||||
BonoboUIHandler *ui_handler;
|
||||
FMIconView *icon_view;
|
||||
#ifdef UIH
|
||||
int i;
|
||||
#endif
|
||||
BonoboUIVerb verbs [] = {
|
||||
BONOBO_UI_VERB ("Rename", (BonoboUIVerbFn)rename_icon_callback),
|
||||
BONOBO_UI_VERB ("Icon Text", (BonoboUIVerbFn)customize_icon_text_callback),
|
||||
BONOBO_UI_VERB ("Stretch", (BonoboUIVerbFn)show_stretch_handles_callback),
|
||||
BONOBO_UI_VERB ("Unstretch", (BonoboUIVerbFn)unstretch_icons_callback),
|
||||
BONOBO_UI_VERB ("Manual Layout", (BonoboUIVerbFn)manual_layout_callback),
|
||||
BONOBO_UI_VERB ("Sort by Name", sort_callback),
|
||||
BONOBO_UI_VERB ("Sort by Size", sort_callback),
|
||||
BONOBO_UI_VERB ("Sort by Type", sort_callback),
|
||||
BONOBO_UI_VERB ("Sort by Modification Date", sort_callback),
|
||||
BONOBO_UI_VERB ("Sort by Emblems", sort_callback),
|
||||
BONOBO_UI_VERB ("Tighter Layout", (BonoboUIVerbFn)tighter_layout_callback),
|
||||
BONOBO_UI_VERB ("Reversed Order", (BonoboUIVerbFn)sort_direction_callback),
|
||||
BONOBO_UI_VERB ("Clean Up", (BonoboUIVerbFn)clean_up_callback),
|
||||
BONOBO_UI_VERB_END
|
||||
};
|
||||
|
||||
g_assert (FM_IS_ICON_VIEW (view));
|
||||
|
||||
|
@ -1534,9 +1545,19 @@ fm_icon_view_merge_menus (FMDirectoryView *view)
|
|||
|
||||
icon_view = FM_ICON_VIEW (view);
|
||||
|
||||
selection = fm_directory_view_get_selection (view);
|
||||
ui_handler = fm_directory_view_get_bonobo_ui_handler (view);
|
||||
icon_view->details->ui = bonobo_ui_component_new ("Icon View");
|
||||
bonobo_ui_component_set_container (icon_view->details->ui,
|
||||
fm_directory_view_get_bonobo_ui_container (view));
|
||||
bonobo_ui_util_set_ui (icon_view->details->ui,
|
||||
NAUTILUS_DATADIR,
|
||||
"nautilus-icon-view-ui.xml",
|
||||
"nautilus");
|
||||
|
||||
bonobo_ui_component_add_verb_list_with_data (icon_view->details->ui, verbs, view);
|
||||
|
||||
selection = fm_directory_view_get_selection (view);
|
||||
|
||||
#ifdef UIH
|
||||
/* Edit menu. */
|
||||
insert_bonobo_menu_item
|
||||
(icon_view, ui_handler, selection,
|
||||
|
@ -1627,6 +1648,7 @@ fm_icon_view_merge_menus (FMDirectoryView *view)
|
|||
_("Rename selected item"),
|
||||
get_next_position (ui_handler, FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE),
|
||||
(BonoboUIHandlerCallback) rename_icon_callback, view);
|
||||
#endif /* UIH */
|
||||
|
||||
nautilus_file_list_free (selection);
|
||||
|
||||
|
@ -1635,6 +1657,8 @@ fm_icon_view_merge_menus (FMDirectoryView *view)
|
|||
update_layout_menus (icon_view);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
update_one_menu_item (FMIconView *view,
|
||||
BonoboUIHandler *ui_handler,
|
||||
|
@ -1650,23 +1674,25 @@ update_one_menu_item (FMIconView *view,
|
|||
g_free (label);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
fm_icon_view_update_menus (FMDirectoryView *view)
|
||||
{
|
||||
BonoboUIHandler *handler;
|
||||
GList *selection;
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (FM_DIRECTORY_VIEW_CLASS, update_menus, (view));
|
||||
|
||||
handler = fm_directory_view_get_bonobo_ui_handler (view);
|
||||
selection = fm_directory_view_get_selection (view);
|
||||
|
||||
#ifdef UIH
|
||||
update_one_menu_item (FM_ICON_VIEW (view), handler, selection,
|
||||
MENU_PATH_STRETCH_ICON);
|
||||
update_one_menu_item (FM_ICON_VIEW (view), handler, selection,
|
||||
MENU_PATH_UNSTRETCH_ICONS);
|
||||
update_one_menu_item (FM_ICON_VIEW (view), handler, selection,
|
||||
MENU_PATH_RENAME);
|
||||
#endif
|
||||
|
||||
nautilus_file_list_free (selection);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include "fm-directory-view.h"
|
||||
#include "fm-list-view-private.h"
|
||||
#include "nautilus-indexing-info.h"
|
||||
#include <bonobo/bonobo-ui-util.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libnautilus-extensions/nautilus-file-attributes.h>
|
||||
|
@ -51,9 +53,14 @@
|
|||
#define MENU_PATH_INDEXING_INFO "/File/Indexing Info..."
|
||||
#define MENU_PATH_REVEAL_IN_NEW_WINDOW "/File/Reveal"
|
||||
|
||||
struct FMSearchListViewDetails {
|
||||
BonoboUIComponent *ui;
|
||||
};
|
||||
|
||||
static void fm_search_list_view_initialize (gpointer object,
|
||||
gpointer klass);
|
||||
static void fm_search_list_view_initialize_class (gpointer klass);
|
||||
static void real_destroy (GtkObject *object);
|
||||
static void real_add_file (FMDirectoryView *view,
|
||||
NautilusFile *file);
|
||||
static void real_create_selection_context_menu_items (FMDirectoryView *view,
|
||||
|
@ -103,12 +110,16 @@ load_location_callback (NautilusView *nautilus_view, char *location)
|
|||
static void
|
||||
fm_search_list_view_initialize_class (gpointer klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
FMDirectoryViewClass *fm_directory_view_class;
|
||||
FMListViewClass *fm_list_view_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
fm_directory_view_class = FM_DIRECTORY_VIEW_CLASS (klass);
|
||||
fm_list_view_class = FM_LIST_VIEW_CLASS (klass);
|
||||
|
||||
object_class->destroy = real_destroy;
|
||||
|
||||
fm_directory_view_class->add_file = real_add_file;
|
||||
fm_directory_view_class->create_selection_context_menu_items =
|
||||
real_create_selection_context_menu_items;
|
||||
|
@ -136,12 +147,16 @@ static void
|
|||
fm_search_list_view_initialize (gpointer object,
|
||||
gpointer klass)
|
||||
{
|
||||
FMSearchListView *search_view;
|
||||
NautilusView *nautilus_view;
|
||||
FMDirectoryView *directory_view;
|
||||
|
||||
g_assert (GTK_BIN (object)->child == NULL);
|
||||
|
||||
directory_view = FM_DIRECTORY_VIEW (object);
|
||||
|
||||
search_view = FM_SEARCH_LIST_VIEW (object);
|
||||
directory_view = FM_DIRECTORY_VIEW (object);
|
||||
|
||||
search_view->details = g_new0 (FMSearchListViewDetails, 1);
|
||||
|
||||
nautilus_view = fm_directory_view_get_nautilus_view (directory_view);
|
||||
|
||||
|
@ -152,6 +167,21 @@ fm_search_list_view_initialize (gpointer object,
|
|||
|
||||
}
|
||||
|
||||
static void
|
||||
real_destroy (GtkObject *object)
|
||||
{
|
||||
FMSearchListView *search_view;
|
||||
|
||||
search_view = FM_SEARCH_LIST_VIEW (object);
|
||||
|
||||
if (search_view->details->ui != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (search_view->details->ui));
|
||||
}
|
||||
g_free (search_view->details);
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
|
||||
}
|
||||
|
||||
static int
|
||||
real_get_number_of_columns (FMListView *view)
|
||||
{
|
||||
|
@ -269,7 +299,7 @@ real_get_column_specification (FMListView *view,
|
|||
}
|
||||
|
||||
static void
|
||||
indexing_info_callback (gpointer ignored, gpointer data)
|
||||
indexing_info_callback (BonoboUIComponent *component, gpointer data, const char *verb)
|
||||
{
|
||||
nautilus_indexing_info_show_dialog ();
|
||||
}
|
||||
|
@ -426,19 +456,35 @@ real_file_still_belongs (FMListView *view, NautilusFile *file)
|
|||
static void
|
||||
real_merge_menus (FMDirectoryView *view)
|
||||
{
|
||||
BonoboUIHandler *ui_handler;
|
||||
FMSearchListView *search_view;
|
||||
GList *selected_files;
|
||||
#ifdef UIH
|
||||
char *name;
|
||||
gboolean sensitive;
|
||||
int position;
|
||||
|
||||
g_assert (FM_IS_LIST_VIEW (view));
|
||||
#endif
|
||||
BonoboUIVerb verbs [] = {
|
||||
BONOBO_UI_VERB ("Indexing Info", indexing_info_callback),
|
||||
BONOBO_UI_VERB ("Reveal", (BonoboUIVerbFn)reveal_selected_items_callback),
|
||||
BONOBO_UI_VERB_END
|
||||
};
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (FM_DIRECTORY_VIEW_CLASS, merge_menus, (view));
|
||||
|
||||
ui_handler = fm_directory_view_get_bonobo_ui_handler (view);
|
||||
search_view = FM_SEARCH_LIST_VIEW (view);
|
||||
|
||||
search_view->details->ui = bonobo_ui_component_new ("Search List View");
|
||||
bonobo_ui_component_set_container (search_view->details->ui,
|
||||
fm_directory_view_get_bonobo_ui_container (view));
|
||||
bonobo_ui_util_set_ui (search_view->details->ui,
|
||||
NAUTILUS_DATADIR,
|
||||
"nautilus-search-list-view-ui.xml",
|
||||
"nautilus");
|
||||
bonobo_ui_component_add_verb_list_with_data (search_view->details->ui, verbs, view);
|
||||
|
||||
selected_files = fm_directory_view_get_selection (view);
|
||||
|
||||
#ifdef UIH
|
||||
/* Indexing Info.. goes right after the Show Properties item that
|
||||
* fm-directory-view places in the File menu.
|
||||
*/
|
||||
|
@ -471,6 +517,7 @@ real_merge_menus (FMDirectoryView *view)
|
|||
g_free (name);
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(ui_handler, MENU_PATH_REVEAL_IN_NEW_WINDOW, sensitive);
|
||||
#endif
|
||||
|
||||
nautilus_file_list_free (selected_files);
|
||||
}
|
||||
|
@ -508,18 +555,19 @@ real_supports_properties (FMDirectoryView *view)
|
|||
static void
|
||||
real_update_menus (FMDirectoryView *view)
|
||||
{
|
||||
BonoboUIHandler *ui_handler;
|
||||
GList *selected_files;
|
||||
#ifdef UIH
|
||||
char *name;
|
||||
gboolean sensitive;
|
||||
#endif
|
||||
|
||||
g_assert (FM_IS_LIST_VIEW (view));
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (FM_DIRECTORY_VIEW_CLASS, update_menus, (view));
|
||||
|
||||
ui_handler = fm_directory_view_get_bonobo_ui_handler (view);
|
||||
selected_files = fm_directory_view_get_selection (view);
|
||||
|
||||
#ifdef UIH
|
||||
compute_reveal_item_name_and_sensitivity
|
||||
(selected_files, TRUE, &name, &sensitive);
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
|
@ -528,6 +576,7 @@ real_update_menus (FMDirectoryView *view)
|
|||
(ui_handler, MENU_PATH_REVEAL_IN_NEW_WINDOW, name);
|
||||
|
||||
g_free (name);
|
||||
#endif
|
||||
|
||||
nautilus_file_list_free (selected_files);
|
||||
}
|
||||
|
|
|
@ -33,8 +33,11 @@
|
|||
#define FM_IS_SEARCH_LIST_VIEW(obj) (GTK_CHECK_TYPE ((obj), FM_TYPE_SEARCH_LIST_VIEW))
|
||||
#define FM_IS_SEARCH_LIST_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), FM_TYPE_SEARCH_LIST_VIEW))
|
||||
|
||||
typedef struct FMSearchListViewDetails FMSearchListViewDetails;
|
||||
|
||||
typedef struct {
|
||||
FMListView parent_slot;
|
||||
FMSearchListViewDetails *details;
|
||||
} FMSearchListView;
|
||||
|
||||
typedef struct {
|
||||
|
|
83
src/file-manager/nautilus-directory-view-ui.xml
Normal file
83
src/file-manager/nautilus-directory-view-ui.xml
Normal file
|
@ -0,0 +1,83 @@
|
|||
<Root>
|
||||
<menu>
|
||||
<submenu name="File" _label="_File">
|
||||
|
||||
<placeholder name="New Items Placeholder">
|
||||
<menuitem name="New Folder"
|
||||
_label="New Folder"
|
||||
accel="*Control*n"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
<placeholder name="Open Placeholder">
|
||||
<menuitem name="Open"
|
||||
_label="_Open"
|
||||
_descr="Open the selected item in this window"
|
||||
accel="*Control*o"
|
||||
verb=""/>
|
||||
<menuitem name="OpenNew"
|
||||
_label="_Open"
|
||||
_descr="Open each selected item in a new window"
|
||||
verb=""/>
|
||||
<submenu name="Open With" _label="Open With">
|
||||
<placeholder name="Open With Applications Placeholder"/>
|
||||
<menuitem name="OtherApplication"
|
||||
_label="Other _Application..."
|
||||
_descr="Choose another application with which to open the selected item"
|
||||
verb=""/>
|
||||
<menuitem/>
|
||||
<placeholder name="Open With Viewers Placeholder"/>
|
||||
<menuitem name="OtherViewer"
|
||||
_label="Other _Viewer..."
|
||||
_descr="Choose another viewer with which to view the selected item"
|
||||
verb=""/>
|
||||
</submenu>
|
||||
</placeholder>
|
||||
|
||||
<placeholder name="File Items Placeholder">
|
||||
<menuitem name="Show Properties"
|
||||
_label="Show _Properties"
|
||||
_descr="View or modify the properties of each selected item"
|
||||
accel="*Control*i"
|
||||
verb=""/>
|
||||
<menuitem name="Trash"
|
||||
_label="Move to _Trash"
|
||||
_descr="Move each selected item to the Trash"
|
||||
accel="*Control*t"
|
||||
verb=""/>
|
||||
<menuitem name="Duplicate"
|
||||
_label="_Duplicate"
|
||||
_descr="Duplicate each selected item"
|
||||
accel="*Control*d"
|
||||
verb=""/>
|
||||
<menuitem name="Create Link"
|
||||
_label="Create _Link"
|
||||
_descr="Create a symbolic link for each selected item"
|
||||
accel="*Control*l"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
|
||||
<placeholder name="Global File Items Placeholder">
|
||||
<menuitem name="Empty Trash"
|
||||
_label="_Empty Trash"
|
||||
_descr="Delete all items in the trash"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
</submenu>
|
||||
|
||||
<submenu name="Edit" _label="_Edit">
|
||||
<menuitem name="Select All"
|
||||
_label="_Select All Files"
|
||||
_descr="Select all items in this window"
|
||||
accel="*Control*a"
|
||||
verb=""/>
|
||||
|
||||
<placeholder name="Edit Items Placeholder">
|
||||
<menuitem name="Remove Custom Icons"
|
||||
_label="R_emove Custom Images"
|
||||
_descr="Remove any custom images from selected icons"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
|
||||
</submenu>
|
||||
</menu>
|
||||
</Root>
|
79
src/file-manager/nautilus-icon-view-ui.xml
Normal file
79
src/file-manager/nautilus-icon-view-ui.xml
Normal file
|
@ -0,0 +1,79 @@
|
|||
<Root>
|
||||
<menu>
|
||||
<submenu name="File" _label="_File">
|
||||
<placeholder name="File Items Placeholder">
|
||||
<menuitem name="Rename"
|
||||
_label="_Rename"
|
||||
_descr="Rename selected icon"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
</submenu>
|
||||
|
||||
<submenu name="Edit" _label="_Edit">
|
||||
<placeholder name="Global Edit Items Placeholder">
|
||||
<menuitem name="Icon Text"
|
||||
_label="_Icon Captions..."
|
||||
_descr="Choose which information appears beneath each icon's name"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
|
||||
<placeholder name="Edit Items Placeholder">
|
||||
<menuitem name="Stretch"
|
||||
_label="_Stretch Icon"
|
||||
_descr="Make the selected icon stretchable"
|
||||
verb=""/>
|
||||
<menuitem name="Unstretch"
|
||||
_label="_Restore Icons' Original Sizes"
|
||||
_descr="Restore each selected icon to its original size"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
|
||||
</submenu>
|
||||
|
||||
<submenu name="View" _label="_View">
|
||||
<placeholder name="View Items Placeholder">
|
||||
<submenu name="Lay Out" _label="_Lay out items">
|
||||
<menuitem name="Manual Layout"
|
||||
_label="_manually"
|
||||
_descr="Leave icons wherever they are dropped"
|
||||
type="radio" group="layout group"/>
|
||||
<placeholder name="Auto Layout" delimit="both">
|
||||
<menuitem name="Sort by Name"
|
||||
_label="by _Name"
|
||||
_descr="Keep icons sorted by name in rows"
|
||||
type="radio" group="layout group"/>
|
||||
<menuitem name="Sort by Size"
|
||||
_label="by _Size"
|
||||
_descr="Keep icons sorted by size in rows"
|
||||
type="radio" group="layout group"/>
|
||||
<menuitem name="Sort by Type"
|
||||
_label="by _Type"
|
||||
_descr="Keep icons sorted by type in rows"
|
||||
type="radio" group="layout group"/>
|
||||
<menuitem name="Sort by Modification Date"
|
||||
_label="by Modification _Date"
|
||||
_descr="Keep icons sorted by modification date in rows"
|
||||
type="radio" group="layout group"/>
|
||||
<menuitem name="Sort by Emblems"
|
||||
_label="by _Emblems"
|
||||
_descr="Keep icons sorted by emblems in rows"
|
||||
type="radio" group="layout group"/>
|
||||
</placeholder>
|
||||
<menuitem name="Tighter Layout"
|
||||
_label="_Tighter Layout"
|
||||
_descr="Toggle using a tighter layout scheme"
|
||||
verb=""/>
|
||||
<menuitem name="Reversed Order"
|
||||
_label="Re_versed Order"
|
||||
_descr="Display icons in the opposite order"
|
||||
verb=""/>
|
||||
</submenu>
|
||||
<menuitem name="Clean Up"
|
||||
_label="_Clean Up by Name"
|
||||
_descr="Reposition icons to better fit in the window and avoid overlapping"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
|
||||
</submenu>
|
||||
</menu>
|
||||
</Root>
|
18
src/file-manager/nautilus-search-list-view-ui.xml
Normal file
18
src/file-manager/nautilus-search-list-view-ui.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<Root>
|
||||
<menu>
|
||||
<submenu name="File" _label="_File">
|
||||
<placeholder name="Open Placeholder">
|
||||
<menuitem name="Reveal"
|
||||
_label="_Reveal in New Window"
|
||||
_descr="Reveal each selected item in its original folder"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
<placeholder name="General Status Placeholder">
|
||||
<menuitem name="Indexing Info"
|
||||
_label="_Indexing Info..."
|
||||
_descr="Show information about indexing used by searching"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
</submenu>
|
||||
</menu>
|
||||
</Root>
|
|
@ -29,7 +29,7 @@
|
|||
#define NAUTILUS_ABOUT_H
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnomeui/gnome-dialog.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -27,17 +27,18 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-application.h"
|
||||
|
||||
#include "nautilus-shell-interface.h"
|
||||
|
||||
#include "file-manager/fm-icon-view.h"
|
||||
#include "file-manager/fm-desktop-icon-view.h"
|
||||
#include "file-manager/fm-icon-view.h"
|
||||
#include "file-manager/fm-list-view.h"
|
||||
#include "file-manager/fm-search-list-view.h"
|
||||
#include "nautilus-desktop-window.h"
|
||||
#include "nautilus-first-time-druid.h"
|
||||
#include "nautilus-shell.h"
|
||||
#include "nautilus-main.h"
|
||||
#include <bonobo.h>
|
||||
#include "nautilus-shell-interface.h"
|
||||
#include "nautilus-shell.h"
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <bonobo/bonobo-object.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomeui/gnome-messagebox.h>
|
||||
|
|
|
@ -140,16 +140,19 @@ static void
|
|||
realize (GtkWidget *widget)
|
||||
{
|
||||
NautilusDesktopWindow *window;
|
||||
#ifdef UIH
|
||||
GtkContainer *dock_as_container;
|
||||
GList *children, *p;
|
||||
GtkWidget *child;
|
||||
#endif
|
||||
|
||||
window = NAUTILUS_DESKTOP_WINDOW (widget);
|
||||
|
||||
/* Hide unused pieces of the GnomeApp.
|
||||
/* Hide unused pieces of the BonoboWin.
|
||||
* We don't want a menu bar, toolbars, or status bar on the desktop.
|
||||
* But we don't want to hide the client area!
|
||||
*/
|
||||
#ifdef UIH
|
||||
gtk_widget_hide (GNOME_APP (window)->menubar);
|
||||
gtk_widget_hide (GNOME_APP (window)->statusbar);
|
||||
dock_as_container = GTK_CONTAINER (GNOME_APP (window)->dock);
|
||||
|
@ -165,6 +168,7 @@ realize (GtkWidget *widget)
|
|||
}
|
||||
}
|
||||
g_list_free (children);
|
||||
#endif
|
||||
|
||||
/* Make sure we get keyboard events */
|
||||
gtk_widget_set_events (widget, gtk_widget_get_events (widget)
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <config.h>
|
||||
#include "nautilus-history-frame.h"
|
||||
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libnautilus/nautilus-bonobo-workarounds.h>
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
#include "nautilus-sidebar-tabs.h"
|
||||
#include "nautilus-sidebar-title.h"
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gtk/gtkcheckmenuitem.h>
|
||||
#include <gtk/gtkdnd.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <gtk/gtknotebook.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <gtk/gtkcheckbutton.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkscrolledwindow.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtktable.h>
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
|
|
|
@ -32,20 +32,21 @@
|
|||
#include "nautilus-main.h"
|
||||
|
||||
#include "nautilus-application.h"
|
||||
#include "nautilus-window.h"
|
||||
#include "nautilus-self-check-functions.h"
|
||||
#include "nautilus-window.h"
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <dlfcn.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-init.h>
|
||||
#include <libgnomevfs/gnome-vfs-init.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <libnautilus-extensions/nautilus-lib-self-check-functions.h>
|
||||
#include <libnautilus-extensions/nautilus-self-checks.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-lib-self-check-functions.h>
|
||||
#include <libnautilus-extensions/nautilus-self-checks.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <parser.h>
|
||||
#include <popt.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -36,7 +36,10 @@
|
|||
#include "nautilus-signaller.h"
|
||||
#include "nautilus-theme-selector.h"
|
||||
#include "nautilus-window-private.h"
|
||||
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libnautilus-extensions/nautilus-bonobo-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
|
@ -50,14 +53,10 @@
|
|||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
#include <libnautilus-extensions/nautilus-user-level-manager.h>
|
||||
#include <libnautilus-extensions/nautilus-xml-extensions.h>
|
||||
|
||||
#include <libnautilus/nautilus-bonobo-ui.h>
|
||||
|
||||
/* gnome-XML headers */
|
||||
#include <parser.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
|
||||
#define STATIC_BOOKMARKS_FILE_NAME "static_bookmarks.xml"
|
||||
|
||||
/* Private menu paths that components don't know about */
|
||||
|
@ -96,11 +95,18 @@
|
|||
#define NAUTILUS_MENU_PATH_ABOUT_ITEM "/Help/About Nautilus"
|
||||
#define NAUTILUS_MENU_PATH_NAUTILUS_FEEDBACK "/Help/Nautilus Feedback"
|
||||
|
||||
|
||||
#define SWITCH_TO_BEGINNER_VERB "Switch to Beginner Level"
|
||||
#define SWITCH_TO_INTERMEDIATE_VERB "Switch to Intermediate Level"
|
||||
#define SWITCH_TO_ADVANCED_VERB "Switch to Advanced Level"
|
||||
|
||||
static GtkWindow *bookmarks_window = NULL;
|
||||
|
||||
#ifdef UIH
|
||||
static void activate_bookmark_in_menu_item (BonoboUIHandler *uih,
|
||||
gpointer user_data,
|
||||
const char *path);
|
||||
#endif
|
||||
static void append_bookmark_to_menu (NautilusWindow *window,
|
||||
NautilusBookmark *bookmark,
|
||||
const char *menu_item_path,
|
||||
|
@ -120,8 +126,8 @@ static void edit_bookmarks (Nau
|
|||
|
||||
|
||||
/* User level things */
|
||||
static guint convert_menu_path_to_user_level (const char *path);
|
||||
static const char * convert_user_level_to_menu_path (guint user_level);
|
||||
static guint convert_verb_to_user_level (const char *verb);
|
||||
static const char * convert_user_level_to_verb (guint user_level);
|
||||
static char * get_customize_user_level_settings_menu_string (void);
|
||||
static void update_user_level_menu_items (NautilusWindow *window);
|
||||
static char * get_customize_user_level_string (void);
|
||||
|
@ -190,38 +196,38 @@ bookmark_holder_free (BookmarkHolder *bookmark_holder)
|
|||
#define NAUTILUS_MENU_PATH_SEPARATOR_BEFORE_CANNED_BOOKMARKS "/Bookmarks/Before Canned Separator"
|
||||
|
||||
static void
|
||||
file_menu_new_window_callback (BonoboUIHandler *ui_handler,
|
||||
file_menu_new_window_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *current_window;
|
||||
NautilusWindow *new_window;
|
||||
|
||||
|
||||
current_window = NAUTILUS_WINDOW (user_data);
|
||||
new_window = nautilus_application_create_window (current_window->application);
|
||||
nautilus_window_goto_uri (new_window, current_window->location);
|
||||
}
|
||||
|
||||
static void
|
||||
file_menu_close_window_callback (BonoboUIHandler *ui_handler,
|
||||
file_menu_close_window_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_close (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
file_menu_close_all_windows_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
file_menu_close_all_windows_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_application_close_all_windows ();
|
||||
}
|
||||
|
||||
static void
|
||||
file_menu_toggle_find_mode_callback (BonoboUIHandler *ui_handler,
|
||||
file_menu_toggle_find_mode_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -232,26 +238,26 @@ file_menu_toggle_find_mode_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
file_menu_web_search_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
file_menu_web_search_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_web_search (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
edit_menu_undo_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_undo_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_undo_manager_undo
|
||||
(NAUTILUS_WINDOW (user_data)->application->undo_manager);
|
||||
}
|
||||
|
||||
static void
|
||||
edit_menu_cut_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_cut_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -262,9 +268,9 @@ edit_menu_cut_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
edit_menu_copy_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_copy_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -276,9 +282,9 @@ edit_menu_copy_callback (BonoboUIHandler *ui_handler,
|
|||
|
||||
|
||||
static void
|
||||
edit_menu_paste_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_paste_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -289,11 +295,10 @@ edit_menu_paste_callback (BonoboUIHandler *ui_handler,
|
|||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
edit_menu_clear_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_clear_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -306,33 +311,33 @@ edit_menu_clear_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
go_menu_back_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_back_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_back (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
go_menu_forward_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_forward_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_forward (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
go_menu_up_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_up_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_up (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
go_menu_home_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_home_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_home (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
@ -375,27 +380,26 @@ forget_history_if_confirmed (NautilusWindow *window)
|
|||
gnome_dialog_set_default (dialog, GNOME_CANCEL);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
go_menu_forget_history_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_forget_history_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
forget_history_if_confirmed (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_reload_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_reload_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_reload (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_sidebar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_sidebar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -408,9 +412,9 @@ view_menu_show_hide_sidebar_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_tool_bar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_tool_bar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -423,9 +427,9 @@ view_menu_show_hide_tool_bar_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_location_bar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_location_bar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -438,9 +442,9 @@ view_menu_show_hide_location_bar_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_status_bar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_status_bar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -457,6 +461,7 @@ nautilus_window_update_show_hide_menu_items (NautilusWindow *window)
|
|||
{
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_label
|
||||
(window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_SHOW_HIDE_STATUS_BAR,
|
||||
|
@ -485,44 +490,45 @@ nautilus_window_update_show_hide_menu_items (NautilusWindow *window)
|
|||
? _("Hide Location Bar")
|
||||
: _("Show Location Bar"));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_zoom_in_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_zoom_in_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_zoom_in (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_zoom_out_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_zoom_out_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_zoom_out (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_zoom_normal_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_zoom_normal_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_zoom_to_fit (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
bookmarks_menu_add_bookmark_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
bookmarks_menu_add_bookmark_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_add_bookmark_for_current_location (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
bookmarks_menu_edit_bookmarks_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
bookmarks_menu_edit_bookmarks_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
edit_bookmarks (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
@ -536,11 +542,10 @@ switch_and_show_intermediate_settings_callback (GtkWidget *button, gpointer user
|
|||
nautilus_global_preferences_show_dialog ();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
user_level_customize_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
user_level_customize_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GnomeDialog *dialog;
|
||||
NautilusWindow *window;
|
||||
|
@ -600,25 +605,25 @@ user_level_customize_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
customize_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
customize_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_property_browser_show ();
|
||||
}
|
||||
|
||||
static void
|
||||
change_appearance_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
change_appearance_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_theme_selector_show ();
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_about_nautilus_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
help_menu_about_nautilus_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
static GtkWidget *about = NULL;
|
||||
|
||||
|
@ -668,9 +673,9 @@ help_menu_about_nautilus_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
help_menu_nautilus_feedback_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_goto_uri (NAUTILUS_WINDOW (user_data), "http://www.eazel.com/feedback.html");
|
||||
}
|
||||
|
@ -731,43 +736,47 @@ switch_to_user_level (NautilusWindow *window, int new_user_level)
|
|||
|
||||
/* change the item pixbufs to reflect the new user level */
|
||||
pixbuf = get_user_level_image (old_user_level, FALSE);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_pixmap
|
||||
(window->ui_handler,
|
||||
convert_user_level_to_menu_path (old_user_level),
|
||||
convert_user_level_to_verb (old_user_level),
|
||||
BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA,
|
||||
pixbuf);
|
||||
#endif
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
|
||||
pixbuf = get_user_level_image (new_user_level, TRUE);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_pixmap
|
||||
(window->ui_handler,
|
||||
convert_user_level_to_menu_path (new_user_level),
|
||||
convert_user_level_to_verb (new_user_level),
|
||||
BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA,
|
||||
pixbuf);
|
||||
#endif
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
|
||||
/* set up the menu title image to reflect the new user level */
|
||||
pixbuf = get_user_level_image (new_user_level, FALSE);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_pixmap
|
||||
(window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_USER_LEVEL,
|
||||
BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA,
|
||||
pixbuf);
|
||||
#endif
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
user_level_menu_item_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
user_level_menu_item_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
window = NAUTILUS_WINDOW (user_data);
|
||||
g_assert (window->ui_handler == ui_handler);
|
||||
|
||||
switch_to_user_level (window, convert_menu_path_to_user_level (path));
|
||||
switch_to_user_level (window, convert_verb_to_user_level (verb));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -822,6 +831,8 @@ show_bogus_bookmark_window (BookmarkHolder *holder)
|
|||
g_free (prompt);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
activate_bookmark_in_menu_item (BonoboUIHandler *uih, gpointer user_data, const char *path)
|
||||
{
|
||||
|
@ -839,19 +850,25 @@ activate_bookmark_in_menu_item (BonoboUIHandler *uih, gpointer user_data, const
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
append_placeholder (NautilusWindow *window, const char *placeholder_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_placeholder (window->ui_handler,
|
||||
placeholder_path);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
append_separator (NautilusWindow *window, const char *separator_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_separator (window->ui_handler,
|
||||
separator_path,
|
||||
-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -862,17 +879,21 @@ append_bookmark_to_menu (NautilusWindow *window,
|
|||
{
|
||||
BookmarkHolder *bookmark_holder;
|
||||
GdkPixbuf *pixbuf;
|
||||
#ifdef UIH
|
||||
BonoboUIHandlerPixmapType pixmap_type;
|
||||
#endif
|
||||
char *raw_name, *display_name, *truncated_name;
|
||||
|
||||
pixbuf = nautilus_bookmark_get_pixbuf (bookmark, NAUTILUS_ICON_SIZE_FOR_MENUS);
|
||||
|
||||
/* Set up pixmap type based on result of function. If we fail, set pixmap type to none */
|
||||
#ifdef UIH
|
||||
if (pixbuf != NULL) {
|
||||
pixmap_type = BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA;
|
||||
} else {
|
||||
pixmap_type = BONOBO_UI_HANDLER_PIXMAP_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
bookmark_holder = bookmark_holder_new (bookmark, window, is_bookmarks_menu);
|
||||
|
||||
|
@ -886,6 +907,7 @@ append_bookmark_to_menu (NautilusWindow *window,
|
|||
display_name = nautilus_str_double_underscores (truncated_name);
|
||||
g_free (raw_name);
|
||||
g_free (truncated_name);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_item (window->ui_handler,
|
||||
menu_item_path,
|
||||
display_name,
|
||||
|
@ -897,13 +919,16 @@ append_bookmark_to_menu (NautilusWindow *window,
|
|||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
#endif
|
||||
g_free (display_name);
|
||||
|
||||
/* We must use "set_callback" since we have a destroy-notify function. */
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_callback
|
||||
(window->ui_handler, menu_item_path,
|
||||
activate_bookmark_in_menu_item,
|
||||
bookmark_holder, (GDestroyNotify) bookmark_holder_free);
|
||||
#endif
|
||||
|
||||
/* Let's get notified whenever a bookmark changes. */
|
||||
gtk_signal_connect_object (GTK_OBJECT (bookmark), "changed",
|
||||
|
@ -954,7 +979,11 @@ create_menu_item_from_node (NautilusWindow *window,
|
|||
char *sub_item_path;
|
||||
|
||||
index_as_string = g_strdup_printf ("item_%d", index);
|
||||
#ifdef UIH
|
||||
item_path = bonobo_ui_handler_build_path (menu_path, index_as_string, NULL);
|
||||
#else
|
||||
item_path = NULL;
|
||||
#endif
|
||||
g_free (index_as_string);
|
||||
|
||||
if (strcmp (node->name, "bookmark") == 0) {
|
||||
|
@ -965,6 +994,7 @@ create_menu_item_from_node (NautilusWindow *window,
|
|||
append_separator (window, item_path);
|
||||
} else if (strcmp (node->name, "folder") == 0) {
|
||||
xml_folder_name = xmlGetProp (node, "name");
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_subtree (window->ui_handler,
|
||||
item_path,
|
||||
xml_folder_name,
|
||||
|
@ -974,6 +1004,7 @@ create_menu_item_from_node (NautilusWindow *window,
|
|||
NULL,
|
||||
0,
|
||||
0);
|
||||
#endif
|
||||
for (node = nautilus_xml_get_children (node), sub_index = 0;
|
||||
node != NULL;
|
||||
node = node->next, ++sub_index) {
|
||||
|
@ -1038,6 +1069,7 @@ remove_bookmarks_after (NautilusWindow *window,
|
|||
const char *menu_path,
|
||||
const char *last_retained_item_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
GList *children, *p;
|
||||
gboolean found_items_to_remove;
|
||||
gpointer callback_data;
|
||||
|
@ -1065,6 +1097,7 @@ remove_bookmarks_after (NautilusWindow *window,
|
|||
|
||||
g_assert (found_items_to_remove);
|
||||
nautilus_g_list_free_deep (children);
|
||||
#endif
|
||||
}
|
||||
|
||||
static NautilusBookmarkList *bookmarks = NULL;
|
||||
|
@ -1183,6 +1216,7 @@ static void
|
|||
remove_underline_accelerator_from_menu_title (NautilusWindow *window,
|
||||
const char *menu_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
char *old_label;
|
||||
char *new_label;
|
||||
|
||||
|
@ -1192,6 +1226,7 @@ remove_underline_accelerator_from_menu_title (NautilusWindow *window,
|
|||
|
||||
g_free (old_label);
|
||||
g_free (new_label);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1275,6 +1310,7 @@ new_top_level_menu (NautilusWindow *window,
|
|||
/* Note that we don't bother with hints for menu titles.
|
||||
* We can revisit this anytime if someone thinks they're useful.
|
||||
*/
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_subtree (window->ui_handler,
|
||||
menu_path,
|
||||
title,
|
||||
|
@ -1284,6 +1320,8 @@ new_top_level_menu (NautilusWindow *window,
|
|||
NULL,
|
||||
0,
|
||||
0);
|
||||
#endif
|
||||
|
||||
g_free (title);
|
||||
}
|
||||
|
||||
|
@ -1323,14 +1361,18 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
const char *menu_path,
|
||||
guint user_level)
|
||||
{
|
||||
#ifdef UIH
|
||||
BonoboUIHandler *ui_handler;
|
||||
#endif
|
||||
GdkPixbuf *pixbuf;
|
||||
guint current_user_level;
|
||||
char *user_level_name;
|
||||
char *menu_label;
|
||||
char *menu_hint;
|
||||
|
||||
#ifdef UIH
|
||||
ui_handler = window->ui_handler;
|
||||
#endif
|
||||
user_level_name = nautilus_user_level_manager_get_user_level_name_for_display (user_level);
|
||||
current_user_level = nautilus_user_level_manager_get_user_level ();
|
||||
|
||||
|
@ -1343,6 +1385,7 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
menu_hint = g_strdup_printf (_("Use %s settings"), user_level_name);
|
||||
|
||||
pixbuf = get_user_level_image (user_level, current_user_level == user_level);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_item (ui_handler,
|
||||
menu_path,
|
||||
menu_label,
|
||||
|
@ -1354,6 +1397,7 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
0,
|
||||
user_level_menu_item_callback,
|
||||
window);
|
||||
#endif
|
||||
g_free (user_level_name);
|
||||
g_free (menu_label);
|
||||
g_free (menu_hint);
|
||||
|
@ -1369,15 +1413,62 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
void
|
||||
nautilus_window_initialize_menus (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GdkPixbuf *pixbuf;
|
||||
BonoboUIHandler *ui_handler;
|
||||
#endif
|
||||
|
||||
BonoboUIVerb verbs [] = {
|
||||
BONOBO_UI_VERB ("New Window", file_menu_new_window_callback),
|
||||
BONOBO_UI_VERB ("Close", file_menu_close_window_callback),
|
||||
BONOBO_UI_VERB ("Close All", file_menu_close_all_windows_callback),
|
||||
BONOBO_UI_VERB ("Toggle Find Mode", file_menu_toggle_find_mode_callback),
|
||||
BONOBO_UI_VERB ("Go to Web Search", file_menu_web_search_callback),
|
||||
BONOBO_UI_VERB ("Undo", edit_menu_undo_callback),
|
||||
BONOBO_UI_VERB ("Cut", edit_menu_cut_callback),
|
||||
BONOBO_UI_VERB ("Copy", edit_menu_copy_callback),
|
||||
BONOBO_UI_VERB ("Paste", edit_menu_paste_callback),
|
||||
BONOBO_UI_VERB ("Clear", edit_menu_clear_callback),
|
||||
BONOBO_UI_VERB ("Customize", customize_callback),
|
||||
BONOBO_UI_VERB ("Change Appearance", change_appearance_callback),
|
||||
BONOBO_UI_VERB ("Back", go_menu_back_callback),
|
||||
BONOBO_UI_VERB ("Forward", go_menu_forward_callback),
|
||||
BONOBO_UI_VERB ("Up", go_menu_up_callback),
|
||||
BONOBO_UI_VERB ("Home", go_menu_home_callback),
|
||||
BONOBO_UI_VERB ("Forget History", go_menu_forget_history_callback),
|
||||
BONOBO_UI_VERB ("Reload", view_menu_reload_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Sidebar", view_menu_show_hide_sidebar_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Tool Bar", view_menu_show_hide_tool_bar_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Location Bar", view_menu_show_hide_location_bar_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Status Bar", view_menu_show_hide_status_bar_callback),
|
||||
BONOBO_UI_VERB ("Zoom In", view_menu_zoom_in_callback),
|
||||
BONOBO_UI_VERB ("Zoom Out", view_menu_zoom_out_callback),
|
||||
BONOBO_UI_VERB ("Zoom Normal", view_menu_zoom_normal_callback),
|
||||
BONOBO_UI_VERB ("Add Bookmark", bookmarks_menu_add_bookmark_callback),
|
||||
BONOBO_UI_VERB ("Edit Bookmarks", bookmarks_menu_edit_bookmarks_callback),
|
||||
BONOBO_UI_VERB ("About Nautilus", help_menu_about_nautilus_callback),
|
||||
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
|
||||
#ifdef UIH
|
||||
/* The next set of verbs doesn't work. Need some different mechanism for radio items apparently */
|
||||
#endif
|
||||
BONOBO_UI_VERB (SWITCH_TO_BEGINNER_VERB, user_level_menu_item_callback),
|
||||
BONOBO_UI_VERB (SWITCH_TO_INTERMEDIATE_VERB, user_level_menu_item_callback),
|
||||
BONOBO_UI_VERB (SWITCH_TO_ADVANCED_VERB, user_level_menu_item_callback),
|
||||
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
|
||||
BONOBO_UI_VERB_END
|
||||
};
|
||||
|
||||
bonobo_ui_component_add_verb_list_with_data (window->details->shell_ui, verbs, window);
|
||||
|
||||
#ifdef UIH
|
||||
ui_handler = window->ui_handler;
|
||||
g_assert (ui_handler != NULL);
|
||||
|
||||
bonobo_ui_handler_create_menubar (ui_handler);
|
||||
#endif
|
||||
nautilus_window_create_top_level_menus (window);
|
||||
|
||||
#ifdef UIH
|
||||
/* File menu */
|
||||
|
||||
bonobo_ui_handler_menu_new_item (ui_handler,
|
||||
|
@ -1852,6 +1943,7 @@ nautilus_window_initialize_menus (NautilusWindow *window)
|
|||
(window->application->undo_manager,
|
||||
ui_handler, NAUTILUS_MENU_PATH_UNDO_ITEM,
|
||||
_("_Undo"), _("Undo the last text change"));
|
||||
#endif /* UIH */
|
||||
|
||||
nautilus_window_initialize_bookmarks_menu (window);
|
||||
nautilus_window_initialize_go_menu (window);
|
||||
|
@ -1902,10 +1994,27 @@ nautilus_window_update_find_menu_item (NautilusWindow *window)
|
|||
(nautilus_window_get_search_mode (window)
|
||||
? _("_Browse")
|
||||
: _("_Find"));
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_label (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_TOGGLE_FIND_MODE,
|
||||
label_string);
|
||||
g_free (label_string);
|
||||
#endif
|
||||
g_free (label_string);
|
||||
|
||||
#ifndef UIH
|
||||
/* avoid "unused function" warnings */
|
||||
return;
|
||||
|
||||
add_user_level_menu_item (0, 0, 0);
|
||||
append_placeholder (0, 0);
|
||||
bookmark_holder_free (0);
|
||||
edit_bookmarks (0);
|
||||
convert_user_level_to_verb (0);
|
||||
forget_history_if_confirmed (0);
|
||||
show_bogus_bookmark_window (0);
|
||||
switch_and_show_intermediate_settings_callback (0, 0);
|
||||
user_level_changed_callback (0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2044,6 +2153,7 @@ update_user_level_menu_items (NautilusWindow *window)
|
|||
g_assert (customize_string != NULL);
|
||||
|
||||
/* Update the user radio group to reflect reality */
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_radio_state (window->ui_handler,
|
||||
convert_user_level_to_menu_path (user_level),
|
||||
TRUE);
|
||||
|
@ -2052,22 +2162,23 @@ update_user_level_menu_items (NautilusWindow *window)
|
|||
bonobo_ui_handler_menu_set_label (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_USER_LEVEL_CUSTOMIZE,
|
||||
customize_string);
|
||||
#endif
|
||||
|
||||
g_free (customize_string);
|
||||
}
|
||||
|
||||
static guint
|
||||
convert_menu_path_to_user_level (const char *path)
|
||||
convert_verb_to_user_level (const char *verb)
|
||||
{
|
||||
g_assert (path != NULL);
|
||||
g_assert (verb != NULL);
|
||||
|
||||
if (strcmp (path, NAUTILUS_MENU_PATH_NOVICE_ITEM) == 0) {
|
||||
if (strcmp (verb, SWITCH_TO_BEGINNER_VERB) == 0) {
|
||||
return NAUTILUS_USER_LEVEL_NOVICE;
|
||||
}
|
||||
else if (strcmp (path, NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM) == 0) {
|
||||
else if (strcmp (verb, SWITCH_TO_INTERMEDIATE_VERB) == 0) {
|
||||
return NAUTILUS_USER_LEVEL_INTERMEDIATE;
|
||||
}
|
||||
else if (strcmp (path, NAUTILUS_MENU_PATH_EXPERT_ITEM) == 0) {
|
||||
else if (strcmp (verb, SWITCH_TO_ADVANCED_VERB) == 0) {
|
||||
return NAUTILUS_USER_LEVEL_HACKER;
|
||||
}
|
||||
|
||||
|
@ -2077,19 +2188,19 @@ convert_menu_path_to_user_level (const char *path)
|
|||
}
|
||||
|
||||
static const char *
|
||||
convert_user_level_to_menu_path (guint user_level)
|
||||
convert_user_level_to_verb (guint user_level)
|
||||
{
|
||||
switch (user_level) {
|
||||
case NAUTILUS_USER_LEVEL_NOVICE:
|
||||
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
|
||||
return SWITCH_TO_BEGINNER_VERB;
|
||||
break;
|
||||
|
||||
case NAUTILUS_USER_LEVEL_INTERMEDIATE:
|
||||
return NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM;
|
||||
return SWITCH_TO_INTERMEDIATE_VERB;
|
||||
break;
|
||||
|
||||
case NAUTILUS_USER_LEVEL_HACKER:
|
||||
return NAUTILUS_MENU_PATH_EXPERT_ITEM;
|
||||
return SWITCH_TO_ADVANCED_VERB;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2147,4 +2258,3 @@ update_preferences_dialog_title (void)
|
|||
|
||||
g_free (dialog_title);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,9 +39,21 @@
|
|||
#include "nautilus-throbber.h"
|
||||
#include "nautilus-window-manage-views.h"
|
||||
#include "nautilus-zoom-control.h"
|
||||
#include <bonobo/bonobo-ui-util.h>
|
||||
#include <ctype.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
#include <gtk/gtkoptionmenu.h>
|
||||
#ifndef UIH
|
||||
#include <gtk/gtkstatusbar.h>
|
||||
#endif
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-geometry.h>
|
||||
#include <libgnomeui/gnome-messagebox.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-uri.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libnautilus-extensions/nautilus-any-width-bin.h>
|
||||
|
@ -106,7 +118,7 @@ static void nautilus_window_show (GtkWidget *widget
|
|||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusWindow,
|
||||
nautilus_window,
|
||||
GNOME_TYPE_APP)
|
||||
BONOBO_TYPE_WIN)
|
||||
|
||||
static void
|
||||
nautilus_window_initialize_class (NautilusWindowClass *klass)
|
||||
|
@ -155,7 +167,9 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
static gboolean
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -167,10 +181,14 @@ nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
#ifdef UIH
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
#endif
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
|
@ -241,13 +259,15 @@ nautilus_window_zoom_to_fit (NautilusWindow *window)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
/* This is our replacement for gnome_app_set_statusbar.
|
||||
* It uses nautilus_any_width_bin to make text changes in the
|
||||
* status bar not affect the width of the window.
|
||||
*/
|
||||
static void
|
||||
install_status_bar (GnomeApp *app,
|
||||
GtkWidget *status_bar)
|
||||
GtkWidget *status_bar)
|
||||
{
|
||||
GtkWidget *bin;
|
||||
|
||||
|
@ -266,6 +286,8 @@ install_status_bar (GnomeApp *app,
|
|||
gtk_box_pack_start (GTK_BOX (app->vbox), bin, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Code should never force the window taller than this size.
|
||||
* (The user can still stretch the window taller if desired).
|
||||
*/
|
||||
|
@ -326,13 +348,10 @@ set_initial_window_geometry (NautilusWindow *window)
|
|||
static void
|
||||
nautilus_window_constructed (NautilusWindow *window)
|
||||
{
|
||||
GnomeApp *app;
|
||||
GtkWidget *location_bar_box, *status_bar;
|
||||
GtkWidget *view_as_menu_vbox;
|
||||
GnomeDockItemBehavior behavior;
|
||||
int sidebar_width;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
BonoboControl *location_bar_wrapper;
|
||||
|
||||
/* set up location bar */
|
||||
location_bar_box = gtk_hbox_new (FALSE, GNOME_PAD);
|
||||
|
@ -349,15 +368,19 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
#ifdef UIH
|
||||
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE
|
||||
| GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL;
|
||||
if (!gnome_preferences_get_toolbar_detachable ()) {
|
||||
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UIH
|
||||
gnome_app_add_docked (app, location_bar_box,
|
||||
URI_ENTRY_DOCK_ITEM, behavior,
|
||||
GNOME_DOCK_TOP, 2, 0, 0);
|
||||
#endif
|
||||
|
||||
/* Option menu for content view types; it's empty here, filled in when a uri is set.
|
||||
* Pack it into vbox so it doesn't grow vertically when location bar does.
|
||||
|
@ -384,7 +407,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* set up status bar */
|
||||
status_bar = gtk_statusbar_new ();
|
||||
#ifdef UIH
|
||||
install_status_bar (app, status_bar);
|
||||
#endif
|
||||
|
||||
/* insert a little padding so text isn't jammed against frame */
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_STATUSBAR (status_bar)->label), GNOME_PAD, 0);
|
||||
|
@ -409,8 +434,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
sidebar_width = nautilus_preferences_get_enum (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH, 148);
|
||||
e_paned_set_position (E_PANED (window->content_hbox), sidebar_width);
|
||||
}
|
||||
|
||||
gnome_app_set_contents (app, window->content_hbox);
|
||||
gtk_widget_show (window->content_hbox);
|
||||
bonobo_win_set_contents (BONOBO_WIN (window), window->content_hbox);
|
||||
|
||||
/* set up the index panel */
|
||||
|
||||
|
@ -428,9 +453,30 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/* CORBA and Bonobo setup */
|
||||
window->ui_handler = bonobo_ui_handler_new ();
|
||||
bonobo_ui_handler_set_app (window->ui_handler, app);
|
||||
window->details->ui_container = bonobo_ui_container_new ();
|
||||
bonobo_ui_container_set_win (window->details->ui_container,
|
||||
BONOBO_WIN (window));
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_set_statusbar (window->ui_handler, status_bar);
|
||||
#endif
|
||||
|
||||
/* Load the user interface from the XML file. */
|
||||
window->details->shell_ui = bonobo_ui_component_new ("Nautilus Shell");
|
||||
bonobo_ui_component_set_container
|
||||
(window->details->shell_ui,
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (window->details->ui_container)));
|
||||
bonobo_ui_util_set_ui (window->details->shell_ui,
|
||||
NAUTILUS_DATADIR,
|
||||
"nautilus-shell-ui.xml",
|
||||
"nautilus");
|
||||
|
||||
/* Wrap the location bar in a control and set it up. */
|
||||
location_bar_wrapper = bonobo_control_new (location_bar_box);
|
||||
bonobo_ui_component_object_set (window->details->shell_ui,
|
||||
"/Location Bar/Wrapper",
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (location_bar_wrapper)),
|
||||
NULL);
|
||||
bonobo_object_unref (BONOBO_OBJECT (location_bar_wrapper));
|
||||
|
||||
/* Create menus and tool bars */
|
||||
nautilus_window_initialize_menus (window);
|
||||
|
@ -455,24 +501,25 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
char *old_app_name;
|
||||
char *old_name;
|
||||
NautilusWindow *window = (NautilusWindow *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
if(!GTK_VALUE_STRING(*arg))
|
||||
if (GTK_VALUE_STRING (*arg) == NULL) {
|
||||
return;
|
||||
|
||||
old_app_name = app->name;
|
||||
g_free(app->name);
|
||||
app->name = g_strdup(GTK_VALUE_STRING(*arg));
|
||||
g_assert(app->name);
|
||||
g_free(app->prefix);
|
||||
app->prefix = g_strconcat("/", app->name, "/", NULL);
|
||||
if(!old_app_name) {
|
||||
nautilus_window_constructed(NAUTILUS_WINDOW(object));
|
||||
}
|
||||
old_name = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
bonobo_win_set_name (BONOBO_WIN (object), GTK_VALUE_STRING (*arg));
|
||||
/* This hack of using the time when the name first
|
||||
* goes non-NULL to be window-constructed time is
|
||||
* completely lame. But it works, so for now we leave
|
||||
* it alone.
|
||||
*/
|
||||
if (old_name == NULL) {
|
||||
nautilus_window_constructed (NAUTILUS_WINDOW (object));
|
||||
}
|
||||
g_free (old_name);
|
||||
break;
|
||||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
|
@ -485,11 +532,9 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
GTK_VALUE_STRING (*arg) = app->name;
|
||||
GTK_VALUE_STRING (*arg) = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
break;
|
||||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
|
@ -558,11 +603,13 @@ nautilus_window_destroy (GtkObject *object)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
|
||||
if (window->ui_handler != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->ui_handler));
|
||||
if (window->details->ui_container != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->details->ui_container));
|
||||
}
|
||||
|
||||
g_free (window->details);
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1112,32 +1159,40 @@ void
|
|||
nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->back_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_BACK_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->forward_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_FORWARD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->up_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_UP_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->reload_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_RELOAD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1355,6 +1410,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
|
||||
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
|
||||
|
@ -1364,6 +1420,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
|
||||
TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static Nautilus_HistoryList *
|
||||
|
@ -1490,9 +1547,11 @@ nautilus_window_set_content_view_widget (NautilusWindow *window,
|
|||
}
|
||||
|
||||
/* Here's an explicit check for a problem that happens all too often. */
|
||||
#ifdef UIH
|
||||
if (bonobo_ui_handler_menu_path_exists (window->ui_handler, "/File/Open")) {
|
||||
g_warning ("There's a lingering Open menu item. This usually means a new Bonobo bug.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (new_view != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (new_view));
|
||||
|
@ -1565,6 +1624,7 @@ sidebar_panels_changed_callback (gpointer user_data)
|
|||
static void
|
||||
show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1575,12 +1635,14 @@ show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_show (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static void
|
||||
hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1591,12 +1653,14 @@ hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_hide (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1604,6 +1668,9 @@ dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
|||
|
||||
dock_item = gnome_app_get_dock_item_by_name (app, dock_item_name);
|
||||
return dock_item != NULL && GTK_WIDGET_VISIBLE (dock_item);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1627,19 +1694,27 @@ nautilus_window_location_bar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
hide_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
show_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_tool_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
return dock_item_showing (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1676,6 +1751,7 @@ nautilus_window_sidebar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1683,12 +1759,14 @@ nautilus_window_hide_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_hide (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1696,18 +1774,23 @@ nautilus_window_show_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_status_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#ifndef NAUTILUS_WINDOW_H
|
||||
#define NAUTILUS_WINDOW_H
|
||||
|
||||
#include <libgnomeui/gnome-app.h>
|
||||
#include <bonobo/bonobo-win.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-bookmark.h>
|
||||
#include <libnautilus-extensions/nautilus-view-identifier.h>
|
||||
|
@ -36,7 +36,6 @@
|
|||
#include "nautilus-view-frame.h"
|
||||
#include "nautilus-sidebar.h"
|
||||
#include "nautilus-application.h"
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
|
||||
#define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type())
|
||||
#define NAUTILUS_WINDOW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
|
||||
|
@ -50,7 +49,7 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
BonoboWinClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
@ -65,7 +64,7 @@ typedef enum {
|
|||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
BonoboWin parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
|
@ -78,7 +77,6 @@ struct NautilusWindow {
|
|||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
|
|
|
@ -39,9 +39,21 @@
|
|||
#include "nautilus-throbber.h"
|
||||
#include "nautilus-window-manage-views.h"
|
||||
#include "nautilus-zoom-control.h"
|
||||
#include <bonobo/bonobo-ui-util.h>
|
||||
#include <ctype.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
#include <gtk/gtkoptionmenu.h>
|
||||
#ifndef UIH
|
||||
#include <gtk/gtkstatusbar.h>
|
||||
#endif
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-geometry.h>
|
||||
#include <libgnomeui/gnome-messagebox.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-uri.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libnautilus-extensions/nautilus-any-width-bin.h>
|
||||
|
@ -106,7 +118,7 @@ static void nautilus_window_show (GtkWidget *widget
|
|||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusWindow,
|
||||
nautilus_window,
|
||||
GNOME_TYPE_APP)
|
||||
BONOBO_TYPE_WIN)
|
||||
|
||||
static void
|
||||
nautilus_window_initialize_class (NautilusWindowClass *klass)
|
||||
|
@ -155,7 +167,9 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
static gboolean
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -167,10 +181,14 @@ nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
#ifdef UIH
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
#endif
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
|
@ -241,13 +259,15 @@ nautilus_window_zoom_to_fit (NautilusWindow *window)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
/* This is our replacement for gnome_app_set_statusbar.
|
||||
* It uses nautilus_any_width_bin to make text changes in the
|
||||
* status bar not affect the width of the window.
|
||||
*/
|
||||
static void
|
||||
install_status_bar (GnomeApp *app,
|
||||
GtkWidget *status_bar)
|
||||
GtkWidget *status_bar)
|
||||
{
|
||||
GtkWidget *bin;
|
||||
|
||||
|
@ -266,6 +286,8 @@ install_status_bar (GnomeApp *app,
|
|||
gtk_box_pack_start (GTK_BOX (app->vbox), bin, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Code should never force the window taller than this size.
|
||||
* (The user can still stretch the window taller if desired).
|
||||
*/
|
||||
|
@ -326,13 +348,10 @@ set_initial_window_geometry (NautilusWindow *window)
|
|||
static void
|
||||
nautilus_window_constructed (NautilusWindow *window)
|
||||
{
|
||||
GnomeApp *app;
|
||||
GtkWidget *location_bar_box, *status_bar;
|
||||
GtkWidget *view_as_menu_vbox;
|
||||
GnomeDockItemBehavior behavior;
|
||||
int sidebar_width;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
BonoboControl *location_bar_wrapper;
|
||||
|
||||
/* set up location bar */
|
||||
location_bar_box = gtk_hbox_new (FALSE, GNOME_PAD);
|
||||
|
@ -349,15 +368,19 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
#ifdef UIH
|
||||
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE
|
||||
| GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL;
|
||||
if (!gnome_preferences_get_toolbar_detachable ()) {
|
||||
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UIH
|
||||
gnome_app_add_docked (app, location_bar_box,
|
||||
URI_ENTRY_DOCK_ITEM, behavior,
|
||||
GNOME_DOCK_TOP, 2, 0, 0);
|
||||
#endif
|
||||
|
||||
/* Option menu for content view types; it's empty here, filled in when a uri is set.
|
||||
* Pack it into vbox so it doesn't grow vertically when location bar does.
|
||||
|
@ -384,7 +407,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* set up status bar */
|
||||
status_bar = gtk_statusbar_new ();
|
||||
#ifdef UIH
|
||||
install_status_bar (app, status_bar);
|
||||
#endif
|
||||
|
||||
/* insert a little padding so text isn't jammed against frame */
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_STATUSBAR (status_bar)->label), GNOME_PAD, 0);
|
||||
|
@ -409,8 +434,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
sidebar_width = nautilus_preferences_get_enum (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH, 148);
|
||||
e_paned_set_position (E_PANED (window->content_hbox), sidebar_width);
|
||||
}
|
||||
|
||||
gnome_app_set_contents (app, window->content_hbox);
|
||||
gtk_widget_show (window->content_hbox);
|
||||
bonobo_win_set_contents (BONOBO_WIN (window), window->content_hbox);
|
||||
|
||||
/* set up the index panel */
|
||||
|
||||
|
@ -428,9 +453,30 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/* CORBA and Bonobo setup */
|
||||
window->ui_handler = bonobo_ui_handler_new ();
|
||||
bonobo_ui_handler_set_app (window->ui_handler, app);
|
||||
window->details->ui_container = bonobo_ui_container_new ();
|
||||
bonobo_ui_container_set_win (window->details->ui_container,
|
||||
BONOBO_WIN (window));
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_set_statusbar (window->ui_handler, status_bar);
|
||||
#endif
|
||||
|
||||
/* Load the user interface from the XML file. */
|
||||
window->details->shell_ui = bonobo_ui_component_new ("Nautilus Shell");
|
||||
bonobo_ui_component_set_container
|
||||
(window->details->shell_ui,
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (window->details->ui_container)));
|
||||
bonobo_ui_util_set_ui (window->details->shell_ui,
|
||||
NAUTILUS_DATADIR,
|
||||
"nautilus-shell-ui.xml",
|
||||
"nautilus");
|
||||
|
||||
/* Wrap the location bar in a control and set it up. */
|
||||
location_bar_wrapper = bonobo_control_new (location_bar_box);
|
||||
bonobo_ui_component_object_set (window->details->shell_ui,
|
||||
"/Location Bar/Wrapper",
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (location_bar_wrapper)),
|
||||
NULL);
|
||||
bonobo_object_unref (BONOBO_OBJECT (location_bar_wrapper));
|
||||
|
||||
/* Create menus and tool bars */
|
||||
nautilus_window_initialize_menus (window);
|
||||
|
@ -455,24 +501,25 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
char *old_app_name;
|
||||
char *old_name;
|
||||
NautilusWindow *window = (NautilusWindow *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
if(!GTK_VALUE_STRING(*arg))
|
||||
if (GTK_VALUE_STRING (*arg) == NULL) {
|
||||
return;
|
||||
|
||||
old_app_name = app->name;
|
||||
g_free(app->name);
|
||||
app->name = g_strdup(GTK_VALUE_STRING(*arg));
|
||||
g_assert(app->name);
|
||||
g_free(app->prefix);
|
||||
app->prefix = g_strconcat("/", app->name, "/", NULL);
|
||||
if(!old_app_name) {
|
||||
nautilus_window_constructed(NAUTILUS_WINDOW(object));
|
||||
}
|
||||
old_name = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
bonobo_win_set_name (BONOBO_WIN (object), GTK_VALUE_STRING (*arg));
|
||||
/* This hack of using the time when the name first
|
||||
* goes non-NULL to be window-constructed time is
|
||||
* completely lame. But it works, so for now we leave
|
||||
* it alone.
|
||||
*/
|
||||
if (old_name == NULL) {
|
||||
nautilus_window_constructed (NAUTILUS_WINDOW (object));
|
||||
}
|
||||
g_free (old_name);
|
||||
break;
|
||||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
|
@ -485,11 +532,9 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
GTK_VALUE_STRING (*arg) = app->name;
|
||||
GTK_VALUE_STRING (*arg) = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
break;
|
||||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
|
@ -558,11 +603,13 @@ nautilus_window_destroy (GtkObject *object)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
|
||||
if (window->ui_handler != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->ui_handler));
|
||||
if (window->details->ui_container != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->details->ui_container));
|
||||
}
|
||||
|
||||
g_free (window->details);
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1112,32 +1159,40 @@ void
|
|||
nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->back_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_BACK_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->forward_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_FORWARD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->up_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_UP_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->reload_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_RELOAD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1355,6 +1410,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
|
||||
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
|
||||
|
@ -1364,6 +1420,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
|
||||
TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static Nautilus_HistoryList *
|
||||
|
@ -1490,9 +1547,11 @@ nautilus_window_set_content_view_widget (NautilusWindow *window,
|
|||
}
|
||||
|
||||
/* Here's an explicit check for a problem that happens all too often. */
|
||||
#ifdef UIH
|
||||
if (bonobo_ui_handler_menu_path_exists (window->ui_handler, "/File/Open")) {
|
||||
g_warning ("There's a lingering Open menu item. This usually means a new Bonobo bug.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (new_view != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (new_view));
|
||||
|
@ -1565,6 +1624,7 @@ sidebar_panels_changed_callback (gpointer user_data)
|
|||
static void
|
||||
show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1575,12 +1635,14 @@ show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_show (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static void
|
||||
hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1591,12 +1653,14 @@ hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_hide (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1604,6 +1668,9 @@ dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
|||
|
||||
dock_item = gnome_app_get_dock_item_by_name (app, dock_item_name);
|
||||
return dock_item != NULL && GTK_WIDGET_VISIBLE (dock_item);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1627,19 +1694,27 @@ nautilus_window_location_bar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
hide_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
show_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_tool_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
return dock_item_showing (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1676,6 +1751,7 @@ nautilus_window_sidebar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1683,12 +1759,14 @@ nautilus_window_hide_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_hide (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1696,18 +1774,23 @@ nautilus_window_show_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_status_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#ifndef NAUTILUS_WINDOW_H
|
||||
#define NAUTILUS_WINDOW_H
|
||||
|
||||
#include <libgnomeui/gnome-app.h>
|
||||
#include <bonobo/bonobo-win.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-bookmark.h>
|
||||
#include <libnautilus-extensions/nautilus-view-identifier.h>
|
||||
|
@ -36,7 +36,6 @@
|
|||
#include "nautilus-view-frame.h"
|
||||
#include "nautilus-sidebar.h"
|
||||
#include "nautilus-application.h"
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
|
||||
#define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type())
|
||||
#define NAUTILUS_WINDOW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
|
||||
|
@ -50,7 +49,7 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
BonoboWinClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
@ -65,7 +64,7 @@ typedef enum {
|
|||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
BonoboWin parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
|
@ -78,7 +77,6 @@ struct NautilusWindow {
|
|||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
|
|
281
src/nautilus-shell-ui.xml
Normal file
281
src/nautilus-shell-ui.xml
Normal file
|
@ -0,0 +1,281 @@
|
|||
<Root>
|
||||
|
||||
<!-- A description of each placeholder's purpose is in libnautilus/nautilus-bonobo-ui.h -->
|
||||
|
||||
<menu>
|
||||
<submenu name="File" _label="_File">
|
||||
|
||||
<placeholder name="New Items Placeholder" delimit="bottom">
|
||||
<menuitem name="New Window"
|
||||
_label="_New Window"
|
||||
_descr="Open another Nautilus window for the displayed location"
|
||||
pixtype="stock" pixname="Menu_New"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
<placeholder name="Open Placeholder"/>
|
||||
|
||||
<menuitem name="Close"
|
||||
_label="_Close Window"
|
||||
_descr="Close this window"
|
||||
pixtype="stock" pixname="Menu_Close"
|
||||
accel="*Control*w"
|
||||
verb=""/>
|
||||
<menuitem name="Close All Windows"
|
||||
_label="Close _All Windows"
|
||||
_descr="Close all Nautilus windows"
|
||||
accel="*Control**Shift*w"
|
||||
verb=""/>
|
||||
|
||||
<placeholder name="General Status Placeholder"/>
|
||||
<placeholder name="File Items Placeholder"/>
|
||||
|
||||
<menuitem/>
|
||||
|
||||
<menuitem name="Toggle Find Mode"
|
||||
_label="_Find"
|
||||
_descr="Search this computer for files"
|
||||
accel="*Control*f"
|
||||
verb=""/>
|
||||
<menuitem name="Go to Web Search"
|
||||
_label="_Web Search"
|
||||
_descr="Search the World Wide Web"
|
||||
accel="*Control**Shift*f"
|
||||
verb=""/>
|
||||
|
||||
<placeholder name="Global File Items Placeholder" delimit="top"/>
|
||||
</submenu>
|
||||
|
||||
<submenu name="Edit" _label="_Edit">
|
||||
<menuitem name="Undo"
|
||||
_label="_Undo"
|
||||
_descr="Undo the last text change"
|
||||
pixtype="stock" pixname="Menu_Undo"
|
||||
accel="*Control*z"
|
||||
verb=""/>
|
||||
|
||||
<menuitem/>
|
||||
|
||||
<menuitem name="Cut"
|
||||
_label="Cut _Text"
|
||||
_descr="Cut the selected text to the clipboard"
|
||||
pixtype="stock" pixname="Menu_Cut"
|
||||
accel="*Control*x"
|
||||
verb=""/>
|
||||
<menuitem name="Copy"
|
||||
_label="_Copy Text"
|
||||
_descr="Copy the selected text to the clipboard"
|
||||
pixtype="stock" pixname="Menu_Copy"
|
||||
accel="*Control*c"
|
||||
verb=""/>
|
||||
<menuitem name="Paste"
|
||||
_label="_Paste Text"
|
||||
_descr="Paste the text stored on the clipboard"
|
||||
pixtype="stock" pixname="Menu_Paste"
|
||||
accel="*Control*v"
|
||||
verb=""/>
|
||||
<menuitem name="Clear"
|
||||
_label="C_lear Text"
|
||||
_descr="Removes the selected text without putting it on the clipboard"
|
||||
verb=""/>
|
||||
|
||||
<menuitem/>
|
||||
|
||||
<menuitem name="Select All"
|
||||
_label="_Select All"
|
||||
accel="*Control*a"
|
||||
verb=""/>
|
||||
|
||||
<menuitem/>
|
||||
|
||||
<menuitem name="Customize"
|
||||
_label="Custo_mization..."
|
||||
_descr="Display the Property Browser, containing patterns, colors, and emblems"
|
||||
verb=""/>
|
||||
<menuitem name="Change Appearance"
|
||||
_label="C_hange Appearance..."
|
||||
_descr="Display the set of available appearance themes"
|
||||
verb=""/>
|
||||
|
||||
<placeholder name="Global Edit Items Placeholder" delimit="bottom"/>
|
||||
<placeholder name="Edit Items Placeholder" delimit="top"/>
|
||||
|
||||
</submenu>
|
||||
|
||||
<submenu name="View" _label="_View">
|
||||
<menuitem name="Reload"
|
||||
_label="_Refresh"
|
||||
_descr="Display the latest contents of the current location"
|
||||
accel="*Control*r"
|
||||
verb=""/>
|
||||
|
||||
<placeholder name="Show Hide Placeholder" delimit="both">
|
||||
<menuitem name="Show Hide Sidebar"
|
||||
_label="Hide Sidebar"
|
||||
_descr="Change the visibility of this window's sidebar"
|
||||
verb=""/>
|
||||
<menuitem name="Show Hide Tool Bar"
|
||||
_label="Hide Tool Bar"
|
||||
_descr="Change the visibility of this window's tool bar"
|
||||
verb=""/>
|
||||
<menuitem name="Show Hide Location Bar"
|
||||
_label="Hide Location Bar"
|
||||
_descr="Change the visibility of this window's location bar"
|
||||
verb=""/>
|
||||
<menuitem name="Show Hide Status Bar"
|
||||
_label="Hide Status Bar"
|
||||
_descr="Change the visibility of this window's status bar"
|
||||
verb=""/>
|
||||
</placeholder>
|
||||
<placeholder name="View Items Placeholder" delimit="bottom"/>
|
||||
|
||||
<menuitem name="Zoom In"
|
||||
_label="Zoom _In"
|
||||
_descr="Show the contents in more detail"
|
||||
accel="*Control*="
|
||||
verb=""/>
|
||||
<menuitem name="Zoom Out"
|
||||
_label="Zoom _Out"
|
||||
_descr="Show the contents in less detail"
|
||||
accel="*Control*-"
|
||||
verb=""/>
|
||||
<menuitem name="Zoom Normal"
|
||||
_label="_Normal Size"
|
||||
_descr="Show the contents at the normal size"
|
||||
verb=""/>
|
||||
</submenu>
|
||||
|
||||
<submenu name="Go" _label="_Go">
|
||||
<menuitem name="Back"
|
||||
_label="_Back"
|
||||
_descr="Go to the previous visited location"
|
||||
accel="*Control*["
|
||||
verb=""/>
|
||||
<menuitem name="Forward"
|
||||
_label="_Forward"
|
||||
_descr="Go to the next visited location"
|
||||
accel="*Control*]"
|
||||
verb=""/>
|
||||
<menuitem name="Up"
|
||||
_label="_Up a Level"
|
||||
_descr="Go to the location that contains this one"
|
||||
accel="*Control*u"
|
||||
verb=""/>
|
||||
<menuitem name="Home"
|
||||
_label="_Home"
|
||||
_descr="Go to the home location"
|
||||
accel="*Control*h"
|
||||
verb=""/>
|
||||
|
||||
<menuitem/>
|
||||
|
||||
<menuitem name="Forget History"
|
||||
_label="For_get History"
|
||||
_descr="Clear contents of Go menu and Back/Forward lists"
|
||||
verb=""/>
|
||||
|
||||
<placeholder name="History Placeholder" delimit="top"/>
|
||||
</submenu>
|
||||
|
||||
<submenu name="Bookmarks" _label="_Bookmarks">
|
||||
<menuitem name="Add Bookmark"
|
||||
_label="_Add Bookmark"
|
||||
_descr="Add a bookmark for the current location to this menu"
|
||||
accel="*Control*B"
|
||||
verb=""/>
|
||||
<menuitem name="Edit Bookmarks"
|
||||
_label="_Edit Bookmarks..."
|
||||
_descr="Display a window that allows editing the bookmarks in this menu"
|
||||
verb=""/>
|
||||
|
||||
<placeholder name="Bookmarks Placeholder" delimit="top"/>
|
||||
</submenu>
|
||||
|
||||
<submenu name="Help" _label="_Help">
|
||||
<menuitem name="About Nautilus"
|
||||
_label="_About Nautilus..."
|
||||
_descr="Display credits for the creators of Nautilus"
|
||||
verb=""/>
|
||||
<menuitem name="Nautilus Feedback"
|
||||
_label="_Nautilus Feedback..."
|
||||
_descr="Show a page from which you can send feedback about Nautilus to its creators"
|
||||
verb=""/>
|
||||
</submenu>
|
||||
|
||||
<submenu name="Preferences" _label="Ski">
|
||||
<placeholder name="User Levels Placeholder" delimit="bottom">
|
||||
<menuitem name="Switch to Beginner Level"
|
||||
_label="Beginner"
|
||||
_descr="Use Beginner settings"
|
||||
type="radio" group="user levels group"/>
|
||||
<menuitem name="Switch to Intermediate Level"
|
||||
_label="Intermediate"
|
||||
_descr="Use Intermediate settings"
|
||||
type="radio" group="user levels group"/>
|
||||
<menuitem name="Switch to Advanced Level"
|
||||
_label="Advanced"
|
||||
_descr="Use Advanced settings"
|
||||
type="radio" group="user levels group"/>
|
||||
</placeholder>
|
||||
<menuitem name="User Level Customization"
|
||||
_label="Edit Settings..."
|
||||
_descr="Edit settings for the current user level"
|
||||
verb=""/>
|
||||
</submenu>
|
||||
</menu>
|
||||
|
||||
<dockitem name="Tool Bar" look="both">
|
||||
|
||||
<toolitem name="Back"
|
||||
_label="Back"
|
||||
_descr="Go to the previous visited location"
|
||||
verb=""/>
|
||||
<toolitem name="Forward"
|
||||
_label="Forward"
|
||||
_descr="Go to the next visited location"
|
||||
verb=""/>
|
||||
<toolitem name="Up"
|
||||
_label="Up"
|
||||
_descr="Go to the location that contains this one"
|
||||
verb=""/>
|
||||
<toolitem name="Reload"
|
||||
_label="Refresh"
|
||||
_descr="Display the latest contents of the current location"
|
||||
verb=""/>
|
||||
|
||||
<toolitem/>
|
||||
|
||||
<toolitem name="Home"
|
||||
_label="Home"
|
||||
_descr="Go to the home location"
|
||||
verb=""/>
|
||||
<toolitem name="Toggle Find Mode"
|
||||
_label="Find"
|
||||
_descr="Search this computer for files"
|
||||
verb=""/>
|
||||
<toolitem name="Go to Web Search"
|
||||
_label="Web Search"
|
||||
_descr="Search the World Wide Web"
|
||||
verb=""/>
|
||||
|
||||
<toolitem/>
|
||||
|
||||
<toolitem name="Stop"
|
||||
_label="Stop"
|
||||
_descr="Stop loading this location"
|
||||
verb=""/>
|
||||
<toolitem name="Services"
|
||||
_label="Services"
|
||||
_descr="Go to the Eazel services location"
|
||||
_verb=""/>
|
||||
</dockitem>
|
||||
|
||||
<dockitem name="Location Bar">
|
||||
<control name="Wrapper"/>
|
||||
</dockitem>
|
||||
|
||||
<status>
|
||||
<!-- the name "main" is required by Bonobo -->
|
||||
<item name="main"/>
|
||||
</status>
|
||||
|
||||
</Root>
|
|
@ -32,8 +32,10 @@
|
|||
#include "nautilus-main.h"
|
||||
#include "nautilus-shell-interface.h"
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-stock.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
#include "nautilus-sidebar-tabs.h"
|
||||
#include "nautilus-sidebar-title.h"
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gtk/gtkcheckmenuitem.h>
|
||||
#include <gtk/gtkdnd.h>
|
||||
#include <gtk/gtkhbox.h>
|
||||
#include <gtk/gtknotebook.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
|
|
|
@ -39,9 +39,21 @@
|
|||
#include "nautilus-throbber.h"
|
||||
#include "nautilus-window-manage-views.h"
|
||||
#include "nautilus-zoom-control.h"
|
||||
#include <bonobo/bonobo-ui-util.h>
|
||||
#include <ctype.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
#include <gtk/gtkoptionmenu.h>
|
||||
#ifndef UIH
|
||||
#include <gtk/gtkstatusbar.h>
|
||||
#endif
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-geometry.h>
|
||||
#include <libgnomeui/gnome-messagebox.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-uri.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libnautilus-extensions/nautilus-any-width-bin.h>
|
||||
|
@ -106,7 +118,7 @@ static void nautilus_window_show (GtkWidget *widget
|
|||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusWindow,
|
||||
nautilus_window,
|
||||
GNOME_TYPE_APP)
|
||||
BONOBO_TYPE_WIN)
|
||||
|
||||
static void
|
||||
nautilus_window_initialize_class (NautilusWindowClass *klass)
|
||||
|
@ -155,7 +167,9 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
static gboolean
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -167,10 +181,14 @@ nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
#ifdef UIH
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
#endif
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
|
@ -241,13 +259,15 @@ nautilus_window_zoom_to_fit (NautilusWindow *window)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
/* This is our replacement for gnome_app_set_statusbar.
|
||||
* It uses nautilus_any_width_bin to make text changes in the
|
||||
* status bar not affect the width of the window.
|
||||
*/
|
||||
static void
|
||||
install_status_bar (GnomeApp *app,
|
||||
GtkWidget *status_bar)
|
||||
GtkWidget *status_bar)
|
||||
{
|
||||
GtkWidget *bin;
|
||||
|
||||
|
@ -266,6 +286,8 @@ install_status_bar (GnomeApp *app,
|
|||
gtk_box_pack_start (GTK_BOX (app->vbox), bin, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Code should never force the window taller than this size.
|
||||
* (The user can still stretch the window taller if desired).
|
||||
*/
|
||||
|
@ -326,13 +348,10 @@ set_initial_window_geometry (NautilusWindow *window)
|
|||
static void
|
||||
nautilus_window_constructed (NautilusWindow *window)
|
||||
{
|
||||
GnomeApp *app;
|
||||
GtkWidget *location_bar_box, *status_bar;
|
||||
GtkWidget *view_as_menu_vbox;
|
||||
GnomeDockItemBehavior behavior;
|
||||
int sidebar_width;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
BonoboControl *location_bar_wrapper;
|
||||
|
||||
/* set up location bar */
|
||||
location_bar_box = gtk_hbox_new (FALSE, GNOME_PAD);
|
||||
|
@ -349,15 +368,19 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
#ifdef UIH
|
||||
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE
|
||||
| GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL;
|
||||
if (!gnome_preferences_get_toolbar_detachable ()) {
|
||||
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UIH
|
||||
gnome_app_add_docked (app, location_bar_box,
|
||||
URI_ENTRY_DOCK_ITEM, behavior,
|
||||
GNOME_DOCK_TOP, 2, 0, 0);
|
||||
#endif
|
||||
|
||||
/* Option menu for content view types; it's empty here, filled in when a uri is set.
|
||||
* Pack it into vbox so it doesn't grow vertically when location bar does.
|
||||
|
@ -384,7 +407,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* set up status bar */
|
||||
status_bar = gtk_statusbar_new ();
|
||||
#ifdef UIH
|
||||
install_status_bar (app, status_bar);
|
||||
#endif
|
||||
|
||||
/* insert a little padding so text isn't jammed against frame */
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_STATUSBAR (status_bar)->label), GNOME_PAD, 0);
|
||||
|
@ -409,8 +434,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
sidebar_width = nautilus_preferences_get_enum (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH, 148);
|
||||
e_paned_set_position (E_PANED (window->content_hbox), sidebar_width);
|
||||
}
|
||||
|
||||
gnome_app_set_contents (app, window->content_hbox);
|
||||
gtk_widget_show (window->content_hbox);
|
||||
bonobo_win_set_contents (BONOBO_WIN (window), window->content_hbox);
|
||||
|
||||
/* set up the index panel */
|
||||
|
||||
|
@ -428,9 +453,30 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/* CORBA and Bonobo setup */
|
||||
window->ui_handler = bonobo_ui_handler_new ();
|
||||
bonobo_ui_handler_set_app (window->ui_handler, app);
|
||||
window->details->ui_container = bonobo_ui_container_new ();
|
||||
bonobo_ui_container_set_win (window->details->ui_container,
|
||||
BONOBO_WIN (window));
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_set_statusbar (window->ui_handler, status_bar);
|
||||
#endif
|
||||
|
||||
/* Load the user interface from the XML file. */
|
||||
window->details->shell_ui = bonobo_ui_component_new ("Nautilus Shell");
|
||||
bonobo_ui_component_set_container
|
||||
(window->details->shell_ui,
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (window->details->ui_container)));
|
||||
bonobo_ui_util_set_ui (window->details->shell_ui,
|
||||
NAUTILUS_DATADIR,
|
||||
"nautilus-shell-ui.xml",
|
||||
"nautilus");
|
||||
|
||||
/* Wrap the location bar in a control and set it up. */
|
||||
location_bar_wrapper = bonobo_control_new (location_bar_box);
|
||||
bonobo_ui_component_object_set (window->details->shell_ui,
|
||||
"/Location Bar/Wrapper",
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (location_bar_wrapper)),
|
||||
NULL);
|
||||
bonobo_object_unref (BONOBO_OBJECT (location_bar_wrapper));
|
||||
|
||||
/* Create menus and tool bars */
|
||||
nautilus_window_initialize_menus (window);
|
||||
|
@ -455,24 +501,25 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
char *old_app_name;
|
||||
char *old_name;
|
||||
NautilusWindow *window = (NautilusWindow *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
if(!GTK_VALUE_STRING(*arg))
|
||||
if (GTK_VALUE_STRING (*arg) == NULL) {
|
||||
return;
|
||||
|
||||
old_app_name = app->name;
|
||||
g_free(app->name);
|
||||
app->name = g_strdup(GTK_VALUE_STRING(*arg));
|
||||
g_assert(app->name);
|
||||
g_free(app->prefix);
|
||||
app->prefix = g_strconcat("/", app->name, "/", NULL);
|
||||
if(!old_app_name) {
|
||||
nautilus_window_constructed(NAUTILUS_WINDOW(object));
|
||||
}
|
||||
old_name = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
bonobo_win_set_name (BONOBO_WIN (object), GTK_VALUE_STRING (*arg));
|
||||
/* This hack of using the time when the name first
|
||||
* goes non-NULL to be window-constructed time is
|
||||
* completely lame. But it works, so for now we leave
|
||||
* it alone.
|
||||
*/
|
||||
if (old_name == NULL) {
|
||||
nautilus_window_constructed (NAUTILUS_WINDOW (object));
|
||||
}
|
||||
g_free (old_name);
|
||||
break;
|
||||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
|
@ -485,11 +532,9 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
GTK_VALUE_STRING (*arg) = app->name;
|
||||
GTK_VALUE_STRING (*arg) = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
break;
|
||||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
|
@ -558,11 +603,13 @@ nautilus_window_destroy (GtkObject *object)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
|
||||
if (window->ui_handler != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->ui_handler));
|
||||
if (window->details->ui_container != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->details->ui_container));
|
||||
}
|
||||
|
||||
g_free (window->details);
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1112,32 +1159,40 @@ void
|
|||
nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->back_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_BACK_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->forward_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_FORWARD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->up_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_UP_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->reload_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_RELOAD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1355,6 +1410,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
|
||||
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
|
||||
|
@ -1364,6 +1420,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
|
||||
TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static Nautilus_HistoryList *
|
||||
|
@ -1490,9 +1547,11 @@ nautilus_window_set_content_view_widget (NautilusWindow *window,
|
|||
}
|
||||
|
||||
/* Here's an explicit check for a problem that happens all too often. */
|
||||
#ifdef UIH
|
||||
if (bonobo_ui_handler_menu_path_exists (window->ui_handler, "/File/Open")) {
|
||||
g_warning ("There's a lingering Open menu item. This usually means a new Bonobo bug.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (new_view != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (new_view));
|
||||
|
@ -1565,6 +1624,7 @@ sidebar_panels_changed_callback (gpointer user_data)
|
|||
static void
|
||||
show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1575,12 +1635,14 @@ show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_show (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static void
|
||||
hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1591,12 +1653,14 @@ hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_hide (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1604,6 +1668,9 @@ dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
|||
|
||||
dock_item = gnome_app_get_dock_item_by_name (app, dock_item_name);
|
||||
return dock_item != NULL && GTK_WIDGET_VISIBLE (dock_item);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1627,19 +1694,27 @@ nautilus_window_location_bar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
hide_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
show_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_tool_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
return dock_item_showing (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1676,6 +1751,7 @@ nautilus_window_sidebar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1683,12 +1759,14 @@ nautilus_window_hide_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_hide (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1696,18 +1774,23 @@ nautilus_window_show_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_status_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#ifndef NAUTILUS_WINDOW_H
|
||||
#define NAUTILUS_WINDOW_H
|
||||
|
||||
#include <libgnomeui/gnome-app.h>
|
||||
#include <bonobo/bonobo-win.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-bookmark.h>
|
||||
#include <libnautilus-extensions/nautilus-view-identifier.h>
|
||||
|
@ -36,7 +36,6 @@
|
|||
#include "nautilus-view-frame.h"
|
||||
#include "nautilus-sidebar.h"
|
||||
#include "nautilus-application.h"
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
|
||||
#define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type())
|
||||
#define NAUTILUS_WINDOW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
|
||||
|
@ -50,7 +49,7 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
BonoboWinClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
@ -65,7 +64,7 @@ typedef enum {
|
|||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
BonoboWin parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
|
@ -78,7 +77,6 @@ struct NautilusWindow {
|
|||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
|
|
|
@ -33,9 +33,10 @@
|
|||
|
||||
#include "nautilus-view-frame-private.h"
|
||||
#include "nautilus-window.h"
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <libnautilus/nautilus-bonobo-workarounds.h>
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libnautilus/nautilus-bonobo-workarounds.h>
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
|
||||
static void impl_Nautilus_ViewFrame_open_location (PortableServer_Servant servant,
|
||||
Nautilus_URI location,
|
||||
|
|
|
@ -75,6 +75,9 @@ struct NautilusViewFrameDetails {
|
|||
char *title;
|
||||
char *label;
|
||||
|
||||
/* A container to connect our clients to. */
|
||||
BonoboUIContainer *ui_container;
|
||||
|
||||
guint check_if_view_is_gone_timeout_id;
|
||||
};
|
||||
|
||||
|
@ -254,6 +257,7 @@ nautilus_view_frame_destroy (GtkObject *object)
|
|||
|
||||
nautilus_view_frame_destroy_client (frame);
|
||||
|
||||
bonobo_object_unref (BONOBO_OBJECT (frame->details->ui_container));
|
||||
g_free (frame->details->title);
|
||||
g_free (frame->details->label);
|
||||
g_free (frame->details);
|
||||
|
@ -279,14 +283,16 @@ nautilus_view_frame_handle_client_gone (GtkObject *object,
|
|||
}
|
||||
|
||||
NautilusViewFrame *
|
||||
nautilus_view_frame_new (BonoboUIHandler *ui_handler,
|
||||
nautilus_view_frame_new (BonoboUIContainer *ui_container,
|
||||
NautilusUndoManager *undo_manager)
|
||||
{
|
||||
NautilusViewFrame *view_frame;
|
||||
|
||||
view_frame = NAUTILUS_VIEW_FRAME (gtk_widget_new (nautilus_view_frame_get_type (), NULL));
|
||||
|
||||
view_frame->ui_handler = ui_handler;
|
||||
bonobo_object_ref (BONOBO_OBJECT (ui_container));
|
||||
view_frame->details->ui_container = ui_container;
|
||||
|
||||
view_frame->undo_manager = undo_manager;
|
||||
|
||||
return view_frame;
|
||||
|
@ -502,7 +508,7 @@ nautilus_view_frame_load_client (NautilusViewFrame *view, const char *iid)
|
|||
view->view_frame = impl_Nautilus_ViewFrame__create (view, &ev);
|
||||
|
||||
/* Add a control frame interface. */
|
||||
control_frame = bonobo_control_frame_new (bonobo_object_corba_objref (BONOBO_OBJECT (view->ui_handler)));
|
||||
control_frame = bonobo_control_frame_new (bonobo_object_corba_objref (BONOBO_OBJECT (view->details->ui_container)));
|
||||
bonobo_object_add_interface (BONOBO_OBJECT (view->view_frame),
|
||||
BONOBO_OBJECT (control_frame));
|
||||
bonobo_control_frame_bind_to_control (control_frame, control);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#define NAUTILUS_VIEW_FRAME_H
|
||||
|
||||
#include <bonobo/bonobo-object-client.h>
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
#include <bonobo/bonobo-ui-container.h>
|
||||
#include <libnautilus-extensions/nautilus-generous-bin.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
#include <libnautilus/nautilus-view-component.h>
|
||||
|
@ -50,7 +50,6 @@ typedef struct {
|
|||
NautilusGenerousBin parent;
|
||||
NautilusViewFrameDetails *details;
|
||||
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusUndoManager *undo_manager;
|
||||
|
||||
char *iid;
|
||||
|
@ -99,7 +98,7 @@ typedef struct {
|
|||
} NautilusViewFrameClass;
|
||||
|
||||
GtkType nautilus_view_frame_get_type (void);
|
||||
NautilusViewFrame * nautilus_view_frame_new (BonoboUIHandler *ui_handler,
|
||||
NautilusViewFrame * nautilus_view_frame_new (BonoboUIContainer *ui_container,
|
||||
NautilusUndoManager *undo_manager);
|
||||
gboolean nautilus_view_frame_load_client (NautilusViewFrame *view,
|
||||
const char *iid);
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include "nautilus-main.h"
|
||||
#include "nautilus-location-bar.h"
|
||||
#include "nautilus-window-private.h"
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-dialog-util.h>
|
||||
#include <libgnomevfs/gnome-vfs-async-ops.h>
|
||||
|
@ -745,6 +747,7 @@ load_content_view (NautilusWindow *window,
|
|||
* the zoom_control will get shown.
|
||||
*/
|
||||
gtk_widget_hide (window->zoom_control);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
|
||||
FALSE);
|
||||
|
@ -754,15 +757,15 @@ load_content_view (NautilusWindow *window,
|
|||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
|
||||
FALSE);
|
||||
#endif
|
||||
|
||||
content_view = window->content_view;
|
||||
if (!NAUTILUS_IS_VIEW_FRAME (content_view)
|
||||
|| strcmp (nautilus_view_frame_get_iid (content_view), iid) != 0) {
|
||||
|
||||
new_view = nautilus_view_frame_new (window->ui_handler,
|
||||
new_view = nautilus_view_frame_new (window->details->ui_container,
|
||||
window->application->undo_manager);
|
||||
nautilus_window_connect_view (window, new_view);
|
||||
|
||||
if (!nautilus_view_frame_load_client (new_view, iid)) {
|
||||
gtk_widget_unref (GTK_WIDGET(new_view));
|
||||
new_view = NULL;
|
||||
|
@ -1485,8 +1488,8 @@ nautilus_window_set_sidebar_panels (NautilusWindow *window,
|
|||
identifier = (NautilusViewIdentifier *) node->data;
|
||||
|
||||
/* Create and load the panel. */
|
||||
sidebar_panel = nautilus_view_frame_new (window->ui_handler,
|
||||
window->application->undo_manager);
|
||||
sidebar_panel = nautilus_view_frame_new (window->details->ui_container,
|
||||
window->application->undo_manager);
|
||||
nautilus_view_frame_set_label (sidebar_panel, identifier->name);
|
||||
nautilus_window_connect_view (window, sidebar_panel);
|
||||
load_succeeded = nautilus_view_frame_load_client (sidebar_panel, identifier->iid);
|
||||
|
|
|
@ -36,7 +36,10 @@
|
|||
#include "nautilus-signaller.h"
|
||||
#include "nautilus-theme-selector.h"
|
||||
#include "nautilus-window-private.h"
|
||||
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnome/gnome-util.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libnautilus-extensions/nautilus-bonobo-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
|
@ -50,14 +53,10 @@
|
|||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
#include <libnautilus-extensions/nautilus-user-level-manager.h>
|
||||
#include <libnautilus-extensions/nautilus-xml-extensions.h>
|
||||
|
||||
#include <libnautilus/nautilus-bonobo-ui.h>
|
||||
|
||||
/* gnome-XML headers */
|
||||
#include <parser.h>
|
||||
#include <xmlmemory.h>
|
||||
|
||||
|
||||
#define STATIC_BOOKMARKS_FILE_NAME "static_bookmarks.xml"
|
||||
|
||||
/* Private menu paths that components don't know about */
|
||||
|
@ -96,11 +95,18 @@
|
|||
#define NAUTILUS_MENU_PATH_ABOUT_ITEM "/Help/About Nautilus"
|
||||
#define NAUTILUS_MENU_PATH_NAUTILUS_FEEDBACK "/Help/Nautilus Feedback"
|
||||
|
||||
|
||||
#define SWITCH_TO_BEGINNER_VERB "Switch to Beginner Level"
|
||||
#define SWITCH_TO_INTERMEDIATE_VERB "Switch to Intermediate Level"
|
||||
#define SWITCH_TO_ADVANCED_VERB "Switch to Advanced Level"
|
||||
|
||||
static GtkWindow *bookmarks_window = NULL;
|
||||
|
||||
#ifdef UIH
|
||||
static void activate_bookmark_in_menu_item (BonoboUIHandler *uih,
|
||||
gpointer user_data,
|
||||
const char *path);
|
||||
#endif
|
||||
static void append_bookmark_to_menu (NautilusWindow *window,
|
||||
NautilusBookmark *bookmark,
|
||||
const char *menu_item_path,
|
||||
|
@ -120,8 +126,8 @@ static void edit_bookmarks (Nau
|
|||
|
||||
|
||||
/* User level things */
|
||||
static guint convert_menu_path_to_user_level (const char *path);
|
||||
static const char * convert_user_level_to_menu_path (guint user_level);
|
||||
static guint convert_verb_to_user_level (const char *verb);
|
||||
static const char * convert_user_level_to_verb (guint user_level);
|
||||
static char * get_customize_user_level_settings_menu_string (void);
|
||||
static void update_user_level_menu_items (NautilusWindow *window);
|
||||
static char * get_customize_user_level_string (void);
|
||||
|
@ -190,38 +196,38 @@ bookmark_holder_free (BookmarkHolder *bookmark_holder)
|
|||
#define NAUTILUS_MENU_PATH_SEPARATOR_BEFORE_CANNED_BOOKMARKS "/Bookmarks/Before Canned Separator"
|
||||
|
||||
static void
|
||||
file_menu_new_window_callback (BonoboUIHandler *ui_handler,
|
||||
file_menu_new_window_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *current_window;
|
||||
NautilusWindow *new_window;
|
||||
|
||||
|
||||
current_window = NAUTILUS_WINDOW (user_data);
|
||||
new_window = nautilus_application_create_window (current_window->application);
|
||||
nautilus_window_goto_uri (new_window, current_window->location);
|
||||
}
|
||||
|
||||
static void
|
||||
file_menu_close_window_callback (BonoboUIHandler *ui_handler,
|
||||
file_menu_close_window_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_close (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
file_menu_close_all_windows_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
file_menu_close_all_windows_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_application_close_all_windows ();
|
||||
}
|
||||
|
||||
static void
|
||||
file_menu_toggle_find_mode_callback (BonoboUIHandler *ui_handler,
|
||||
file_menu_toggle_find_mode_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -232,26 +238,26 @@ file_menu_toggle_find_mode_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
file_menu_web_search_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
file_menu_web_search_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_web_search (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
edit_menu_undo_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_undo_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_undo_manager_undo
|
||||
(NAUTILUS_WINDOW (user_data)->application->undo_manager);
|
||||
}
|
||||
|
||||
static void
|
||||
edit_menu_cut_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_cut_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -262,9 +268,9 @@ edit_menu_cut_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
edit_menu_copy_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_copy_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -276,9 +282,9 @@ edit_menu_copy_callback (BonoboUIHandler *ui_handler,
|
|||
|
||||
|
||||
static void
|
||||
edit_menu_paste_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_paste_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -289,11 +295,10 @@ edit_menu_paste_callback (BonoboUIHandler *ui_handler,
|
|||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
edit_menu_clear_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
edit_menu_clear_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
|
@ -306,33 +311,33 @@ edit_menu_clear_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
go_menu_back_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_back_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_back (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
go_menu_forward_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_forward_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_forward (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
go_menu_up_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_up_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_up (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
go_menu_home_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_home_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_go_home (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
@ -375,27 +380,26 @@ forget_history_if_confirmed (NautilusWindow *window)
|
|||
gnome_dialog_set_default (dialog, GNOME_CANCEL);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
go_menu_forget_history_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
go_menu_forget_history_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
forget_history_if_confirmed (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_reload_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_reload_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_reload (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_sidebar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_sidebar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -408,9 +412,9 @@ view_menu_show_hide_sidebar_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_tool_bar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_tool_bar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -423,9 +427,9 @@ view_menu_show_hide_tool_bar_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_location_bar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_location_bar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -438,9 +442,9 @@ view_menu_show_hide_location_bar_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
view_menu_show_hide_status_bar_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_show_hide_status_bar_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
|
@ -457,6 +461,7 @@ nautilus_window_update_show_hide_menu_items (NautilusWindow *window)
|
|||
{
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_label
|
||||
(window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_SHOW_HIDE_STATUS_BAR,
|
||||
|
@ -485,44 +490,45 @@ nautilus_window_update_show_hide_menu_items (NautilusWindow *window)
|
|||
? _("Hide Location Bar")
|
||||
: _("Show Location Bar"));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_zoom_in_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_zoom_in_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_zoom_in (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_zoom_out_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_zoom_out_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_zoom_out (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
view_menu_zoom_normal_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
view_menu_zoom_normal_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_zoom_to_fit (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
bookmarks_menu_add_bookmark_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
bookmarks_menu_add_bookmark_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_add_bookmark_for_current_location (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
bookmarks_menu_edit_bookmarks_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
bookmarks_menu_edit_bookmarks_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
edit_bookmarks (NAUTILUS_WINDOW (user_data));
|
||||
}
|
||||
|
@ -536,11 +542,10 @@ switch_and_show_intermediate_settings_callback (GtkWidget *button, gpointer user
|
|||
nautilus_global_preferences_show_dialog ();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
user_level_customize_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
user_level_customize_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
GnomeDialog *dialog;
|
||||
NautilusWindow *window;
|
||||
|
@ -600,25 +605,25 @@ user_level_customize_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
customize_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
customize_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_property_browser_show ();
|
||||
}
|
||||
|
||||
static void
|
||||
change_appearance_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
change_appearance_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_theme_selector_show ();
|
||||
}
|
||||
|
||||
static void
|
||||
help_menu_about_nautilus_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
help_menu_about_nautilus_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
static GtkWidget *about = NULL;
|
||||
|
||||
|
@ -668,9 +673,9 @@ help_menu_about_nautilus_callback (BonoboUIHandler *ui_handler,
|
|||
}
|
||||
|
||||
static void
|
||||
help_menu_nautilus_feedback_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
help_menu_nautilus_feedback_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
nautilus_window_goto_uri (NAUTILUS_WINDOW (user_data), "http://www.eazel.com/feedback.html");
|
||||
}
|
||||
|
@ -731,43 +736,47 @@ switch_to_user_level (NautilusWindow *window, int new_user_level)
|
|||
|
||||
/* change the item pixbufs to reflect the new user level */
|
||||
pixbuf = get_user_level_image (old_user_level, FALSE);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_pixmap
|
||||
(window->ui_handler,
|
||||
convert_user_level_to_menu_path (old_user_level),
|
||||
convert_user_level_to_verb (old_user_level),
|
||||
BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA,
|
||||
pixbuf);
|
||||
#endif
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
|
||||
pixbuf = get_user_level_image (new_user_level, TRUE);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_pixmap
|
||||
(window->ui_handler,
|
||||
convert_user_level_to_menu_path (new_user_level),
|
||||
convert_user_level_to_verb (new_user_level),
|
||||
BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA,
|
||||
pixbuf);
|
||||
#endif
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
|
||||
/* set up the menu title image to reflect the new user level */
|
||||
pixbuf = get_user_level_image (new_user_level, FALSE);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_pixmap
|
||||
(window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_USER_LEVEL,
|
||||
BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA,
|
||||
pixbuf);
|
||||
#endif
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
user_level_menu_item_callback (BonoboUIHandler *ui_handler,
|
||||
gpointer user_data,
|
||||
const char *path)
|
||||
user_level_menu_item_callback (BonoboUIComponent *component,
|
||||
gpointer user_data,
|
||||
const char *verb)
|
||||
{
|
||||
NautilusWindow *window;
|
||||
|
||||
window = NAUTILUS_WINDOW (user_data);
|
||||
g_assert (window->ui_handler == ui_handler);
|
||||
|
||||
switch_to_user_level (window, convert_menu_path_to_user_level (path));
|
||||
switch_to_user_level (window, convert_verb_to_user_level (verb));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -822,6 +831,8 @@ show_bogus_bookmark_window (BookmarkHolder *holder)
|
|||
g_free (prompt);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
static void
|
||||
activate_bookmark_in_menu_item (BonoboUIHandler *uih, gpointer user_data, const char *path)
|
||||
{
|
||||
|
@ -839,19 +850,25 @@ activate_bookmark_in_menu_item (BonoboUIHandler *uih, gpointer user_data, const
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
append_placeholder (NautilusWindow *window, const char *placeholder_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_placeholder (window->ui_handler,
|
||||
placeholder_path);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
append_separator (NautilusWindow *window, const char *separator_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_separator (window->ui_handler,
|
||||
separator_path,
|
||||
-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -862,17 +879,21 @@ append_bookmark_to_menu (NautilusWindow *window,
|
|||
{
|
||||
BookmarkHolder *bookmark_holder;
|
||||
GdkPixbuf *pixbuf;
|
||||
#ifdef UIH
|
||||
BonoboUIHandlerPixmapType pixmap_type;
|
||||
#endif
|
||||
char *raw_name, *display_name, *truncated_name;
|
||||
|
||||
pixbuf = nautilus_bookmark_get_pixbuf (bookmark, NAUTILUS_ICON_SIZE_FOR_MENUS);
|
||||
|
||||
/* Set up pixmap type based on result of function. If we fail, set pixmap type to none */
|
||||
#ifdef UIH
|
||||
if (pixbuf != NULL) {
|
||||
pixmap_type = BONOBO_UI_HANDLER_PIXMAP_PIXBUF_DATA;
|
||||
} else {
|
||||
pixmap_type = BONOBO_UI_HANDLER_PIXMAP_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
bookmark_holder = bookmark_holder_new (bookmark, window, is_bookmarks_menu);
|
||||
|
||||
|
@ -886,6 +907,7 @@ append_bookmark_to_menu (NautilusWindow *window,
|
|||
display_name = nautilus_str_double_underscores (truncated_name);
|
||||
g_free (raw_name);
|
||||
g_free (truncated_name);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_item (window->ui_handler,
|
||||
menu_item_path,
|
||||
display_name,
|
||||
|
@ -897,13 +919,16 @@ append_bookmark_to_menu (NautilusWindow *window,
|
|||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
#endif
|
||||
g_free (display_name);
|
||||
|
||||
/* We must use "set_callback" since we have a destroy-notify function. */
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_callback
|
||||
(window->ui_handler, menu_item_path,
|
||||
activate_bookmark_in_menu_item,
|
||||
bookmark_holder, (GDestroyNotify) bookmark_holder_free);
|
||||
#endif
|
||||
|
||||
/* Let's get notified whenever a bookmark changes. */
|
||||
gtk_signal_connect_object (GTK_OBJECT (bookmark), "changed",
|
||||
|
@ -954,7 +979,11 @@ create_menu_item_from_node (NautilusWindow *window,
|
|||
char *sub_item_path;
|
||||
|
||||
index_as_string = g_strdup_printf ("item_%d", index);
|
||||
#ifdef UIH
|
||||
item_path = bonobo_ui_handler_build_path (menu_path, index_as_string, NULL);
|
||||
#else
|
||||
item_path = NULL;
|
||||
#endif
|
||||
g_free (index_as_string);
|
||||
|
||||
if (strcmp (node->name, "bookmark") == 0) {
|
||||
|
@ -965,6 +994,7 @@ create_menu_item_from_node (NautilusWindow *window,
|
|||
append_separator (window, item_path);
|
||||
} else if (strcmp (node->name, "folder") == 0) {
|
||||
xml_folder_name = xmlGetProp (node, "name");
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_subtree (window->ui_handler,
|
||||
item_path,
|
||||
xml_folder_name,
|
||||
|
@ -974,6 +1004,7 @@ create_menu_item_from_node (NautilusWindow *window,
|
|||
NULL,
|
||||
0,
|
||||
0);
|
||||
#endif
|
||||
for (node = nautilus_xml_get_children (node), sub_index = 0;
|
||||
node != NULL;
|
||||
node = node->next, ++sub_index) {
|
||||
|
@ -1038,6 +1069,7 @@ remove_bookmarks_after (NautilusWindow *window,
|
|||
const char *menu_path,
|
||||
const char *last_retained_item_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
GList *children, *p;
|
||||
gboolean found_items_to_remove;
|
||||
gpointer callback_data;
|
||||
|
@ -1065,6 +1097,7 @@ remove_bookmarks_after (NautilusWindow *window,
|
|||
|
||||
g_assert (found_items_to_remove);
|
||||
nautilus_g_list_free_deep (children);
|
||||
#endif
|
||||
}
|
||||
|
||||
static NautilusBookmarkList *bookmarks = NULL;
|
||||
|
@ -1183,6 +1216,7 @@ static void
|
|||
remove_underline_accelerator_from_menu_title (NautilusWindow *window,
|
||||
const char *menu_path)
|
||||
{
|
||||
#ifdef UIH
|
||||
char *old_label;
|
||||
char *new_label;
|
||||
|
||||
|
@ -1192,6 +1226,7 @@ remove_underline_accelerator_from_menu_title (NautilusWindow *window,
|
|||
|
||||
g_free (old_label);
|
||||
g_free (new_label);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1275,6 +1310,7 @@ new_top_level_menu (NautilusWindow *window,
|
|||
/* Note that we don't bother with hints for menu titles.
|
||||
* We can revisit this anytime if someone thinks they're useful.
|
||||
*/
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_subtree (window->ui_handler,
|
||||
menu_path,
|
||||
title,
|
||||
|
@ -1284,6 +1320,8 @@ new_top_level_menu (NautilusWindow *window,
|
|||
NULL,
|
||||
0,
|
||||
0);
|
||||
#endif
|
||||
|
||||
g_free (title);
|
||||
}
|
||||
|
||||
|
@ -1323,14 +1361,18 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
const char *menu_path,
|
||||
guint user_level)
|
||||
{
|
||||
#ifdef UIH
|
||||
BonoboUIHandler *ui_handler;
|
||||
#endif
|
||||
GdkPixbuf *pixbuf;
|
||||
guint current_user_level;
|
||||
char *user_level_name;
|
||||
char *menu_label;
|
||||
char *menu_hint;
|
||||
|
||||
#ifdef UIH
|
||||
ui_handler = window->ui_handler;
|
||||
#endif
|
||||
user_level_name = nautilus_user_level_manager_get_user_level_name_for_display (user_level);
|
||||
current_user_level = nautilus_user_level_manager_get_user_level ();
|
||||
|
||||
|
@ -1343,6 +1385,7 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
menu_hint = g_strdup_printf (_("Use %s settings"), user_level_name);
|
||||
|
||||
pixbuf = get_user_level_image (user_level, current_user_level == user_level);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_new_item (ui_handler,
|
||||
menu_path,
|
||||
menu_label,
|
||||
|
@ -1354,6 +1397,7 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
0,
|
||||
user_level_menu_item_callback,
|
||||
window);
|
||||
#endif
|
||||
g_free (user_level_name);
|
||||
g_free (menu_label);
|
||||
g_free (menu_hint);
|
||||
|
@ -1369,15 +1413,62 @@ add_user_level_menu_item (NautilusWindow *window,
|
|||
void
|
||||
nautilus_window_initialize_menus (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GdkPixbuf *pixbuf;
|
||||
BonoboUIHandler *ui_handler;
|
||||
#endif
|
||||
|
||||
BonoboUIVerb verbs [] = {
|
||||
BONOBO_UI_VERB ("New Window", file_menu_new_window_callback),
|
||||
BONOBO_UI_VERB ("Close", file_menu_close_window_callback),
|
||||
BONOBO_UI_VERB ("Close All", file_menu_close_all_windows_callback),
|
||||
BONOBO_UI_VERB ("Toggle Find Mode", file_menu_toggle_find_mode_callback),
|
||||
BONOBO_UI_VERB ("Go to Web Search", file_menu_web_search_callback),
|
||||
BONOBO_UI_VERB ("Undo", edit_menu_undo_callback),
|
||||
BONOBO_UI_VERB ("Cut", edit_menu_cut_callback),
|
||||
BONOBO_UI_VERB ("Copy", edit_menu_copy_callback),
|
||||
BONOBO_UI_VERB ("Paste", edit_menu_paste_callback),
|
||||
BONOBO_UI_VERB ("Clear", edit_menu_clear_callback),
|
||||
BONOBO_UI_VERB ("Customize", customize_callback),
|
||||
BONOBO_UI_VERB ("Change Appearance", change_appearance_callback),
|
||||
BONOBO_UI_VERB ("Back", go_menu_back_callback),
|
||||
BONOBO_UI_VERB ("Forward", go_menu_forward_callback),
|
||||
BONOBO_UI_VERB ("Up", go_menu_up_callback),
|
||||
BONOBO_UI_VERB ("Home", go_menu_home_callback),
|
||||
BONOBO_UI_VERB ("Forget History", go_menu_forget_history_callback),
|
||||
BONOBO_UI_VERB ("Reload", view_menu_reload_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Sidebar", view_menu_show_hide_sidebar_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Tool Bar", view_menu_show_hide_tool_bar_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Location Bar", view_menu_show_hide_location_bar_callback),
|
||||
BONOBO_UI_VERB ("Show Hide Status Bar", view_menu_show_hide_status_bar_callback),
|
||||
BONOBO_UI_VERB ("Zoom In", view_menu_zoom_in_callback),
|
||||
BONOBO_UI_VERB ("Zoom Out", view_menu_zoom_out_callback),
|
||||
BONOBO_UI_VERB ("Zoom Normal", view_menu_zoom_normal_callback),
|
||||
BONOBO_UI_VERB ("Add Bookmark", bookmarks_menu_add_bookmark_callback),
|
||||
BONOBO_UI_VERB ("Edit Bookmarks", bookmarks_menu_edit_bookmarks_callback),
|
||||
BONOBO_UI_VERB ("About Nautilus", help_menu_about_nautilus_callback),
|
||||
BONOBO_UI_VERB ("Nautilus Feedback", help_menu_nautilus_feedback_callback),
|
||||
#ifdef UIH
|
||||
/* The next set of verbs doesn't work. Need some different mechanism for radio items apparently */
|
||||
#endif
|
||||
BONOBO_UI_VERB (SWITCH_TO_BEGINNER_VERB, user_level_menu_item_callback),
|
||||
BONOBO_UI_VERB (SWITCH_TO_INTERMEDIATE_VERB, user_level_menu_item_callback),
|
||||
BONOBO_UI_VERB (SWITCH_TO_ADVANCED_VERB, user_level_menu_item_callback),
|
||||
BONOBO_UI_VERB ("User Level Customization", user_level_customize_callback),
|
||||
BONOBO_UI_VERB_END
|
||||
};
|
||||
|
||||
bonobo_ui_component_add_verb_list_with_data (window->details->shell_ui, verbs, window);
|
||||
|
||||
#ifdef UIH
|
||||
ui_handler = window->ui_handler;
|
||||
g_assert (ui_handler != NULL);
|
||||
|
||||
bonobo_ui_handler_create_menubar (ui_handler);
|
||||
#endif
|
||||
nautilus_window_create_top_level_menus (window);
|
||||
|
||||
#ifdef UIH
|
||||
/* File menu */
|
||||
|
||||
bonobo_ui_handler_menu_new_item (ui_handler,
|
||||
|
@ -1852,6 +1943,7 @@ nautilus_window_initialize_menus (NautilusWindow *window)
|
|||
(window->application->undo_manager,
|
||||
ui_handler, NAUTILUS_MENU_PATH_UNDO_ITEM,
|
||||
_("_Undo"), _("Undo the last text change"));
|
||||
#endif /* UIH */
|
||||
|
||||
nautilus_window_initialize_bookmarks_menu (window);
|
||||
nautilus_window_initialize_go_menu (window);
|
||||
|
@ -1902,10 +1994,27 @@ nautilus_window_update_find_menu_item (NautilusWindow *window)
|
|||
(nautilus_window_get_search_mode (window)
|
||||
? _("_Browse")
|
||||
: _("_Find"));
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_label (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_TOGGLE_FIND_MODE,
|
||||
label_string);
|
||||
g_free (label_string);
|
||||
#endif
|
||||
g_free (label_string);
|
||||
|
||||
#ifndef UIH
|
||||
/* avoid "unused function" warnings */
|
||||
return;
|
||||
|
||||
add_user_level_menu_item (0, 0, 0);
|
||||
append_placeholder (0, 0);
|
||||
bookmark_holder_free (0);
|
||||
edit_bookmarks (0);
|
||||
convert_user_level_to_verb (0);
|
||||
forget_history_if_confirmed (0);
|
||||
show_bogus_bookmark_window (0);
|
||||
switch_and_show_intermediate_settings_callback (0, 0);
|
||||
user_level_changed_callback (0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2044,6 +2153,7 @@ update_user_level_menu_items (NautilusWindow *window)
|
|||
g_assert (customize_string != NULL);
|
||||
|
||||
/* Update the user radio group to reflect reality */
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_radio_state (window->ui_handler,
|
||||
convert_user_level_to_menu_path (user_level),
|
||||
TRUE);
|
||||
|
@ -2052,22 +2162,23 @@ update_user_level_menu_items (NautilusWindow *window)
|
|||
bonobo_ui_handler_menu_set_label (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_USER_LEVEL_CUSTOMIZE,
|
||||
customize_string);
|
||||
#endif
|
||||
|
||||
g_free (customize_string);
|
||||
}
|
||||
|
||||
static guint
|
||||
convert_menu_path_to_user_level (const char *path)
|
||||
convert_verb_to_user_level (const char *verb)
|
||||
{
|
||||
g_assert (path != NULL);
|
||||
g_assert (verb != NULL);
|
||||
|
||||
if (strcmp (path, NAUTILUS_MENU_PATH_NOVICE_ITEM) == 0) {
|
||||
if (strcmp (verb, SWITCH_TO_BEGINNER_VERB) == 0) {
|
||||
return NAUTILUS_USER_LEVEL_NOVICE;
|
||||
}
|
||||
else if (strcmp (path, NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM) == 0) {
|
||||
else if (strcmp (verb, SWITCH_TO_INTERMEDIATE_VERB) == 0) {
|
||||
return NAUTILUS_USER_LEVEL_INTERMEDIATE;
|
||||
}
|
||||
else if (strcmp (path, NAUTILUS_MENU_PATH_EXPERT_ITEM) == 0) {
|
||||
else if (strcmp (verb, SWITCH_TO_ADVANCED_VERB) == 0) {
|
||||
return NAUTILUS_USER_LEVEL_HACKER;
|
||||
}
|
||||
|
||||
|
@ -2077,19 +2188,19 @@ convert_menu_path_to_user_level (const char *path)
|
|||
}
|
||||
|
||||
static const char *
|
||||
convert_user_level_to_menu_path (guint user_level)
|
||||
convert_user_level_to_verb (guint user_level)
|
||||
{
|
||||
switch (user_level) {
|
||||
case NAUTILUS_USER_LEVEL_NOVICE:
|
||||
return NAUTILUS_MENU_PATH_NOVICE_ITEM;
|
||||
return SWITCH_TO_BEGINNER_VERB;
|
||||
break;
|
||||
|
||||
case NAUTILUS_USER_LEVEL_INTERMEDIATE:
|
||||
return NAUTILUS_MENU_PATH_INTERMEDIATE_ITEM;
|
||||
return SWITCH_TO_INTERMEDIATE_VERB;
|
||||
break;
|
||||
|
||||
case NAUTILUS_USER_LEVEL_HACKER:
|
||||
return NAUTILUS_MENU_PATH_EXPERT_ITEM;
|
||||
return SWITCH_TO_ADVANCED_VERB;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2147,4 +2258,3 @@ update_preferences_dialog_title (void)
|
|||
|
||||
g_free (dialog_title);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
#define NAUTILUS_WINDOW_PRIVATE_H
|
||||
|
||||
#include "nautilus-window.h"
|
||||
#include <libnautilus/libnautilus.h>
|
||||
#include <bonobo/bonobo-ui-component.h>
|
||||
#include <bonobo/bonobo-ui-container.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
typedef enum {
|
||||
CV_PROGRESS_INITIAL = 1,
|
||||
|
@ -45,6 +45,11 @@ typedef enum {
|
|||
/* FIXME bugzilla.eazel.com 2575: Need to migrate window fields into here. */
|
||||
struct NautilusWindowDetails
|
||||
{
|
||||
/* Bonobo. */
|
||||
BonoboUIContainer *ui_container;
|
||||
BonoboUIComponent *shell_ui;
|
||||
|
||||
/* Menus. */
|
||||
guint refresh_bookmarks_menu_idle_id;
|
||||
guint refresh_go_menu_idle_id;
|
||||
|
||||
|
@ -65,19 +70,6 @@ struct NautilusWindowDetails
|
|||
#define NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM "/View/Zoom Out"
|
||||
#define NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM "/View/Zoom Normal"
|
||||
|
||||
/* FIXME bugzilla.eazel.com 2663: Would be nice to share more command information
|
||||
* between menus and toolbars than just these hint strings.
|
||||
*/
|
||||
#define NAUTILUS_HINT_BACK N_("Go to the previous visited location")
|
||||
#define NAUTILUS_HINT_FORWARD N_("Go to the next visited location")
|
||||
#define NAUTILUS_HINT_UP N_("Go to the location that contains this one")
|
||||
#define NAUTILUS_HINT_REFRESH N_("Display the latest contents of the current location")
|
||||
#define NAUTILUS_HINT_HOME N_("Go to the home location")
|
||||
#define NAUTILUS_HINT_FIND N_("Search this computer for files")
|
||||
#define NAUTILUS_HINT_WEB_SEARCH N_("Search the World Wide Web")
|
||||
#define NAUTILUS_HINT_STOP N_("Stop loading this location")
|
||||
#define NAUTILUS_HINT_SERVICES N_("Go to the Eazel services location")
|
||||
|
||||
/* window geometry */
|
||||
#define NAUTILUS_WINDOW_MIN_WIDTH 450
|
||||
#define NAUTILUS_WINDOW_MIN_HEIGHT 350
|
||||
|
|
|
@ -34,7 +34,11 @@
|
|||
#include "nautilus-window-manage-views.h"
|
||||
#include "nautilus-window-private.h"
|
||||
#include "nautilus-window.h"
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-app.h>
|
||||
#include <libgnomeui/gnome-app-helper.h>
|
||||
#include <libnautilus-extensions/nautilus-bookmark.h>
|
||||
#include <libnautilus-extensions/nautilus-file-utilities.h>
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
|
@ -108,52 +112,52 @@ toolbar_search_web_callback (GtkWidget *widget, NautilusWindow *window)
|
|||
|
||||
static GnomeUIInfo toolbar_info[] = {
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Back"), NAUTILUS_HINT_BACK,
|
||||
(N_("Back"), NULL,
|
||||
toolbar_back_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Back.png"),
|
||||
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Forward"), NAUTILUS_HINT_FORWARD,
|
||||
(N_("Forward"), NULL,
|
||||
toolbar_forward_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Forward.png"),
|
||||
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Up"), NAUTILUS_HINT_UP,
|
||||
(N_("Up"), NULL,
|
||||
toolbar_up_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Up.png"),
|
||||
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Refresh"), NAUTILUS_HINT_REFRESH,
|
||||
(N_("Refresh"), NULL,
|
||||
toolbar_reload_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Refresh.png"),
|
||||
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Home"), NAUTILUS_HINT_HOME,
|
||||
(N_("Home"), NULL,
|
||||
toolbar_home_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Home.png"),
|
||||
|
||||
NAUTILUS_GNOMEUIINFO_TOGGLEITEM_STOCK
|
||||
(N_("Find"), NAUTILUS_HINT_FIND,
|
||||
(N_("Find"), NULL,
|
||||
toolbar_search_local_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Search.png"),
|
||||
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Web Search"), NAUTILUS_HINT_WEB_SEARCH,
|
||||
(N_("Web Search"), NULL,
|
||||
toolbar_search_web_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/SearchWeb.png"),
|
||||
|
||||
GNOMEUIINFO_SEPARATOR,
|
||||
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Stop"), NAUTILUS_HINT_STOP,
|
||||
(N_("Stop"), NULL,
|
||||
toolbar_stop_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Stop.png"),
|
||||
|
||||
#ifdef EAZEL_SERVICES
|
||||
GNOMEUIINFO_ITEM_STOCK
|
||||
(N_("Services"), NAUTILUS_HINT_SERVICES,
|
||||
(N_("Services"), NULL,
|
||||
toolbar_services_callback,
|
||||
NAUTILUS_PIXMAPDIR "/eazel/Services.png"),
|
||||
#endif
|
||||
|
@ -251,7 +255,7 @@ back_or_forward_button_clicked_callback (GtkWidget *widget,
|
|||
|
||||
/* utility to remember newly allocated toolbar buttons for later enabling/disabling */
|
||||
static void
|
||||
remember_buttons(NautilusWindow *window, GnomeUIInfo current_toolbar_info[])
|
||||
remember_buttons (NautilusWindow *window, GnomeUIInfo current_toolbar_info[])
|
||||
{
|
||||
window->back_button = current_toolbar_info[TOOLBAR_BACK_BUTTON_INDEX].widget;
|
||||
window->forward_button = current_toolbar_info[TOOLBAR_FORWARD_BUTTON_INDEX].widget;
|
||||
|
@ -399,26 +403,32 @@ theme_changed_callback (gpointer callback_data)
|
|||
void
|
||||
nautilus_window_initialize_toolbars (NautilusWindow *window)
|
||||
{
|
||||
GnomeApp *app;
|
||||
GtkWidget *toolbar;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
toolbar = nautilus_toolbar_new ();
|
||||
gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH);
|
||||
nautilus_toolbar_set_button_spacing (NAUTILUS_TOOLBAR (toolbar), 50);
|
||||
|
||||
gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (toolbar), toolbar_info, app->accel_group, app);
|
||||
remember_buttons(window, toolbar_info);
|
||||
/* This function doesn't actually require a GnomeApp; we can
|
||||
* use it on our BonoboWin.
|
||||
*/
|
||||
gnome_app_fill_toolbar_with_data
|
||||
(GTK_TOOLBAR (toolbar), toolbar_info,
|
||||
bonobo_win_get_accel_group (BONOBO_WIN (window)),
|
||||
window);
|
||||
|
||||
remember_buttons (window, toolbar_info);
|
||||
window->throbber = allocate_throbber (toolbar);
|
||||
|
||||
set_up_toolbar_images (window);
|
||||
set_up_throbber_frame_type (window);
|
||||
|
||||
#ifdef UIH
|
||||
gnome_app_set_toolbar (app, GTK_TOOLBAR (toolbar));
|
||||
|
||||
bonobo_ui_handler_set_toolbar (window->ui_handler, "Main", toolbar);
|
||||
#endif
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window->back_button),
|
||||
"button_press_event",
|
||||
|
@ -445,8 +455,7 @@ nautilus_window_toolbar_remove_theme_callback (NautilusWindow *window)
|
|||
theme_changed_callback,
|
||||
window);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
toolbar_reload_callback (GtkWidget *widget, NautilusWindow *window)
|
||||
{
|
||||
|
|
|
@ -39,9 +39,21 @@
|
|||
#include "nautilus-throbber.h"
|
||||
#include "nautilus-window-manage-views.h"
|
||||
#include "nautilus-zoom-control.h"
|
||||
#include <bonobo/bonobo-ui-util.h>
|
||||
#include <ctype.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gtk/gtkmenuitem.h>
|
||||
#include <gtk/gtkoptionmenu.h>
|
||||
#ifndef UIH
|
||||
#include <gtk/gtkstatusbar.h>
|
||||
#endif
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include <libgnome/gnome-i18n.h>
|
||||
#include <libgnomeui/gnome-geometry.h>
|
||||
#include <libgnomeui/gnome-messagebox.h>
|
||||
#include <libgnomeui/gnome-uidefs.h>
|
||||
#include <libgnomevfs/gnome-vfs-uri.h>
|
||||
#include <libgnomevfs/gnome-vfs-utils.h>
|
||||
#include <libnautilus-extensions/nautilus-any-width-bin.h>
|
||||
|
@ -106,7 +118,7 @@ static void nautilus_window_show (GtkWidget *widget
|
|||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusWindow,
|
||||
nautilus_window,
|
||||
GNOME_TYPE_APP)
|
||||
BONOBO_TYPE_WIN)
|
||||
|
||||
static void
|
||||
nautilus_window_initialize_class (NautilusWindowClass *klass)
|
||||
|
@ -155,7 +167,9 @@ nautilus_window_initialize (NautilusWindow *window)
|
|||
static gboolean
|
||||
nautilus_window_clear_status (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
window->status_bar_clear_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -167,10 +181,14 @@ nautilus_window_set_status (NautilusWindow *window, const char *txt)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
gtk_statusbar_pop (GTK_STATUSBAR (GNOME_APP (window)->statusbar), window->status_bar_context_id);
|
||||
#endif
|
||||
if (txt != NULL && txt[0] != '\0') {
|
||||
window->status_bar_clear_id = g_timeout_add(STATUS_BAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
|
||||
#ifdef UIH
|
||||
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->status_bar_context_id, txt);
|
||||
#endif
|
||||
} else {
|
||||
window->status_bar_clear_id = 0;
|
||||
}
|
||||
|
@ -241,13 +259,15 @@ nautilus_window_zoom_to_fit (NautilusWindow *window)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
|
||||
/* This is our replacement for gnome_app_set_statusbar.
|
||||
* It uses nautilus_any_width_bin to make text changes in the
|
||||
* status bar not affect the width of the window.
|
||||
*/
|
||||
static void
|
||||
install_status_bar (GnomeApp *app,
|
||||
GtkWidget *status_bar)
|
||||
GtkWidget *status_bar)
|
||||
{
|
||||
GtkWidget *bin;
|
||||
|
||||
|
@ -266,6 +286,8 @@ install_status_bar (GnomeApp *app,
|
|||
gtk_box_pack_start (GTK_BOX (app->vbox), bin, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Code should never force the window taller than this size.
|
||||
* (The user can still stretch the window taller if desired).
|
||||
*/
|
||||
|
@ -326,13 +348,10 @@ set_initial_window_geometry (NautilusWindow *window)
|
|||
static void
|
||||
nautilus_window_constructed (NautilusWindow *window)
|
||||
{
|
||||
GnomeApp *app;
|
||||
GtkWidget *location_bar_box, *status_bar;
|
||||
GtkWidget *view_as_menu_vbox;
|
||||
GnomeDockItemBehavior behavior;
|
||||
int sidebar_width;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
BonoboControl *location_bar_wrapper;
|
||||
|
||||
/* set up location bar */
|
||||
location_bar_box = gtk_hbox_new (FALSE, GNOME_PAD);
|
||||
|
@ -349,15 +368,19 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
gtk_box_pack_start (GTK_BOX (location_bar_box), window->navigation_bar,
|
||||
TRUE, TRUE, GNOME_PAD_SMALL);
|
||||
#ifdef UIH
|
||||
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE
|
||||
| GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL;
|
||||
if (!gnome_preferences_get_toolbar_detachable ()) {
|
||||
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UIH
|
||||
gnome_app_add_docked (app, location_bar_box,
|
||||
URI_ENTRY_DOCK_ITEM, behavior,
|
||||
GNOME_DOCK_TOP, 2, 0, 0);
|
||||
#endif
|
||||
|
||||
/* Option menu for content view types; it's empty here, filled in when a uri is set.
|
||||
* Pack it into vbox so it doesn't grow vertically when location bar does.
|
||||
|
@ -384,7 +407,9 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
|
||||
/* set up status bar */
|
||||
status_bar = gtk_statusbar_new ();
|
||||
#ifdef UIH
|
||||
install_status_bar (app, status_bar);
|
||||
#endif
|
||||
|
||||
/* insert a little padding so text isn't jammed against frame */
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_STATUSBAR (status_bar)->label), GNOME_PAD, 0);
|
||||
|
@ -409,8 +434,8 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
sidebar_width = nautilus_preferences_get_enum (NAUTILUS_PREFERENCES_SIDEBAR_WIDTH, 148);
|
||||
e_paned_set_position (E_PANED (window->content_hbox), sidebar_width);
|
||||
}
|
||||
|
||||
gnome_app_set_contents (app, window->content_hbox);
|
||||
gtk_widget_show (window->content_hbox);
|
||||
bonobo_win_set_contents (BONOBO_WIN (window), window->content_hbox);
|
||||
|
||||
/* set up the index panel */
|
||||
|
||||
|
@ -428,9 +453,30 @@ nautilus_window_constructed (NautilusWindow *window)
|
|||
}
|
||||
|
||||
/* CORBA and Bonobo setup */
|
||||
window->ui_handler = bonobo_ui_handler_new ();
|
||||
bonobo_ui_handler_set_app (window->ui_handler, app);
|
||||
window->details->ui_container = bonobo_ui_container_new ();
|
||||
bonobo_ui_container_set_win (window->details->ui_container,
|
||||
BONOBO_WIN (window));
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_set_statusbar (window->ui_handler, status_bar);
|
||||
#endif
|
||||
|
||||
/* Load the user interface from the XML file. */
|
||||
window->details->shell_ui = bonobo_ui_component_new ("Nautilus Shell");
|
||||
bonobo_ui_component_set_container
|
||||
(window->details->shell_ui,
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (window->details->ui_container)));
|
||||
bonobo_ui_util_set_ui (window->details->shell_ui,
|
||||
NAUTILUS_DATADIR,
|
||||
"nautilus-shell-ui.xml",
|
||||
"nautilus");
|
||||
|
||||
/* Wrap the location bar in a control and set it up. */
|
||||
location_bar_wrapper = bonobo_control_new (location_bar_box);
|
||||
bonobo_ui_component_object_set (window->details->shell_ui,
|
||||
"/Location Bar/Wrapper",
|
||||
bonobo_object_corba_objref (BONOBO_OBJECT (location_bar_wrapper)),
|
||||
NULL);
|
||||
bonobo_object_unref (BONOBO_OBJECT (location_bar_wrapper));
|
||||
|
||||
/* Create menus and tool bars */
|
||||
nautilus_window_initialize_menus (window);
|
||||
|
@ -455,24 +501,25 @@ nautilus_window_set_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
char *old_app_name;
|
||||
char *old_name;
|
||||
NautilusWindow *window = (NautilusWindow *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
if(!GTK_VALUE_STRING(*arg))
|
||||
if (GTK_VALUE_STRING (*arg) == NULL) {
|
||||
return;
|
||||
|
||||
old_app_name = app->name;
|
||||
g_free(app->name);
|
||||
app->name = g_strdup(GTK_VALUE_STRING(*arg));
|
||||
g_assert(app->name);
|
||||
g_free(app->prefix);
|
||||
app->prefix = g_strconcat("/", app->name, "/", NULL);
|
||||
if(!old_app_name) {
|
||||
nautilus_window_constructed(NAUTILUS_WINDOW(object));
|
||||
}
|
||||
old_name = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
bonobo_win_set_name (BONOBO_WIN (object), GTK_VALUE_STRING (*arg));
|
||||
/* This hack of using the time when the name first
|
||||
* goes non-NULL to be window-constructed time is
|
||||
* completely lame. But it works, so for now we leave
|
||||
* it alone.
|
||||
*/
|
||||
if (old_name == NULL) {
|
||||
nautilus_window_constructed (NAUTILUS_WINDOW (object));
|
||||
}
|
||||
g_free (old_name);
|
||||
break;
|
||||
case ARG_APP:
|
||||
window->application = NAUTILUS_APPLICATION (GTK_VALUE_OBJECT (*arg));
|
||||
|
@ -485,11 +532,9 @@ nautilus_window_get_arg (GtkObject *object,
|
|||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GnomeApp *app = (GnomeApp *) object;
|
||||
|
||||
switch(arg_id) {
|
||||
case ARG_APP_ID:
|
||||
GTK_VALUE_STRING (*arg) = app->name;
|
||||
GTK_VALUE_STRING (*arg) = bonobo_win_get_name (BONOBO_WIN (object));
|
||||
break;
|
||||
case ARG_APP:
|
||||
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (NAUTILUS_WINDOW (object)->application);
|
||||
|
@ -558,11 +603,13 @@ nautilus_window_destroy (GtkObject *object)
|
|||
g_source_remove (window->status_bar_clear_id);
|
||||
}
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
|
||||
if (window->ui_handler != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->ui_handler));
|
||||
if (window->details->ui_container != NULL) {
|
||||
bonobo_object_unref (BONOBO_OBJECT (window->details->ui_container));
|
||||
}
|
||||
|
||||
g_free (window->details);
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (GTK_OBJECT (window)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1112,32 +1159,40 @@ void
|
|||
nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->back_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_BACK_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->forward_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_FORWARD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->up_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_UP_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
|
||||
{
|
||||
gtk_widget_set_sensitive (window->reload_button, allow);
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity
|
||||
(window->ui_handler, NAUTILUS_MENU_PATH_RELOAD_ITEM, allow);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1355,6 +1410,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
|
||||
}
|
||||
|
||||
#ifdef UIH
|
||||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
|
||||
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
|
||||
|
@ -1364,6 +1420,7 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
|
|||
bonobo_ui_handler_menu_set_sensitivity (window->ui_handler,
|
||||
NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
|
||||
TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static Nautilus_HistoryList *
|
||||
|
@ -1490,9 +1547,11 @@ nautilus_window_set_content_view_widget (NautilusWindow *window,
|
|||
}
|
||||
|
||||
/* Here's an explicit check for a problem that happens all too often. */
|
||||
#ifdef UIH
|
||||
if (bonobo_ui_handler_menu_path_exists (window->ui_handler, "/File/Open")) {
|
||||
g_warning ("There's a lingering Open menu item. This usually means a new Bonobo bug.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (new_view != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (new_view));
|
||||
|
@ -1565,6 +1624,7 @@ sidebar_panels_changed_callback (gpointer user_data)
|
|||
static void
|
||||
show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1575,12 +1635,14 @@ show_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_show (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static void
|
||||
hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1591,12 +1653,14 @@ hide_dock_item (NautilusWindow *window, const char *dock_item_name)
|
|||
gtk_widget_hide (GTK_WIDGET (dock_item));
|
||||
gtk_widget_queue_resize (GTK_WIDGET (dock_item)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
GnomeDockItem *dock_item;
|
||||
|
||||
|
@ -1604,6 +1668,9 @@ dock_item_showing (NautilusWindow *window, const char *dock_item_name)
|
|||
|
||||
dock_item = gnome_app_get_dock_item_by_name (app, dock_item_name);
|
||||
return dock_item != NULL && GTK_WIDGET_VISIBLE (dock_item);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1627,19 +1694,27 @@ nautilus_window_location_bar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
hide_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_tool_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
show_dock_item (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_tool_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
return dock_item_showing (window, GNOME_APP_TOOLBAR_NAME);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1676,6 +1751,7 @@ nautilus_window_sidebar_showing (NautilusWindow *window)
|
|||
void
|
||||
nautilus_window_hide_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1683,12 +1759,14 @@ nautilus_window_hide_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_hide (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_status_bar (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
@ -1696,18 +1774,23 @@ nautilus_window_show_status_bar (NautilusWindow *window)
|
|||
if (app->statusbar != NULL) {
|
||||
gtk_widget_show (GTK_WIDGET (app->statusbar)->parent);
|
||||
}
|
||||
#endif
|
||||
nautilus_window_update_show_hide_menu_items (window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_window_status_bar_showing (NautilusWindow *window)
|
||||
{
|
||||
#ifdef UIH
|
||||
GnomeApp *app;
|
||||
|
||||
app = GNOME_APP (window);
|
||||
|
||||
return app->statusbar != NULL
|
||||
&& GTK_WIDGET_VISIBLE (GTK_WIDGET (app->statusbar)->parent);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#ifndef NAUTILUS_WINDOW_H
|
||||
#define NAUTILUS_WINDOW_H
|
||||
|
||||
#include <libgnomeui/gnome-app.h>
|
||||
#include <bonobo/bonobo-win.h>
|
||||
#include <libnautilus-extensions/nautilus-glib-extensions.h>
|
||||
#include <libnautilus-extensions/nautilus-bookmark.h>
|
||||
#include <libnautilus-extensions/nautilus-view-identifier.h>
|
||||
|
@ -36,7 +36,6 @@
|
|||
#include "nautilus-view-frame.h"
|
||||
#include "nautilus-sidebar.h"
|
||||
#include "nautilus-application.h"
|
||||
#include <bonobo/bonobo-ui-handler.h>
|
||||
|
||||
#define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type())
|
||||
#define NAUTILUS_WINDOW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
|
||||
|
@ -50,7 +49,7 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
#endif
|
||||
|
||||
typedef struct {
|
||||
GnomeAppClass parent_spot;
|
||||
BonoboWinClass parent_spot;
|
||||
} NautilusWindowClass;
|
||||
|
||||
typedef struct NautilusWindowStateInfo NautilusWindowStateInfo;
|
||||
|
@ -65,7 +64,7 @@ typedef enum {
|
|||
typedef struct NautilusWindowDetails NautilusWindowDetails;
|
||||
|
||||
struct NautilusWindow {
|
||||
GnomeApp parent_object;
|
||||
BonoboWin parent_object;
|
||||
|
||||
NautilusWindowDetails *details;
|
||||
|
||||
|
@ -78,7 +77,6 @@ struct NautilusWindow {
|
|||
guint status_bar_context_id, status_bar_clear_id;
|
||||
|
||||
/** CORBA-related elements **/
|
||||
BonoboUIHandler *ui_handler;
|
||||
NautilusApplication *application;
|
||||
|
||||
/* FIXME bugzilla.eazel.com 916: Workaround for Bonobo bug. */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue