diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-12-11 10:18:06 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-12-11 10:18:06 +0100 |
commit | 49653f7c3811a29afc92b3def7430e962a39fe0b (patch) | |
tree | 74460916357ae9f0dd1849290d29881f3a4f423b /src/de/blinkt/openvpn/DisconnectVPN.java | |
parent | ce1dba9a001049264449eadd138a9b1d93eccba3 (diff) |
Move activities and views into packages
--HG--
rename : src/de/blinkt/openvpn/ConfigConverter.java => src/de/blinkt/openvpn/activities/ConfigConverter.java
rename : src/de/blinkt/openvpn/app/CreateShortcuts.java => src/de/blinkt/openvpn/activities/CreateShortcuts.java
rename : src/de/blinkt/openvpn/DisconnectVPN.java => src/de/blinkt/openvpn/activities/DisconnectVPN.java
rename : src/de/blinkt/openvpn/FileSelect.java => src/de/blinkt/openvpn/activities/FileSelect.java
rename : src/de/blinkt/openvpn/LogWindow.java => src/de/blinkt/openvpn/activities/LogWindow.java
rename : src/de/blinkt/openvpn/MainActivity.java => src/de/blinkt/openvpn/activities/MainActivity.java
rename : src/de/blinkt/openvpn/FileSelectLayout.java => src/de/blinkt/openvpn/views/FileSelectLayout.java
rename : src/de/blinkt/openvpn/RemoteCNPreference.java => src/de/blinkt/openvpn/views/RemoteCNPreference.java
rename : src/de/blinkt/openvpn/fragments/SeekBarTicks.java => src/de/blinkt/openvpn/views/SeekBarTicks.java
extra : rebase_source : fccff1bc269dbc0ae33b96a4947b8a6e2924efeb
Diffstat (limited to 'src/de/blinkt/openvpn/DisconnectVPN.java')
-rw-r--r-- | src/de/blinkt/openvpn/DisconnectVPN.java | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/de/blinkt/openvpn/DisconnectVPN.java b/src/de/blinkt/openvpn/DisconnectVPN.java deleted file mode 100644 index 0f9e83aa..00000000 --- a/src/de/blinkt/openvpn/DisconnectVPN.java +++ /dev/null @@ -1,80 +0,0 @@ -package de.blinkt.openvpn; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.*; -import android.os.IBinder; -import de.blinkt.openvpn.core.OpenVpnService; -import de.blinkt.openvpn.core.ProfileManager; - -/** - * Created by arne on 13.10.13. - */ -public class DisconnectVPN extends Activity implements DialogInterface.OnClickListener{ - protected OpenVpnService mService; - - private ServiceConnection mConnection = new ServiceConnection() { - - - @Override - public void onServiceConnected(ComponentName className, - IBinder service) { - // We've bound to LocalService, cast the IBinder and get LocalService instance - OpenVpnService.LocalBinder binder = (OpenVpnService.LocalBinder) service; - mService = binder.getService(); - } - - @Override - public void onServiceDisconnected(ComponentName arg0) { - mService =null; - } - - }; - - @Override - protected void onResume() { - super.onResume(); - Intent intent = new Intent(this, OpenVpnService.class); - intent.setAction(OpenVpnService.START_SERVICE); - bindService(intent, mConnection, Context.BIND_AUTO_CREATE); - showDisconnectDialog(); - } - - @Override - protected void onStop() { - super.onStop(); - unbindService(mConnection); - } - - // if (getIntent() !=null && OpenVpnService.DISCONNECT_VPN.equals(getIntent().getAction())) - - // setIntent(null); - - /* - @Override - protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - setIntent(intent); - } - */ - - private void showDisconnectDialog() { - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.title_cancel); - builder.setMessage(R.string.cancel_connection_query); - builder.setNegativeButton(android.R.string.no, this); - builder.setPositiveButton(android.R.string.yes,this); - - builder.show(); - } - - @Override - public void onClick(DialogInterface dialog, int which) { - if (which == DialogInterface.BUTTON_POSITIVE) { - ProfileManager.setConntectedVpnProfileDisconnected(this); - if (mService != null && mService.getManagement() != null) - mService.getManagement().stopVPN(); - } - finish(); - } -} |