small improvements in vpn module

* renamed "Off" to "Disconnect"
* do not show already established connection in popup menu
This commit is contained in:
Bernhard B 2019-06-10 20:12:54 +02:00
parent a7a1da6b5d
commit c7a0caeda5

View file

@ -81,8 +81,10 @@ class Module(bumblebee.engine.Module):
menu = bumblebee.popup_v2.PopupMenu()
if self._connected_vpn_profile is not None:
menu.add_menuitem("Off", callback=self._on_vpn_disconnect)
menu.add_menuitem("Disconnect", callback=self._on_vpn_disconnect)
for vpn_profile in self._vpn_profiles:
if self._connected_vpn_profile is not None and self._connected_vpn_profile == vpn_profile:
continue
menu.add_menuitem(vpn_profile, callback=functools.partial(self._on_vpn_connect, vpn_profile))
menu.show(widget)