summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserwidget.c
Commit message (Collapse)AuthorAgeFilesLines
* filterchooser: Maintain filter combo visibilityMatthias Clasen2023-05-081-9/+7
| | | | | | This code broke when it was ported to listmodels since we always have a non-NULL lis model of filters. It can just be empty.
* filechooser: Plug a memory leakMatthias Clasen2023-04-271-0/+2
|
* filechooser: Plug a memory leakMatthias Clasen2023-04-271-0/+6
| | | | We own references to the columns. Drop them.
* filechooserwidget: Port to GtkSignalListItemFactoryCorey Berla2023-04-211-59/+172
| | | | | | | | | BuilderListItemFactory isn't quite suited for our purposes, primarily because you can't pass user data to BuilderListItemFactory. Because we can't get the data we are using a workaround to get the GtkFileChooserWidget ancestory, which used to work, but with the recent list view changes no longer doesn't. Use GtkSignalListItemFactory with the GtkFileChooserWidget as the user data.
* Revert "filechooser: Set date and time after cell is a child of ↵Corey Berla2023-04-211-6/+8
| | | | | | | | filechooserwidget" This reverts commit 2a70093a309481cf633086a5e8f0c8bc6d2c89f0. This fix was incomplete, the actual fix is to use signal factory.
* Revert "filechoosercell: Store type_format in filechoosercell"Corey Berla2023-04-211-12/+13
| | | | | | This reverts commit dd407dab000dc4de7d078c6270c93d303a1c18c6. This fix was incomplete, the actual fix is to use signal factory.
* filechooser: Set date and time after cell is a child of filechooserwidgetCorey Berla2023-04-101-8/+6
| | | | | | | | | | | The date/time column relies on the filechooserwidget to format the date properly. During bind, the filechoosercell, get the filechooserwidget ancestor, but now due to changes in the listview, the cell isn't a child of the filechooserwidget at that point. Since this is deeply ingrained into the filechooserwidget, let's keep the same behavior, but move it to filechoosercell in realize. Alternatively, we could have used a signal factory (with the file chooser widget as the user data), but that would have been a major overhaul.
* filechoosercell: Store type_format in filechoosercellCorey Berla2023-04-101-13/+12
| | | | | | | | | The format of the type column depends on the the type_format, which is stored in the filechooserwidget. We get that setting by looking for the filechooserwidget ancestor, which no longer works after recent changes to the list views (it was fragile to begin with). At one point, the setting appears to have been dynamic, but now it is only loading from GSettings, so let's simply do the same within FileChooserCell.
* filechooserwidget: Finish port to GtkColumnViewCellCorey Berla2023-04-101-18/+18
| | | | Some missing updates from f5dea9a3c217c49f44eedb18822be080d2451dc0
* filechooser: Set a row-factoryBenjamin Otte2023-04-011-1/+17
| | | | | This way, we can toggle per-row selectability and ensure files are not selectable in select-folder mode.
* Ensure GtkFileChooserCell's typeEmmanuele Bassi2023-03-221-0/+2
| | | | | | Otherwise anything that dlopen()'s GTK will have a bad day. See: https://discourse.gnome.org/t/strange-filechooserdialog-behaviour-in-gtk-4-10/14435
* Merge branch 'reverse-file-chooser-recent-files-sort-order' into 'main'Matthias Clasen2023-03-101-0/+4
|\ | | | | | | | | filerchooser: Show Recent files in inverse order See merge request GNOME/gtk!5625
| * filerchooser: Show Recent files in inverse orderRay Strode2023-03-091-0/+4
| | | | | | | | | | | | | | When looking at Recent files in the file chooser, it makes more sense to show the recent files on top. This commit flips the sort order for that case.
* | filechooser: Inform the model about selectabilityMatthias Clasen2023-03-101-2/+5
| | | | | | | | In folder modes, we don't want to select files.
* | Merge branch 'file-chooser-selection' into 'main'Matthias Clasen2023-03-101-1/+8
|\ \ | |/ |/| | | | | filechooser: Don't automatically select a file See merge request GNOME/gtk!5572
| * filechooser: Don't automatically select a filerobxnano2023-03-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | When the folder changes, do not select the first item in the list, so if the user enters a folder and then clicks the accept button, the current folder is returned instead of the selected one. To maintain consistency with the previous implementation, when a folder in the path bar is clicked the previously-entered folder is selected, and when the file chooser is in open file mode the first item is always selected. See #5438
* | filechooser: Do not look up parents of directoriesBarnabás Pőcze2023-03-081-9/+18
| | | | | | | | | | | | | | | | | | | | | | If the `GtkRecentInfo` represents a directory, simply use it, and do not try to find its parent in `_gtk_file_chooser_extract_recent_folders()`. For example, there is an entry in my recently-used database from the Amberol music player about the folder I have opened with it, but the folder is not listed on the "Recent" tab of the file chooser widget, only its parent. After this change, the directory itself is shown.
* | filechooser: Use gtk_recent_info_is_local() for filteringBarnabás Pőcze2023-03-081-5/+3
| | | | | | | | | | There is already a function for determining if URI has the "file" scheme, so use that.
* | Merge branch 'ebassi/issue-5650' into 'main'Matthias Clasen2023-03-081-0/+7
|\ \ | | | | | | | | | | | | | | | | | | Filter recently used files in the file chooser Closes #5650 See merge request GNOME/gtk!5618
| * | Filter recently used files in the file chooserEmmanuele Bassi2023-03-081-0/+7
| | | | | | | | | | | | | | | | | | | | | Since it's a file selection widget, we should only list recently used files that point to a file. Fixes: #5650
* | | gtkfilechooser: Keep GtkSearchEngine around for longerCarlos Garnacho2023-03-081-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the GtkSearchEngine is torn down every time the search is stopped, which also means between typed characters. This prevents any of the optimizations that the GtkSearchEngine can do in the long run. Let the GtkSearchEngine stay around for longer, and only be disposed after search is cancelled, the filechooser moves onto a different mode than search, or is otherwise unmapped/disposed. While at it, remove an unused struct field.
* | | filechooser: Fix memory leaksBarnabás Pőcze2023-03-081-2/+7
| | | | | | | | | | | | The returned strings from `file_chooser_get_location()` were never freed.
* | | filechooser: Handle pathless filesMatthias Clasen2023-03-071-0/+3
|/ / | | | | | | | | | | | | g_file_get_path() can return NULL. Make our getter for file locations handle that case. Related: !5610
* | Check for attributes being available before querying themEmmanuele Bassi2023-03-041-2/+5
|/ | | | | | | | | GLib 2.75 started checking if a GFileInfo was created with the attribute we're querying, instead of failing silently and leaving us in an inconsistent state. Turns out that GtkFileChooserWidget, GtkFileSystemModel, and GtkPathBar trip the newly introduced check.
* Drop some unnecessary includesMatthias Clasen2023-02-181-5/+0
|
* Use a Gtk prefix for dbus-generated codeMatthias Clasen2023-02-051-1/+1
| | | | | | | Copying this file from GIO without renaming it was not the greatest idea in retrospect. Fixes: #5572
* filechooser: Fix context menusMatthias Clasen2023-02-031-8/+13
| | | | | | | We only want to show the file list context menu when we are over the file list. Fixes: #5554
* filechooserwidget: Fix file chooser crash when dropping empty file listFina Wilke2023-01-301-0/+3
|
* filesystemmodel: Rename private headerMatthias Clasen2023-01-071-1/+1
|
* filechooser: Don't assert for possible casesMatthias Clasen2023-01-051-8/+22
| | | | | | | | | switch_to_selected_folder can be called when the selection contains more than one item. Handle it like it used to be handled: switch to the first folder we find. Fixes: #5494
* alertdialog: Bring the GError backBenjamin Otte2022-12-241-6/+6
| | | | | Make sure we have a GError, so that dismissing and cancelling can be separated.
* GtkFileChooser: Tweak Grid View & List View button tooltipssunflowerskater2022-12-171-2/+2
| | | | | | The tooltips from the Grid View & List View buttons are unnecessarily long and look different from the tooltips used in Nautilus. This commit makes the tooltips to be consistent with Nautilus and, consequently, makes them shorter.
* Merge branch 'gbsneto/filechooser-grid-view' into 'main'Georges Basile Stavracas Neto2022-12-141-31/+146
|\ | | | | | | | | | | | | Add GtkGridView to the filechooser Closes #233 See merge request GNOME/gtk!5163
| * filechooserwidget: Don't check operation mode for tooltipGeorges Basile Stavracas Neto2022-12-131-9/+0
| | | | | | | | | | There's no way this could ever have been correct. We always want to show the tooltip, and it's basically always available.
| * filechooserwidget: Show pathbar in recent modeGeorges Basile Stavracas Neto2022-12-131-1/+2
| | | | | | | | As per design direction, show the pathbar in recent mode.
| * filechooserwidget: Hide ColumnView settings in GridViewCorey Berla2022-12-131-0/+6
| |
| * filechooser: Save and restore view typeMatthias Clasen2022-12-131-0/+5
| | | | | | | | | | | | With this, the filechooser comes up with the same view (grid or list) that it had the last time you used it.
| * filechooserwidget: Rename callbackGeorges Basile Stavracas Neto2022-12-131-7/+9
| | | | | | | | It's shared between both column and grid views now.
| * filechooserwidget: Implement 'keynav-failed' for grid viewGeorges Basile Stavracas Neto2022-12-131-4/+4
| | | | | | | | | | It's exactly the same as of the column view. Since we're sharing the callback now, rename it to browse_files_view_keynav_failed_cb.
| * filechooserwidget: Use correct view in various placesGeorges Basile Stavracas Neto2022-12-131-9/+28
| | | | | | | | | | | | Most of the pointer comparisons against 'browse_files_column_view' should actually be performed against the current view widget. As it turns out, it weren't that many places after all.
| * filechooserwidget: Add a grid viewGeorges Basile Stavracas Neto2022-12-131-1/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a grid view outside of the widgetry tree. The grid view mimics the column view using bindings, so we only need to manage the column view. Also add a button in the path bar section to toggle the view. This is handled as a new 'toggle-view' action in the file chooser. The way switching between views currently work is by setting either the column or grid view as the child of the GtkScrolledWindow. This has the benefit of unmapping the unused view, which is nice and can avoid some tricky situations with thumbnails. Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/233
* | gtk: Update all callersMatthias Clasen2022-12-131-2/+2
| |
* | gtk: Stop using gtk_show_uriMatthias Clasen2022-12-091-59/+5
|/ | | | | Replace all uses of gtk_show_uri with GtkFileLauncher.
* openuriportal: Support OpenDirectoryMatthias Clasen2022-12-091-1/+1
| | | | This required an extra argument. Update all callers.
* filechooserwidget: FixesMatthias Clasen2022-12-091-13/+13
| | | | Fix a memory leak in the file manager launch path.
* gtk: Stop using gtk_widget_show/hideMatthias Clasen2022-11-281-13/+9
| | | | | | | gtk_widget_set_visible and gtk_window_present are better alternatives, and calling gtk_widget_show on newly created widgets is no longer necessary anyway.
* filechooser: Fix gtk_file_chooser_set_choice againrobxnano2022-11-161-6/+3
| | | | | If the choice was in the form of a GtkDropDown, the code failed to find the widget and so the choice never got set. Fixes #5346.
* Deprecate GtkFileChooser and implementationsMatthias Clasen2022-10-291-3/+9
| | | | | | | | | These are being replaced by GtkFileDialog. This commit only moves the headers for GtkFileChooserWidget and GtkFileChooserDialog to deprecated/, and keeps the implementations in gtk/, since they will eventually be salvaged into a private GtkFileChooserWindow.
* gtk: Port to async dialog APIMatthias Clasen2022-10-291-88/+41
|
* g-i: Add missing since annotationBilal Elmoussaoui2022-10-271-0/+7
|