mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-27 11:29:24 +00:00
Scroll to ICON_PAD_TOP above the icon.
2003-10-07 Dave Camp <dave@ximian.com> * libnautilus-private/nautilus-icon-container.c: (nautilus_icon_container_scroll_to_icon): Scroll to ICON_PAD_TOP above the icon. * src/nautilus-navigation-window.c: (nautilus_navigation_window_set_sidebar_panels), (nautilus_navigation_window_class_init): * src/nautilus-spatial-window.c: (nautilus_spatial_window_class_init): * src/nautilus-view-frame.c: (nautilus_view_frame_new), (nautilus_view_frame_get_prop), (create_ambient_properties): * src/nautilus-view-frame.h: * src/nautilus-window-manage-views.c: (load_content_view): * src/nautilus-window.h: * libnautilus/nautilus-view-component.idl: * libnautilus/nautilus-view.c: (nautilus_view_set_listener_mask), (nautilus_view_get_window_type): * libnautilus/nautilus-view.h: Added a window type property to the view frame. * src/file-manager/fm-directory-view.c: (can_use_component_for_file), (reset_bonobo_open_with_menu), (showing_trash_directory), (should_show_empty_trash), (file_list_all_can_use_components), (real_update_menus), (activate_callback), (fm_directory_view_accepts_dragged_files): * src/file-manager/nautilus-directory-view-ui.xml: Don't use file views in spatial windows. Use Browse Folder in spatial windows and Open in New Window in navigation windows. Don't show "Empty Trash" in non-trash spatial windows.
This commit is contained in:
parent
41958fab29
commit
db8964065e
32
ChangeLog
32
ChangeLog
|
@ -1,3 +1,35 @@
|
|||
2003-10-07 Dave Camp <dave@ximian.com>
|
||||
|
||||
* libnautilus-private/nautilus-icon-container.c:
|
||||
(nautilus_icon_container_scroll_to_icon): Scroll to ICON_PAD_TOP
|
||||
above the icon.
|
||||
|
||||
* src/nautilus-navigation-window.c:
|
||||
(nautilus_navigation_window_set_sidebar_panels),
|
||||
(nautilus_navigation_window_class_init):
|
||||
* src/nautilus-spatial-window.c:
|
||||
(nautilus_spatial_window_class_init):
|
||||
* src/nautilus-view-frame.c: (nautilus_view_frame_new),
|
||||
(nautilus_view_frame_get_prop), (create_ambient_properties):
|
||||
* src/nautilus-view-frame.h:
|
||||
* src/nautilus-window-manage-views.c: (load_content_view):
|
||||
* src/nautilus-window.h:
|
||||
* libnautilus/nautilus-view-component.idl:
|
||||
* libnautilus/nautilus-view.c: (nautilus_view_set_listener_mask),
|
||||
(nautilus_view_get_window_type):
|
||||
* libnautilus/nautilus-view.h: Added a window type property to
|
||||
the view frame.
|
||||
|
||||
* src/file-manager/fm-directory-view.c:
|
||||
(can_use_component_for_file), (reset_bonobo_open_with_menu),
|
||||
(showing_trash_directory), (should_show_empty_trash),
|
||||
(file_list_all_can_use_components), (real_update_menus),
|
||||
(activate_callback), (fm_directory_view_accepts_dragged_files):
|
||||
* src/file-manager/nautilus-directory-view-ui.xml: Don't use
|
||||
file views in spatial windows. Use Browse Folder in spatial
|
||||
windows and Open in New Window in navigation windows. Don't
|
||||
show "Empty Trash" in non-trash spatial windows.
|
||||
|
||||
2003-10-02 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* libnautilus-private/nautilus-icon-container.c:
|
||||
|
|
|
@ -4474,6 +4474,8 @@ nautilus_icon_container_scroll_to_icon (NautilusIconContainer *container,
|
|||
x1, y1,
|
||||
&x, &y);
|
||||
|
||||
y -= ICON_PAD_TOP;
|
||||
|
||||
y = MAX (0, y);
|
||||
|
||||
eel_gtk_adjustment_set_value (vadj, y);
|
||||
|
|
|
@ -53,6 +53,11 @@ module Nautilus {
|
|||
};
|
||||
typedef sequence<HistoryItem> History;
|
||||
|
||||
enum WindowType {
|
||||
WINDOW_SPATIAL,
|
||||
WINDOW_NAVIGATION
|
||||
};
|
||||
|
||||
/* The View interface is used by the Nautilus shell to control
|
||||
* the view. A view that is a Bonobo::Control can choose to
|
||||
* implement the View interface for additional finer control
|
||||
|
@ -82,9 +87,10 @@ module Nautilus {
|
|||
* on the Bonobo::ControlFrame for the view.
|
||||
*
|
||||
* The Ambient properties on the ControlFrame are:
|
||||
* 'title' - ro - string - the title
|
||||
* 'history' - ro - Nautilus::History - the history list
|
||||
* 'selection' - ro - URIList - the selection
|
||||
* 'title' - ro - string - the title
|
||||
* 'history' - ro - Nautilus::History - the history list
|
||||
* 'selection' - ro - URIList - the selection
|
||||
* 'window-type' - ro - Nautilus::WindowType - the window type
|
||||
*/
|
||||
interface ViewFrame : ::Bonobo::Unknown {
|
||||
enum OpenMode {
|
||||
|
|
|
@ -66,6 +66,9 @@ struct NautilusViewDetails {
|
|||
|
||||
NautilusIdleQueue *incoming_queue;
|
||||
NautilusIdleQueue *outgoing_queue;
|
||||
|
||||
gboolean have_window_type;
|
||||
Nautilus_WindowType window_type;
|
||||
};
|
||||
|
||||
typedef void (* ViewFunction) (NautilusView *view,
|
||||
|
@ -1007,3 +1010,44 @@ nautilus_view_set_listener_mask (NautilusView *view,
|
|||
view->details->listener_mask = mask;
|
||||
update_listener (view);
|
||||
}
|
||||
|
||||
Nautilus_WindowType
|
||||
nautilus_view_get_window_type (NautilusView *view)
|
||||
{
|
||||
Bonobo_PropertyBag bag;
|
||||
BonoboArg *arg;
|
||||
CORBA_Environment ev;
|
||||
|
||||
if (view->details->have_window_type) {
|
||||
return view->details->window_type;
|
||||
}
|
||||
|
||||
view->details->have_window_type = TRUE;
|
||||
|
||||
CORBA_exception_init (&ev);
|
||||
|
||||
bag = nautilus_view_get_ambient_properties (view, &ev);
|
||||
|
||||
view->details->window_type = Nautilus_WINDOW_SPATIAL;
|
||||
|
||||
if (!BONOBO_EX (&ev)) {
|
||||
arg = Bonobo_PropertyBag_getValue (bag, "window-type", &ev);
|
||||
|
||||
if (!BONOBO_EX (&ev)) {
|
||||
view->details->window_type = BONOBO_ARG_GET_GENERAL (arg,
|
||||
TC_Nautilus_WindowType,
|
||||
Nautilus_WindowType,
|
||||
NULL);
|
||||
CORBA_free (arg);
|
||||
} else {
|
||||
g_warning ("Window type not found in view frame properties.");
|
||||
}
|
||||
|
||||
bonobo_object_release_unref (bag, &ev);
|
||||
} else {
|
||||
g_warning ("Couldn't get ambient properties for the view frame.");
|
||||
}
|
||||
CORBA_exception_free (&ev);
|
||||
|
||||
return view->details->window_type;
|
||||
}
|
||||
|
|
|
@ -122,6 +122,7 @@ Bonobo_PropertyBag nautilus_view_get_ambient_properties (NautilusV
|
|||
CORBA_Environment *opt_ev);
|
||||
void nautilus_view_set_listener_mask (NautilusView *view,
|
||||
NautilusViewListenerMask mask);
|
||||
Nautilus_WindowType nautilus_view_get_window_type (NautilusView *view);
|
||||
|
||||
/* `protected' functions for use by subclasses only. */
|
||||
NautilusView * nautilus_view_construct (NautilusView *view,
|
||||
|
|
|
@ -133,7 +133,6 @@
|
|||
#define FM_DIRECTORY_VIEW_COMMAND_PASTE_FILES "/commands/Paste Files"
|
||||
#define FM_DIRECTORY_VIEW_COMMAND_PASTE_FILES_INTO "/commands/Paste Files Into"
|
||||
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_ALTERNATE "/menu/File/Open Placeholder/OpenAlternate"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_WITH "/menu/File/Open Placeholder/Open With"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_SCRIPTS "/menu/File/Open Placeholder/Scripts"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_TRASH "/menu/Edit/Dangerous File Items Placeholder/Trash"
|
||||
|
@ -142,6 +141,7 @@
|
|||
#define FM_DIRECTORY_VIEW_MENU_PATH_CREATE_LINK "/menu/Edit/File Items Placeholder/Create Link"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Applications Placeholder"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION "/menu/File/Open Placeholder/Open With/OtherApplication"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_BEFORE_VIEWERS_SEPARATOR "/menu/File/Open Placeholder/Open With/Before Viewers"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_VIEWERS_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Viewers Placeholder"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER "/menu/File/Open Placeholder/Open With/OtherViewer"
|
||||
#define FM_DIRECTORY_VIEW_MENU_PATH_SCRIPTS_PLACEHOLDER "/menu/File/Open Placeholder/Scripts/Scripts Placeholder"
|
||||
|
@ -158,6 +158,7 @@
|
|||
#define FM_DIRECTORY_VIEW_POPUP_PATH_BACKGROUND_SCRIPTS_SEPARATOR "/popups/background/Before Zoom Items/Scripts/After Scripts"
|
||||
|
||||
#define FM_DIRECTORY_VIEW_POPUP_PATH_APPLICATIONS_PLACEHOLDER "/popups/selection/Open Placeholder/Open With/Applications Placeholder"
|
||||
#define FM_DIRECTORY_VIEW_POPUP_PATH_BEFORE_VIEWERS_SEPARATOR "/popups/selection/Open Placeholder/Open With/Before Viewers"
|
||||
#define FM_DIRECTORY_VIEW_POPUP_PATH_VIEWERS_PLACEHOLDER "/popups/selection/Open Placeholder/Open With/Viewers Placeholder"
|
||||
#define FM_DIRECTORY_VIEW_POPUP_PATH_SCRIPTS_PLACEHOLDER "/popups/selection/Open Placeholder/Scripts/Scripts Placeholder"
|
||||
#define FM_DIRECTORY_VIEW_POPUP_PATH_SCRIPTS_SEPARATOR "/popups/selection/Open Placeholder/Scripts/After Scripts"
|
||||
|
@ -3425,6 +3426,12 @@ add_component_to_bonobo_menu (FMDirectoryView *directory_view,
|
|||
g_free (label);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
can_use_component_for_file (FMDirectoryView *view,
|
||||
NautilusFile *file)
|
||||
{
|
||||
return (nautilus_file_is_directory (file) || NAUTILUS_IS_DESKTOP_ICON_FILE (file) || nautilus_view_get_window_type (view->details->nautilus_view) == Nautilus_WINDOW_NAVIGATION);
|
||||
}
|
||||
|
||||
static void
|
||||
reset_bonobo_open_with_menu (FMDirectoryView *view, GList *selection)
|
||||
|
@ -3467,25 +3474,45 @@ reset_bonobo_open_with_menu (FMDirectoryView *view, GList *selection)
|
|||
any_applications = TRUE;
|
||||
add_application_to_bonobo_menu (view, node->data, file, index);
|
||||
}
|
||||
gnome_vfs_mime_application_list_free (applications);
|
||||
|
||||
components = nautilus_mime_get_short_list_components_for_file (NAUTILUS_FILE (selection->data));
|
||||
for (node = components, index = 0; node != NULL; node = node->next, index++) {
|
||||
any_viewers = TRUE;
|
||||
add_component_to_bonobo_menu (view, node->data, uri, index);
|
||||
}
|
||||
gnome_vfs_mime_component_list_free (components);
|
||||
|
||||
gnome_vfs_mime_application_list_free (applications);
|
||||
nautilus_bonobo_set_label
|
||||
(view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OTHER_APPLICATION,
|
||||
any_applications ? _("Other _Application...") : _("An _Application..."));
|
||||
|
||||
nautilus_bonobo_set_label
|
||||
(view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OTHER_VIEWER,
|
||||
any_applications ? _("Other _Viewer...") : _("A _Viewer..."));
|
||||
|
||||
if (can_use_component_for_file (view, NAUTILUS_FILE (selection->data))) {
|
||||
components = nautilus_mime_get_short_list_components_for_file (NAUTILUS_FILE (selection->data));
|
||||
for (node = components, index = 0; node != NULL; node = node->next, index++) {
|
||||
any_viewers = TRUE;
|
||||
add_component_to_bonobo_menu (view, node->data, uri, index);
|
||||
}
|
||||
gnome_vfs_mime_component_list_free (components);
|
||||
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_MENU_PATH_BEFORE_VIEWERS_SEPARATOR,
|
||||
FALSE);
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_POPUP_PATH_BEFORE_VIEWERS_SEPARATOR,
|
||||
FALSE);
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OTHER_VIEWER,
|
||||
FALSE);
|
||||
nautilus_bonobo_set_label
|
||||
(view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OTHER_VIEWER,
|
||||
any_applications ? _("Other _Viewer...") : _("A _Viewer..."));
|
||||
} else {
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OTHER_VIEWER,
|
||||
TRUE);
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_MENU_PATH_BEFORE_VIEWERS_SEPARATOR,
|
||||
TRUE);
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_POPUP_PATH_BEFORE_VIEWERS_SEPARATOR,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
|
@ -4723,6 +4750,29 @@ clipboard_targets_received (GtkClipboard *clipboard,
|
|||
g_object_unref (view);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
showing_trash_directory (FMDirectoryView *view)
|
||||
{
|
||||
return nautilus_file_is_in_trash (fm_directory_view_get_directory_as_file (view));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_show_empty_trash (FMDirectoryView *view)
|
||||
{
|
||||
return (showing_trash_directory (view) || nautilus_view_get_window_type (view->details->nautilus_view) == Nautilus_WINDOW_NAVIGATION);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
file_list_all_can_use_components (GList *file_list)
|
||||
{
|
||||
GList *l;
|
||||
for (l = file_list; l != NULL; l = l->next) {
|
||||
if (!nautilus_file_is_directory (NAUTILUS_FILE (l->data)) && !NAUTILUS_IS_DESKTOP_ICON_FILE (l->data)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
static void
|
||||
real_update_menus (FMDirectoryView *view)
|
||||
{
|
||||
|
@ -4741,6 +4791,7 @@ real_update_menus (FMDirectoryView *view)
|
|||
gboolean can_duplicate_files;
|
||||
gboolean show_separate_delete_command;
|
||||
gboolean vfolder_directory;
|
||||
gboolean show_open_alternate;
|
||||
EelBackground *background;
|
||||
|
||||
if (view->details->ui == NULL) {
|
||||
|
@ -4784,12 +4835,23 @@ real_update_menus (FMDirectoryView *view)
|
|||
nautilus_bonobo_set_sensitive (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OPEN,
|
||||
selection_count != 0);
|
||||
|
||||
if (selection_count <= 1) {
|
||||
label_with_underscore = g_strdup (_("Navigation Window"));
|
||||
|
||||
if (nautilus_view_get_window_type (view->details->nautilus_view) == Nautilus_WINDOW_NAVIGATION) {
|
||||
show_open_alternate = TRUE;
|
||||
if (selection_count <= 1) {
|
||||
label_with_underscore = g_strdup (_("Open in New Window"));
|
||||
} else {
|
||||
label_with_underscore = g_strdup_printf (_("Open in %d New Windows"), selection_count);
|
||||
}
|
||||
} else {
|
||||
label_with_underscore = g_strdup_printf (_("%d Navigation Windows"), selection_count);
|
||||
show_open_alternate = file_list_all_can_use_components (selection);
|
||||
if (selection_count <= 1) {
|
||||
label_with_underscore = g_strdup (_("Browse Folder"));
|
||||
} else {
|
||||
label_with_underscore = g_strdup_printf (_("Browse Folders"));
|
||||
}
|
||||
}
|
||||
|
||||
nautilus_bonobo_set_label
|
||||
(view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OPEN_ALTERNATE,
|
||||
|
@ -4800,6 +4862,10 @@ real_update_menus (FMDirectoryView *view)
|
|||
FM_DIRECTORY_VIEW_COMMAND_OPEN_ALTERNATE,
|
||||
selection_count != 0);
|
||||
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_OPEN_ALTERNATE,
|
||||
!show_open_alternate);
|
||||
|
||||
/* Broken into its own function just for convenience */
|
||||
reset_bonobo_open_with_menu (view, selection);
|
||||
reset_bonobo_mime_actions_menu (view, selection);
|
||||
|
@ -4874,6 +4940,9 @@ real_update_menus (FMDirectoryView *view)
|
|||
nautilus_bonobo_set_sensitive (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_EMPTY_TRASH,
|
||||
!nautilus_trash_monitor_is_empty ());
|
||||
nautilus_bonobo_set_hidden (view->details->ui,
|
||||
FM_DIRECTORY_VIEW_COMMAND_EMPTY_TRASH,
|
||||
!should_show_empty_trash (view));
|
||||
|
||||
nautilus_bonobo_set_sensitive (view->details->ui,
|
||||
NAUTILUS_COMMAND_SELECT_ALL,
|
||||
|
@ -5248,9 +5317,9 @@ activate_callback (NautilusFile *file, gpointer callback_data)
|
|||
|
||||
if (action == ACTIVATION_ACTION_DISPLAY) {
|
||||
action_type = nautilus_mime_get_default_action_type_for_file (file);
|
||||
|
||||
if (action_type == GNOME_VFS_MIME_ACTION_TYPE_COMPONENT &&
|
||||
nautilus_mime_has_any_components_for_file (file)) {
|
||||
nautilus_mime_has_any_components_for_file (file) &&
|
||||
can_use_component_for_file (view, file)) {
|
||||
open_location (view, uri, parameters->mode, parameters->flags);
|
||||
} else {
|
||||
nautilus_launch_show_file
|
||||
|
@ -5888,12 +5957,6 @@ fm_directory_view_accepts_dragged_files (FMDirectoryView *view)
|
|||
accepts_dragged_files, (view));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
showing_trash_directory (FMDirectoryView *view)
|
||||
{
|
||||
return nautilus_file_is_in_trash (fm_directory_view_get_directory_as_file (view));
|
||||
}
|
||||
|
||||
/**
|
||||
* fm_directory_view_should_show_file
|
||||
*
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
_label="_Open"
|
||||
_tip="Open the selected item in this window"/>
|
||||
<cmd name="OpenAlternate"
|
||||
_label="Navigation Window"
|
||||
_label="Open in Navigation Window"
|
||||
_tip="Open each selected item in a navigation window"/>
|
||||
<cmd name="Open Scripts Folder"
|
||||
_label="_Open Scripts Folder"
|
||||
|
@ -94,17 +94,16 @@
|
|||
accel="*Control*o"
|
||||
pixtype="stock" pixname="gtk-open"
|
||||
verb="Open"/>
|
||||
<menuitem name="OpenAlternate"
|
||||
accel="*Control**Shift*o"
|
||||
verb="OpenAlternate"/>
|
||||
<submenu name="Open With"
|
||||
_label="Open Wit_h"
|
||||
_tip="Choose a program with which to open the selected item">
|
||||
<menuitem name="OpenAlternate"
|
||||
accel="*Control**Shift*o"
|
||||
verb="OpenAlternate"/>
|
||||
<separator/>
|
||||
<placeholder name="Applications Placeholder" delimit="none"/>
|
||||
<menuitem name="OtherApplication"
|
||||
verb="OtherApplication"/>
|
||||
<separator/>
|
||||
<separator name="Before Viewers"/>
|
||||
<placeholder name="Viewers Placeholder" delimit="none"/>
|
||||
<menuitem name="OtherViewer"
|
||||
verb="OtherViewer"/>
|
||||
|
@ -221,16 +220,15 @@
|
|||
<menuitem name="Open"
|
||||
pixtype="stock" pixname="gtk-open"
|
||||
verb="Open"/>
|
||||
<menuitem name="OpenAlternate"
|
||||
verb="OpenAlternate"/>
|
||||
<submenu name="Open With"
|
||||
_label="Open Wit_h"
|
||||
tearoff="0"
|
||||
_tip="Choose a program with which to open the selected item">
|
||||
<menuitem name="OpenAlternate"
|
||||
verb="OpenAlternate"/>
|
||||
<separator/>
|
||||
<placeholder name="Applications Placeholder" delimit="none"/>
|
||||
<menuitem name="OtherApplication" verb="OtherApplication"/>
|
||||
<separator/>
|
||||
<separator name="Before Viewers"/>
|
||||
<placeholder name="Viewers Placeholder" delimit="none"/>
|
||||
<menuitem name="OtherViewer" verb="OtherViewer"/>
|
||||
</submenu>
|
||||
|
|
|
@ -1233,7 +1233,8 @@ nautilus_navigation_window_set_sidebar_panels (NautilusNavigationWindow *window,
|
|||
|
||||
/* Create and load the panel. */
|
||||
sidebar_panel = nautilus_view_frame_new (NAUTILUS_WINDOW (window)->details->ui_container,
|
||||
NAUTILUS_WINDOW (window)->application->undo_manager);
|
||||
NAUTILUS_WINDOW (window)->application->undo_manager,
|
||||
NAUTILUS_WINDOW_GET_CLASS (window)->window_type);
|
||||
|
||||
eel_accessibility_set_name (sidebar_panel, _("Side Pane"));
|
||||
eel_accessibility_set_description
|
||||
|
@ -1453,6 +1454,8 @@ nautilus_navigation_window_show (GtkWidget *widget)
|
|||
static void
|
||||
nautilus_navigation_window_class_init (NautilusNavigationWindowClass *class)
|
||||
{
|
||||
NAUTILUS_WINDOW_CLASS (class)->window_type = Nautilus_WINDOW_NAVIGATION;
|
||||
|
||||
G_OBJECT_CLASS (class)->finalize = nautilus_navigation_window_finalize;
|
||||
GTK_OBJECT_CLASS (class)->destroy = nautilus_navigation_window_destroy;
|
||||
GTK_WIDGET_CLASS (class)->show = nautilus_navigation_window_show;
|
||||
|
|
|
@ -319,6 +319,8 @@ nautilus_spatial_window_instance_init (NautilusSpatialWindow *window)
|
|||
static void
|
||||
nautilus_spatial_window_class_init (NautilusSpatialWindowClass *class)
|
||||
{
|
||||
NAUTILUS_WINDOW_CLASS (class)->window_type = Nautilus_WINDOW_SPATIAL;
|
||||
|
||||
G_OBJECT_CLASS (class)->finalize = nautilus_spatial_window_finalize;
|
||||
GTK_OBJECT_CLASS (class)->destroy = nautilus_spatial_window_destroy;
|
||||
GTK_WIDGET_CLASS (class)->show = nautilus_spatial_window_show;
|
||||
|
|
|
@ -118,6 +118,8 @@ struct NautilusViewFrameDetails {
|
|||
gboolean has_min_zoom_level;
|
||||
gboolean has_max_zoom_level;
|
||||
GList *zoom_levels;
|
||||
|
||||
Nautilus_WindowType window_type;
|
||||
};
|
||||
|
||||
static void nautilus_view_frame_init (NautilusViewFrame *view);
|
||||
|
@ -451,7 +453,8 @@ view_frame_failed (NautilusViewFrame *view)
|
|||
|
||||
NautilusViewFrame *
|
||||
nautilus_view_frame_new (BonoboUIContainer *ui_container,
|
||||
NautilusUndoManager *undo_manager)
|
||||
NautilusUndoManager *undo_manager,
|
||||
Nautilus_WindowType window_type)
|
||||
{
|
||||
NautilusViewFrame *view_frame;
|
||||
|
||||
|
@ -460,6 +463,7 @@ nautilus_view_frame_new (BonoboUIContainer *ui_container,
|
|||
bonobo_object_ref (ui_container);
|
||||
view_frame->details->ui_container = ui_container;
|
||||
view_frame->details->undo_manager = undo_manager;
|
||||
view_frame->details->window_type = window_type;
|
||||
|
||||
return view_frame;
|
||||
}
|
||||
|
@ -522,7 +526,8 @@ zoom_level_changed_callback (BonoboZoomableFrame *zframe,
|
|||
enum {
|
||||
BONOBO_PROPERTY_TITLE,
|
||||
BONOBO_PROPERTY_HISTORY,
|
||||
BONOBO_PROPERTY_SELECTION
|
||||
BONOBO_PROPERTY_SELECTION,
|
||||
BONOBO_PROPERTY_WINDOW_TYPE,
|
||||
};
|
||||
|
||||
static Nautilus_History *
|
||||
|
@ -562,6 +567,12 @@ nautilus_view_frame_get_prop (BonoboPropertyBag *bag,
|
|||
g_warning ("NautilusViewFrame: selection fetch not yet implemented");
|
||||
break;
|
||||
|
||||
case BONOBO_PROPERTY_WINDOW_TYPE :
|
||||
BONOBO_ARG_SET_GENERAL (arg, view->details->window_type,
|
||||
TC_Nautilus_WindowType,
|
||||
Nautilus_WindowType,
|
||||
NULL);
|
||||
break;
|
||||
default:
|
||||
g_warning ("NautilusViewFrame: Unknown property idx %d", arg_id);
|
||||
break;
|
||||
|
@ -602,6 +613,15 @@ create_ambient_properties (NautilusViewFrame *view)
|
|||
_("the current selection"),
|
||||
BONOBO_PROPERTY_READABLE);
|
||||
|
||||
bonobo_property_bag_add
|
||||
(bag,
|
||||
"window-type",
|
||||
BONOBO_PROPERTY_WINDOW_TYPE,
|
||||
TC_Nautilus_WindowType,
|
||||
NULL,
|
||||
_("the type of window the view is embedded in"),
|
||||
BONOBO_PROPERTY_READABLE);
|
||||
|
||||
view->details->event_source = bag->es;
|
||||
|
||||
return bag;
|
||||
|
|
|
@ -96,7 +96,8 @@ typedef struct {
|
|||
/* basic view management */
|
||||
GType nautilus_view_frame_get_type (void);
|
||||
NautilusViewFrame *nautilus_view_frame_new (BonoboUIContainer *ui_container,
|
||||
NautilusUndoManager *undo_manager);
|
||||
NautilusUndoManager *undo_manager,
|
||||
Nautilus_WindowType window_type);
|
||||
Bonobo_Control nautilus_view_frame_get_control (NautilusViewFrame *view);
|
||||
|
||||
/* connecting to a Nautilus:View */
|
||||
|
|
|
@ -972,7 +972,8 @@ load_content_view (NautilusWindow *window,
|
|||
} else {
|
||||
/* create a new content view */
|
||||
view = nautilus_view_frame_new (window->details->ui_container,
|
||||
window->application->undo_manager);
|
||||
window->application->undo_manager,
|
||||
NAUTILUS_WINDOW_GET_CLASS (window)->window_type);
|
||||
|
||||
eel_accessibility_set_name (view, _("Content View"));
|
||||
eel_accessibility_set_description (view, _("View of the current file or folder"));
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type())
|
||||
#define NAUTILUS_WINDOW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindow))
|
||||
#define NAUTILUS_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_WINDOW, NautilusWindowClass))
|
||||
#define NAUTILUS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_WINDOW, NautilusWindowClass))
|
||||
#define NAUTILUS_IS_WINDOW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_WINDOW))
|
||||
#define NAUTILUS_IS_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_WINDOW))
|
||||
|
||||
|
@ -53,6 +54,8 @@ typedef struct NautilusWindow NautilusWindow;
|
|||
typedef struct {
|
||||
BonoboWindowClass parent_spot;
|
||||
|
||||
Nautilus_WindowType window_type;
|
||||
|
||||
/* Function pointers for overriding, without corresponding signals */
|
||||
|
||||
/* add_current_location_to_history_list is a function pointer that
|
||||
|
|
Loading…
Reference in a new issue