sieren / QSyncthingTray

ATT: NO LONGER ACTIVELY MAINTAINED, NEEDS NEW OWNER || A OS X / Windows / Linux Tray App for Syncthing written in C++
GNU Lesser General Public License v3.0
366 stars 30 forks source link

Icon not animated on Windows #50

Closed sieren closed 8 years ago

sieren commented 8 years ago

Needs further investigation. Potentially Qt related.

meztup commented 8 years ago

This is working just fine for me -- Windows 7 Ultimate SP1 x64. It does, however, only show the monochrome version of the animated icon and tends to flash between the normal and animated during file transfers. I'm guessing this is by design and that the display of the animated icon must be tied very closely to the actual Tx/Rx of data rather than some sort of "updating" status that syncthing provides.

johnmaguire commented 8 years ago

qsyncthingtray-network Maybe related to this? (Compare network activity.)

sieren commented 8 years ago

Why, Windows, why? It is indeed very closely tied, seems like I need to smooth it out (maybe thats why I never saw it because I only ran it in a VM).

This is somehow a trade-off by the way..I'm only polling the REST API of SyncThing every x seconds, I could make the interval smaller, but this will ultimately result in more CPU Usage in both Syncthing and QSyncthingTray.. and given the scope of the utility I thought that wasnt worth it.

I'm also slightly confused as to why it shows 0 connections.

johnmaguire commented 8 years ago

Hehe. Yeah, I tried checking it a few times over the course of about a minute while it was syncing to see if it showed any changes (I figured it wasn't perfectly on-demand) but didn't see anything.

Could it have anything to do with enabling HTTPS in the GUI? This did break the "Open Syncthing" feature. Not sure if you're using the socket API or not (which I'd think would be unaffected by the HTTPS toggle?)

meztup commented 8 years ago

I think that the 1 second polling of the REST API is good. Considering how spotty the Syncthing web interface is with its own stats (percentage left and others don't update/aren't too accurate), I'd be surprised if they didn't enhance that portion of the program and, hopefully, expose some of it via the API. For now, I believe it could be smoothed out by allowing the animated icon to finish a full rotation before switching back to the static version.

meztup commented 8 years ago

@JohnMaguire: I recreated your issue and managed to get everything working. In addition to enabling HTTPS, you also have to change the URL in the settings to "https://..." You will then be prompted to install OpenSSL. Download the Win64 Light version from the URL provided, and then copy the three dll's from C:\OpenSSL-Win64 into your QSyncthingTray folder. Now QST will be able to communicate with syncthing--"Open Syncthing" and the stats in the context menu will both work and be accurate! Unfortunately, this uncovers another bug where exiting QST leaves the syncthing process running -- I'll open a new issues for these problems after I gather some more info...

johnmaguire commented 8 years ago

On that note, does QST use the web interface for gathering those stats? I know there's a bug open upstream in Syncthing about "if you have the web interface open, everything gets way slower."

Here's a link: https://github.com/syncthing/syncthing/issues/867

It was closed as fix, but you can see a commenter expressed that the issue is still occurring. I've also had friends/coworkers report this issue to me after convincing them to start using Syncthing.

Not sure that there's really any way around it.

sieren commented 8 years ago

QST is getting the stats through the REST API, not the web interface. However I believe the Web Interface is using the same API. Would introducing a field to set the timer manually help? Maybe a tweaks section?

meztup commented 8 years ago

Some in that thread seemed to have the opinion that the web interface was basically flooding the system with http requests. What does QST do when it doesn't get a response from the API?

It already has a response from /rest/system/connections. Maybe comparing the "total":"at" timecode to now and/or the request time could give an idea of how timely the requests are being fulfilled. QST could dynamically adjust the request frequency or pause for a few extra seconds in that case.

meztup commented 8 years ago

...But that exact method might not work if the Syncthing server is on another machine as the clocks would also be on different machines. Perhaps there is another way of linking a specific response to a specific request.

sieren commented 8 years ago

Committed a fix for the smooth animations by basically waiting for a full rotation before sending a stop signal.

We should probably open up a new issue for variable polling/timing.