Commit graph

25133 commits

Author SHA1 Message Date
António Fernandes c19589fc43 gtkplacesview: Drop non-reusable code 2024-06-02 15:39:09 +00:00
António Fernandes 1906daebd8 network-address-bar: Add clear button
It had already been added once[0], later replaced by the info icon[1].

[0] 9341f64c19
[1] bb8b459407
2024-06-02 15:39:09 +00:00
António Fernandes 1d9332c6c9 network-address-bar: Use new icon
As per mockups.

Part of: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2785
2024-06-02 15:39:09 +00:00
António Fernandes 62c4a979ba network-address-bar: Recycle widgetry (step 2/2)
The new design for Network view uses an address entry bar which is
similar to the one from Other Locations view. Instead of reinventing
the wheel, let's salvage some code.

In addition to formatting the code to nautilus style, this also makes
a couple of visual changes to match the design requests.

https://gitlab.gnome.org/GNOME/nautilus/-/issues/2785
2024-06-02 15:39:09 +00:00
António Fernandes 2e59a031c1 network-address-bar: Recycle widgetry (step 1/2)
Rename file before applying changes to it, for git to preserve its
history. Otherwise it will look like the XML is new.
2024-06-02 15:39:09 +00:00
António Fernandes 7c12611bd0 gtkplacesview: Remove from build
Now that NautilusPlacesView is gone, we don't use this anymore.

But there is quite a bit of recycleable code here. So, let's take this
out of the build pipeline in order to disassemble it freely.
2024-06-02 15:39:09 +00:00
António Fernandes 6997f3a5eb general: Remove Other Locations
It's going to be replaced with a new Network view.[0]

For now this removes only the direct support in nautilus code proper.
The code imported from GtkPlacesView is kept to be recycled for a new
purpose.

[0] https://gitlab.gnome.org/GNOME/nautilus/-/issues/2785
2024-06-02 15:39:09 +00:00
António Fernandes b85d0773a4 gtkplacessidebar: Drop unused places and options
This used to be shared with GTK, and even public GTK API, before GTK 4.

Therefore, it has optional behaviors we don't use. Drop them.
2024-06-02 15:39:09 +00:00
Martin cbee15bd21 Update Slovenian translation 2024-06-02 05:39:26 +00:00
Khalid Abu Shawarib 13f3ec9f35 proprties: Don't scale up the image
In [1], a frame and an overlay were introduced for the redesign of the
thumbnail editor so that the new edit and clear buttons will not be
entirely inside the image frame. This was inside a GtkStack with
another a image which caused it to be scaled since the stack enforces
size homogeneity by default. This is undesirable, so disable it.

[1] 1c70bab1f0

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/3422#note_2128815
2024-06-01 14:03:54 +00:00
António Fernandes 41c0c1f624 internal-place-file: Mount network:/// on ready request
The whole application freezes the first time `x-network-view:///` is
visited during a session (or after `killall gvfsd-network`).

This happens because GDaemonFile makes sync DBus calls to mount the
`network:///` location when we call `g_file_monitor_directory()`[0],
which is done by the view when the ready callback is invoked.

In order to avoid this, ensure the `network:///` location is mounted
before invoking the ready callback for the `x-network-view:///` file.

(This achieves a result which is similar to accessing `network:///`
directly, or any other location which is slow to mount: the location
is not changed until after the mount succeeds. I don't think this is
good UX, but it's an entirely different problem which is not specific
to the Network view at all.)

[0] More context on https://gitlab.gnome.org/GNOME/gvfs/-/issues/455
2024-06-01 11:57:05 +00:00
António Fernandes f0d250d0cc network-directory: Introduce new directory subclass
This aggregates files from two sources:

* network:// for discoverable network resources
* computer:// for remote mounts and volumes

For the second case, we need to filter out local mounts and volumes.
For the time being, this is implemented by relying on the the icon
names, until a new file attribute is provided by GVFS.
2024-06-01 11:57:05 +00:00
António Fernandes 7776f13c69 internal-place-file: Introduce new file subclass
Instead of special casing the NautilusFile for the starred:/// URI,
give it a proper display name as part of a new specialized subclass.

This is prepared to handle more cases, like the upcoming Network view.
2024-06-01 11:57:05 +00:00
António Fernandes 61032380f3 file: Document vtable
Ensure no virtual method is left undefined by subclasses.
2024-06-01 11:57:05 +00:00
António Fernandes 6d47fce9c9 file: Make get_where_string() non-polymorphic
Similarly to .get_date(), addressed by the previous commit, this has
been added for the sake of NautilusTrashFile[0] for it to say it lives:

   "on the desktop"

We have no desktop anymore. NautilusSearchDirectoryFile is not on
desktop nor in any view, and it doesn't have a parent, so it doesn't
need this either.

[0] commit d23bb1b5be
2024-06-01 11:57:05 +00:00
António Fernandes ce35cd2441 file: Make get_date() method non-polymorphic
It was born as a virtual method with 2 implementations: NautilusVfsFile
and NautilusTrashFile: commit e82bab8c49

Nowadays only the NautilusVfsFile implements it anyway, so, rather than
leaving it undefined for other subclasses it's best to move the
implementation to the parent class and drop the vfunc.

An undefined virtual method obviously can cause problems. A crash
can be reproduced through FileManager1 D-Bus method ShowItemProperties
with the parameters (["x-nautilus-search://0/"],""). We are lucky this
probably never happens under regular usage.
2024-06-01 11:57:05 +00:00
António Fernandes c7d515942b search-directory: Create own file
There is no reason for nautilus-directory.c to include the header for
a subclass just to implement a virtual method the subclass could have
implemented itself.

So, have NautilusSearchDirectory create NautilusSearchDirectoryFile
and stop including unneeded headers in directory.c.

Also do precondition checking in the method, not the implementation.

This sets a pattern for upcoming new NautilusFile subclasses.
2024-06-01 11:57:05 +00:00
António Fernandes 3c23786c8c file: Make directory a construct property
We always call nautilus_file_set_directory() right after creating the
object, and a file is not expected to live without a directory.

Therefore, it makes sense to require the directory to be passed upon
object construction.

This is not just about adopting idiomatic GObject patterns: it's
going to become useful later for new file subclasses who will need to
know something about their parent directory upon construction.
2024-06-01 11:57:05 +00:00
Jordi Mas i Hernandez 3153252095 Update Catalan translation 2024-05-31 22:12:16 +00:00
Pawan Chitrakar 4511a7ab9b Update Nepali translation
(cherry picked from commit ea10fe4a07)
2024-05-28 16:36:45 +00:00
Khalid Abu Shawarib 0aab4b8458 files-view: Don't always reload on global search
In [1], global search was excluded from skipping the reloading of
the view like normal search in order for the current content of the
view to not appear in the global search for a short time until the
results were loaded. This causes global search results to flicker
for every key stroke.

Instead, make the condition more specific so that it will not
affect loading between search queries.

[1] ce47e61372

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/3403
2024-05-27 23:57:35 +00:00
António Fernandes a9ca62f771 file: Don't rely on application-x-generic
`application-x-generic` is our preferred fallback themed icon. However,
it's  not present in the icon naming specification[0] and, as such, is
not included in the icon themes some downstreams adopt.

Instead of immediately resorting to the unthemed fallback texture, we
can give a second themed alternative which is likely available in any
icon theme: text-x-generic.

[0] https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/3268
2024-05-27 22:47:34 +00:00
Martin 56a9882610 Update Slovenian translation 2024-05-27 12:44:29 +00:00
Artur S0 6dd4f7ef9f Update Russian translation 2024-05-27 10:18:30 +00:00
Asier Sarasua Garmendia bfde9badb5 Update Basque translation
(cherry picked from commit 52f4db5071)
2024-05-26 09:36:48 +00:00
Balázs Úr 5a7347867f Update Hungarian translation 2024-05-26 09:22:53 +00:00
António Fernandes 356570978c bookmark: Don't mark non-native bookmarks as broken
We want to use a warning icon to warn about broken bookmarks,
i.e., bookmarks whose pointed path is gone.

But for non-local files, this may just mean they are not currently
mounted or temporarily innaccessible, not necessarily broken.

So, apply the broken bookmark icon logic to native icons only.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1430#note_2069827
2024-05-24 15:09:12 +00:00
António Fernandes a011010567 bookmark: Simplify get_native_icon() and get_xdg_type()
The usage of goto's makes get_native_icon() unnecessarily complex and
error-prone.

Indeed, the goto's may be the reason why the commit[0] which introduced
the `nautilus_bookmark_get_xdg_type()` function as a replacement for
`nautilus_file_is_user_special_directory()` didn't remove the obsolete
checks `bookmark->file == NULL` and `xdg_type < G_USER_N_DIRECTORIES`.

Simplify and modernize `nautilus_bookmark_get_xdg_type()` as well, to
make it clear it the passed `GUserDirectory` value is always lower than
G_USER_N_DIRECTORIES, because it's the for loop condition.

[0] commit 1dcd2d816a
2024-05-24 15:09:12 +00:00
Corey Berla 7e427c0ba7 sidebar: Remove "enter-location" row
We don't use it, and likely never will again.
2024-05-24 15:09:12 +00:00
Corey Berla 26480b7017 sidebar: Replace gtkbookmarksmanager with nautilus-bookmark-list 2024-05-24 15:09:12 +00:00
Corey Berla 3aca4ce418 bookmark-list: Save file on name changed
Now that we allow changing the name at any time, save the file when
the name is updated, as that information ends up in the bookmarks file.
2024-05-24 15:09:12 +00:00
Corey Berla 4dd0e6aa57 bookmark: Expose nautilus_bookmark_set_name
In the following commits we will be dropping gtkbookmarkmanager and
using nautilus-bookmark/list instead.  In order to allow renaming
bookmarks we need access to set_name.
2024-05-24 15:09:12 +00:00
Corey Berla 3bdf93975a bookmark: Update custom_name on new name
We incorrectly only set custom_name on construction.
2024-05-24 15:09:12 +00:00
Corey Berla ced25b64e3 bookmark: Stop notifying twice on set_name 2024-05-24 15:09:12 +00:00
Corey Berla 08ec5c4b45 bookmark-list: Remove legacy fallback bookmark file
The current location was added almost 12 years ago in commit ed90577118
("Use new GTK bookmarks location").
2024-05-24 15:09:12 +00:00
António Fernandes 1ff52d2e46 bookmark-list: Modernize old-new code
There is no need to use g_list_free_1() when we can achieve the same
result using g_list_delete_link() instead of g_list_remove_link().

There is also no need to free 1 link when it can be reinserted in
another position.

Also other style rearrangements, mixing declarations with code, etc.
2024-05-24 15:09:12 +00:00
António Fernandes f92141abb8 bookmark-link: Don't leak link 2024-05-24 15:09:12 +00:00
Corey Berla facd45d7c2 bookmark-list: Restore formerly unused methods
This partially reverts commit [1] and [2].

We didn't need these when the sidebar lived in
GTK, but now the sidebar has come back and we should prefer
our code over the gtkbookmarkmanager.

[1] 380124b5cf.
[2] e13b3e2fcd
2024-05-24 15:09:12 +00:00
Automeris naranja f2b853ca5b properties-window: Don't show a blank space if extension_models_list_box is empty
If "Image/Audio/Video Properties" rows aren't present, a blank space
will unnecessarily be shown at the bottom of the properties window.
To fix this, hide the AdwPreferencesGroup that contains these rows.
2024-05-22 17:41:47 -03:00
Automeris naranja d7b9b3722f properties-window: Fix indentation 2024-05-22 17:28:46 -03:00
Peter Eisenmann df0878e3ce fd-holder: Don't try to iterate NULL hash table 2024-05-22 11:28:22 +01:00
Automeris naranja cc6378b337 properties-window: Remove period from status page description
"Text generally shouldn’t end with a period. This applies
to headings, descriptions, and includes text that is
written as a complete sentence."

https://developer.gnome.org/hig/guidelines/writing-style.html#periods
2024-05-20 20:57:29 -03:00
Automeris naranja eb285df21d properties-window: Remove the "title-lines" property from some rows
Some rows have title-lines=1, but it's unlikely that their
titles will get ellipsized, as they are fixed and predictable,
unlike their subtitles. So remove this property as it's
unnecessary in this case.
2024-05-20 16:10:03 -03:00
Corey Berla bf0d53b948 file-changes-queue: Make sure only one file queue is created
Since NautilusFileChangesQueue is called from multiple threads,
a simple NULL check can't prevent init from happening twice.
Use GOnce to make sure we only init once and gain some (tiny)
performance benefit over the NULL check.
2024-05-19 00:10:39 +00:00
Corey Berla 279d4de256 file-changes-queue: Use GAsyncQueue
Credit to Antonio for mentioning this.
2024-05-19 00:10:39 +00:00
Peter Eisenmann 9dca6ac4f4 thumbnails: Simplify scheduled thumbnailing flow
This also skips one call to the queue for already thumbnailing images.
2024-05-19 00:10:39 +00:00
Peter Eisenmann 5708a86d7a thumbnails: Add autocleanup for thumbnail info 2024-05-19 00:10:39 +00:00
Corey Berla 722b219b8e thumbnails: Use NautilusHashQueue 2024-05-19 00:10:39 +00:00
Peter Eisenmann 04884c759a general: Rename NautilusFileQueue to NautilusHashQueue 2024-05-19 00:10:39 +00:00
Corey Berla d751d7a971 file-queue: Use generic parameter types
Also, adjust documentation and move it to the .c file.
2024-05-19 00:10:39 +00:00