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

Icon shows as idle while syncing data #20

Open
admirabilis opened this issue Sep 18, 2016 · 4 comments
Open

Icon shows as idle while syncing data #20

admirabilis opened this issue Sep 18, 2016 · 4 comments

Comments

@admirabilis
Copy link

admirabilis commented Sep 18, 2016

I was replacing the default icons, and noticed that syncthing-ubuntu-indicator doesn't change the icons while syncing data. Under the line def set_icon(self):, I have placed print(self.state), and on the console the following was being printed while the devices were exchanging data (I have tested with big files to make sure the indicator had enough time to update itself):

/opt/syncthing-ubuntu-indicator/syncthing-ubuntu-indicator.py:19: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gio, GLib
/opt/syncthing-ubuntu-indicator/syncthing-ubuntu-indicator.py:20: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
  from gi.repository import AppIndicator3 as appindicator
2016-09-18 13:32:37,427 INFO: Started main procedure
{'set_icon': 'paused', 'update_devices': True, 'update_files': True, 'update_st_running': False, 'update_folders': True}
2016-09-18 13:32:37,475 INFO: rest_get /rest/system/version 
2016-09-18 13:32:37,483 INFO: Starting new HTTP connection (1): 127.0.0.1
2016-09-18 13:32:37,483 INFO: rest_get /rest/system/connections 
2016-09-18 13:32:37,485 INFO: Starting new HTTP connection (2): 127.0.0.1
2016-09-18 13:32:37,486 INFO: rest_get /rest/system/status 
2016-09-18 13:32:37,486 INFO: rest_get /rest/system/upgrade 
2016-09-18 13:32:37,490 WARNING: rest_receive_data: /rest/system/upgrade failed (500)
2016-09-18 13:32:37,490 INFO: rest_get /rest/system/error 
2016-09-18 13:32:37,491 INFO: rest_get /rest/events {'since': 0}
2016-09-18 13:32:37,585 INFO: Device connected: miui
{'set_icon': 'idle', 'update_devices': True, 'update_files': True, 'update_st_running': True, 'update_folders': True}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': False}
2016-09-18 13:32:47,489 INFO: rest_get /rest/events {'since': 1237}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': True}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': False}
2016-09-18 13:32:57,488 INFO: rest_get /rest/events {'since': 1239}
2016-09-18 13:32:57,491 INFO: Resetting dropped connection: 127.0.0.1
{'set_icon': 'idle', 'update_devices': True, 'update_files': False, 'update_st_running': True, 'update_folders': True}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': False}
2016-09-18 13:33:07,485 INFO: rest_get /rest/system/connections 
2016-09-18 13:33:07,488 INFO: rest_get /rest/system/status 
2016-09-18 13:33:07,492 INFO: rest_get /rest/system/error 
2016-09-18 13:33:07,493 INFO: rest_get /rest/events {'since': 1249}
{'set_icon': 'idle', 'update_devices': True, 'update_files': False, 'update_st_running': True, 'update_folders': False}
{'set_icon': 'scanning', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': True}
2016-09-18 13:33:17,490 INFO: rest_get /rest/events {'since': 1250}
{'set_icon': 'idle', 'update_devices': True, 'update_files': False, 'update_st_running': True, 'update_folders': True}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': False}
2016-09-18 13:33:27,488 INFO: rest_get /rest/events {'since': 1257}
{'set_icon': 'idle', 'update_devices': True, 'update_files': False, 'update_st_running': True, 'update_folders': True}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': False}
2016-09-18 13:33:37,488 INFO: rest_get /rest/system/connections 
2016-09-18 13:33:37,491 INFO: rest_get /rest/system/status 
2016-09-18 13:33:37,497 INFO: rest_get /rest/system/error 
2016-09-18 13:33:37,500 INFO: rest_get /rest/events {'since': 1265}
2016-09-18 13:33:37,502 INFO: Resetting dropped connection: 127.0.0.1
{'set_icon': 'idle', 'update_devices': True, 'update_files': False, 'update_st_running': True, 'update_folders': True}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': False}
2016-09-18 13:33:47,489 INFO: rest_get /rest/events {'since': 1279}
{'set_icon': 'idle', 'update_devices': True, 'update_files': False, 'update_st_running': True, 'update_folders': True}
{'set_icon': 'idle', 'update_devices': False, 'update_files': False, 'update_st_running': True, 'update_folders': False}
2016-09-18 13:33:57,489 INFO: rest_get /rest/events {'since': 1285}
2016-09-18 13:33:57,492 INFO: Resetting dropped connection: 127.0.0.1
^C
@icaruseffect
Copy link
Owner

icaruseffect commented Sep 21, 2016

Thank you for your feedback.
I switched to arch some time ago and now i have difficulties to get the dependencies together (therefore issue #9).
Maybe I find time in the next days to look further into it.
You may look at the fork from hungrywolf. Having a short look at the commit history it may be, that he already fixed the issue.

@admirabilis
Copy link
Author

Thank you for your answer! I have tried his fork, but the problem was not fixed either! Do you recommend to switch to his version and report the bug there?

@icaruseffect
Copy link
Owner

It would be reasonable to switch to the fork, because he made some improvements.
When I find some time I will look into the issue and try to fix it.
As far as I see something is missing which triggers the update of the icon after state change.
If you have some Python experience (or none, its the easiest programing language to start with) you are always welcome to push some changes.

@admirabilis
Copy link
Author

OK, thanks! I'm still beginning to learn Python, since I have always done all my projects in Bash. I even wrote a tray icon for Syncthing, actually, but decided to try something new since the old systray is a X thing and will be deprecated in the future with Wayland (and maintaining code in bash always turns into a nightmare)!

I tried understanding the code that sets the icon, but was not able, probably due to my inexperience with Python yet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants