PlacesSidebar
Object Hierarchy:
Description:
public sealed class PlacesSidebar : ScrolledWindow, Implementor, Buildable
PlacesSidebar is a widget that displays a list of frequently-used places in the file system: the user’s home directory, the user’s bookmarks, and volumes and drives.
This widget is used as a sidebar in FileChooser and may be used by file managers and similar programs.
The places sidebar displays drives and volumes, and will automatically mount or unmount them when the user selects them.
Applications can hook to various signals in the places sidebar to customize its behavior. For example, they can add extra commands to the context menu of the sidebar.
While bookmarks are completely in control of the user, the places sidebar also allows individual applications to provide extra shortcut folders that are unique to each application. For example, a Paint program may want to add a shortcut for a Clipart folder. You can do this with add_shortcut.
To make use of the places sidebar, an application at least needs to connect to the open_location signal. This is emitted when the user selects in the sidebar a location to open. The application should also call set_location when it changes the currently-viewed location.
CSS nodes
GtkPlacesSidebar uses a single CSS node with name placessidebar and style class .sidebar.
Among the children of the places sidebar, the following style classes can be used: - .sidebar-new-bookmark-row for the 'Add new bookmark' row - .sidebar-placeholder-row for a row that is a placeholder - .has-open-popup when a popup is open for a row
Content:
Properties:
- public bool local_only { get; set; }
- public File location { owned get; set; }
- public PlacesOpenFlags open_flags { get; set; }
- public bool populate_all { get; set; }
If populate_all is true, the populate_popup signal is also emitted for popovers.
- public bool show_connect_to_server { get; set; }
- public bool show_desktop { get; set; }
- public bool show_enter_location { get; set; }
- public bool show_other_locations { get; set; }
- public bool show_recent { get; set; }
- public bool show_starred_location { get; set; }
- public bool show_trash { get; set; }
Creation methods:
- public PlacesSidebar ()
Creates a new PlacesSidebar widget.
Methods:
- public void add_shortcut (File location)
Applications may want to present some folders in the places sidebar if they could be immediately useful to users.
- public bool get_local_only ()
Returns the value previously set with set_local_only.
- public File? get_location ()
Gets the currently selected location in the this .
- public File? get_nth_bookmark (int n)
This function queries the bookmarks added by the user to the places sidebar, and returns one of them.
- public PlacesOpenFlags get_open_flags ()
Gets the open flags.
- public bool get_show_connect_to_server ()
Returns the value previously set with set_show_connect_to_server
- public bool get_show_desktop ()
Returns the value previously set with set_show_desktop
- public bool get_show_enter_location ()
Returns the value previously set with set_show_enter_location
- public bool get_show_other_locations ()
Returns the value previously set with set_show_other_locations
- public bool get_show_recent ()
Returns the value previously set with set_show_recent
- public bool get_show_starred_location ()
Returns the value previously set with set_show_starred_location
- public bool get_show_trash ()
Returns the value previously set with set_show_trash
- public SList<File> list_shortcuts ()
Gets the list of shortcuts.
- public void remove_shortcut (File location)
Removes an application-specific shortcut that has been previously been inserted with add_shortcut.
- public void set_drop_targets_visible (bool visible, DragContext context)
Make the GtkPlacesSidebar show drop targets, so it can show the available drop targets and a "new bookmark" row.
- public void set_local_only (bool local_only)
Sets whether the this should only show local files.
- public void set_location (File? location)
Sets the location that is being shown in the widgets surrounding the this, for example, in a folder view in a file manager.
- public void set_open_flags (PlacesOpenFlags flags)
Sets the way in which the calling application can open new locations from the places sidebar.
- public void set_show_connect_to_server (bool show_connect_to_server)
Sets whether the this should show an item for connecting to a network server; this is off by default.
- public void set_show_desktop (bool show_desktop)
Sets whether the this should show an item for the Desktop folder.
- public void set_show_enter_location (bool show_enter_location)
Sets whether the this should show an item for entering a location; this is off by default.
- public void set_show_other_locations (bool show_other_locations)
Sets whether the this should show an item for the application to show an Other Locations view; this is off by default.
- public void set_show_recent (bool show_recent)
Sets whether the this should show an item for recent files.
- public void set_show_starred_location (bool show_starred_location)
If you enable this, you should connect to the on_show_starred_location signal.
- public void set_show_trash (bool show_trash)
Sets whether the this should show an item for the Trash location.
Signals:
- public signal int drag_action_ask (int actions)
The places sidebar emits this signal when it needs to ask the application to pop up a menu to ask the user for which drag action to perform.
- public signal int drag_action_requested (DragContext context, File dest_file, List<File> source_file_list)
When the user starts a drag-and-drop operation and the sidebar needs to ask the application for which drag action to perform, then the sidebar will emit this signal.
- public signal void drag_perform_drop (File dest_file, List<File> source_file_list, int action)
The places sidebar emits this signal when the user completes a drag-and-drop operation and one of the sidebar's items is the destination.
- public signal void mount (MountOperation mount_operation)
The places sidebar emits this signal when it starts a new operation because the user clicked on some location that needs mounting.
- public signal void on_show_connect_to_server ()
The places sidebar emits this signal when it needs the calling application to present an way to connect directly to a network server.
- public signal void on_show_enter_location ()
The places sidebar emits this signal when it needs the calling application to present an way to directly enter a location.
- public signal void on_show_starred_location (PlacesOpenFlags open_flags)
The places sidebar emits this signal when it needs the calling application to present a way to show the starred files.
- public signal void open_location (File location, PlacesOpenFlags open_flags)
The places sidebar emits this signal when the user selects a location in it.
- public signal void populate_popup (Widget container, File? selected_item, Volume? selected_volume)
The places sidebar emits this signal when the user invokes a contextual popup on one of its items.
- public signal void show_error_message (string primary, string secondary)
The places sidebar emits this signal when it needs the calling application to present an error message.
- public signal void show_other_locations_requested ()
The places sidebar emits this signal when it needs the calling application to present a way to show other locations e.
- public signal void show_other_locations_with_flags (PlacesOpenFlags open_flags)
The places sidebar emits this signal when it needs the calling application to present a way to show other locations e.
- public signal void unmount (MountOperation mount_operation)
The places sidebar emits this signal when it starts a new operation because the user for example ejected some drive or unmounted a mount.
Inherited Members:
- add_with_viewport
- edge_overshot
- edge_reached
- get_capture_button_press
- get_hadjustment
- get_hscrollbar
- get_kinetic_scrolling
- get_max_content_height
- get_max_content_width
- get_min_content_height
- get_min_content_width
- get_overlay_scrolling
- get_placement
- get_policy
- get_propagate_natural_height
- get_propagate_natural_width
- get_shadow_type
- get_vadjustment
- get_vscrollbar
- hadjustment
- hscrollbar_policy
- kinetic_scrolling
- max_content_height
- max_content_width
- min_content_height
- min_content_width
- move_focus_out
- overlay_scrolling
- propagate_natural_height
- propagate_natural_width
- scroll_child
- set_capture_button_press
- set_hadjustment
- set_kinetic_scrolling
- set_max_content_height
- set_max_content_width
- set_min_content_height
- set_min_content_width
- set_overlay_scrolling
- set_placement
- set_policy
- set_propagate_natural_height
- set_propagate_natural_width
- set_shadow_type
- set_vadjustment
- shadow_type
- unset_placement
- vadjustment
- vscrollbar_policy
- window_placement
- window_placement_set
- accel_closures_changed
- activate
- add_accelerator
- add_device_events
- add_events
- add_mnemonic_label
- add_tick_callback
- adjust_baseline_allocation
- adjust_baseline_request
- adjust_size_allocation
- adjust_size_request
- app_paintable
- bind_template_callback_full
- bind_template_child_full
- button_press_event
- button_release_event
- can_activate_accel
- can_default
- can_focus
- child_focus
- child_notify
- class_path
- composite_child
- composited_changed
- compute_expand
- compute_expand_internal
- configure_event
- create_pango_context
- create_pango_layout
- damage_event
- delete_event
- destroy
- destroy_event
- destroyed
- device_is_shadowed
- direction_changed
- dispatch_child_properties_changed
- double_buffered
- drag_begin
- drag_data_delete
- drag_data_get
- drag_data_received
- drag_drop
- drag_end
- drag_failed
- drag_leave
- drag_motion
- draw
- draw_to_cairo_context
- ensure_style
- enter_notify_event
- error_bell
- event
- event_after
- events
- expand
- find_style_property
- focus
- focus_in_event
- focus_on_click
- focus_out_event
- freeze_child_notify
- get_accessible
- get_action_group
- get_allocated_baseline
- get_allocated_height
- get_allocated_size
- get_allocated_width
- get_allocation
- get_ancestor
- get_app_paintable
- get_can_default
- get_can_focus
- get_child_requisition
- get_child_visible
- get_clip
- get_clipboard
- get_composite_name
- get_css_name
- get_default_direction
- get_default_style
- get_device_enabled
- get_device_events
- get_direction
- get_display
- get_double_buffered
- get_events
- get_focus_on_click
- get_font_map
- get_font_options
- get_frame_clock
- get_halign
- get_has_tooltip
- get_has_window
- get_hexpand
- get_hexpand_set
- get_mapped
- get_margin_bottom
- get_margin_end
- get_margin_left
- get_margin_right
- get_margin_start
- get_margin_top
- get_modifier_mask
- get_modifier_style
- get_no_show_all
- get_opacity
- get_pango_context
- get_parent
- get_parent_window
- get_path
- get_pointer
- get_preferred_height
- get_preferred_height_and_baseline_for_width
- get_preferred_height_for_width
- get_preferred_height_for_width_internal
- get_preferred_height_internal
- get_preferred_size
- get_preferred_width
- get_preferred_width_for_height
- get_preferred_width_for_height_internal
- get_preferred_width_internal
- get_realized
- get_receives_default
- get_request_mode
- get_requisition
- get_root_window
- get_scale_factor
- get_screen
- get_sensitive
- get_settings
- get_size_request
- get_state
- get_state_flags
- get_style
- get_style_context
- get_support_multidevice
- get_template_child
- get_tooltip_markup
- get_tooltip_text
- get_tooltip_window
- get_toplevel
- get_valign
- get_valign_with_baseline
- get_vexpand
- get_vexpand_set
- get_visible
- get_visual
- get_window
- grab_broken_event
- grab_default
- grab_focus
- grab_notify
- halign
- has_default
- has_focus
- has_grab
- has_rc_style
- has_screen
- has_tooltip
- has_visible_focus
- height_request
- hexpand
- hexpand_set
- hide
- hide_on_delete
- hierarchy_changed
- in_destruction
- init_template
- input_shape_combine_region
- insert_action_group
- install_style_property
- install_style_property_parser
- intersect
- is_ancestor
- is_composited
- is_drawable
- is_focus
- is_sensitive
- is_toplevel
- is_visible
- key_press_event
- key_release_event
- keynav_failed
- leave_notify_event
- list_accel_closures
- list_action_prefixes
- list_mnemonic_labels
- list_style_properties
- map
- map_event
- margin
- margin_bottom
- margin_end
- margin_left
- margin_right
- margin_start
- margin_top
- mnemonic_activate
- modify_base
- modify_bg
- modify_cursor
- modify_fg
- modify_font
- modify_style
- modify_text
- motion_notify_event
- move_focus
- name
- no_show_all
- opacity
- override_background_color
- override_color
- override_cursor
- override_font
- override_symbolic_color
- parent
- parent_set
- path
- pop_composite_child
- popup_menu
- property_notify_event
- proximity_in_event
- proximity_out_event
- push_composite_child
- query_tooltip
- queue_allocate
- queue_compute_expand
- queue_draw
- queue_draw_area
- queue_draw_region
- queue_resize
- queue_resize_no_redraw
- realize
- receives_default
- region_intersect
- register_window
- remove_accelerator
- remove_mnemonic_label
- remove_tick_callback
- render_icon
- render_icon_pixbuf
- reparent
- reset_rc_styles
- reset_style
- scale_factor
- screen_changed
- scroll_event
- selection_clear_event
- selection_get
- selection_notify_event
- selection_received
- selection_request_event
- send_expose
- send_focus_change
- sensitive
- set_accel_path
- set_accessible_role
- set_accessible_type
- set_allocation
- set_app_paintable
- set_can_default
- set_can_focus
- set_child_visible
- set_clip
- set_composite_name
- set_connect_func
- set_css_name
- set_default_direction
- set_device_enabled
- set_device_events
- set_direction
- set_double_buffered
- set_events
- set_focus_on_click
- set_font_map
- set_font_options
- set_halign
- set_has_tooltip
- set_has_window
- set_hexpand
- set_hexpand_set
- set_mapped
- set_margin_bottom
- set_margin_end
- set_margin_left
- set_margin_right
- set_margin_start
- set_margin_top
- set_no_show_all
- set_opacity
- set_parent
- set_parent_window
- set_realized
- set_receives_default
- set_redraw_on_allocate
- set_sensitive
- set_size_request
- set_state
- set_state_flags
- set_style
- set_support_multidevice
- set_template
- set_template_from_resource
- set_tooltip_markup
- set_tooltip_text
- set_tooltip_window
- set_valign
- set_vexpand
- set_vexpand_set
- set_visible
- set_visual
- set_window
- shape_combine_region
- show
- show_all
- show_help
- show_now
- size_allocate
- size_allocate_with_baseline
- size_request
- state_changed
- state_flags_changed
- style
- style_attach
- style_get
- style_get_property
- style_get_valist
- style_set
- style_updated
- thaw_child_notify
- tooltip_markup
- tooltip_text
- touch_event
- translate_coordinates
- trigger_tooltip_query
- unmap
- unmap_event
- unparent
- unrealize
- unregister_window
- unset_state_flags
- valign
- vexpand
- vexpand_set
- visibility_notify_event
- visible
- width_request
- window_state_event