Skip to content

Commit

Permalink
showing fallback message when no key is present
Browse files Browse the repository at this point in the history
  • Loading branch information
wolpi committed May 12, 2024
1 parent 1539a44 commit 23fe380
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions primitiveFTPd/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<string name="pubkeyAuthKeysHeading">Keys for public key auth</string>
<string name="addPubkeyForAuth">Add public key for auth</string>
<string name="pubkeyInvalid">Input is not a valid key, has been ignored.</string>
<string name="noKeysPresent">No keys present.</string>
<string name="state">State</string>
<string name="serverStarted">Running …</string>
<string name="serverStopped">Stopped</string>
Expand Down
6 changes: 6 additions & 0 deletions primitiveFTPd/src/org/primftpd/ui/PubKeyAuthKeysFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ private void displayKeys(View view, List<String> keys) {
textView.setPadding(1, 1, 1, 5);
container.addView(textView);
}

if (keys.isEmpty()) {
TextView textView = new TextView(container.getContext());
textView.setText(R.string.noKeysPresent);
container.addView(textView);
}
}

protected void addKeyToFile(CharSequence key) {
Expand Down

0 comments on commit 23fe380

Please sign in to comment.