Closed ANGOmarcello closed 9 years ago
Ah thanks, I misunderstood and thought you meant setting the switch status depending on what the current color is, but I see you meant the other way around. Thanks!
Are those 3 lines left over from testing?
No that is necessary after reboot to reinstate the gamma if enabled is set to 1. Because you would it expect to be actually on if it is set to on.
But I oversaw something.
It should be more something like this:
if ([defaults boolForKey:@"enabled"] && firstExecution){
[self enableOrangeness];
firstExecution = false;
}
Where firstExecution should be a boolean indicating that the Application is running for the first time so that the screen is not lit every time a fetch request happens and enabled is 1.
Yep, that's what I was worried about. Maybe it's also possible to put this into one of the application delegate methods?
If we put the code in the didFinishLaunchingWithOptions method it only works without user interaction if you use the VOIP Backgrounding, with the fetching backgrounding it will only be applied if you start the application manually.
So if we want to use it with the fetching it should be in a place where we can call from the didFinishLaunchingWithOptions method and from the fetching method.
So it seems that handling this in the autoChangeOrangenessIfNeeded method works best for now but it could be implemented in a more beautiful way.
I'm unsure what to do now. I changed my GammaController class with the suggestion I gave above and that works.
Added changes so that on launch Gamma Thingy checks wether it should reapply the gammatable