add an options menu to access the future settings activity

sigsegv_dump
Greg Alexander 10 years ago
parent 1d79555a2f
commit 95c028ad81

@ -72,11 +72,14 @@ it uses select(), I'm not sure how I would honor Thread.interrupt() or
whatever. It's not guaranteed to interrupt select(), and I'm not keen on
adding an arbitrary timeout/polling feature to it.
XXX - allow user to specify parameters for dropbear
XXX - convert UI to use proper preferences templates, and have ...->settings instead of putting it on the home screen
XXX - draw icon and 1024x512 display image
XXX - allow user to specify extra commandline for dropbear
XXX - convert UI to use proper preferences template
XXX - main screen should show dropbear.err contents
XXX - scp
XXX - zlib
XXX - rsync
XXX - draw icon and 1024x512 display image
XXX - document (ga.org/software/simplesshd/)
XXX - upload

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/settings"
android:icon="@android:drawable/ic_menu_manage"
android:title="Settings" />
<item android:id="@+id/about"
android:icon="@android:drawable/ic_menu_help"
android:title="About" />
</menu>

@ -9,6 +9,9 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Button;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.net.Uri;
public class SimpleSSHD extends Activity
{
@ -42,6 +45,26 @@ public class SimpleSSHD extends Activity
super.onPause();
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.settings:
/* XXX - launch settings activity */
return true;
case R.id.about: {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("http://www.galexander.org/software/simplesshd"));
startActivity(i);
} return true;
default:
return super.onOptionsItemSelected(item);
}
}
public void update_startstop() {
if (SimpleSSHDService.is_started()) {
startstop_view.setText("STOP");

Loading…
Cancel
Save