Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for updates & forum/discord links in Help menu #1126

Merged
merged 5 commits into from Dec 9, 2018

Conversation

Projects
None yet
4 participants
@chchwy
Copy link
Member

chchwy commented Nov 12, 2018

help-menu

check-for-updates

up-to-date

found-updates

The latest version number is from here:
https://www.pencil2d.org/version/

At the moment check-for-updates is for regular versuions only, no nightly builds.

chchwy added some commits Nov 6, 2018

Added check-for-update, forum/discord links to help menu
- Implemented a check-for-update Dialog
- Check-for-updates works for regular builds only at the moment. Haven't thought of how to do nightly builds yet.
@Jose-Moreno

This comment has been minimized.

Copy link
Member

Jose-Moreno commented Nov 12, 2018

@chchwy Oh wow! that is great. Thank you for taking the time to implement this! 😄

@CandyFace
Copy link
Member

CandyFace left a comment

LGTM 👍
well done chchwy!

@scribblemaniac
Copy link
Member

scribblemaniac left a comment

Looks good. See my comments for some possible improvements.

void CheckUpdatesDialog::startChecking()
{
#ifdef NIGHTLY
nightlyBuildCheck();

This comment has been minimized.

Copy link
@scribblemaniac

scribblemaniac Nov 13, 2018

Member

It would be nice if a nightly builds checked for a newer regular build first.

This comment has been minimized.

Copy link
@chchwy

chchwy Nov 13, 2018

Author Member

yeah, I am thinking how to do it. It means we have to give nightly build a proper version number which can compare to the version number of a regular build.

This comment has been minimized.

Copy link
@scribblemaniac

scribblemaniac Nov 13, 2018

Member

We could use the Google Drive API to get the files currently in the drive folder. The request would look like this:

https://www.googleapis.com/drive/v3/files?q='<FOLDER_ID>'+in+parents&key=<API_KEY>

The result is a json file that looks like this:

{
 "kind": "drive#fileList",
 "incompleteSearch": false,
 "files": [
  {
   "kind": "drive#file",
   "id": "1IZgGuJmy4JOnAdEQEkjHCv8qVGFqvcpr",
   "name": "pencil2d-mac-2018-11-13.zip",
   "mimeType": "application/zip"
  },
  {
   "kind": "drive#file",
   "id": "1HQhIrf97nTIfpsN9i4NqhROOlCZKWld7",
   "name": "pencil2d-mac-2018-11-04.zip",
   "mimeType": "application/zip"
  },
  ...
 ]
}

The v2 api provides even more information if you need it, but we should just be able to parse the name and compare it to the date stored in the build.

A side note, I discovered during researching this that Google Drive does have a "revisions" feature which automatically deletes old revisions after a month or 100 revisions and keeps the same link so you could have a "latest nightly build" link for each OS which is pretty nice. Unfortunately it doesn't seem that you can access the revision list without OAuth, so if we're going to add a nightly build check with the API, it would not be a good idea to switch to this.

Show resolved Hide resolved app/src/checkupdatesdialog.cpp Outdated
Show resolved Hide resolved app/src/checkupdatesdialog.cpp
Show resolved Hide resolved app/src/checkupdatesdialog.cpp Outdated
Code review updates
- use https://github.com/pencil2d/pencil/releases.atom to get latest version number instead

@chchwy chchwy added this to the 0.6.3 milestone Dec 4, 2018

@chchwy chchwy merged commit 1552cb7 into pencil2d:master Dec 9, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.