From c7a0caeda5ee167e8f00cfac4a08307a59ac8853 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Mon, 10 Jun 2019 20:12:54 +0200 Subject: [PATCH] small improvements in vpn module * renamed "Off" to "Disconnect" * do not show already established connection in popup menu --- bumblebee/modules/vpn.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/vpn.py b/bumblebee/modules/vpn.py index acb2e05..149e547 100644 --- a/bumblebee/modules/vpn.py +++ b/bumblebee/modules/vpn.py @@ -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)