Commit graph

23113 commits

Author SHA1 Message Date
Peter Eisenmann 856803f9d6 general: Delete no longer needed git ignores
Meson builds out-of-tree, these ignored files will never get created in
these directories. If they do, it indicates a build configuration error
and should not be hidden.
2022-07-17 23:51:03 +00:00
codeboybebop 76c59b8ecb toolbar: Fix wrong cast of GtkMenuButton
In some parts of the code, operations_button was considered as a member
of the child class of class GtkToggleButton. Which is incorrect in gtk4.
Using visibility of popover gives the intended functionality.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2313
2022-07-17 22:06:30 +00:00
António Fernandes a6c9418ed5 files-view: Add empty state for Recent 2022-07-17 18:25:21 +00:00
António Fernandes b1a30dcd7a files-view: Build from UI template
We have multiple empty state .ui files, which make little sense now
that they are so simple, thanks to AdwStatusPage.

So, instead, add a single UI file for the whole view.
2022-07-17 18:25:21 +00:00
Christopher Davis f76684fe6c general: Refine status page writing style
Updates the writing style of the status pages to follow
https://developer.gnome.org/hig/guidelines/writing-style.html.
This means making sure titles use header grammar and capitalization,
and that sentences have punctuation.
2022-07-17 18:25:21 +00:00
Christopher Davis a336c68b08 gtkplacesview: Use AdwStatusPage
The places view had placeholders in a popover and for search. These
are both use cases where we can and should use AdwStatusPage, now that
we no longer keep this code in sync with GTK.
2022-07-17 18:25:21 +00:00
Christopher Davis c158f08e5b resources: Use AdwStatusPage for empty views
libadwaita provides a widget for status/empty pages. Instead
of rolling our own lookalike, we can now use the original
since we have a GtkStack instead of a GtkOverlay managing
views.
2022-07-17 18:25:21 +00:00
Christopher Davis 7c7f7096bb files-view: Use GtkStack to manage views
The port to GTK4 allows us to rework how we structure the view
to use a more modern view management widget: GtkStack. Now instead
of managing visibility with `show()`/`hide()`, we use
`GtkStack:visible-child`.
2022-07-17 18:25:21 +00:00
António Fernandes 96493e87cc list-base: Move bg click gestures to view
We've been setting background click gestures on the view_ui widget,
which is either GtkGridView or GtkColumnView.

But this means the empty state widgets don't get to handle these
clicks. And the situation would get worse with AdwStatusPage, which
fills the whole area.

So, follow the lead of the background drop target and set the gestures
on the NautilusFilesView container itself. This has the side effect
of clicks on the floating status bar working like clicks on the empty
space. But it's not a big problem.
2022-07-17 18:25:21 +00:00
Quentin PAGÈS a9857bf4de Update Occitan translation 2022-07-17 15:33:32 +00:00
Yuri Chornoivan 53459f8fc4 Update Ukrainian translation 2022-07-16 19:44:07 +00:00
Codeboybebop 4677dbe104 nautilus-files-view.c: separated actions for creating a link
Single action for creating a link can be either enabled and visible or disabled and invisible. Creating separate action allows hiding entry in context menu without disabling a shortcut.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2315
2022-07-16 19:27:19 +00:00
Christopher Davis 2f1e0d25f6 general: Use GtkButton:icon-name more
Instead of packing a GtkImage, we can now set the icon
name on buttons directly.

GtkButton's API sets the right style classes automatically.
2022-07-16 20:02:21 +01:00
Christopher Davis f88c4a2b39 batch-rename-dialog: Use always-show-arrow for numbering order
GtkMenuButton now has the `always-show-arrow` property. This
means we don't need to pack a label and icon ourselves anymore.
2022-07-16 20:02:21 +01:00
Christopher Davis c4b9e130db Batch-rename-dialog: Use AdwButtonContent for add tag button
AdwButtonContent is a pre-made widget for this use case
that provides everything you need.
2022-07-16 20:02:21 +01:00
Christopher Davis 7c2e0c3693 general: Remove unnecessary use of receives-default
Same rationale as previous commit for `focusable`.
2022-07-16 20:02:21 +01:00
Christopher Davis 8837c869dd general: Remove unnecessary use of focusable
gtk4-builder-tool tries to port uses of `can_focus` to `focusable`,
but in real code you generally don't need to set `focusable` - the
defaults are always sensible, and removing the explicit property
means less code without any behavior change.
2022-07-16 20:02:21 +01:00
Christopher Davis 5fe9df1a39 grid-view: Don't set focusable
The view can receive focus, which causes it to draw an unnecessary
ring when focused and requires an extra focus step to get into the
items.

The view itself should not be focusable. This was set as a translation
of `can-focus`, but the semantics are different, and you generally
don't want to manually set `focusable` as the widgets set proper
defaults.
2022-07-16 20:02:20 +01:00
Corey Berla 6f81f1b46f list-base: Clear scroll_to idle handler before clearing list-base
When you the navigation buttons to go back and forth very quickly
you can reliably get Nautilus to crash.  This happens because there
is an idle timer set to scroll to the item to be selected.  If you
change the view before the scroll has happened, the handler will
attempt to scroll to a non-existent item.

Clear scroll_to_file_handle_id before clearing all view items
in real_clear().
2022-07-16 08:13:19 -07:00
Corey Berla 4a7d4c2965 pathbar: Don't make new tab active
Opening a new tab from the main view and side bar is set with
NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE.  Prior to
022867e3d3 this was the same for tabs opened
from the pathbar.  It appears that the change was unintentional
(GTK Open Flags don't have a "don't make active" flag).

Set new tabs as not active from the path bar.
2022-07-16 08:13:19 -07:00
Corey Berla aa1f6d50c4 toolbar: Open new tab on back/forward middle click
Middle click should open a new tab.  This is consistent with
the main view, sidebar, and pathbar.  When opening the new tab
set the location preemptively to either one location forward or
back.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1490
2022-07-16 08:13:19 -07:00
Corey Berla 802a33b3e7 window: Add helper to open new tab from a back / forward selection
Add function like nautilus_window_back_or_foward(), but instead
of acting on the current slot, open a new tab.  This will be used
when middle clicking the navigation buttons in the toolbar.
2022-07-16 08:13:10 -07:00
Corey Berla 55c6e19682 window: Move NautilusNavigationDirection from toolbar.c to window.h
We need to reuse the same enum when navigating to new tabs.
2022-07-16 08:00:50 -07:00
Codeboybebop 22ecf3809c grid-view: Make GridView fill the whole height
valign property of the widget responsible for the folder content was
set to GTK_ALIGN_START. This widget was moved to the top part of
the parent if this widget receives enough space. However, this
is not needed in this situation, since GridView already placing
folders and files from top to bottom. Also, the height of
the GridView was bounded by parent height and by some linear
function of the number of elements in a folder.
Changing valign will force the GridView to fill all allowed vertical space.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2301
2022-07-16 14:27:11 +00:00
Danial Behzadi 07fdcbe3f1 Update Persian translation 2022-07-16 13:30:44 +00:00
Piotr Drąg 6f8316b39a Update POTFILES.in 2022-07-16 13:50:57 +02:00
Yuri Chornoivan e6a4c96b87 Update Ukrainian translation 2022-07-16 05:45:41 +00:00
Hugo Carvalho d2803bb7c3 Update Portuguese translation 2022-07-15 11:18:07 +00:00
Corey Berla f5465fdf7e clipboard: Check for empty string when deserializing
It's possible that nautilus_clipbaord_from_string() receives an
empty string.  When an empty string is received nautilus crashes
because g_str_equal() cannot handle the null value returned from
g_strsplit().  We could simply change g_str_equal() to g_strcmp0()
but that opens up the possibility for the for loop to give
unexpected results (it only checks for NULL starting at index=1).

Check if the results from g_strsplit()[0] == NULL and return early.
2022-07-15 07:00:12 +00:00
Corey Berla 0aa1b66ffa window-slot: Show special-directory info bar for Public folder
Check for schema org.gnome.desktop.file-sharing to verify
gnome-user-share is installed.
2022-07-14 18:51:14 -07:00
Corey Berla c92e98c4bb special-location-bar: Extend to support Public folder for sharing
gnome-user-share maintains an extension to create an info bar
in the ~/Public folder notifying the user of the ability to turn
on file sharing.  This is broken with 43.alpha because of gtk3-gtk4.
This is a core feature and it will be easier to implement and
maintain in Nautilus itself rather than as an extension.

Extend special-location-bar for the Public folder / sharing.
Use dbus-launcher to open Settings to the "sharing" panel on
button click.

Fixes: https://gitlab.gnome.org/GNOME/gnome-user-share/-/issues/26
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2155

See: https://gitlab.gnome.org/GNOME/gnome-user-share/-/merge_requests/18
2022-07-14 18:50:46 -07:00
Corey Berla 6ec528bae2 file-utilities: Add ability to check for installed schema
Now that we are bringing the gnome-user-share extension
into Nautilus itself, we need the ability to check
if gnome-user-share is installed.  GNOME Settings
does this by checking the schema.  Let's use the same
code that Settings uses.

This doesn't work within sandboxes, so if we are
sandboxed always return TRUE;
2022-07-14 16:30:11 -07:00
Corey Berla 12be10d331 sidebar: Use dbus-launcher to open gnome disks
When running Nautilus in a flatpak, the format option
is not available on the sidebar.  Use dbus_launcher
to check / run gnome disks for stability and flatpak
integration.
2022-07-14 22:09:29 +00:00
Corey Berla 8d4682b989 properties: Use dbus-launcher to open gnome-disks
Use the dbus_launcher to launch gnome disks rather than the
commandline for stability and flatpak integration.

Related to: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1997
2022-07-14 22:09:29 +00:00
Corey Berla 65455ab78f trash-bar: Use dbus-launcher to open settings
With the trash-bar the "settings" button opens Settings via
commandline which doesn't work within a flatpak.  Use dbus-launcher
to open settings for flatpak integration and stability.
2022-07-14 22:09:29 +00:00
Corey Berla d219b85d61 dbus-launcher: Launch programs via DBUS
Nautilus launches external programs (i.e. Settings & gnome-disks)
directly via the commandline which doesn't work in flatpaks.
Create new module nautilus-dbus-launcher to allow for launching
these programs via DBus.  nautilus-application holds ono a
singleton instance of the dbus launcher (similar to undo manager
and tag manager) so we don't need to create proxies over and over again.
2022-07-14 22:09:29 +00:00
Corey Berla c5fd01a8e5 places: Add properties to context menu of local and network mounts
Places only allows properties for "Computer". Add properties
for local and network mounts.
2022-07-14 22:09:29 +00:00
Corey Berla b17d6b290a places: Don't show available space for / when running in a flatpak
The available space is incorrect when running in a flatpak.
Don't show available space for "/" when the
/.flatpak-info file exists

Related to: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1997
2022-07-14 22:09:29 +00:00
Corey Berla 63f562117a properties: Don't show volume information for root when in flatpak
Nautilus shows incorrect statistics for the root volume when
running in a flatpak.  Don't show volume information when the
/.flatpak-info file exists

Related to: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1997
2022-07-14 22:09:29 +00:00
Corey Berla 662a38bb68 application: Move is_sandboxed() to allow re-use
Move function is_sandboxed() from mime-actions to nautilus-application
to allow reuse.
2022-07-14 22:09:29 +00:00
Corey Berla b1ab0c0ce0 properties-window: Remove duplicate include 2022-07-14 22:09:29 +00:00
Luming Zh 367958b148 Update Chinese (China) translation 2022-07-14 17:43:05 +00:00
Yosef Or Boczko 9a42b8ca54 Update Hebrew translation 2022-07-14 09:21:28 +00:00
Kukuh Syafaat 733024e1dd Update Indonesian translation 2022-07-12 10:45:09 +00:00
Hugo Carvalho ffb1987513 Update Portuguese translation 2022-07-11 15:15:43 +00:00
Danial Behzadi 3e1a6aab94 Update Persian translation 2022-07-11 13:44:29 +00:00
Yuri Chornoivan e80fc74b72 Update Ukrainian translation 2022-07-11 11:18:37 +00:00
Christopher Davis 91bc0ea9aa general: GtkPaned -> AdwFlap
Exchange the adjustable GtkPaned widget for AdwFlap. We lose a
resizable sidebar, but gain an adaptive one. For windows narrower
than 600px, we fold the sidebar.

The loss of the resizable sidebar means that all settings related
to it are removed.

Fixes #2156
2022-07-11 00:38:48 +01:00
Christopher Davis 07db1d6ff2 general: Always show sidebar
Always show the sidebar, and remove the setting to hide it.

We are going to introduce a replacement next commit: AdwFlap.
2022-07-11 00:36:50 +01:00
Christopher Davis 94ba087d09 window: Use NautilusGtkPlacesSidebar directly
Get rid of the middleman; Use `g_type_ensure()` to
initialize the type.
2022-07-09 15:01:47 -04:00