Class: Gtk::PlacesSidebar

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#add_shortcut(location) ⇒ nil

Applications may want to present some folders in the places sidebar if they could be immediately useful to users. For example, a drawing program could add a “/usr/share/clipart” location when the sidebar is being used in an “Insert Clipart” dialog box.

This function adds the specified location to a special place for immutable shortcuts. The shortcuts are application-specific; they are not shared across applications, and they are not persistent. If this function is called multiple times with different locations, then they are added to the sidebar’s list in the same order as the function is called.

Parameters:

  • location (Gio::File)

    location to add as an application-specific shortcut

Returns:

  • (nil)

#get_nth_bookmark(n) ⇒ Gio::File

This function queries the bookmarks added by the user to the places sidebar, and returns one of them. This function is used by Gtk::FileChooser to implement the “Alt-1”, “Alt-2”, etc. shortcuts, which activate the cooresponding bookmark. nil if no such index exist. Note that the indices start at 0, even though the file chooser starts them with the keyboard shortcut “Alt-1”.

Parameters:

  • n (Integer)

    index of the bookmark to query

Returns:

  • (Gio::File)

    The bookmark specified by the index n, or

#list_shortcutsGLib::SList

Gets the list of shortcuts.

Returns:

  • (GLib::SList)

    A #GSList of #GFile of the locations that have been added as application-specific shortcuts with gtk_places_sidebar_add_shortcut(). To free this list, you can use

    g_slist_free_full (list, (GDestroyNotify) g_object_unref);

#local_onlyTrueClass

Returns the value previously set with gtk_places_sidebar_set_local_only().

Returns:

  • (TrueClass)

    true if the sidebar will only show local files.

#local_only=(local_only) ⇒ TrueClass

Parameters:

  • local_only (TrueClass)

Returns:

  • (TrueClass)

    local-only

  • (TrueClass)

    local-only

#local_only?TrueClass

Returns local-only.

Returns:

  • (TrueClass)

    local-only

#locationGio::File

Returns location.

Returns:

#location=(location) ⇒ Gio::File

Parameters:

Returns:

#newGtk::Widget

Creates a new Gtk::PlacesSidebar widget.

The application should connect to at least the Gtk::PlacesSidebar::open-location signal to be notified when the user makes a selection in the sidebar.

Returns:

#open_flagsGtk::PlacesOpenFlags

Returns open-flags.

Returns:

#open_flags=(open_flags) ⇒ Gtk::PlacesOpenFlags

Parameters:

Returns:

#populate_all=(populate_all) ⇒ TrueClass

If :populate-all is true, the Gtk::PlacesSidebar::populate-popup signal is also emitted for popovers.

Parameters:

  • populate_all (TrueClass)

Returns:

  • (TrueClass)

    populate-all

  • (TrueClass)

    populate-all

#populate_all?TrueClass

If :populate-all is true, the Gtk::PlacesSidebar::populate-popup signal is also emitted for popovers.

Returns:

  • (TrueClass)

    populate-all

#remove_shortcut(location) ⇒ nil

Removes an application-specific shortcut that has been previously been inserted with gtk_places_sidebar_add_shortcut(). If the location is not a shortcut in the sidebar, then nothing is done.

Parameters:

  • location (Gio::File)

    location to remove

Returns:

  • (nil)

#set_drop_targets_visible(visible, context) ⇒ nil

Make the GtkPlacesSidebar show drop targets, so it can show the available drop targets and a “new bookmark” row. This improves the Drag-and-Drop experience of the user and allows applications to show all available drop targets at once.

This needs to be called when the application is aware of an ongoing drag that might target the sidebar. The drop-targets-visible state will be unset automatically if the drag finishes in the GtkPlacesSidebar. You only need to unset the state when the drag ends on some other widget on your application.

Parameters:

  • visible (TrueClass)

    whether to show the valid targets or not.

  • context (Gdk::DragContext)

    drag context used to ask the source about the action that wants to perform, so hints are more accurate.

Returns:

  • (nil)

#show_connect_to_serverTrueClass

Returns the value previously set with gtk_places_sidebar_set_show_connect_to_server()

Returns:

  • (TrueClass)

    true if the sidebar will display a “Connect to Server” item.

#show_connect_to_server=(show_connect_to_server) ⇒ TrueClass

Parameters:

  • show_connect_to_server (TrueClass)

Returns:

  • (TrueClass)

    show-connect-to-server

  • (TrueClass)

    show-connect-to-server

#show_connect_to_server?TrueClass

Returns show-connect-to-server.

Returns:

  • (TrueClass)

    show-connect-to-server

#show_desktopTrueClass

Returns the value previously set with gtk_places_sidebar_set_show_desktop()

Returns:

  • (TrueClass)

    true if the sidebar will display a builtin shortcut to the desktop folder.

#show_desktop=(show_desktop) ⇒ TrueClass

Parameters:

  • show_desktop (TrueClass)

Returns:

  • (TrueClass)

    show-desktop

  • (TrueClass)

    show-desktop

#show_desktop?TrueClass

Returns show-desktop.

Returns:

  • (TrueClass)

    show-desktop

#show_enter_locationTrueClass

Returns the value previously set with gtk_places_sidebar_set_show_enter_location()

Returns:

  • (TrueClass)

    true if the sidebar will display an “Enter Location” item.

#show_enter_location=(show_enter_location) ⇒ TrueClass

Parameters:

  • show_enter_location (TrueClass)

Returns:

  • (TrueClass)

    show-enter-location

  • (TrueClass)

    show-enter-location

#show_enter_location?TrueClass

Returns show-enter-location.

Returns:

  • (TrueClass)

    show-enter-location

#show_other_locationsTrueClass

Returns the value previously set with gtk_places_sidebar_set_show_other_locations()

Returns:

  • (TrueClass)

    true if the sidebar will display an “Other Locations” item.

#show_other_locations=(show_other_locations) ⇒ TrueClass

Parameters:

  • show_other_locations (TrueClass)

Returns:

  • (TrueClass)

    show-other-locations

  • (TrueClass)

    show-other-locations

#show_other_locations?TrueClass

Returns show-other-locations.

Returns:

  • (TrueClass)

    show-other-locations

#show_recentTrueClass

Returns the value previously set with gtk_places_sidebar_set_show_recent()

Returns:

  • (TrueClass)

    true if the sidebar will display a builtin shortcut for recent files

#show_recent=(show_recent) ⇒ TrueClass

Parameters:

  • show_recent (TrueClass)

Returns:

  • (TrueClass)

    show-recent

  • (TrueClass)

    show-recent

#show_recent?TrueClass

Returns show-recent.

Returns:

  • (TrueClass)

    show-recent

#show_starred_locationTrueClass

Returns the value previously set with gtk_places_sidebar_set_show_starred_location()

Returns:

  • (TrueClass)

    true if the sidebar will display a Starred item.

#show_starred_location=(show_starred_location) ⇒ TrueClass

Parameters:

  • show_starred_location (TrueClass)

Returns:

  • (TrueClass)

    show-starred-location

  • (TrueClass)

    show-starred-location

#show_starred_location?TrueClass

Returns show-starred-location.

Returns:

  • (TrueClass)

    show-starred-location

#show_trashTrueClass

Returns the value previously set with gtk_places_sidebar_set_show_trash()

Returns:

  • (TrueClass)

    true if the sidebar will display a “Trash” item.

#show_trash=(show_trash) ⇒ TrueClass

Parameters:

  • show_trash (TrueClass)

Returns:

  • (TrueClass)

    show-trash

  • (TrueClass)

    show-trash

#show_trash?TrueClass

Returns show-trash.

Returns:

  • (TrueClass)

    show-trash