summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ConfigurationWizard.java
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-07-12 11:56:57 -0600
committerSean Leonard <meanderingcode@aetherislands.net>2013-07-12 11:56:57 -0600
commitbdedc7fa03c962f79d1f2ecdb8720ac29394a02e (patch)
tree35994060c5b2a0a6109832757d04d231f69d0cf7 /src/se/leap/leapclient/ConfigurationWizard.java
parent4bb6f30a63fb45ab5256b65c40a46979e8ece6ab (diff)
parentf6efff1a7ec06d68bad27cd65e66d33e72572c37 (diff)
Merge branch 'feature/configuration-wizard-menu' into develop
Diffstat (limited to 'src/se/leap/leapclient/ConfigurationWizard.java')
-rw-r--r--src/se/leap/leapclient/ConfigurationWizard.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/ConfigurationWizard.java b/src/se/leap/leapclient/ConfigurationWizard.java
index 5eab3053..23220e79 100644
--- a/src/se/leap/leapclient/ConfigurationWizard.java
+++ b/src/se/leap/leapclient/ConfigurationWizard.java
@@ -9,6 +9,8 @@ import org.json.JSONObject;
import se.leap.leapclient.ProviderAPIResultReceiver.Receiver;
import se.leap.leapclient.ProviderListContent.ProviderItem;
import se.leap.leapclient.R;
+import se.leap.openvpn.AboutFragment;
+import se.leap.openvpn.MainActivity;
import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
@@ -19,7 +21,10 @@ import android.content.Intent;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.os.Handler;
+import android.view.Menu;
+import android.view.MenuItem;
import android.view.View;
+import android.view.ViewGroup;
/**
* Activity that builds and shows the list of known available providers.
@@ -329,6 +334,39 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
startService(provider_API_command);
}
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.configuration_wizard_activity, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item){
+ switch (item.getItemId()){
+ case R.id.about_leap:
+ showAboutFragment(getCurrentFocus());
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
+ /**
+ * Once selected a provider, this fragment offers the user to log in,
+ * use it anonymously (if possible)
+ * or cancel his/her election pressing the back button.
+ * @param view
+ */
+ public void showAboutFragment(View view) {
+ FragmentTransaction fragment_transaction = getFragmentManager().beginTransaction();
+ Fragment previous_about_fragment = getFragmentManager().findFragmentByTag(ConfigHelper.ABOUT_FRAGMENT);
+ if (previous_about_fragment == null) {
+ fragment_transaction.addToBackStack(null);
+
+ Fragment newFragment = AboutFragment.newInstance();
+ fragment_transaction.replace(R.id.configuration_wizard_layout, newFragment, ConfigHelper.ABOUT_FRAGMENT).commit();
+ }
+ }
@Override
public void login() {