Commit graph

299 commits

Author SHA1 Message Date
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
Ernestas Kulik f0df1fc510 general: only remember window size
Currently, Nautilus is able to save the last window position when it’s
closed. That is broken in certain cases (#197 and multi-monitor setups
in general) and therefore window placement is best left to the window
manager.
2018-01-16 13:23:54 +02:00
Carlos Soriano ec3eefcd2e tests: Put eel check and nautilus check under display-test option
Although eel can be split into displayless and display like we did for
other tests, let's make sure we have a working prototype for now.
2018-01-06 01:59:04 +01:00
António Fernandes 6c5f6ecc28 eel-vfs-extensions: Remove unused, undefined API
Leftovers from the gnome-vfs to gio port 10 years ago
https://git.gnome.org/browse/archive/eel/commit/?id=59511dfee330102ee42e09bef37cbc9cd12973c6
2018-01-04 18:32:50 +00:00
Ernestas Kulik d48db627fc eel: remove unused code
Additionally, this commit makes some unused public functions static.
2018-01-02 13:11:10 +02:00
Ernestas Kulik e3777b5410 program-choosing: drop eel dependency
Terminal applications are launched via eel, and, since this file is the
only consumer of that API, the code from eel can be moved over.
2018-01-02 13:11:10 +02:00
Ernestas Kulik 983892a656 build: general cleanups
This commit does the following:
  * Canonicalize the style:
    * Use two-space indentations.
    * Un-Autotools-ify option names.
    * Don’t align arguments, simply increase indentation.
    * Don’t add a space before opening parenthesis in calls.
  * Remove unused variables.
  * Remove unused dependencies.
  * Remove config.h.meson.
  * Optimize dependencies.
  * Use disabler functionality for libselinux dependency, to save lines.
2018-01-02 12:51:32 +02:00
Ernestas Kulik 74dd9c9f72 general: remove desktop support 2018-01-02 12:51:32 +02:00
Carlos Soriano f3f28052ec Merge branch 'remove-error-details-expander' into 'master'
Remove error details expander

See merge request GNOME/nautilus!41
2018-01-01 23:36:19 +00:00
Ernestas Kulik 61ac48bdc0 file-utilities: rework common prefix computation
Currently, the process for getting the common prefix of a list of file
names is a tad too greedy:
    1. Find the common prefix of all the strings.
    2. Strip the extension from the prefix.
    3. Strip trailing punctuation.

Step 2 may strip dots if there’s trailing whitespace and step 3 may
strip useful punctuation (e.g. parentheses). This commit reworks the
process as such:
    1. Strip the extension from all the file names.
    2. Find the common prefix of all the strings.
    3. Trim trailing whitespace.

Fixes #174.
2017-12-23 17:38:17 +02:00
Alexandru Fazakas 490a6cbeb8 file-operations: Port error details inline
As the eel_gtk_message_dialog_set_details_label function is only used once,
we can safely remove it and do everything inside of nautilus-file-operations.c.

Thus, we deleted the eel function and we do everything inside the
do_run_simple_dialog function and remove the function header from the header
file. We add the label straight into the content_area of the dialog box.

https://bugzilla.gnome.org/show_bug.cgi?id=598671
2017-12-21 02:11:24 +02:00
Alexandru Fazakas 28ae2d032b eel/eel-gtk-extensions.c: Remove expander showing error details
Creating directories within read-only ones is not allowed and appropriate
error messages pop up.

Trying to create a directory within a read-only directory opens a window
showing the error. Within the window, an expander shows the error details.
Whenever the expander is clicked, the window moves unexpectedly.
We need to fix this as the behaviour is not normal and doesn't look good.

In order to fix the issue, we removed the expander and included the error
details as a label inside the dialog box itself.

https://bugzilla.gnome.org/show_bug.cgi?id=786212
2017-12-20 01:35:21 +02:00
Alexandru Pandelea a9c446afe2 Add favorite files
Add option to make files Favorite, by either toggling a star in the
list view, or from the context menu.

https://bugzilla.gnome.org/show_bug.cgi?id=786039
2017-11-05 20:09:00 +01:00
Kevin Lopez 047735a28b eel-gtk-extensions: avoid deprecated warnings
This patch avoids the use of gdk_screen_get_width,
gdk_screen_get_height,gdk_screen_width,gdk_screen_height, functions
which are deprecated since 3.22 version of GDK library.

Also deletes the eel_pop_up_context_menu function since is not used
in the source code.

https://bugzilla.gnome.org/show_bug.cgi?id=780283
2017-08-17 15:37:45 +02:00
Ernestas Kulik 857a90c29b autotools: kill it
We’re moving to Meson this cycle, so this is losing some deadweight.

https://bugzilla.gnome.org/show_bug.cgi?id=780366
2017-03-22 17:18:29 +02:00
Ernestas Kulik ed5652c89a general: add support for Meson
Since it’s 2017 already, Nautilus should use a build system that doesn’t
take longer to set up the build than it takes to actually build. An
observed build time using Ninja of roughly one-fifth of what it took
Autotools is more than reason enough to add support for Meson. Along
with that, this commit adds a convenience script to generate a tarball
for releases, since we use libgd as a submodule and Meson does not
handle source distributions.

https://bugzilla.gnome.org/show_bug.cgi?id=778167
2017-02-24 00:24:27 +02:00
Ernestas Kulik 728300331d general: drop git.mk
This commit removes git.mk and adds hand-written gitignore files. That
is needed to ignore build/, which is the directory of choice for Meson
builds.

https://bugzilla.gnome.org/show_bug.cgi?id=778167
2017-02-24 00:24:27 +02:00
Mohammed Sadiq 3c8d450cd6 nautilus-toolbar: disable bookmark on 'Other Locations'
'Other locations' is already listed in the sidebar. So there is no
need for allowing the user to bookmark 'Other Locations'.

This commit makes the bookmark button in toolbar insensitive for
'Other Locations'.

https://bugzilla.gnome.org/show_bug.cgi?id=771163
2016-09-21 10:24:19 +02:00
Alexandru Pandelea 0b6a05851d eel-vfs-extensions: Update filename extensions
If a file had the extensions .tar.bz or .tar.xz, the function
eel_filename_get_extension_offset would identify only .bz or .xz as
an extension.

To fix this, .xz and .bz were added among the other special cases.

https://bugzilla.gnome.org/show_bug.cgi?id=771018
2016-09-08 21:54:20 +03:00
Carlos Soriano 0abaab1c44 general: adjust uncrustify style
https://bugzilla.gnome.org/show_bug.cgi?id=770564
2016-09-06 15:41:06 +02:00
Carlos Soriano 52d960542b general: run uncrustify
And make the style of Nautilus the same for all files.
Hopefully we can fix all the style issues we can find in the next days,
so expect a little of movement on this.

https://bugzilla.gnome.org/show_bug.cgi?id=770564
2016-08-29 18:37:10 +02:00
Neil Herald ca0e00b6b3 files-view: change "New Folder /w Selection" to offer a name
New Folder with Selection currently doesn't offer a folder name. It
would be better if it suggested a folder name based on the files that
are selected.

With this change, it now looks for a common filename prefix of the
selected files, and pre-populates the folder name entry with that. If no
common prefix is found that is greater than 3 characters long, the
folder name entry will be left blank.

https://bugzilla.gnome.org/show_bug.cgi?id=747907
2016-07-10 08:30:48 +01:00
Ernestas Kulik f3aabd3d17 eel-canvas: don't override deprecated functions
AtkComponentIface's {add,remove}_focus_handler should not be overridden,
since ATK 2.9.4, as atk_component_{add,remove}_focus_handler() are
deprecated.

This commit removes deprecated virtual function overrides.

https://bugzilla.gnome.org/show_bug.cgi?id=762236
2016-05-03 13:16:56 +03:00
Ernestas Kulik 225f2cf768 eel-canvas: use GdkSeat operations
Some GdkDisplay operations have been deprecated in GDK 3.20.

This commit replaces the deprecated code in eel_canvas_item_grab() and
eel_canvas_item_ungrab() functions with new GdkSeat operations.

https://bugzilla.gnome.org/show_bug.cgi?id=762235
2016-05-03 12:57:29 +03:00
Carlos Soriano 1ffb8ca593 general: remove vim modelines
Vim and emacs modelines are used to specify some of the code style in the code.
However, this is misleading and poorly supported since nautilus had a mix of
code style for some time.
Also, the mode lines doesn't specify the whole code style, so we will need to
use a different tool as well to specify the whole code style.
For that, we can just use a different tool for everything.

So remove the mode lines, and in a short future we will reestyle the nautilus
code to have a single code style, and use a tool like editorconfig to specify
the whole code style.
2016-04-04 18:08:36 +02:00
Carlos Soriano ab61aa46d8 eel-canvas: remove background draw handling
This seems no longer necessary. It looks like it was done to avoid
flashing when redrawing, but probably this was fixed sometime in the
past, so a transparent background in a widget doesn't flash anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=761965
2016-02-15 11:38:43 +01:00
Carlos Soriano 864c815479 file: refactor eel-partition for better ownership management
Instead of a generic function to filter GLists, implement a simpler
and clearer filter function for file lists, since it was the only
use of that function.
In this way the ownership of files and directories are clearer
since it always returns a new allocated nautilus file list, and also
it always uses nautilus_file_ref instead of the generic g_object_ref
to match what we do everywhere else in nautilus, so it's not confusing
when breaking at nautilus_file_ref/unref for ref counting debugging.

This change fixes multiple leaks on nautilus files catched by valgrind.
2015-12-11 22:42:04 +01:00
Georges Basile Stavracas Neto 6adf3cf74c project: replace deprecated GtkMisc calls
GtkMisc is deprecated since 3.14 release, being replaced
by GtkWidget's halign & valign, and GtkLabel's xalign &
yalign.

Nautilus, however, did not updated its codebase to match
the new deprecations.

Remove any reminescent gtk_misc* calls from the codebase.
2015-07-21 18:20:26 -03:00
Cosimo Cecchi 396aa4b0e5 eel: remove eel_embed_image_in_frame()
It's unused now.
2015-05-24 19:41:39 -07:00
Cosimo Cecchi c590053c18 eel: remove some unused API 2015-05-23 13:45:39 -07:00
Cosimo Cecchi e816485d52 eel: remove unused EelEditableLabel
This was only used for in-place renaming inside the canvas container,
which does not exist any more. Remove it.
2015-05-23 12:14:32 -07:00
Cosimo Cecchi cbc37d3ecd Don't mention FSF address
Use the website instead.

https://bugzilla.gnome.org/show_bug.cgi?id=721518
2014-02-17 14:41:43 -08:00
Daniel Mustieles e314fbcc99 Updated FSF's address 2014-01-31 14:13:48 +01:00
Alexander Larsson c3b2b0a022 EelEditableLabel: Render background
Without this the rename widget background is always transparent, which
makes it very hard to read on e.g. the desktop with a background
image.
2013-11-06 10:23:58 +01:00
Alexander Larsson 481cf68948 Fix rename entry position
We need to not modify the cairo_t when we propagate up to the parent class
as this affects where GtkLayout draws the child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=705464
2013-11-04 16:50:48 +01:00
Cosimo Cecchi 4edfee8c40 eel: don't use deprecated GtkStock and GtkImageMenuItem 2013-08-13 12:34:51 +02:00