@ -80,15 +80,38 @@ public class SimpleSSHD extends Activity
public boolean onOptionsItemSelected ( MenuItem item ) {
switch ( item . getItemId ( ) ) {
case R . id . settings :
s tartActivity( new Intent ( this , Settings . class ) ) ;
s ettings_clicked( null ) ;
return true ;
case R . id . copypriv :
copy _app_private( ) ;
copy priv_clicked( null ) ;
return true ;
case R . id . resetkeys :
reset _ keys( ) ;
reset keys_clicked ( null ) ;
return true ;
case R . id . doc : {
case R . id . doc :
doc_clicked ( null ) ;
return true ;
case R . id . about :
about_clicked ( null ) ;
return true ;
default :
return super . onOptionsItemSelected ( item ) ;
}
}
/ * these can be called as the _clicked ( ) variant on Android TV , or
* through the options menu on regular Android * /
public void settings_clicked ( View v ) {
startActivity ( new Intent ( this , Settings . class ) ) ;
}
public void copypriv_clicked ( View v ) {
copy_app_private ( ) ;
}
public void resetkeys_clicked ( View v ) {
reset_keys ( ) ;
}
public void doc_clicked ( View v ) {
try {
Intent i = new Intent ( Intent . ACTION_VIEW ) ;
i . setData ( Uri . parse ( "http://www.galexander.org/software/simplesshd" ) ) ;
@ -105,8 +128,8 @@ public class SimpleSSHD extends Activity
. setMessage ( "YOU: a note 7 owner with no browser installed on your android?\nME: an app developer who keeps getting crash reports and wants to hear your story. email nobrowserdroid@galexander.org" )
. show ( ) ;
}
} return true ;
case R . id . about : {
}
public void about_clicked ( View v ) {
AlertDialog . Builder b = new AlertDialog . Builder ( this ) ;
b . setCancelable ( true ) ;
b . setPositiveButton ( "OK" ,
@ -121,20 +144,19 @@ public class SimpleSSHD extends Activity
"\nscp/sftp from OpenSSH 6.7p1" +
"\nrsync 3.1.1" ) ;
b . show ( ) ;
} return true ;
default :
return super . onOptionsItemSelected ( item ) ;
}
}
private void update_startstop_prime ( ) {
if ( SimpleSSHDService . is_started ( ) ) {
startstop_view . setText (
Prefs . get_onopen ( ) ? "QUIT" : "STOP" ) ;
startstop_view . setTextColor ( 0xFF881111 ) ;
startstop_view . setTextColor (
is_tv ? 0xFFFF6666 : 0xFF881111 ) ;
} else {
startstop_view . setText ( "START" ) ;
startstop_view . setTextColor ( 0xFF118811 ) ;
startstop_view . setTextColor (
is_tv ? 0xFF44FF44 : 0xFF118811 ) ;
}
}