-
Notifications
You must be signed in to change notification settings - Fork 42
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
pause on metered networks #231
Comments
Ok, so this should just pause devices - and not stop Syncthing completely? And I assume devices should be resumed automatically once the network is not metered anymore? |
* Allow to pause all devices on metered network connections (devices will be automatically resumed when network is no longer metered) * Allow to stop Syncthing when it was started via the built-in launcher on metered network connections (it will be automatically started again when the network connection is no longer metered) * See #231
I implemented both. You can select in the connection options to pause devices and you can select in the launcher options to stop Syncthing completely. Note that this only works in environments where Qt provides a backend for determining whether the network connection is metered (see https://doc.qt.io/qt-6/qnetworkinformation.html#loadDefaultBackend for a list of backends). This requires Qt 6.4 or newer. You can see whether it works in your environment by hovering over the checkbox in the settings. The tooltip will tell you whether the connection is currently considered metered or whether the detection is not supported. |
Nice. Able to stop it completely is much better. Is there a pre release that I can test or I have to build manually? |
I created a development build. You can find it on https://martchus.no-ip.biz/repo/arch/ownstuff-experimental/os/x86_64. (Extract the archive with e.g. bsdtar and use the "static" executables.) I haven't tested it myself yet under Windows (only GNU/Linux with NetworkManager) so help with testing is appreciated. Of course you're also welcome to do you own build, even under Windows it is kind of straight forward these days with MSYS2 (see https://github.com/Martchus/cpp-utilities#remarks-for-building-on-windows). |
You don't have to try. This version is crashing under Windows. It may be already fixed on master but I still have to make a new Windows build. |
Providing this feature on Windows build is problematic. It worked in my tests using MSVC but my release builds are done using mingw-w64 which lacks cppwinrt and thus Qt cannot use certain APIs and monitoring whether the network is metered is not available. Maybe I'll have to switch to ucrt-based mingw-w64 builds. This is definitely quite some effort so don't expect that this feature will be actually available in Windows builds soon. (Of course you can always do your own builds. With MSVC it works but you cannot have the built-in Syncthing library with it. It possibly also works with mingw-w64-ucrt64 packages from MSYS2 but I haven't tested it yet.) |
I was able to compile and use cppwinrt with mingw-w64 (not the ucrt-based version) after all. The fact that MSYS2 only has mingw-w64-ucrt-cppwinrt (and not mingw-w64-cppwinrt) and that https://github.com/Yuubi-san/YoloRT/tree/master exist does luckily not mean using cppwinrt is not possible with plain old mingw-w64. So this feature can be enabled in the next release also on Windows. (I guess I still have to sort out some general bugs, though.) |
By the way, the build on https://martchus.no-ip.biz/repo/arch/ownstuff-experimental/os/x86_64 has been updated. It generally works but as I mentioned I still need to sort out some bugs. Just for the record, building Qt 6 against mingw-w64 with cpp_winrt support enabled required some additional modifications to Qt's build system: Martchus/PKGBUILDs@64ce42f |
I haven't tested it yet under Windows 11 and I currently don't have such a system to test. So also stopping from the launcher options doesn't work at all? That part should have been working. What does the tooltip of the options say in the settings? Is it correctly stating whether the network is metered? Not sure about the icons. That may be a regression of Qt 6.6.2 which I have updated to that only occurs under Windows 11 or when scaling is enabled. Do you use a scaling factor in Window's display settings? |
I think the meter option works now after a system reboot. I' m on 2 monitors ,with one 2k 12 inch at 200% scaling factor and another with 1080p 24inch at 100% scaling factor ( as main ). |
Good, although it is a bit weird that a reboot was required.
Ah, it breaks indeed if the screen with 100 % scaling is the main one. However, it looks like is also the case with the latest release; so not a regression. |
The wrong icons sizes should be fixed via Martchus/qtforkawesome@bb2030c, at least with that it looks good in the configurations I tried. With 43caad8 the icons should also always stay sharp after moving the window between screens or changing the scale factor. |
Thanks. |
If you want to try it out, I made a new development build today. You can download it from https://martchus.no-ip.biz/repo/arch/ownstuff-experimental/os/x86_64 (same URL as before, the previous archive was overridden). |
Thanks. The icons are fine now. |
Please read the following points before filing an issue but remove them before
filing the issue:
Relevant components
syncthingctl
)libsyncthing
)Is your feature request specific to a certain platform/environment? Please specify.
metered networks
Is your feature request related to a problem? Please describe.
pause devices on metered networks
Describe the solution you'd like
Like https://github.com/canton7/SyncTrayzor can do.
The text was updated successfully, but these errors were encountered: