Commit graph

334 commits

Author SHA1 Message Date
Peter Eisenmann 16e3e6ddd3 eel: remove eel-glib-extensions.h
Replace the eel_boolean_bit typedef with a plain guint and remove all
includes.
2022-12-23 17:42:34 +00:00
Peter Eisenmann 10198a8174 eel: remove more unused functionality 2022-12-23 17:42:34 +00:00
Corey Berla 5d1fcf1e77 eel: Remove unused files
Usage was generally removed in 2d1deaac2d
2022-12-23 17:42:34 +00:00
António Fernandes 0c0e92a0ea eel-string: Support Unicode when capitalizing first character
And use this instead of g_ascii_to_upper() in app-chooser.c

This is more i18n-friendly.
2022-08-08 21:37:53 +00:00
Christopher Davis 021f0d828d eel-stock-dialogs: Use AdwMessageDialog for timed wait 2022-08-06 19:35:00 +01:00
Christopher Davis 2bfc3f3584 eel-stock-dialogs: Remove message dialogs
Now that we have AdwMessageDialog to provide a GNOME-compliant
message dialog API, we don't need the functions from eel.
This commit removes all of the functions for creating
dialogs from eel-stock-dialogs.
2022-08-06 19:35:00 +01:00
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
Ondrej Holy e55613a582 eel-stock-dialogs: Remove unused functionality
Some functions are no more used. Let's remove them instead of fixing
GTK 4 regressions in them.

Related: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2117
2022-02-07 16:41:05 +00:00
Ondrej Holy 7cad82c9d1 general: Make message dialogs modal again
After the GTK 4 port, some dialogs are no more modal. This is regression,
which is probably caused by the fact, that this needs to be explicitly
specified now. Let's make all the `GtkMessageDialog` dialogs modal again.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2117
2022-02-07 16:41:05 +00:00
António Fernandes e358c2343c general: Switch to GTK4
The new major version of the toolkit is a requirement to fix old issues and enable future enhancements.

Update symbols and adapt logic to API changes.
Update and simplify UI definitions.
Update local copy of places sidebar and places view.
Replace dependencies with their GTK4-compatible successors.
Make a minimum changes required to build and run, with known
regressions to be fixed in future commits.

For a detailed breakup of the changes, see the 36 commits-deep
log leading to d5763facb1e5045251171ed1273dca0859f3542f.

This is the main part of https://gitlab.gnome.org/GNOME/nautilus/-/issues/276
2022-01-09 01:25:39 +00:00
António Fernandes 23cb15d8ee eel: Drop gtk extensions
No longer used.
2022-01-05 11:32:12 +00:00
António Fernandes 8d974ecc60 files-view: Drop NAUTILUS_SCRIPT_WINDOW_GEOMETRY envar
It relies on X11-only information, such as the window position on the
screen, which is not known to the application under Wayland.
So, this was already broken.

Also, its implementation relies on GtkWindow API which is gone in GTK 4.
2022-01-05 11:32:12 +00:00
António Fernandes 2d1deaac2d general: Remove canvas view
The new grid view has reached feature parity with the canvas, if we
ignore drag-and-drop and clipboard support (which would need to be
reimplemented in GTK 4 anyway) and performance scalability (which is
a problem of GtkFlowBox and solvable by using GtkGridView in GTK 4).

The canvas view relies on extensive custom implementation for layout,
drawing, input handling, accessibility, etc., which would be too
hard to port to in GT1K4.

Furthermore, most of its features, such as support for manual sorting,
haven't been used since the "icons on desktop" feature has been taken
out from this app. We are actually using a swiss army knife for a job
where we only need a single blade -- a simple pocketknife would do!

Therefore, we say goodbye to this seasoned veteran widget, who has
served us for 2 whole decades.
2021-12-29 11:39:32 +00:00
António Fernandes 130a676b08 eel-stock-dialogs: Start and end va_list
This got lost in the refactoring and results in it not being initialized.
Thanks to Abderrahim Kitouni for reporting.
2021-12-29 11:14:06 +00:00
Matthew Jakeman b85def1615 eel-stock-dialogs: Remove eel_run_simple_dialog
This method is no longer used anywhere and can be
safely removed.

Part of #1992
2021-12-28 23:08:39 +00:00
Matthew Jakeman 67812f918d eel-stock-dialogs: Add eel_show_simple_dialog
Extracts the creation of simple dialogs to a new function
that does not depend on gtk_dialog_run. It is the caller's
responsibility to obtain a response from the dialog.

Part of #1992
2021-12-28 23:04:20 +00:00
António Fernandes 8c31d783ba general: Use envar to make warnings fatal in scripts
Same rationale as last commit.
2021-11-12 01:40:05 +00:00
António Fernandes 619970b1e8 general: Uniformize case code style
There are a few non-braced single-statement in the final cases, which
have  gone unnoticed until detected by a recent uncrustify update.

Let's add the missing braces around single-statements even if it's the
last case.
2021-07-11 22:05:51 +00:00
António Fernandes e9e026df88 eel-vfs-extensions: Document get_extension_offset
Mostly to remember callers must be ready to handle a NULL return value,
trying to prevent more bugs like the one fixed by the previous commit.
2021-04-30 11:52:45 +01:00
Joshua Lee d275c8bde1 general: Clean up signal handler disconnection
Make use of GLib's new g_clear_signal_handler() function to simplify nautilus'
signal handler disconnection and reduce unneccessary code.

Fixes: #1522
2020-07-08 19:37:24 +01:00
Marvin Schmidt 294c89d0f3 meson: Remove libX11 dependency
As of commit 70393e321 (general: Allow to compile on Wayland-only
system) libX11 is no longer a dependency
2020-05-01 19:39:03 +00:00
Ondrej Holy fd2e7dfdea general: Run uncrustify script
There are some style issue since the last run. Let's run it again
before enabling style-check CI job.
2020-04-05 16:22:26 +00:00
Ondrej Holy b477a7026c eel: Add redundant parentheses to prevent changes by uncrustify
Uncrustify changes "(*pixsrc++ * *pixdest)" to "(*pixsrc++ **pixdest)"
which is unwanted. Let's add redundant parentheses around "*pixdest" to
prevent these unwanted changes.
2020-04-05 16:22:26 +00:00
Vilhelm Prytz ba24423344 eel-canvas: Remove redundant comparison
Comparison is always false because positions >= 1

Makes comparison redundant
2020-03-29 19:43:26 +00:00
Abdul Rauf 2a741d9617
files-view: Say "Trash is Empty" only in trash:///
Empty trash widget is displaying for empty folder inside trash
instead of Empty folder widget.

`eel_uri_is_trash` only checks whether the URI starts with "trash:",
that's why it also returns true for empty folders inside trash.

Create `eel_uri_is_trash_root` to distinguish trash root (trash:///)
from empty folder inside trash (trash:///emptyfolder)

Closes https://gitlab.gnome.org/GNOME/nautilus/issues/1367
2020-02-15 14:16:03 +05:00
Javier Jardón 70393e321c general: Allow to compile on Wayland-only system
Remove unneeded includes and add some guards to X11-only code.
2019-12-01 00:11:24 +09:00
florin.diaconescu 11da28bcfe eel: string: Add documentation
This commit adds comments describing the functionality,
the parameters and the return values of the functions that were not
documented.
2019-05-27 11:42:43 +02:00
Carlos Soriano e03376b9d8 eel-graphic-effects: Make hover light less intense
With the new icons most of the area was white.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/827
2019-02-22 14:44:16 +00:00
Jordan Petridis b4d200fed3 file: replace eel_ref_str with GRefString
glib now offers a reference counted api.
This allows us to replace a lot of legacy code and get rid of
eel_ref_str. GRefString [1] is almost a drop-in replacement.

nautilus-file-operations.c was indirectly depending upon
eel/eel-string.h from nautilus-file-private.h and thus
a new include was added.

This bumps the minimum version of glib to 2.58

Close #781
https://gitlab.gnome.org/GNOME/nautilus/issues/781

[1] https://developer.gnome.org/glib/stable/glib-Reference-counted-strings.html
2019-02-22 11:29:57 +00:00
ionbabalau d4983562d6 eel-string: Add description to some eel-string functions
The eel_str_double_underscores and eel_str_capitalize
functions didn't have documentation.
Added importance of eel_str_double_underscores as well.

It's good practice to have documentation for functions
in the long term.
2018-10-29 15:57:26 +00:00
Ernestas Kulik 487213ad9b canvas-item: Drop gtk_style_context_get_background_color()
Even though more convoluted than the previous solution, this one
should last longer. Canvas item icons are now colorized by first drawing
the background to a Cairo surface and then multiplying the color values
of the original icon pixbuf and the ones from the newly created one.
2018-05-30 11:39:13 +03:00
Ernestas Kulik 0a6e406344 eel: Remove superfluous include
gdk/gdkprivate.h is no longer a thing in GTK+ 4 and doesn’t seem to be
at all required.
2018-05-28 13:13:56 +03:00
Ernestas Kulik bde55f4189 eel: Remove a11y utilities
In theory, it would be possible to just drop the GAIL code and keep the
header, but, given that NautilusCanvasItem is the only remaining
consumer, the needed bits can be moved over.
2018-05-22 16:52:48 +03:00
Ernestas Kulik 0cad9482c0 eel: accessibility: Use ATK to get accessible object
atk_gobject_accessible_get_object() does the same thing and doesn’t
require redefining quarks or using magic strings.
2018-05-22 16:52:48 +03:00
Ernestas Kulik 1de2ec116d eel: glib-extensions: Move functions to Nautilus
They’re only used once, so why not.
2018-05-18 14:39:23 +00:00
Ernestas Kulik 3e3bd830b5 eel: string: fix middle truncation test cases
f42979f0b0 changed the ellipsis to a
unicode one, which is one character in length, in turn changing the
expected output.

For cases where the truncation length is zero, the expected output is
changed to NULL, as 536505728e added an
assertion.
2018-03-21 10:05:45 +02:00
Alexandru Fazakas aa7cfcf01c eel: self-checks: Fix misaligned arguments
A couple of arguments were misaligned, so we placed
them properly.
2018-03-19 14:49:44 +02:00
Alexandru Fazakas 95ecfc8ea0 general: Remove include guards in favor of pragma once
The traditional include guards are not as easy to handle
and require extra thought into the names.

Pragma once is an easier, more contributor friendly approach.

Closes https://gitlab.gnome.org/GNOME/nautilus/issues/294

general: Remove include guards in favor of pragma once

The traditional include guards are not as easy to handle
and require extra thought into the names.

Pragma once is an easier, more contributor friendly approach.

Closes https://gitlab.gnome.org/GNOME/nautilus/issues/294
2018-03-19 14:43:38 +02:00
Ernestas Kulik df583c2e4a general: Allow running in separate instance
When hacking on Nautilus, it is very inconvenient to have to close any
running instance before running the built version. This commit enables
running three different instances by changing the application ID.
Beside the default “profile” is one crafted for stable flatpak
releases and one for development. The stable flatpak profile adds an
identifying mark to the about dialog to aid collecting information in
bug reports. The development profile is that plus additional styling to
help visually identify the development instance. It also will be used
when generating Flatpak bundles with the help of CI.

Generally, the implementation is slightly hacky to allow all the
different workflows, spanning from regular installations to GNOME
Builder flatpak builds, as each comes with its own quirks.
2018-03-18 22:28:08 +02:00
Ernestas Kulik 510a8303dd build: make all tests optional
This can help cut down on link times a bit when working on things.
2018-03-16 06:22:36 +02:00
Ernestas Kulik 7447f62fc7 eel: string: remove custom strdup_printf functions
These aren’t used anywhere and cause Clang to spit out errors about
format strings not being literals.
2018-03-05 11:26:49 +02:00
Ernestas Kulik 9f9183d83e eel: string: remove tautological comparison 2018-03-05 11:26:49 +02:00
Ernestas Kulik 6286e0a079 general: don’t shadow variables
Shadowing variables is error-prone, since one might mean to refer to a
variable that was declared earlier, but has the same name. Additionally,
being more strict about variable scoping can help make the code more
readable.
2018-03-01 08:37:50 +00:00
Ernestas Kulik 536505728e eel: string: refactor middle truncation
This commit tries to make the function more readable and fixes the allocation of
the new string: the truncated string is of the same size as the source string.
This can be fixed by adding a couple of different allocations. :)
Some comments were trimmed down or removed.
2018-02-27 08:59:08 +02:00
Carlos Soriano b6ebffd567 general: Run uncrustify 2018-02-13 20:11:55 +01:00
Carlos Soriano 27b039b37c general: Rename from 'favorite' to 'starred'
It was a mix of both terms, given that tracker uses 'favorite' but we
use 'starred' in the UI. Since the part that interact with tracker is
minimal, is better to be consistent with the UI.

This renames 'favorite' to 'starred' except the tracker queries.
2018-02-13 20:11:55 +01:00
Carlos Soriano c6657af342 files-view: Show starring only for indexed (by default) files
Currently the star menu item is shown for every file in the system,
however when a file is not indexed by tracker this operation fails.

We cannot set Tracker to index the file and wait for Tracker to index
it, since that happens in an idle and Tracker doesn't queue the
operation of starring.

There is no easy solution for this, so for now we will show the star
menu item for indexed (by default) locations, which are the XDG folders,
otherwise we will hide the item.

A better solution needs to be researched for 3.30, but this will do for
now.

Related https://gitlab.gnome.org/GNOME/nautilus/issues/243
2018-02-12 13:20:38 +00:00
António Fernandes f2f0947627 eel-string: Fix API comment
eel_string_ellispize_*() functions and eel-gdk-extension.h
are no more. This comment was totally outdated.

Replace it with actual API docs.
2018-02-06 22:59:21 +00:00
António Fernandes f42979f0b0 eel-string: middle_truncate with ellipsis character.
Instead of 3 periods ("...")
2018-02-06 22:58:45 +00:00
Ernestas Kulik 971b90d646 eel: gtk-extensions: readd removed function prototype
f0df1fc510 removed the prototype of a
function that is still being used.
2018-01-20 23:35:18 +02:00