diff options
author | Sean Leonard <meanderingcode@aetherislands.net> | 2013-06-09 04:36:08 -0600 |
---|---|---|
committer | Sean Leonard <meanderingcode@aetherislands.net> | 2013-06-20 18:46:40 -0600 |
commit | 276b8f7dbc7763e284f246a1c538bd06dd8be756 (patch) | |
tree | 12177eec45c0158e5da50a3117ef60c56a8a6070 | |
parent | 389dfcdfad555feb1cf212ef9b42626633d5eade (diff) |
Bring up VPN connection log on status line click.
Also show it on click of "Configure" button on system notification popup.
Also allow toggling of status line.
-rw-r--r-- | res/layout/eip_overview.xml | 4 | ||||
-rw-r--r-- | src/se/leap/leapclient/Dashboard.java | 23 | ||||
-rw-r--r-- | src/se/leap/openvpn/OpenVpnService.java | 6 |
3 files changed, 24 insertions, 9 deletions
diff --git a/res/layout/eip_overview.xml b/res/layout/eip_overview.xml index 9cb659f..738c82e 100644 --- a/res/layout/eip_overview.xml +++ b/res/layout/eip_overview.xml @@ -56,6 +56,7 @@ android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" + android:layout_margin="10dp" android:contentDescription="@string/eip_settings_button_description" android:src="@drawable/ic_sysbar_quicksettings" /> @@ -65,8 +66,11 @@ android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" + android:clickable="true" + android:onClick="showEIPLog" android:text="@string/eip_status" /> </RelativeLayout> + </RelativeLayout>
\ No newline at end of file diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java index f10966b..965e869 100644 --- a/src/se/leap/leapclient/Dashboard.java +++ b/src/se/leap/leapclient/Dashboard.java @@ -7,6 +7,7 @@ import org.json.JSONObject; import se.leap.leapclient.ProviderAPIResultReceiver.Receiver; import se.leap.openvpn.AboutFragment; +import se.leap.openvpn.LogWindow; import se.leap.openvpn.MainActivity; import se.leap.openvpn.OpenVPN; import se.leap.openvpn.OpenVPN.StateListener; @@ -188,13 +189,28 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf } } }); - + //TODO write our info into the view fragment that will expand with details and a settings button // TODO set eip overview subview // TODO make eip type clickable, show subview // TODO attach vpn status feedback to eip overview view // TODO attach settings button to something } + + public void toggleEipOverview(View view) { + if (eipDetail.isShown()) + eipDetail.setVisibility(View.GONE); + else + eipDetail.setVisibility(View.VISIBLE); + } + + // FIXME!! I will move to EIPSettingsFragment and begone! + // Also means change onClick property for status line + public void showEIPLog(View view){ + Intent intent = new Intent(getBaseContext(),LogWindow.class); + intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); + startActivity(intent); + } @Override public boolean onPrepareOptionsMenu(Menu menu) { @@ -253,11 +269,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf } } - - @SuppressWarnings("unused") - private void toggleOverview() { - // TODO Expand the one line overview item to show some details - } @Override public void authenticate(String username, String password) { diff --git a/src/se/leap/openvpn/OpenVpnService.java b/src/se/leap/openvpn/OpenVpnService.java index 2408483..a4aa8a3 100644 --- a/src/se/leap/openvpn/OpenVpnService.java +++ b/src/se/leap/openvpn/OpenVpnService.java @@ -175,10 +175,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac } PendingIntent getLogPendingIntent() { - // Let the configure Button show the Log - Intent intent = new Intent(getBaseContext(),LogWindow.class); + // Let the configure Button show the Dashboard + Intent intent = new Intent(Dashboard.getAppContext(),Dashboard.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); - PendingIntent startLW = PendingIntent.getActivity(getApplicationContext(), 0, intent, 0); + PendingIntent startLW = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); return startLW; |