mirror of
http://galexander.org/git/simplesshd.git
synced 2025-03-30 05:05:42 +00:00
first draft of settings activity
This commit is contained in:
parent
95c028ad81
commit
bbcb048996
@ -6,14 +6,14 @@
|
|||||||
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7" />
|
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<application android:label="@string/app_name" >
|
<application android:label="SimpleSSHD">
|
||||||
<activity android:name="SimpleSSHD"
|
<activity android:name="SimpleSSHD" android:label="SimpleSSHD">
|
||||||
android:label="@string/app_name">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity android:name="Settings" android:label="Settings" />
|
||||||
<service android:name="SimpleSSHDService"
|
<service android:name="SimpleSSHDService"
|
||||||
android:label="SimpleSSHDService" />
|
android:label="SimpleSSHDService" />
|
||||||
</application>
|
</application>
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="app_name">SimpleSSHD</string>
|
|
||||||
</resources>
|
|
31
res/xml/preferences.xml
Normal file
31
res/xml/preferences.xml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="onboot"
|
||||||
|
android:title="Start on boot"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:key="port"
|
||||||
|
android:title="Port number to listen on"
|
||||||
|
android:summary="must be greater than 1024"
|
||||||
|
android:numeric="integer"
|
||||||
|
android:defaultValue="2222" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:key="path"
|
||||||
|
android:title="Path to SSH files"
|
||||||
|
android:summary="put authorized_keys here"
|
||||||
|
android:defaultValue="/sdcard/ssh" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:key="shell"
|
||||||
|
android:title="Login shell"
|
||||||
|
android:defaultValue="/system/bin/sh" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:key="home"
|
||||||
|
android:title="Home directory"
|
||||||
|
android:summary="put .profile here"
|
||||||
|
android:defaultValue="/sdcard/ssh" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:key="extra"
|
||||||
|
android:title="Extra dropbear commandline options"
|
||||||
|
android:defaultValue="" />
|
||||||
|
</PreferenceScreen>
|
11
src/org/galexander/sshd/Settings.java
Normal file
11
src/org/galexander/sshd/Settings.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package org.galexander.sshd;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
|
|
||||||
|
public class Settings extends PreferenceActivity {
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
addPreferencesFromResource(R.xml.preferences);
|
||||||
|
}
|
||||||
|
}
|
@ -53,7 +53,7 @@ public class SimpleSSHD extends Activity
|
|||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.settings:
|
case R.id.settings:
|
||||||
/* XXX - launch settings activity */
|
startActivity(new Intent(this, Settings.class));
|
||||||
return true;
|
return true;
|
||||||
case R.id.about: {
|
case R.id.about: {
|
||||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||||
|
Loading…
Reference in New Issue
Block a user