From b916d36bc7bb4d1efbf227ce86862519b5bde6e5 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 19 May 2016 16:21:52 +0200 Subject: only show disconnect dialog for connected VPN in profile list --- main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java | 2 +- main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java index dbcb13fc..6add8ae0 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java @@ -136,7 +136,7 @@ class LogFileHandler extends Handler { readCacheContents(new FileInputStream(logfile)); - } catch (java.io.IOException | java.lang.RuntimeException e) { + } catch (java.io.IOException | java.lang.RuntimeException e ) { VpnStatus.logError("Reading cached logfile failed"); VpnStatus.logException(e); e.printStackTrace(); diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java index 0323ba76..c3763334 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java @@ -112,7 +112,7 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn } private void startOrStopVPN(VpnProfile profile) { - if (VpnStatus.isVPNActive()) { + if (VpnStatus.isVPNActive() && ProfileManager.getLastConnectedVpn() == profile) { Intent disconnectVPN = new Intent(getActivity(), DisconnectVPN.class); startActivity(disconnectVPN); } else { -- cgit v1.2.3