aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/frontends/android/AndroidManifest.xml21
-rw-r--r--src/frontends/android/res/layout/log_activity.xml26
-rw-r--r--src/frontends/android/res/menu/main.xml5
-rw-r--r--src/frontends/android/res/values-de/strings.xml4
-rw-r--r--src/frontends/android/res/values/strings.xml4
-rw-r--r--src/frontends/android/src/org/strongswan/android/ui/LogActivity.java46
-rw-r--r--src/frontends/android/src/org/strongswan/android/ui/MainActivity.java8
7 files changed, 111 insertions, 3 deletions
diff --git a/src/frontends/android/AndroidManifest.xml b/src/frontends/android/AndroidManifest.xml
index 5c8686e79..62fc6a135 100644
--- a/src/frontends/android/AndroidManifest.xml
+++ b/src/frontends/android/AndroidManifest.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2012 Tobias Brunner
+ Copyright (C) 2012 Giuliano Grassi
+ Copyright (C) 2012 Ralf Sager
+ Hochschule fuer Technik Rapperswil
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.strongswan.android"
android:versionCode="1"
@@ -18,12 +34,17 @@
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
+
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.VpnProfileDetailActivity" >
</activity>
+ <activity
+ android:name=".ui.LogActivity"
+ android:label="@string/log_title" >
+ </activity>
<service
android:name=".logic.VpnStateService"
diff --git a/src/frontends/android/res/layout/log_activity.xml b/src/frontends/android/res/layout/log_activity.xml
new file mode 100644
index 000000000..80fee09fb
--- /dev/null
+++ b/src/frontends/android/res/layout/log_activity.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2012 Tobias Brunner
+ Hochschule fuer Technik Rapperswil
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <fragment
+ class="org.strongswan.android.ui.LogFragment"
+ android:id="@+id/log_frag"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+</FrameLayout>
diff --git a/src/frontends/android/res/menu/main.xml b/src/frontends/android/res/menu/main.xml
index f5d1e31cf..4063110da 100644
--- a/src/frontends/android/res/menu/main.xml
+++ b/src/frontends/android/res/menu/main.xml
@@ -20,4 +20,9 @@
android:title="@string/reload_trusted_certs"
android:showAsAction="withText" />
+ <item
+ android:id="@+id/menu_show_log"
+ android:title="@string/show_log"
+ android:showAsAction="withText" />
+
</menu> \ No newline at end of file
diff --git a/src/frontends/android/res/values-de/strings.xml b/src/frontends/android/res/values-de/strings.xml
index ed4456497..7f7288d5f 100644
--- a/src/frontends/android/res/values-de/strings.xml
+++ b/src/frontends/android/res/values-de/strings.xml
@@ -21,6 +21,10 @@
<string name="app_name">strongSwan VPN Client</string>
<string name="main_activity_name">strongSwan</string>
<string name="reload_trusted_certs">CA-Zertifikate neu laden</string>
+ <string name="show_log">Log anzeigen</string>
+
+ <!-- Log view -->
+ <string name="log_title">Log</string>
<!-- VPN profile list -->
<string name="no_profiles">Keine VPN Profile vorhanden.</string>
diff --git a/src/frontends/android/res/values/strings.xml b/src/frontends/android/res/values/strings.xml
index 0dad64233..762273fc8 100644
--- a/src/frontends/android/res/values/strings.xml
+++ b/src/frontends/android/res/values/strings.xml
@@ -21,6 +21,10 @@
<string name="app_name">strongSwan VPN Client</string>
<string name="main_activity_name">strongSwan</string>
<string name="reload_trusted_certs">Reload CA certificates</string>
+ <string name="show_log">View log</string>
+
+ <!-- Log view -->
+ <string name="log_title">Log</string>
<!-- VPN profile list -->
<string name="no_profiles">No VPN profiles.</string>
diff --git a/src/frontends/android/src/org/strongswan/android/ui/LogActivity.java b/src/frontends/android/src/org/strongswan/android/ui/LogActivity.java
new file mode 100644
index 000000000..84bb458af
--- /dev/null
+++ b/src/frontends/android/src/org/strongswan/android/ui/LogActivity.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2012 Tobias Brunner
+ * Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+package org.strongswan.android.ui;
+
+import org.strongswan.android.R;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.MenuItem;
+
+public class LogActivity extends Activity
+{
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.log_activity);
+
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item)
+ {
+ switch (item.getItemId())
+ {
+ case android.R.id.home:
+ finish();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java b/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java
index 50b2bfbe5..f9d6c1725 100644
--- a/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java
+++ b/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java
@@ -38,7 +38,6 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
-import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
@@ -66,8 +65,7 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.main, menu);
+ getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@@ -79,6 +77,10 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
case R.id.menu_reload_certs:
new CertificateLoadTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, true);
return true;
+ case R.id.menu_show_log:
+ Intent logIntent = new Intent(this, LogActivity.class);
+ startActivity(logIntent);
+ return true;
default:
return super.onOptionsItemSelected(item);
}