When switching view mode from list to grid, the grid view may set its view model sorter before the list view has been disposed.
If this happens and dispose runs, we would have cleared the grid view model sorter and file ordering would break upon reload.
Keep track of the sorter created in list-view and check if the sorter belongs to us before clearing it to NULL.
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/3383
AdwButtonRow is a new widget to present actions at the end of a
boxed list. Requires a bump of libadwaita dependency to v1.6.alpha.
Also, add a mnemonic to this button row.
Unlike other preferences change callbacks, it doesn't do anything other
than asking to updating the cached setting value.
Also, it has an unamed and unused `gpointer` parameter, which is unusual.
This function used to be unnecessarily long and complex, so it has been
simplified by commit e3052ab1c8
However, now it's too cryptic/obfuscated. This is partly dues to the
clash between boolean logic (`0` being FALSE) and the requirements of
g_list_find_custom() (`0` being a positive match). And partly because
of nested ternary operator, dereferencing a union, and unfortunate
naming (`callback` having double meaning).
To make the code easily readable and auditable by humans, let's break
up the comparisons and use explicit return value literals.
This partially reverts commit c5216c47da
G_DIR_SEPARATOR_S exists primarily as convenience to make GLib-based
code portable to Microsoft Windows, which is not relevant to this app.
We can still use it anyway when we want to be clear that a slash is
being used as a dir separator.
The root directory's path is "/". While that's the exact same character
as a directory separator, its meaning is completely different.
This reverts commit ba665f5371.
NautilusFilesView should be agnostic to the inner widgetry. So,
it should not be GtkListItemWidget|listitem.select action.
Also, moving this whole function is not necessary. The true cause of
the bug[0] was that NautilusFilesView was not forwarding the focus
event its child. Which turned out to be an AdwBin bug. Good news is
this bug has been fixed in libadwaita main[1] and stable[2] branches.
So let's revert this workaround.
[0] https://gitlab.gnome.org/GNOME/nautilus/-/issues/3354
[1] 0e30d48f66
[2] 9962168906
This is a follow-up to commit 1206af7d12
It fixed a bug where we were validating but not accepting the filename.
try_accept() and validate() do almost the same job except the first also emits
::name-accepted if valid, or, if duplicate, shows feedback without delay.
The 'go-up' and 'go-down' icons in the batch rename dialog do not seem to have any tooltips.
> Tooltips can be set for any UI element. They are primarily used to convey additional information about what controls (often icon buttons) do, but can also be used to show additional information about app content.
More information: https://developer.gnome.org/hig/patterns/feedback/tooltips.html
Cleanup ui layout via using AdwActionRow with .property style class
instead of adding GtkLabels for file attributes values.
Note: Long file paths (parent folder, link target, original folder)
become multiline.
Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/3183
The mime type x-directory/smb-share is not used by any current programs
anymore. A Github search resulted only in nautilus forks and references
to the deprecated gnome-vfs.
Allow passing a file's parent to get_filesystem_use_preview and
get_filesystem_remote. This resolves the multi-level parent checking
discussed in [1], by only checking one parent at most.
[1] https://gitlab.gnome.org/GNOME/nautilus/-/issues/3336
GtkCheckButton has the label property, so embedding a GtkLabel
to it is unnecessary. This fixes the warning that says
"Finalizing GtkCheckButton [...], but it still has children left:
GtkLabel".
Also, add a mnemonic.
Because of the "Reset" button, the "Replace and "Rename" button
use the letter "P" and "N" respectively for their mnemonics,
which is odd, since the letter "R" would be more practical
to use; and "Replace and "Rename" never appear together.
So, use the letter "R" for "Replace and "Rename" and "E"
for the "Reset" button.