rtyley / agit

Agit - Git client for Android
https://play.google.com/store/apps/details?id=com.madgag.agit
GNU General Public License v3.0
503 stars 108 forks source link

Issue 100: Add a settings menu with a single preference for controlling sync frequency. #103

Open jwir3 opened 10 years ago

jwir3 commented 10 years ago

I added a new 'Settings' menu to the Dashboard Activity which contains a single preference: the frequency, in minutes, of how often to synchronize repositories.

This works, but it's sort of a first pass at fixing this problem. Ideally, I think it would be nice to be able to sync with different options (e.g. every X minutes/hours, once per week, once a day, X day of the month, etc..). This is possible right now, but it requires that the user calculate the sync frequency to minutes, which is rather tedious for longer-term syncs.

rtyley commented 10 years ago

Thanks for this submission - it's a good feature, but I think this dialog would be better as an exponential slider, or just a combo box with decent options (which I think is what you mean by this being a first pass):

screenshot_2014-03-02-12-29-49

I don't think users really need to be able to set their sync time to minute precision- a reasonable set of effective options would be:

...and I can't imagine a situation where it would benefit the user to have longer sync periods.

Incidentally, the CLA for Agit is here, if you want to make a submission please make sure you specify which copyright option you choose:

https://github.com/rtyley/agit/wiki/Contribution-Agreement

jwir3 commented 10 years ago

I've updated the pull request to remove the lint.xml from the .gitignore file. Additionally, I caught a problem with the AndroidManifest.xml file where I inadvertently changed the versionCode field, which I've now reverted.

I'll be happy to make the change outlined in your most recent comment, Roberto.

As for the question on whether I would assign the copyright to you or disclaim the copyright, and thus put the code in the public domain, is there really a difference? My suspicion is that by assigning the copyright to you, it would add the ability for you to go after someone for outright copyright infringement if the need arose, whereas the other option would not have this available. Is this correct? (There might be something else I'm missing, so I just wanted to make sure I understand the two options fully).

rtyley commented 10 years ago

I'll be happy to make the change outlined in your most recent comment, Roberto.

That's great :sparkles: For instance PocketCast does this, totally reasonably:

screenshot_2014-03-02-23-31-12 1

As for the question on whether I would assign the copyright to you or disclaim the copyright, and thus put the code in the public domain, is there really a difference?

Yeah, the reasoning is covered pretty fully here:

http://www.gnu.org/licenses/gpl-faq.html#AssignCopyright

jwir3 commented 10 years ago

I think this is ready to be pulled. I've mimicked the example screen, and enabled a version of sync that happens at time-of-day using the AlarmManager.

Also, I hereby transfer copyright to Roberto Tyley for this feature to be included in agit.

jwir3 commented 10 years ago

One thing I've noticed when testing this is that on repos that have a self signed cert, sync can't ask for permission. I'm not sure if this should be a separate ticket, but this hampers sync in these cases because there isn't a way to prevent agit from asking if the cert is OK. Perhaps there should be a cert storage mechanism, or something cooked into this ticket that allows users to just accept sync operations on a given repository once the first manual refresh has been done?

jwir3 commented 10 years ago

@rtyley Aside from issue #107, this pull request is probably ready for review again. I have confirmed that on hosts that don't have the issue described in #107 (i.e. hosts that don't have a self-signed certificate), the sync options all work as expected.

jwir3 commented 10 years ago

Review ping?