Commit Graph

43559 Commits

Author SHA1 Message Date
621e941bf2 app: parse the release date for the last release.
I was mistakenly using the date of the last check, not the release date.

(cherry picked from commit d5febf6e62)
2020-02-07 00:14:10 +01:00
1e76a008c5 app: also localize LC_TIME to GUI language.
When we set the GUI language through Preferences, also set LC_TIME, so
that locale-aware date functions also produce the right formats.

For instance, I use this in the About dialog to format the release date
of the last version of GIMP.

(cherry picked from commit a4e65ac836)
2020-02-07 00:14:10 +01:00
49f1d83488 app: show the About dialog at startup when a new version is available.
This about dialog will complain an explicit message about the new
version and a link button to go to the download page.

(cherry picked from commit 6b237b90fd)
2020-02-07 00:14:10 +01:00
bb316e5376 app: add alternative "Check for updates" button in the About dialog.
When an update is available, a big frame is visible, proposing to go to
the download page. Now a button is also available to explicitly request
for an update check in other cases (bypassing the wait delay for a
future startup).

(cherry picked from commit 827473fd88)
2020-02-07 00:14:10 +01:00
52e3b02768 app: show new version availability in About dialog.
I was wondering which shape should take the new version notification
(again some ugly pop-up?!) and realized using the About dialog was a
good idea.
This is preparatory work for this to happen.

(cherry picked from commit 826ece3b86)
2020-02-07 00:14:10 +01:00
07807203b5 app: make gimp_versions.json parsing easier to test.
First, let's make the check happen at each startup on unstable (still
once a week on stable).
Second, make it parse gimp.org's gimp_versions.json on stable, but
testing's one on unstable and also check environment variable
GIMP_DEV_VERSIONS_JSON (unstable only) to allow setting a local path
(allowing to tweak the file and test various cases).

Unrelated to testing, some improvements:
- save a timestamp in seconds (really no need to keep microseconds
  precision here).
- just in case, check that the saved timestamp is not in the future.

(cherry picked from commit b874cadfad)
2020-02-07 00:14:10 +01:00
af91989eff app: fixes int overflow warning.
This fixes the following warning when compiling with Mingw:
> warning: integer overflow in expression of type 'long int' results in '-694967296' [-Woverflow]

(cherry picked from commit bb7f229b97)
2020-02-07 00:14:10 +01:00
ef4b353b49 app: check last GIMP release from gimp.org/gimp_versions.json.
GIMP will now process the remote gimp_versions json file to look if one
is using the last version of GIMP. This initial code doesn't act up yet
on this information. This will come in further commits.

Here are the characteristics:
- Since this requires internet access, a new checkbox is available in
  the Preferences dialog, allowing to disable version checks. Note that
  it is enabled by default as it is an important security feature, but
  it has to be deactivatable.
- The remote access is done as an async operation because we don't want
  it to block the startup in any way (for whatever reason). Also it
  doesn't output errors if it fails to not be a bother (you don't
  technically need internet access for an image program).
- We don't check at every startup. At each successful check, we save a
  timestamp to prevent too frequent useless checks (I set it the timer
  to a week or more for now).

(cherry picked from commit 506a0476f4)
2020-02-07 00:14:10 +01:00
8537ee8661 app, configure: add configure option for a build id and revision.
The point will be for a packager to create a unique build ID to identify
the build or provenance. I also add a revision number so that we can
identify 2 builds from the same version/commit, same maker and platform.

It will also be used later to check for new versions (see "phone home"
feature #2584).

Separating autotools and meson commits for easy backport.

(cherry picked from commit 73c09ebb32)
2020-02-07 00:14:09 +01:00
Ell
9ea30995d7 app: in polynomial_odd_roots(), fix derivative array size
(cherry picked from commit db678ad212)
2020-02-07 00:56:11 +02:00
9a817d28dd Update Spanish translation 2020-02-06 10:35:53 +00:00
Ell
97938d78f5 app: respect brush-outline preferences in the Warp tool
In the Warp tool, handle the brush-outline and cursor prefernces
(namely, show-brush-outline, snap-brush-outline, and
show-paint-tool-cursor) similarly to the paint tools.

(cherry picked from commit 5cc9af09b0)
2020-02-05 21:37:14 +02:00
Ell
2c15299bda app: initialize GimpPaintTool::snap_brush field
(cherry picked from commit 272fa300aa)
2020-02-05 21:37:14 +02:00
Ell
ba772e6bf0 app: add "Snap brush outline to stroke" option to the preferences
Add a new "Snap brush outline to stroke" toggle to the "Image
Windows" preferences page.  When enabled, the brush outline in
paint tools snaps to the individual dabs while painting, instead of
following the cursor precisely (this is the existing behavior).
When disabled, the brush outline follows the cursor while painting
in the same way it does while not painting.

Disable the option by default.  This seems to be what most other
programs are doing, and it does give paitning a smoother feel.

(cherry picked from commit 499834a1cb)
2020-02-05 18:44:26 +02:00
7f632df33a Update Russian translation 2020-02-05 15:10:56 +03:00
Ell
4ef668676e app: set the default 3D Transform tool mode to rotation
Change the default mode of the 3D Transform tool from CAMERA to
ROTATE.  Canvas interaction is limited in camera mode, while
rotation is the main function of the tool.

(cherry picked from commit 251d758771)
2020-02-05 09:28:49 +02:00
Ell
8722629aac app: add missing file to last commit
(cherry picked from commit 3a8725a409)
2020-02-05 01:19:21 +02:00
Ell
1156b1e89e app: don't reject toolrc files due to missing experimental tools
Add a new GimpToolInfo::experimental boolean field, and mark
GimpNPointDeformationTool and GimpSeamlessCloneTool as
experimental.  In gimp_tools_deserialize(), don't reject the file
if the only missing tools are experimental, but rather add them to
the passed container.  In particular, this prevents us from
rejecting the default toolrc file when experimental tools are
enabled.

(cherry picked from commit 9f298f767f)
2020-02-05 00:07:22 +02:00
Ell
50ef78a52e app: increase display update rate
Now that painting is done in a separate thread, the display update
rate has a far smaller impact on it.  Increate the GimpDisplay
update rate, which handles image updates, to 60 FPS, and the
GimpDrawTool update rate to 120 FPS.  In particular, the latter
change makes brush-outline motion much smoother.
2020-02-04 17:51:14 +02:00
5dd59fdaff Updated Spanish Translation 2020-02-04 12:32:47 +01:00
357fd0fc20 Updated Spanish Translation 2020-02-04 12:30:33 +01:00
219d368459 Update Spanish translation 2020-02-04 11:30:03 +00:00
Ell
7a29aca309 Issue #4174 - Crash when using the Foreground Select tool with an offset drawable
In the Foreground Select tool, use the drawable bounds (including
its offset) as the trimap buffer extents, which is now supported by
the rest of the code.  This is both more streamlined, and works
around a GEGL bug (independently fixed by commit
gegl@378cd512c35fe2eb255492f90b503a67ab38d7a3), causing
gegl:matting-global to segfault when the drawable and trimap bounds
are differnet.

(cherry picked from commit 666d0845e1)
2020-02-03 21:21:17 +02:00
Ell
a1eb04ea71 app: in GimpCanvasBufferPreview, take strong ref on buffer
In GimpCanvasBufferPreview, take a strong reference on the preview
buffer, fixing a segfault in the foreground-select tool when
switching engines while the grayscale preview is active.

(cherry picked from commit ea864e2d5c)
2020-02-03 21:21:17 +02:00
Ell
f4dc0fd147 app: in GimpCanvasBufferPreview, add support for offset buffers
Ditto.

(cherry picked from commit 43f8a5199f)
2020-02-03 21:21:17 +02:00
Ell
21d6c8a8da app: add support for offset buffers in GimpScanConvert
Ditto.

(cherry picked from commit d920569771)
2020-02-03 21:21:16 +02:00
Ell
901b0e7211 app: add support for offset buffers in gimp_channel_select_buffer() ...
... and gimp_gegl_mask_combine_buffer()

Allow the functions to work with buffers whose top-left corner is
not at (0, 0).

(cherry picked from commit 24534338e7)
2020-02-03 21:21:16 +02:00
Ell
113c1a6838 Issue #4285 - [Free Select Tool] functionality bug with Ctrl/Shift combination
While GimpPolygonSelectTool is active, don't let GimpSelectionTool
handle the Shift/Ctrl modifiers, which are handled by the tool
widget, unless they're used in combination with Alt, in which case
they're used to move the selection, instead of control the
selection mode.

(cherry picked from commit 0c917cb359b0ace43f82c68e36e64221ab1bcf91)
2020-02-03 12:38:59 +02:00
Ell
0bc37ce94a app: reorganize GimpPolygonSelectTool functions
... to match the GimpTool virtual-function order.

(cherry picked from commit f4adfd5a905f5e1f8001a4900e38d52968b1e93d)
2020-02-03 12:38:59 +02:00
Ell
0ad20b24f2 app: improve empty-selection check in GimpSelectionTool
Add a new GimpSelectionTool::have_selection() virtual function,
which determines if the image has a selection (default
implementation), or if the tool will create one upon committing
(implemented by subclasses).  Use this function in
gimp_selection_tool_oper_update() to determine the tool function;
in particular, don't use SELECTION_MOVE and SELECTION_MOVE_COPY
when there's no selection.

Override have_selection() in GimpFreeSelectTool, and return TRUE if
we have a polygon with three or more vertices, which will create a
selection upon committing.

(cherry picked from commit aeff0d6207463d0ed6f97e39e6b2450a60715863)
2020-02-03 12:38:59 +02:00
Ell
b94e8d91ea app: fix typo in gimpselectiontool.c 2020-02-03 12:38:46 +02:00
Ell
7dd7c67d0c app, po: don't translate gimppanedbox.c
... it doesn't have any translatable strings anymore.

(cherry picked from commit b8aba199a0)
2020-02-03 00:55:48 +02:00
Ell
a8e1cb83ff app: don't use gimp_highlight_widget() in GimpPanedBox
We already do our own highlighting of the droppable areas, so this
is just visual clutter.

Also, a fix for last commit.
2020-02-03 00:33:34 +02:00
Ell
4730bc2a4d app: "You can drop dockable dialogs here" no more!
This commit removes the empty-dock-pane message, and instead
highlights all empty dockable drop-target areas once a drag
operation begins.

Add new gimp_dockbook_{add,remove}_callback() global functions,
which can be used to register a callback function to be called when
a dockable drag operation begins and ends.

Register such a callback in GimpPanedBox, and use it to highlight
all drop areas the widget handles.  Furthermore, when the widget is
contained in a GtkPaned, make sure that it has a minimal size for
the duration of the drag operation, so that the drop area is
visible even if the widget is normally hidden.
2020-02-03 00:05:44 +02:00
Ell
fd162391b7 app: fix GimpToolEditor visibility-toggle state update
In GimpToolEditor, update the visibiltiy-toggle state in response
to the corresponding tool-item's "notify" signal, rather than its
"shown-changed" signal, since the latter is not emitted when the
item's visibility changes while it's not shown.

(cherry picked from commit df19401fb3)
2020-02-02 16:44:31 +02:00
6d347dba5e Update Polish translation 2020-02-02 12:58:08 +01:00
Ell
9362e89b50 app: add a "Use tool groups" option to the toolbox preferences
Add a new Gimp::tool_item_ui_list, which is a GimpTreeProxy over
Gimp::tool_item_list.  This allows us to use either a hierarchical
or a flat tool list in the UI, by setting the "flat" property of
the new list.

Use Gimp::tool_item_ui_list in GimpToolPalette, so that the toolbox
layout is affected by this choice.

Add a "Use tool groups" toggle to the toolbox preferences, and bind
it to the "flat" property of Gimp::tool_item_ui_list.

(cherry picked from commit 3cda972100)
2020-02-01 13:20:23 +02:00
Ell
6c86a4c611 app: add GimpTreeProxy
Add a new GimpTreeProxy container class, which proxies a
GimpViewable tree.  The proxy has a dynamically-settable boolean
"flat" property, which controls if the tree hierarchy is preserved,
or if it's viewed as a flat list.

(cherry picked from commit 2caa518b19)
2020-02-01 13:16:03 +02:00
Ell
01cebc4307 app: add gimp_container_search()
Add a new GimpContainer::search() virtual function, and a
corresponding gimp_container_search() function, which works
similarly to gimp_container_foreach(), except that the callback
returns a boolean.  When the callback returns TRUE, the search is
stopped, and the current object is returned.

Implement GimpContainer::search() in GimpList.

(cherry picked from commit c4cc015c43)
2020-02-01 13:15:53 +02:00
Ell
f95decdc9f app: add GimpToolItem::shown property
Add a new read-only GimpToolItem::shown property, and a
corresponding GimpToolItem::shown-changed signal, which determines
if a tool item is visible throughtout the hierarchy, i.e., if it
and all its ancestors are visible.  This replaces
gimp_tool_item_is_visible().

Use the new property and signal in GimpToolPalette and
GimpToolEditor, to simplify the code, and in preparation for a flat
toolbox view.

(cherry picked from commit ee9661237e)
2020-02-01 13:15:52 +02:00
Ell
defc949724 app: use a weak pointer for tool-manager active group
In GimpToolManager, use a weak pointer for tracking the active tool
group, instead of taking a reference on it.  This avoids
erroneously extending the group's lifetime, which can cause
problems with the tool-item hierarchy.

In GimpToolGroup, make sure that newly-added tools don't already
have a parent.

(cherry picked from commit 30d833d00f)
2020-02-01 13:15:52 +02:00
Ell
5f97141ba6 app: fix a super secret segfault
(cherry picked from commit 2145f4301c)
2020-01-30 18:28:57 +02:00
Ell
c58d4017de app: move tool-activation upon tool-group active-tool change to GimpToolManager
When the active tool of the tool group associated with the
currently-selected tool changes, we select the new active tool;
this is currently handled in GimpToolButton.  Move this logic to
GimpToolManager, which already handles the other half of the
problem: updating the group's active tool when one of its tools is
selected.
2020-01-30 16:39:22 +02:00
f8dd60dba0 Update Spanish translation 2020-01-30 09:05:32 +00:00
Ell
b0f0013af6 app: various fixes to last commits
(cherry picked from commit bae9f2d880)
2020-01-30 10:46:21 +02:00
Ell
daad6a78b5 etc: add a default toolrc file, using tool groups to oragnize the tools
Add a default toolrc file, installed in the sysconf dir, with a
more minimalistic tool layout using groups, inspired by Photoshop
(not identical, though, don't kill me! :)
2020-01-30 02:46:53 +02:00
Ell
14d7964b9e app: reduce toolbox color-area size
Reduce the size of the toolbox color area, and make it square.
This allows for a narrower toolbox layout, which is more practical
now that we have tool groups.
2020-01-30 02:46:53 +02:00
Ell
0f4f4f28a4 app: use GimpToolButton in GimpToolPalette
In GimpToolPalette, replace the direct implementation of tool
buttons with GimpToolButton, added in the previous commit.
2020-01-30 02:46:53 +02:00
Ell
bcc5634093 app: add GimpToolButton
Add a new GimpToolButton class, used for tool-buttons in the
toolbox, instead of implementing them directly in GimpToolPalette.
Each GimpToolButton is associated with a GimpToolItem, which can be
either an individual tool or a group.

When a tool button is associated with a group, it displays the
group's active tool, with an arrow at the corner.  Clicking the
button selects the active tool, while clicking-and-holding, or
right-clicking, shows a menu of all the tools in the group.
Alternatively, the active tool can be changed using the scroll
wheel.
2020-01-30 02:46:53 +02:00
Ell
d916e3ca21 app: show popup menus at the same height as their corresponding button
In gimp_button_menu_position(), position the menu at the same
height as the button, instead of half-way down.  This is mostly a
stylistic choice, but it works much better for tool-button menus,
added in the next commit.
2020-01-30 02:46:53 +02:00