mirror of
http://galexander.org/git/simplesshd.git
synced 2025-03-03 16:26:04 +00:00
move the option menu items into their own _clicked functions
This commit is contained in:
parent
f0cef36573
commit
97989bce7f
6
NOTES
6
NOTES
@ -1012,9 +1012,9 @@ irrelevant or redundant, so I'm just about there.
|
|||||||
|
|
||||||
|
|
||||||
XXX - android TV support
|
XXX - android TV support
|
||||||
- make buttons work
|
- doc should start a WebView instead of a URL
|
||||||
- doc should start a WebView instead of a URL??
|
- make the backgrounds of the buttons more vividly demonstrate focus
|
||||||
- about shouldn't use Dialog??
|
- make nextFocusDown/Left/Right/Up overrides for some buttons
|
||||||
|
|
||||||
|
|
||||||
XXX - figure out how to force a refresh on eink devices (onyx boox) when the password is displayed (Roman)
|
XXX - figure out how to force a refresh on eink devices (onyx boox) when the password is displayed (Roman)
|
||||||
|
@ -80,15 +80,38 @@ 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:
|
||||||
startActivity(new Intent(this, Settings.class));
|
settings_clicked(null);
|
||||||
return true;
|
return true;
|
||||||
case R.id.copypriv:
|
case R.id.copypriv:
|
||||||
copy_app_private();
|
copypriv_clicked(null);
|
||||||
return true;
|
return true;
|
||||||
case R.id.resetkeys:
|
case R.id.resetkeys:
|
||||||
reset_keys();
|
resetkeys_clicked(null);
|
||||||
return true;
|
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 {
|
try {
|
||||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||||
i.setData(Uri.parse("http://www.galexander.org/software/simplesshd"));
|
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")
|
.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();
|
.show();
|
||||||
}
|
}
|
||||||
} return true;
|
}
|
||||||
case R.id.about: {
|
public void about_clicked(View v) {
|
||||||
AlertDialog.Builder b = new AlertDialog.Builder(this);
|
AlertDialog.Builder b = new AlertDialog.Builder(this);
|
||||||
b.setCancelable(true);
|
b.setCancelable(true);
|
||||||
b.setPositiveButton("OK",
|
b.setPositiveButton("OK",
|
||||||
@ -121,20 +144,19 @@ public class SimpleSSHD extends Activity
|
|||||||
"\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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user