Package: gtk
Class gtk-places-sidebar
Superclassesgtk-scrolled-window, gtk-bin, gtk-container, gtk-widget, gtk-buildable, g-object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk-places-sidebar 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 the gtk-file-chooser interface 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 the function gtk-places-sidebar-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 the function gtk-places-sidebar-location when it changes the currently-viewed location. CSS nodesAmong the children of the places sidebar, the following style classes can be used:
Signal DetailsThe "drag-action-ask" signallambda (sidebar actions) : Run LastThe 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.
The "drag-action-requested" signallambda (sidebar context dest-file source-file-list) : Run LastWhen 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. The application can evaluate the context for customary actions, or it can check the type of the files indicated by source-file-list against the possible actions for the destination dest-file. The drag action to use must be the return value of the signal handler.
The "drag-perform-drop" signallambda (sidebar dest-file source-file-list action) : Run FirstThe places sidebar emits this signal when the user completes a drag and drop operation and one of the sidebar's items is the destination. This item is in the dest-file, and the source-file-list has the list of files that are dropped into it and which should be
The "mount" signallambda (sidebar mount-operation) : Run FirstThe places sidebar emits this signal when it starts a new operation because the user clicked on some location that needs mounting. In this way the application using the gtk-places-sidebar can track the progress of the operation and, for example, show a notification. Since 3.20
The "open-location" signallambda (sidebar location open-flags) : Run FirstThe places sidebar emits this signal when the user selects a location in it. The calling application should display the contents of that location; for example, a file manager should show a list of files in the specified location.
The "populate-popup" signallambda (sidebar container selected-item selected-volume) : Run FirstThe places sidebar emits this signal when the user invokes a contextual popup on one of its items. In the signal handler, the application may add extra items to the menu as appropriate. For example, a file manager may want to add a "Properties" command to the menu. It is not necessary to store the selected-item for each menu item; during their callbacks, the application can use the function gtk-places-sidebar-location to get the file to which the item refers. The selected-item argument may be nil in case the selection refers to a volume. In this case, selected-volume will be non-nil. In this case, the calling application will have to the function g-object-ref the selected-volume and keep it around to use it in the callback. The container and all its contents are destroyed after the user dismisses the popup. The popup is re-created, and thus, this signal is emitted, every time the user activates the contextual menu. Before 3.18, the container always was a gtk-menu, and you were expected to add your items as gtk-menu-item objects. Since 3.18, the popup may be implemented as a gtk-popover, in which case container will be something else, e.g. a gtk-box, to which you may add gtk-model-button widgets or other widgets, such as gtk-entry, gtk-spin-button widgets, etc. If your application can deal with this situation, you can set populate-all to true to request that this signal is emitted for populating popovers as well.
The "show-connect-to-server" signallambda (sidebar) : Run FirstThe places sidebar emits this signal when it needs the calling application to present an way to connect directly to a network server. For example, the application may bring up a dialog box asking for a URL like "sftp://ftp.example.com". It is up to the application to create the corresponding mount by using, for example, g_file_mount_enclosing_volume(). Warning: The "show-connect-to-server" signal has been deprecated since version 3.18 and should not be used in newly written code. Use the "show-other-locations" signal to connect to network servers.
The "show-enter-location" signallambda (sidebar) : Run FirstThe places sidebar emits this signal when it needs the calling application to present an way to directly enter a location. For example, the application may bring up a dialog box asking for a URL like "http://http.example.com".
The "show-error-message" signallambda (sidebar primary secondary) : Run FirstThe places sidebar emits this signal when it needs the calling application to present an error message. Most of these messages refer to mounting or unmounting media, for example, when a drive cannot be started for some reason.
The "show-other-locations" signallambda (sidebar) : Run FirstThe places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g. drives and network access points. For example, the application may bring up a page showing persistent volumes and discovered network addresses. Since 3.18 Warning: The "show-other-locations" signal has been deprecated since version 3.20 and should not be used in newly written code. Use the "show-other-locations-with-flags" signal which includes the open flags in order to allow the user to specify to open in a new tab or window, in a similar way than the "open-location" signal.
The "show-other-locations-with-flags" signallambda (sidebar open-flags) : Run FirstThe places sidebar emits this signal when it needs the calling application to present a way to show other locations e.g. drives and network access points. For example, the application may bring up a page showing persistent volumes and discovered network addresses. Since 3.20
The "show-starred-location" signallambda (sidebar open-flags) : Run FirstThe places sidebar emits this signal when it needs the calling application to present a way to show the starred files. In GNOME, starred files are implemented by setting the nao:predefined-tag-favorite tag in the tracker database. Since 3.22
The "unmount" signallambda (sidebar mount-operation) : Run FirstThe places sidebar emits this signal when it starts a new operation because the user for example ejected some drive or unmounted a mount. In this way the application using the gtk-places-sidebar can track the progress of the operation and, for example, show a notification. Since 3.20
| Inherited Slot Access FunctionsSee also |
2020-6-6