Commit graph

22545 commits

Author SHA1 Message Date
Sveinn í Felli 100f627633 Update Icelandic translation 2021-12-13 09:23:51 +00:00
Álvaro Costa b4cc5fc070 file-operations: Delay FileConflictDialog activation
Just as the error, warning and question dialogs, the FileConflictDialog
may also pop up unexpectedly during a lengthier operation.

The same idea of the previous commit is applied here.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1988
2021-12-08 18:23:59 +00:00
Álvaro Costa 3647c7473a file-operations: Delay dialog activation
Warning, error and question dialogs may pop up unexpectedly during
lengthier operations and the user may end up selecting an unwanted
action.

This patch introduces a delay of 2s for dialog activation when
the total elapsed time of the job that created the dialog is
greater than 2s.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1988
2021-12-08 18:23:59 +00:00
Matthew Jakeman e295cac225 search-popover: Stop using blocking dialog functions
Replaces usage of gtk_dialog_run() with the "response" signal in
preparation for GTK 4 port.

Part of #1992
2021-12-07 00:52:51 +13:00
António Fernandes d5caa0b021 general: Stop overriding GtkWidget.destroy()
It's gone in GTK4.

Anything we are doing on ::destroy can be done on ::dispose().
Extra care must be taken, however, because GObject.dispose() may be
run multiple times; for this reason, move some things to .finalize().
2021-12-06 10:39:33 +00:00
António Fernandes cb257a2cbd Revert "general: Stop overriding GtkWidget.destroy()"
This reverts commit 1c83d6af8b.

It did a little to much and this introduced at least one bug: when
going from a regular folder to other-locations:///, the current view
menu keeps displaying invalid actions (New Folder, Properties, etc.),
which, if activated, crash the application.

Let's revert first and do it right in the next commit.
2021-12-06 10:39:33 +00:00
António Fernandes 54617c32b3 extensions/image-properties: Reduce container API
Preparing for GTK4.
2021-12-06 00:27:15 +00:00
António Fernandes c1760ff543 extensions/image-properties: Don't subclass widget
GTK discourages subclassing widgets.

The only reason we are subclassing here is to add struct fields. But we
don't need to subclass a widget for that. We don't even need to subclass
GObject. A plain data struct is enough.
2021-12-06 00:27:15 +00:00
António Fernandes 79fc62b3c5 general: Stop using GtkContainer::get_children() and ::foreach()
Add transition wrappers for needed GTK4 methods unavailable in GTK3.
2021-12-06 00:27:15 +00:00
António Fernandes e9ae1add9c general: Stop using gtk_container_add()
GtkContainer is gone in GTK4.

Use per-class child-adding methods. For the cases where such methods
are unavailable in GTK3, introduce small wrapper functions with the
same signature as the GTK4 methods, to help with the transition.
2021-12-06 00:27:04 +00:00
António Fernandes 999842ba69 floating-bar: Drop arbitrary multi-action API
The only action we need is to stop loading.

The code to cleanup actions relies on GtkContainer API, gone in GTK4.

So, specialize the code on the stop button.
2021-12-06 00:24:52 +00:00
António Fernandes 4770f1f51d notebook: Stop using GtkContainer methods
GtkContainer is gone in GTK4.

Replace all usage of its API, except gtk_container_child_set() because
there is no replacement for "tab-expand" in GTK3.
2021-12-06 00:24:52 +00:00
António Fernandes cfdee53695 toolbar: Use list box for operations list
Using a GtkBox to display a dynamic list requires us to manually add
and remove children, relying on the GtkContainer API, gone in GTK4.

Instead, we can use GtkListBox, which we can pass a model and let
it take care of creating and disposing of children for us.

After the GTK4 switch, we should probably replace it with GtkListView
to avoid the default behaviors of GtkListBox which we are adding
workarounds for.
2021-12-06 00:24:52 +00:00
António Fernandes 57e3910e5e toolbar: Unify toolbar UI definitions
The toolbar's UI definition is split among two files because we used to
have a NautilusContainerMaxWidth between them, which is not GtkBuildable.

With out custom container gone from the toolbar, we can simplify this,
while also reduce the usage of GtkContainer API, which is gone in GTK4.
2021-12-06 00:24:52 +00:00
António Fernandes 690a03bb63 toolbar: Stop using custom max width container
We have been using NautilusMaxWidthContainer on the title widget in
order to set a size where it stops expanding and starts centering.

But we can achieve the same visual result (with default font) by
setting a the location entry's :max-width-chars to 88.

This is going to allow us to drop the custom container at a later
point, which is going to help wtih the transition to GTK4.

As a side effect, now the pathbar can grow beyond the max width if
neecessary to display more of a path. I see this as a nice bonus!
2021-12-06 00:24:52 +00:00
Aaron Jacobs a43fb2deab extension: Allow @tip to be NULL in nautilus_menu_item_new()
Tooltips are currently unused, so it makes sense to allow NULL here, as
with the @icon parameter.
2021-12-04 20:35:25 -05:00
Aaron Jacobs 960ef5fb85 extension: Add some missing nullable annotations
I've generally verified that these are nullable by looking elsewhere in
the source.
2021-12-04 20:35:25 -05:00
Nishal Kulkarni 0dfaaaeecd extensions/image-properties: Replace deprecated functions
Build log contains deprecation warnings for gexiv2 functions.
Replaced `gexiv2_metadata_has_tag()` with
`gexiv2_metadata_try_has_tag()` and `gexiv2_metadata_get_orientation()`
with `gexiv2_metadata_try_get_orientation()`

Closes: #2033
2021-12-04 22:54:14 +00:00
Suhaas b7b475298c src/nautilus-trash-bar.c: remove generic container
This is to prepare for the migration to GTK4.

https://gitlab.gnome.org/GNOME/nautilus/-/issues/1947
2021-12-04 22:42:17 +00:00
Fabio Tomat 9f45773097 Update Friulian translation 2021-12-03 10:56:29 +00:00
Aaron Jacobs ecf366b58e extension: Mark backwards-compatibility typedefs as not introspectable
I believe these are only included to prevent breakage of existing C
extensions, but as they're not intended for actual use we should mark
them with `(skip)`.

This has the added benefit of making the VAPI file generated from the
resulting GIR file much less noisy.
2021-11-28 16:22:53 -05:00
Aleksandr Melman 0e7bf616f3 Update Russian translation 2021-11-28 15:24:14 +00:00
Aaron Jacobs 4309509d51 extension: Mark entry points as not introspectable
As pointed out by Emmanuele Bassi, these are not part of the ABI and
should be marked with (skip).

See: https://discourse.gnome.org/t/vala-bindings-for-an-unusual-c-ownership-function-signature/8184
2021-11-28 13:11:27 +00:00
Aaron Jacobs 068f0315bc extension: Fix annotation for modules's type list
As pointed out by Emmanuele Bassi, this should be transfer=none instead
of the present transfer=full.

See: https://discourse.gnome.org/t/vala-bindings-for-an-unusual-c-ownership-function-signature/8184
2021-11-28 13:10:14 +00:00
Nishit Patel 639eb6dd61 nautilus-search-engine: search by creation time
this will let user search for the files using the
crtime (creation time) of the files

Closes #1761
2021-11-27 11:04:53 +00:00
Daniel Mustieles 7797151a0a Updated Spanish translation 2021-11-26 18:05:45 +01:00
António Fernandes cec92f898a progress-info-widget: Make button round again
The button currently looks like a vertical pill, not a circle.

This is a regression from a2d5dafa05

Not using the GtkButton image API apparently requires us to add the image-button style class ourselves.
2021-11-25 17:13:13 +00:00
Ernestas Kulik 8b293757e5 nautilus-search-popover.ui: Drop GtkSizeGroup:ignore-hidden
The property no longer exists, and the code acts as if it were true,
anyway.
2021-11-22 20:42:03 +00:00
Ernestas Kulik 684650c8ae general: Drop uses of gtk-timeout-expand setting
It's deprecated.

Add a hardcoded value equal to the default of gtk-timeout-expand.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 20:41:57 +00:00
Ernestas Kulik b17c3f61a8 general: Don’t set xalign where unsupported
Most notably, GtkButton:xalign has been deprecated since GTK+ 3.14.
2021-11-22 20:37:38 +00:00
António Fernandes fef7cb3dd8 properties-window: Stop using deprecated property
GtkImage:stock and GTK_STOCK_MISSING_IMAGE are deprecated.
2021-11-22 20:37:38 +00:00
Ernestas Kulik 1e010f94aa pathbar: Drop gtk_container_class_handle_border_width()
It's gone in GTK4 and removing this doesn't seem to cause any visual or
behavorial change at the moment.
2021-11-22 20:37:38 +00:00
António Fernandes fad73c2c37 general: Stop setting GtkWidget:margin
This is also gone in GTK4, so we should set the margin for all 4 sides.

In batch-rename-dialog.ui there is a case where :margin was set to 0,
which is the default, so just remove the tag in that case.
2021-11-22 20:37:37 +00:00
Ernestas Kulik 497c16a69d general: Drop uses of GtkContainer:border-width
In preparation for porting to GTK4.

Rebased and ammeded by António Fernandes <antoniof@gnome.org>
2021-11-22 20:35:54 +00:00
António Fernandes 9d3a12c38d general: Stop using GtkBox padding, fill and expand child properties
In preparation for porting to GTK4, where child properties are no more.

Based on patch by Ernestas: d4b5c02ee9b2f1870f6b2e5e5bcf6b8d65ea2b85
2021-11-22 20:30:39 +00:00
Ernestas Kulik 67b66a4d51 tree-view-drag-dest: Stop connecting to ::draw
The "treeview-drop-indicator" style class was a thing in GTK2, but not
in GTK3. So, remove this old code which isn't even do anything visible
anymore. Also, the ::draw signal is going away when we move to GTK4.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 15:16:18 +00:00
Ernestas Kulik 09628b7484 pathbar: Remove event GdkWindow
This usage of GdkWindow is a X11'ism that's gone in GTK4.

Removing this doesn't seem to cause any visual or behavorial change at
the moment.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 15:16:18 +00:00
Ernestas Kulik 2cf73a92a1 pathbar: Drop gtk_widget_set_allocation()
It's gone in GTK4 and removing this doesn't seem to cause any visual or
behavorial change at the moment.
2021-11-22 15:16:18 +00:00
Ernestas Kulik f717ec01ab pathbar: Drop gtk_widget_{g,s}et_clip()
It's gone in GTK4 and removing this doesn't seem to cause any visual or
behavorial change at the moment.

Originally it was a workaround to some visual problem with button
shadows. Our pathbar buttons don't have shadows nowadays, and even if
testing with added shadows, there is no apparent issue nowadays.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 15:16:18 +00:00
Ernestas Kulik c56ccce791 pathbar: Drop gtk_widget_set_redraw_on_allocate()
It's gone in GTK4 [1] and doesn't seem to make a difference in GTK3.

[1] a8a755e5cd
2021-11-22 15:16:18 +00:00
António Fernandes ad2fcd7b6d tree-view-drag-dest: Don't use gdk_window_get_position()
It's gone in GTK4.

Instead, translate to widget coordinates.
2021-11-22 15:16:18 +00:00
Ernestas Kulik d32c24c266 files-view: Drop uses of removed GtkStyleContext API
gtk_style_context_set_junction_sides() is no more.
2021-11-22 15:16:18 +00:00
António Fernandes be4b941ad2 autorun-software: Don't use gtk_window_set_icon()
It's gone in GTK4.

We get an icon from GMount. Assuming it's a GThemedIcon, so we can
simply get its first name and use gtk_window_set_icon_name() which is
still going to work in GTK4.
2021-11-22 15:16:18 +00:00
António Fernandes b80d2f3234 properties-window: Don't use gtk_window_set_icon()
It's gone in GTK4.

Here it's used only as a fallback to a named icon.
Also, GNOME doesn't use window icons anyway.

So, just drop it to ease the port to GTK4.
2021-11-22 15:16:18 +00:00
Ernestas Kulik 23279d5912 icon-info: Drop gtk_icon_size_lookup()
It no longer exists, and the enumeration only contains normal and large
sizes, so hardcoded icon sizes are now used.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 15:16:18 +00:00
António Fernandes 243861e97b file: Pass parent window to unmount operation
It's conveniently set as a property of GtkMountOperation, so there is no
reason not to pass both forward.

This is necessary for the preceding commit to actually work as intended.
2021-11-22 15:16:18 +00:00
António Fernandes a3126525a1 file-operations: Make "trash on unmount" dialog modal
Actually set the parent window, instead of juggling with GdkScreen,
which is going away with GdkScreen. Furthermore, parentless dialogs
should not exist, HIG-wise.

While we are at it, also remove gtk_window_set_skip_taskbar_hint()
which is going away with GTK4 too.
2021-11-22 15:16:18 +00:00
António Fernandes 77f580f577 properties-window: Stop using GtkButtonBox
It's going away with GTK4.

Replace it with a GtkBox.

This will result in visual changes to the dialog, but the existing
visuals are outdated and a redesign is overdue anyway.
2021-11-22 15:16:18 +00:00
Ernestas Kulik 0105bfb8ac files-view: Handle parent changes in GObject::notify
GtkWidget::parent-set is gone in GTK4.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 15:16:18 +00:00
Ernestas Kulik cd0299b20e general: Drop gtk_window_has_toplevel_focus()
It’s identical to gtk_window_is_active() as far as we are concerned.
Also, it's gone in GTK4.
2021-11-22 15:16:18 +00:00