@ -80,61 +80,83 @@ 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 :
s tartActivity( new Intent ( this , Settings . class ) ) ;
s ettings_clicked( null ) ;
return true ;
return true ;
case R . id . copypriv :
case R . id . copypriv :
copy _app_private( ) ;
copy priv_clicked( null ) ;
return true ;
return true ;
case R . id . resetkeys :
case R . id . resetkeys :
reset _ keys( ) ;
reset keys_clicked ( null ) ;
return true ;
return true ;
case R . id . doc : {
case R . id . doc :
try {
doc_clicked ( null ) ;
Intent i = new Intent ( Intent . ACTION_VIEW ) ;
return true ;
i . setData ( Uri . parse ( "http://www.galexander.org/software/simplesshd" ) ) ;
case R . id . about :
startActivity ( i ) ;
about_clicked ( null ) ;
} catch ( Exception e ) {
return true ;
new AlertDialog . Builder ( this )
default :
. setCancelable ( true )
return super . onOptionsItemSelected ( item ) ;
. setPositiveButton ( "OK" ,
}
new DialogInterface . OnClickListener ( ) {
}
public void onClick ( DialogInterface di , int which ) { }
} )
. setIcon ( android . R . drawable . ic_dialog_info )
/ * these can be called as the _clicked ( ) variant on Android TV , or
. setTitle ( "no browser" )
* through the options menu on regular Android * /
. 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" )
public void settings_clicked ( View v ) {
. show ( ) ;
startActivity ( new Intent ( this , Settings . class ) ) ;
}
}
} return true ;
public void copypriv_clicked ( View v ) {
case R . id . about : {
copy_app_private ( ) ;
AlertDialog . Builder b = new AlertDialog . Builder ( this ) ;
}
b . setCancelable ( true ) ;
public void resetkeys_clicked ( View v ) {
b . setPositiveButton ( "OK" ,
reset_keys ( ) ;
new DialogInterface . OnClickListener ( ) {
}
public void onClick ( DialogInterface di , int which ) { }
public void doc_clicked ( View v ) {
} ) ;
try {
b . setIcon ( android . R . drawable . ic_dialog_info ) ;
Intent i = new Intent ( Intent . ACTION_VIEW ) ;
b . setTitle ( "About" ) ;
i . setData ( Uri . parse ( "http://www.galexander.org/software/simplesshd" ) ) ;
b . setMessage (
startActivity ( i ) ;
} catch ( Exception e ) {
new AlertDialog . Builder ( this )
. setCancelable ( true )
. setPositiveButton ( "OK" ,
new DialogInterface . OnClickListener ( ) {
public void onClick ( DialogInterface di , int which ) { }
} )
. setIcon ( android . R . drawable . ic_dialog_info )
. setTitle ( "no browser" )
. 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 ( ) ;
}
}
public void about_clicked ( View v ) {
AlertDialog . Builder b = new AlertDialog . Builder ( this ) ;
b . setCancelable ( true ) ;
b . setPositiveButton ( "OK" ,
new DialogInterface . OnClickListener ( ) {
public void onClick ( DialogInterface di , int which ) { }
} ) ;
b . setIcon ( android . R . drawable . ic_dialog_info ) ;
b . setTitle ( "About" ) ;
b . setMessage (
"SimpleSSHD version " + my_version ( ) +
"SimpleSSHD version " + my_version ( ) +
"\ndropbear 2019.78" +
"\ndropbear 2019.78" +
"\nscp/sftp from OpenSSH 6.7p1" +
"\nscp/sftp from OpenSSH 6.7p1" +
"\nrsync 3.1.1" ) ;
"\nrsync 3.1.1" ) ;
b . show ( ) ;
b . show ( ) ;
} return true ;
default :
return super . onOptionsItemSelected ( item ) ;
}
}
}
private void update_startstop_prime ( ) {
private void update_startstop_prime ( ) {
if ( SimpleSSHDService . is_started ( ) ) {
if ( SimpleSSHDService . is_started ( ) ) {
startstop_view . setText (
startstop_view . setText (
Prefs . get_onopen ( ) ? "QUIT" : "STOP" ) ;
Prefs . get_onopen ( ) ? "QUIT" : "STOP" ) ;
startstop_view . setTextColor ( 0xFF881111 ) ;
startstop_view . setTextColor (
is_tv ? 0xFFFF6666 : 0xFF881111 ) ;
} else {
} else {
startstop_view . setText ( "START" ) ;
startstop_view . setText ( "START" ) ;
startstop_view . setTextColor ( 0xFF118811 ) ;
startstop_view . setTextColor (
is_tv ? 0xFF44FF44 : 0xFF118811 ) ;
}
}
}
}