Commit graph

24359 commits

Author SHA1 Message Date
Khalid Abu Shawarib 4b97eb3f7f placessidebar: Mark row reference in hover timer as weak
This avoids a crash that was previously masked by leaking rows.
2023-10-11 20:13:00 +00:00
Khalid Abu Shawarib 7f68d75834 general: Use gtk_widget_dispose_template
And set child property to NULL before calling it for bin-like
widgets.

Resolves https://gitlab.gnome.org/GNOME/nautilus/-/issues/2418
2023-10-11 20:13:00 +00:00
Alynx Zhou 6656cdb3a4 pathbar: Add menu item to enter location entry
We already have an action to show location entry via a keybinding,
however a new user may be confused because nowhere hints the keybinding.

ADd a menu item to the menu in pathbar so user can easily find it and 
then paste or edit the location.
2023-10-11 11:57:07 +00:00
Gary Li 497ed46f0e window-slot: Fix restoring scroll position from history
Nautilus does not scroll correctly for forward or backward navigation.

This is because the behaviour of the action "list.scroll-to-item" does
not put the specified position at the top of the view, but rather
scrolls the minimum amount to bring it to view, which usually leaves it
at the bottom of the view.

So, instead save the last visible item to scroll to.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2720

(Ammended by António Fernandes <antoniof@gnome.org>)
2023-10-10 17:35:10 +01:00
Florentina Mușat 1aa0bfdda3 Update Romanian translation 2023-10-09 16:08:13 +00:00
António Fernandes 8297825c62 location-banner: Import remove-old-trash-files monitoring
Complete the mission of the previous commit, removing the last
piece of banner-managing code from slot.
2023-10-06 22:17:06 +01:00
António Fernandes 03dd284356 location-banner: Import location matching code
This needs nothing from the slot other than the location.

So, let's make the slot file cleaner and gather banner code in
a single place.
2023-10-06 22:17:05 +01:00
Peter Eisenmann f2c9793e2c location-banner: adjust auto-emptied trash strings
Match propsed strings of #2527.

Part of #2527
2023-10-06 22:16:42 +01:00
Peter Eisenmann 4bcafcf2f0 window-slot: add banner for non-auto-emptied trash
Show a "Empty" button for the trash if it is not emptied automatically.

Part of #2527
2023-10-06 22:16:42 +01:00
Peter Eisenmann 5176499adc sidebar: add mnemonic for empty trash
As a side benefit the same string can later be used in a banner button.
2023-10-06 22:16:42 +01:00
Peter Eisenmann 0f049c070c location-banner: drop periods after some titles
According to the HIG banner texts shouldn't end in periods.
2023-10-06 22:16:39 +01:00
Peter Eisenmann 3d6df1a7fb file: add is_public_share_folder
Match the signature by moving the function from nautilus-window-slot to
nautilus-file.
2023-10-06 22:16:39 +01:00
Peter Eisenmann 86e80a8afa window-slot: simplify get_current_location()
The NULL check on self->location is not required, since NULL is returned
otherwise anyway.
2023-10-06 22:16:39 +01:00
Peter Eisenmann 6e07531f7b location-banner: sort cases alphabetically 2023-10-06 22:16:35 +01:00
António Fernandes 4a5d128a8b window-slot: Simplify banner setup code
- Use autocleanup.
- Replace NautilusDirectory methods with more convenient equivalents.
- Factor out scripts folder matching.
2023-10-06 21:47:26 +01:00
Peter Eisenmann 9e509de40d window-slot: Reuse banner
Banners are currently one of the "extra_location_widgets", which get
destroyed and recreated whenever the location changes. This setup
precludes the usage of the reveal functionality of AdwBanner, which
is desired by the design team.

Setup the banner separately from the extra location widgets (of which
x-content-bar is the only left possible element now). Make it a direct
child of the slot which can be reloaded as many times as needed.
2023-10-06 20:35:54 +01:00
Peter Eisenmann f73e542ed3 window-slot: remove redundant forward declarations 2023-10-06 20:30:04 +01:00
Peter Eisenmann cb60f91cd1 special-location-bar: Rename to nautilus-location-banner
Update name to reflect the fact it's an AdwBanner now.
2023-10-06 20:29:04 +01:00
Peter Eisenmann 0db04f4e09 special-location-bar: use AdwBanner
GtkInfoBar is deprecated in GTK 4.10. Use AdwBanner introduced in
libadwaita 1.3 instead.

This makes having a custom struct to store all the information
redundant, so drop the NautilusSpecialLocationBar class and provide
a method to create an AdwBanner instead.

Part of #2722.
2023-10-06 10:19:58 +01:00
Peter Eisenmann 304b8990d4 special-location-bar: Buttonize "Learn More" link in Templates
Make it consistent with other infobars with a button and add mnemonic.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2402

(Factored out by António Fernandes <antoniof@gnome.org> from Peter's
original commit)
2023-10-06 10:18:50 +01:00
Peter Eisenmann a22f86f679 special-location-bar: Factor out Settings launch code
We are going to change from GtkInfoBar to AdwBanner.

So, the GtkInfoBar::response signal is going away. In preparation,
isolate the reusable parts of its callback in functions that can
be used as calbacks to the AdwBanner::button-clicked signal.

(Factored out by António Fernandes <antoniof@gnome.org> from Peter's
original commit.)
2023-10-05 20:36:35 +01:00
Cheng-Chia Tseng 6a20c86588 Update Chinese (Taiwan) translation
(cherry picked from commit e33c6fc991)
2023-10-05 07:25:44 +00:00
Peter Eisenmann 5a4fc5664e build: autappdata build version
As suggested by @naheemsays on Matrix and inspired by
775dbec2e6
2023-10-05 08:26:07 +02:00
António Fernandes d23e6bf085 files-view: Restore searched location state
When switching view mode, a new view is created. If we are in a search,
the new view has no previous location to go back to when canelling
search, so it falls back to the user home directory.

In order to improve this situation, let's have the new view assume that
the queried location is the original location.

(This fails for global search, but the proper fix requires larger
changes, which are not suited for a bugfix in the stable branch.)
2023-10-05 02:05:26 +00:00
António Fernandes 3a8e0a6043 files-view: Restore search state on view switch
As follow-up to not treating search as a navigation node[0], I've
removed some intrincate logic to handle the case where we go back or
forward to a search directory.[1]

Except... this logic was also needed for the case where we reload a
search directory in a new view during view mode (grid/list) change.

As a consequence, switching view mode during search results in an
empty results view, even if there were some before.

So, let's restore the important bits that were removed in [0].

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/3114

[0] commit d06b4d6a81
[1] commit 570e5c59c3
2023-10-05 02:05:26 +00:00
Sebastian Keller ffde5d91e1 file: Fix crash when opening properties dialog while using admin backend
The properties dialog of a file or directory accessed using the admin
backend allows changing its owner. The list of possible users for this
gets populated from passwd. If one of the users in passwd has an empty
GECOS field, this will cause get_real_name() to use g_strsplit() on an
empty string, which means geco_parts[0] is NULL, leading to a crash when
passed to g_utf8_validate().

Fix this by not doing anything when we encounter an empty GECOS field.

Closes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/3111
2023-10-04 09:08:08 +00:00
Stefan Hansson 165164de5e thumbnails: Fix compilation on 32-bit musl
%lu probably works in most cases, but on 32-bit musl (not sure
about glibc) it complains about that %lu expects
"long unsigned int" but time_t is "long long int". As such, work
around this by copying what gnome-desktop does for this case.
2023-10-03 01:32:17 +00:00
Sabri Ünal e90b86707e Update Turkish translation 2023-10-01 18:31:03 +00:00
Rafael Fontenelle 5c311a8d8e Update Brazilian Portuguese translation
(cherry picked from commit 9e8cdd4873)
2023-09-25 14:03:16 +00:00
Khalid Abu Shawarib 46568edd7d gtk/placessidebar: Use list box for coordinates translation 2023-09-24 21:09:01 +00:00
Peter Eisenmann 5cf288a93e general: Remove nautilus-profile
With tools like sysprof that use the kernels perf functionality, there
is no need to maintain an in-tree profiling solution.
2023-09-24 21:06:08 +00:00
António Fernandes 250853856d files-view: Rename model to directory
In preparation for handling NautilusViewModel in the parent class,
which is going to use the "model" name.
2023-09-24 19:18:47 +00:00
António Fernandes 59c43786dc list-base: Stop jumping to top on Menu key
Pressing the Menu key while the view is scrolled down causes the view
to jump up, which shouldn't happen.

This happens because of a faulty reimplementation of an edge case
handling in the GTK4 port. It's utterly broken and it's my fault.[0,1]

  - The index from the selection filter model is wrongly applied
    to scroll the view (as if it was the index of the unfiltered
    model);
  - If the `for` loop runs until the end, the `i` is not the
    index of the last item: it's the length of the filter model.
  - For list view, the focus child is the inner list view, not
    the cell's parent, so this logic would work only in grid.

The first two points are fixable using GtkBitset instead of
GtkSelectionFilterModel, but the last point means this would
still not work under list view.

The proper solution requires a way to query the focus position,
which doesn't exist (yet? [2]).

Let's give up on the smart handling of corner cases and just get
the common case right. Even in the corner cases, this simple
solution is not too bad.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/3095

[0] 809049a3f6
[1] b28e2d545d
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/2891
2023-09-24 20:02:35 +01:00
Kristjan SCHMIDT 28670ea679 Update Esperanto translation
(cherry picked from commit e73ba8f15d)
2023-09-24 01:57:37 +00:00
Bruce Cowan bea11af01c Update British English translation
(cherry picked from commit e256a91eaf)
2023-09-22 10:09:25 +00:00
Guillaume Bernard f72e8075c0 Update French translation
(cherry picked from commit 4a6819c8b0)
2023-09-19 17:07:48 +00:00
Yuri Chornoivan ca829d48a0 Update Ukrainian translation 2023-09-19 06:37:58 +00:00
Fabio Tomat 28adbb9125 Update Friulian translation
(cherry picked from commit db4823aa9e)
2023-09-18 13:31:24 +00:00
Rūdolfs Mazurs d09f3f5fd1 Update Latvian translation
(cherry picked from commit 47cd5ed2e3)
2023-09-17 10:35:31 +00:00
Milo Casagrande 03054e2232 Update Italian translation 2023-09-16 15:18:33 +00:00
Artur S0 c5cd178620 Update Russian translation 2023-09-16 09:43:19 +00:00
Milo Casagrande 2a7c61e952 Update Italian translation 2023-09-13 08:17:55 +00:00
Khalid Abu Shawarib 4425df0966 build: bump gexiv dependency to 0.14.2
This resolves an issue with GPS coordinates not showing
when there's no altitude number.

See: 634df09f85
2023-09-11 13:27:13 +03:00
Jordi Mas i Hernandez c3bef815a8 Update Catalan translation
(cherry picked from commit c5bf07b17f)
2023-09-11 07:08:01 +00:00
Anders Jonsson dbe0ebe87a Update Swedish translation
(cherry picked from commit 280528dd09)
2023-09-10 09:31:42 +00:00
Changwoo Ryu 61922a127d Update Korean translation
(cherry picked from commit 48181e3ef6)
2023-09-08 08:48:54 +00:00
António Fernandes a6bcce3d9a files-view: Don't update sort metadata if no change
This is unlikely after the previous commit, but it doesn't hurt to have
an optimization that potentially avoids doing I/O.
2023-09-07 16:18:12 +01:00
António Fernandes 86c7e5b441 files-view: Don't save sort metadata on visit
We save sort options when the state of the view.sort action changes.

But this state may be changed in cases where the user hasn't changed
the sort options. Such is the case when the folder is loaded and we
read preferences and metadata to update the state of the sort action.

As a result, visiting a folder for the first time causes the default
sort setting to be saved as metadata and remembered in future visits.
This makes the setting moot except for never before visited folders.
This also causes us to save metadata unnecessarily.

Instead, sort metadata should be saved only when the user explicitly
changes the sort order form the default on each folder. To enforce
this, block our handler of state changes when updating from settings
and metadata.

Resolves a partial regression https://gitlab.gnome.org/GNOME/nautilus/-/issues/2931#note_1784938
2023-09-07 16:18:11 +01:00
António Fernandes 9f3a6e3574 files-view: Move sort metadata saving upclass
The previous commit had already moved the metadata reading part.

NautilusListView and NautilusGridView still set the action state,
and NautilusFilesView listens to the state change.
2023-09-07 16:18:11 +01:00
António Fernandes 3c4f0a2df2 list-base: Move begin-loading code upclass and chain-up
Resolve 2 TODOs. Also remove outdated comment (update_context_menu()
doesn't activate the view.sort action at all.

Preferences signal connections are moved upclass too, because
their handler is update_sort_order_from_metadata_and_preferences().

This helps with preparing to move more things upclass, as per the
plan from  https://gitlab.gnome.org/GNOME/nautilus/-/issues/3042
2023-09-07 16:18:11 +01:00