Commit Graph

10 Commits

Author SHA1 Message Date
Jehan 7b5fff7861 app: now also process the build revision when checking for updates.
The idea is to be able to advertize a new revision of the same version
of GIMP. For instance, this would apply when we release a
`gimp-2-10-14-setup-3.exe` Windows installer (then we are at revision
3, provided we started at revision 0).

The revision number is obviously only relevant to a given platform and
version. Also the concept of build ID allows to differentiate various
builds for a same platform, in particular to not look at revisions of
third-party builds. The build ID can be any string. Maybe we could just
use reverse DNS build id (such as "org.gimp.GIMP_official") to identify
the official GIMP build. So in the end, we only compare revisions for an
identical (version, platform, build-id) tuple.
2020-02-06 21:47:00 +01:00
Jehan 315665592c app, configure: new --disable-check-update option at configuration.
Allows to disable the automatic update check at startup. I believe some
packagers will want such options, in particular on Linux distribution
(where they control their own release schedule and won't want GIMP to
pop new version warning up because they have been slow to update their
package).
Note that it is still possible to query version checks manually in the
about dialog, but the automatic check/popup is gone with this option.
2020-02-06 21:21:17 +01:00
Jehan 8528759834 app: better error management.
- Clear the GError when relevant.
- Check result of json_path_compile() just in case.
- Print some error on stderr when parsing of gimp_versions.json fails
  (which should never happen on releases but would help during
  development).
2020-01-26 15:13:10 +01:00
Jehan 1f75d2e34a app: update gimp-update to new gimp_versions.json format.
Instead of storing versions as objects, we now store them as arrays,
because json arrays are ordered, unlike objects (the website was using
non-standard Python extension to consider the version objects ordered
but this is not proper and even more, the lib we use for GIMP does not
have a similar extension.
This simplifies a bit the code as we don't need to order the versions by
comparing their string representations.
2020-01-26 11:26:13 +01:00
Jehan d5febf6e62 app: parse the release date for the last release.
I was mistakenly using the date of the last check, not the release date.
2020-01-02 23:09:23 +01:00
Jehan 6b237b90fd 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.
2019-12-29 13:41:59 +01:00
Jehan 827473fd88 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).
2019-12-29 13:24:20 +01:00
Jehan b874cadfad 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.
2019-12-29 10:36:12 +01:00
Jehan bb7f229b97 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]
2019-12-25 22:01:33 +01:00
Jehan 506a0476f4 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).
2019-12-13 17:51:44 +01:00