Commit graph

22512 commits

Author SHA1 Message Date
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
Ernestas Kulik
8576d45c59 files-view-dnd: Drop GDK_ACTION_DEFAULT
It’s gone in GTK4, and its use has been discouraged in GTK3.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 15:16:18 +00:00
António Fernandes
49ec3bd2c5 file-changes-queue: Drop GdkPoint struct member
It's unused because we no longer handle icons on desktop.
Also, the type is gone in GDK4.
2021-11-22 15:16:18 +00:00
António Fernandes
37740f0d72 general: Stop using gtk_main_iteration()
It's going away with GTK4. Use the recomended replacement.
2021-11-22 15:16:18 +00:00
Ernestas Kulik
67baf819d2 general: Replace uses of GDK thread API
We are doing all GTK stuff from the main thread anyway. If we are not,
we are in big trouble anyway.

So, drop gdk_threads* API this in preparation for GTK4, where it won't
exist.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-22 15:16:18 +00:00
Fabio Tomat
03a21f33d2 Update Friulian translation 2021-11-21 23:26:58 +00:00
Fran Dieguez
ddf023b843 Update Galician translation 2021-11-19 22:45:39 +00:00
António Fernandes
c56e90ed69 pathbar: Avoid leaking stack pages
The templates submenu in the current location popover is recreated
every time the menu model is updated, but the old widgetry is never
destroyed.

This results in a memory leak and many warnings in the terminal output.

I couldn't find the root cause, after many investigations. However,
I've found that unsetting the model actually removes the old widgetry.
Let's do that as a workaround.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1705
2021-11-19 16:19:41 +00:00
Goran Vidović
2c65d3e5ff Update Croatian translation 2021-11-19 15:56:22 +00:00
António Fernandes
7e3dab1f52 operations-ui-manager: Port passphrase dialog to GtkBuilder
This removes usage of the GtkContainer API, preparing for GTK4.
2021-11-19 08:36:50 +01:00
Ondrej Holy
9e4e95395b file-operations: Simplify archive password dialog handling
Our AutoarExtractor::request-passphrase handler implements in invoking
the main context for the dialog from an operation thread.

This duplicates existing code that caters the same use case for the
file conflict dialog (using the `invoke_main_context_sync()` function).

Let's move the code handling of the password dialog into the
`src/nautilus-operations-ui-manager.c` file to make use of
`invoke_main_context_sync()`.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1829
2021-11-19 08:36:00 +01:00
Danial Behzadi
e95cb881c0 Update Persian translation 2021-11-18 22:50:35 +00:00
Quentin PAGÈS
33bd031824 Update Occitan translation 2021-11-17 18:10:05 +00:00
Rajat Jain
a3369c5a4b file: use specific file type for Sort by Type
Adds file comparison based on actual file type, rather than generic
type category. For example .jpg and .png files will now be sorted
into two different groups.

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

Signed-off-by: Rajat Jain <rajatjain.ix@gmail.com>
2021-11-16 17:56:31 +00:00
Joshua Lee
b002cb626d file-conflict-dialog: Prevent rename button appearing prematurely
Commit 38803058cb introduced calls to
gtk_widget_show_all(), which causes the 'Rename' button to appear prematurely
when the dialog is created. Fix this by using gtk_widget_show() instead.

Take this opportunity to modify the call when creating the app chooser dialog
too as gtk_widget_show_all() doesn't exist in GTK 4.
2021-11-16 17:15:17 +00:00
Yaron Shahrabani
d9374912b2 Update Hebrew translation 2021-11-15 13:46:50 +00:00
Yaron Shahrabani
ad2d4a5ead Update Hebrew translation 2021-11-15 13:45:14 +00:00
Yuri Chornoivan
1857076401 Update Ukrainian translation 2021-11-14 20:38:20 +00:00
DillyPickly
e6c0b65ccc files-view: Fix "Copy To" from "Starred" folder
"Copy To" or "Move To" dialog starting from the current location.

However, if the current location is starred://, GtkFileChooserDialog
prompts an error message "The specified location is not supported".

Instead, while in the Starred location, use the actual parent of the
selected item as a starting location for the "Copy To" dialog.

Fixes: #1243
2021-11-14 11:58:38 +00:00
Marco Trevisan (Treviño)
305985f209 shell-search-provider: Cancel metadata requests on disposal
Keep track of the nautilus_file_list_call_when_ready calls we performed
and and stop them on disposal, returning empty values on dbus invocations.
2021-11-14 09:29:29 +00:00
Marco Trevisan (Treviño)
5441744011 shell-search-provider: Don't return search provider results on disposal
If the search provider is disposed while searching, just stop cancel
the search without sending to the shell any result.
2021-11-14 09:29:29 +00:00
Hugo Carvalho
6fe1663b32 Update Portuguese translation 2021-11-13 15:37:31 +00:00
Peter
b151025d3e directory: Use finite amount of tries for self check
Turn potentially infinite while loops into for loops with finite
amount of repetitions. In general 1000 tries should be sufficient,
so the chosen amount of 100.000 serves as an upper limit.

See https://gitlab.gnome.org/GNOME/nautilus/-/issues/1290
2021-11-13 13:18:44 +00:00
António Fernandes
2103a487a0 files-view: Simplify select-items.ui
Remove usage of properties that are gone in GTK4, such as border-width.
Also, move the "Pattern:" label above the entry, drop the colon and
make it bold.
2021-11-13 12:22:59 +00:00
Apoorv Sachan
28ce30df03 files-view: Port Ctrl+S dialog to use GtkBuilder
Now the Ctrl+S dialog is being built using the
GtkBuilder API, Now it's styling and can be
handled in the XML UI definition. The UI definiton
needs to be handled manually as Glade doesn't handle
the implementation of the GtkDialog used here.
2021-11-13 12:17:07 +00:00
António Fernandes
38803058cb operations-ui-manager: Stop using gtk_dialog_run()
It's going to be unavailable in GTK 4.

Thanks to the previous commit, we can use GtkDialog::response instead.

Part of https://gitlab.gnome.org/GNOME/nautilus/-/issues/1992
2021-11-12 14:12:36 +00:00
António Fernandes
19782f41e5 operations-ui-manager: Refactor main context task completion
invoke_main_context_sync() wraps the boilerplate needed for the file
operations thread to trigger UI dialogs and wait for their feedback.

It assumes that the UI task is completed by the time the invoked
function returns. This assumption presumably stems from the expected
usage of gtk_dialog_run().

However, gtk_dialog_run() is gone in GTK 4, so we should stop making
that assumption. Let's introduce an explicit way to signal that the
task is completed, such that it can be used either before or after
the wrapped function returns.

This will enable us to drop gtk_dialog_run() later. It will also
help with https://gitlab.gnome.org/GNOME/nautilus/-/issues/1829
2021-11-12 14:12:36 +00:00
Goran Vidović
1a8e28347c Update Croatian translation 2021-11-12 11:04:03 +00:00
Yuri Chornoivan
1a3d218f2e Update Ukrainian translation 2021-11-12 04:58:05 +00:00
António Fernandes
1c83d6af8b 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.

Also, while we are at it, move some object unreferencing from
.finalize() to .dispose(), which is where we should do it.
2021-11-12 01:40:53 +00:00
António Fernandes
1acded8c0c files-view: Stop using NULL slot as destruction flag
We already have a boolean to query whether we are in destruction.
2021-11-12 01:40:53 +00:00
Ernestas Kulik
a2d5dafa05 general: Use GtkButton as a container
GtkButton lost its GtkImage-related API in GTK4, and should be used as
a regular container.

Note #1: In x-content-bar.c, this requires using gtk_box_pack_start()
and gtk_container_add(), which must later be replaced, respectively,
by gtk_box_preopend() and gtk_button_add_child() when switching to
GTK4. However, it's worth refactoring the code in advance such that
we can simply find and replace funciton calls later.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-12 01:40:39 +00:00
Ernestas Kulik
f3e1d8a46e ui: Hide state overlays by default
They need to be shown by code anyway. This prepares for GTK+ 4, where
widgets are shown by default unless explicitly hidden.

Rebased and ammended by António Fernandes <antoniof@gnome.org>
2021-11-12 01:40:06 +00:00
António Fernandes
71c96cd31a general: Stop using the state argument of GtkStyleContext getters
As per https://docs.gtk.org/gtk4/migrating-3to4.html#stop-using-the-state-argument-of-gtkstylecontext-getters
2021-11-12 01:40:05 +00:00