summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2016-05-19 16:21:52 +0200
committerArne Schwabe <arne@rfc2549.org>2016-06-16 11:01:06 +0200
commitb916d36bc7bb4d1efbf227ce86862519b5bde6e5 (patch)
tree732e8d76e410f3cd26054c08208803e36210a7e0
parent16d942a1a077fbeab59c5502e1b623c6acc82da8 (diff)
only show disconnect dialog for connected VPN in profile list
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java2
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java2
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 {