have a direct set/change pass phrase button in key creation/editing, instead of hiding it in the menu, also capitalize user id names automatically and give the email field an inputType of textEmailAddress

This commit is contained in:
Thialfihar 2010-07-23 12:57:02 +00:00
parent 15461e4720
commit 2407f3b989
8 changed files with 66 additions and 37 deletions

View File

@ -32,7 +32,33 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:orientation="vertical"
android:layout_marginRight="?android:attr/scrollbarSize"/> android:layout_marginRight="?android:attr/scrollbarSize">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button
android:id="@+id/btn_change_pass_phrase"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="@string/btn_setPassPhrase"/>
<View
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
</ScrollView> </ScrollView>

View File

@ -59,7 +59,8 @@
android:id="@+id/name" android:id="@+id/name"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="fill_parent"/> android:layout_width="fill_parent"
android:inputType="textPersonName|textCapWords"/>
</TableRow> </TableRow>
@ -77,7 +78,8 @@
android:id="@+id/email" android:id="@+id/email"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="fill_parent"/> android:layout_width="fill_parent"
android:inputType="textEmailAddress"/>
</TableRow> </TableRow>

View File

@ -63,6 +63,8 @@
<string name="btn_delete">Slet</string> <string name="btn_delete">Slet</string>
<string name="btn_noDate">Ingen</string> <string name="btn_noDate">Ingen</string>
<string name="btn_clearFilter">Ryd Filter</string> <string name="btn_clearFilter">Ryd Filter</string>
<string name="btn_changePassPhrase">Skift Kodeord</string>
<string name="btn_setPassPhrase">Sæt Kodeord</string>
<!-- menu_lowerCase: capitalized words, no punctuation --> <!-- menu_lowerCase: capitalized words, no punctuation -->
<string name="menu_about">Om APG</string> <string name="menu_about">Om APG</string>
@ -71,8 +73,6 @@
<string name="menu_managePublicKeys">Administrér Offentlige Nøgler</string> <string name="menu_managePublicKeys">Administrér Offentlige Nøgler</string>
<string name="menu_manageSecretKeys">Administrér Private Nøgler</string> <string name="menu_manageSecretKeys">Administrér Private Nøgler</string>
<string name="menu_preferences">Indstillinger</string> <string name="menu_preferences">Indstillinger</string>
<string name="menu_changePassPhrase">Skift Kodeord</string>
<string name="menu_setPassPhrase">Sæt Kodeord</string>
<string name="menu_importKeys">Importér Nøgler</string> <string name="menu_importKeys">Importér Nøgler</string>
<string name="menu_exportKeys">Eksportér Nøgler</string> <string name="menu_exportKeys">Eksportér Nøgler</string>
<string name="menu_exportKey">Eksportér Nøgle</string> <string name="menu_exportKey">Eksportér Nøgle</string>
@ -146,7 +146,7 @@
<string name="wrongPassPhrase">Forkert kodeord.</string> <string name="wrongPassPhrase">Forkert kodeord.</string>
<string name="usingClipboardContent">Bruger clipboardets indhold.</string> <string name="usingClipboardContent">Bruger clipboardets indhold.</string>
<string name="keySaved">Nøgle gemt.</string> <string name="keySaved">Nøgle gemt.</string>
<string name="setAPassPhrase">Sæt et kodeord via Indstillinger først.</string> <string name="setAPassPhrase">Sæt et kodeord først.</string>
<string name="noFilemanagerInstalled">Der er ikke installeret en kompatibel fil håndtering.</string> <string name="noFilemanagerInstalled">Der er ikke installeret en kompatibel fil håndtering.</string>
<string name="passPhrasesDoNotMatch">Kodeordet matchede ikke.</string> <string name="passPhrasesDoNotMatch">Kodeordet matchede ikke.</string>
<string name="passPhraseMustNotBeEmpty">Et tomt kodeord er ikke tilladt.</string> <string name="passPhraseMustNotBeEmpty">Et tomt kodeord er ikke tilladt.</string>

View File

@ -66,6 +66,8 @@
<string name="btn_delete">Löschen</string> <string name="btn_delete">Löschen</string>
<string name="btn_noDate">Niemals</string> <string name="btn_noDate">Niemals</string>
<string name="btn_clearFilter">Filter zurücksetzen</string> <string name="btn_clearFilter">Filter zurücksetzen</string>
<string name="btn_changePassPhrase">Passwort ändern</string>
<string name="btn_setPassPhrase">Passwort wählen</string>
<!-- menu_lowerCase: capitalized words, no punctuation --> <!-- menu_lowerCase: capitalized words, no punctuation -->
<string name="menu_about">Über</string> <string name="menu_about">Über</string>
@ -74,8 +76,6 @@
<string name="menu_managePublicKeys">Öffentliche Schlüssel verwalten</string> <string name="menu_managePublicKeys">Öffentliche Schlüssel verwalten</string>
<string name="menu_manageSecretKeys">Private Schlüssel verwalten</string> <string name="menu_manageSecretKeys">Private Schlüssel verwalten</string>
<string name="menu_preferences">Einstellungen</string> <string name="menu_preferences">Einstellungen</string>
<string name="menu_changePassPhrase">Passwort ändern</string>
<string name="menu_setPassPhrase">Passwort wählen</string>
<string name="menu_importKeys">Schlüssel importieren</string> <string name="menu_importKeys">Schlüssel importieren</string>
<string name="menu_exportKeys">Mehrere Schlüssel exportieren</string> <string name="menu_exportKeys">Mehrere Schlüssel exportieren</string>
<string name="menu_exportKey">Einzelnen Schlüssel exportieren</string> <string name="menu_exportKey">Einzelnen Schlüssel exportieren</string>
@ -154,7 +154,7 @@
<string name="usingClipboardContent">Zwischenablage wird verwendet.</string> <string name="usingClipboardContent">Zwischenablage wird verwendet.</string>
<string name="keySaved">Schlüssel gespeichert.</string> <string name="keySaved">Schlüssel gespeichert.</string>
<string name="setAPassPhrase">Zuerst über Auswahlmenü Passwort festlegen.</string> <string name="setAPassPhrase">Zuerst Passwort festlegen.</string>
<string name="noFilemanagerInstalled">Kein kompatibler Dateimanager installiert.</string> <string name="noFilemanagerInstalled">Kein kompatibler Dateimanager installiert.</string>
<string name="passPhrasesDoNotMatch">Passwörter stimmen nicht überein.</string> <string name="passPhrasesDoNotMatch">Passwörter stimmen nicht überein.</string>
<string name="passPhraseMustNotBeEmpty">Leere Passwörter sind unzulässig.</string> <string name="passPhraseMustNotBeEmpty">Leere Passwörter sind unzulässig.</string>

View File

@ -65,6 +65,8 @@
<string name="btn_delete">Cancella</string> <string name="btn_delete">Cancella</string>
<string name="btn_noDate">Nessuno</string> <string name="btn_noDate">Nessuno</string>
<string name="btn_clearFilter">Cancella Filtro</string> <string name="btn_clearFilter">Cancella Filtro</string>
<string name="btn_changePassPhrase">Cambia Pass Phrase</string>
<string name="btn_setPassPhrase">Imposta Pass Phrase</string>
<!-- menu_lowerCase: capitalized words, no punctuation --> <!-- menu_lowerCase: capitalized words, no punctuation -->
<string name="menu_about">Informazioni</string> <string name="menu_about">Informazioni</string>
@ -73,8 +75,6 @@
<string name="menu_managePublicKeys">Gestisci Chiavi Pubbliche</string> <string name="menu_managePublicKeys">Gestisci Chiavi Pubbliche</string>
<string name="menu_manageSecretKeys">Gestisci Chiavi Private</string> <string name="menu_manageSecretKeys">Gestisci Chiavi Private</string>
<string name="menu_preferences">Impostazioni</string> <string name="menu_preferences">Impostazioni</string>
<string name="menu_changePassPhrase">Cambia Pass Phrase</string>
<string name="menu_setPassPhrase">Imposta Pass Phrase</string>
<string name="menu_importKeys">Importa Chiavi</string> <string name="menu_importKeys">Importa Chiavi</string>
<string name="menu_exportKeys">Esporta Chiavi</string> <string name="menu_exportKeys">Esporta Chiavi</string>
<string name="menu_exportKey">Esporta Chiave</string> <string name="menu_exportKey">Esporta Chiave</string>
@ -148,7 +148,7 @@
<string name="wrongPassPhrase">Pass Phrase errata.</string> <string name="wrongPassPhrase">Pass Phrase errata.</string>
<string name="usingClipboardContent">Utilizza il contenuto della clipboard.</string> <string name="usingClipboardContent">Utilizza il contenuto della clipboard.</string>
<string name="keySaved">Chiave salvata..</string> <string name="keySaved">Chiave salvata..</string>
<string name="setAPassPhrase">Imposta prima una Pass Phrase tramite il menù Opzioni.</string> <string name="setAPassPhrase">Imposta prima una Pass Phrase.</string>
<string name="noFilemanagerInstalled">Nessun file manager compatibile installato.</string> <string name="noFilemanagerInstalled">Nessun file manager compatibile installato.</string>
<string name="passPhrasesDoNotMatch">La Pass Phrase non è corretta</string> <string name="passPhrasesDoNotMatch">La Pass Phrase non è corretta</string>
<string name="passPhraseMustNotBeEmpty">La Pass Phrases non può essere vuota.</string> <string name="passPhraseMustNotBeEmpty">La Pass Phrases non può essere vuota.</string>

View File

@ -65,6 +65,8 @@
<string name="btn_delete">Izbriši</string> <string name="btn_delete">Izbriši</string>
<string name="btn_noDate">Brez</string> <string name="btn_noDate">Brez</string>
<string name="btn_clearFilter">Umakni filtriranje</string> <string name="btn_clearFilter">Umakni filtriranje</string>
<string name="btn_changePassPhrase">Spremeni geslo</string>
<string name="btn_setPassPhrase">Določi geslo</string>
<!-- menu_lowerCase: capitalized words, no punctuation --> <!-- menu_lowerCase: capitalized words, no punctuation -->
<string name="menu_about">O programu</string> <string name="menu_about">O programu</string>
@ -73,8 +75,6 @@
<string name="menu_managePublicKeys">Upravljanje javnih ključev</string> <string name="menu_managePublicKeys">Upravljanje javnih ključev</string>
<string name="menu_manageSecretKeys">Upravljanje zasebnih ključev</string> <string name="menu_manageSecretKeys">Upravljanje zasebnih ključev</string>
<string name="menu_preferences">Nastavitve</string> <string name="menu_preferences">Nastavitve</string>
<string name="menu_changePassPhrase">Spremeni geslo</string>
<string name="menu_setPassPhrase">Določi geslo</string>
<string name="menu_importKeys">Uvozi ključe</string> <string name="menu_importKeys">Uvozi ključe</string>
<string name="menu_exportKeys">Izvozi ključe</string> <string name="menu_exportKeys">Izvozi ključe</string>
<string name="menu_exportKey">Izvozi ključ</string> <string name="menu_exportKey">Izvozi ključ</string>
@ -150,7 +150,7 @@
<string name="wrongPassPhrase">Napačno geslo.</string> <string name="wrongPassPhrase">Napačno geslo.</string>
<string name="usingClipboardContent">Uporabljam vsebino odložišča.</string> <string name="usingClipboardContent">Uporabljam vsebino odložišča.</string>
<string name="keySaved">Ključ shranjen.</string> <string name="keySaved">Ključ shranjen.</string>
<string name="setAPassPhrase">Najprej preko menija možnosti določite geslo.</string> <string name="setAPassPhrase">Najprej določite geslo.</string>
<string name="noFilemanagerInstalled">Nameščen ni noben združljiv upravitelj datotek.</string> <string name="noFilemanagerInstalled">Nameščen ni noben združljiv upravitelj datotek.</string>
<string name="passPhrasesDoNotMatch">Gesli se ne ujemata.</string> <string name="passPhrasesDoNotMatch">Gesli se ne ujemata.</string>
<string name="passPhraseMustNotBeEmpty">Prazna gesla niso dovoljena.</string> <string name="passPhraseMustNotBeEmpty">Prazna gesla niso dovoljena.</string>

View File

@ -63,6 +63,8 @@
<string name="btn_delete">Delete</string> <string name="btn_delete">Delete</string>
<string name="btn_noDate">None</string> <string name="btn_noDate">None</string>
<string name="btn_clearFilter">Clear Filter</string> <string name="btn_clearFilter">Clear Filter</string>
<string name="btn_changePassPhrase">Change Pass Phrase</string>
<string name="btn_setPassPhrase">Set Pass Phrase</string>
<!-- menu_lowerCase: capitalized words, no punctuation --> <!-- menu_lowerCase: capitalized words, no punctuation -->
<string name="menu_about">About</string> <string name="menu_about">About</string>
@ -71,8 +73,6 @@
<string name="menu_managePublicKeys">Manage Public Keys</string> <string name="menu_managePublicKeys">Manage Public Keys</string>
<string name="menu_manageSecretKeys">Manage Secret Keys</string> <string name="menu_manageSecretKeys">Manage Secret Keys</string>
<string name="menu_preferences">Settings</string> <string name="menu_preferences">Settings</string>
<string name="menu_changePassPhrase">Change Pass Phrase</string>
<string name="menu_setPassPhrase">Set Pass Phrase</string>
<string name="menu_importKeys">Import Keys</string> <string name="menu_importKeys">Import Keys</string>
<string name="menu_exportKeys">Export Keys</string> <string name="menu_exportKeys">Export Keys</string>
<string name="menu_exportKey">Export Key</string> <string name="menu_exportKey">Export Key</string>
@ -148,7 +148,7 @@
<string name="wrongPassPhrase">Wrong pass phrase.</string> <string name="wrongPassPhrase">Wrong pass phrase.</string>
<string name="usingClipboardContent">Using clipboard content.</string> <string name="usingClipboardContent">Using clipboard content.</string>
<string name="keySaved">Key saved.</string> <string name="keySaved">Key saved.</string>
<string name="setAPassPhrase">Set a pass phrase via the option menu first.</string> <string name="setAPassPhrase">Set a pass phrase first.</string>
<string name="noFilemanagerInstalled">No compatible file manager installed.</string> <string name="noFilemanagerInstalled">No compatible file manager installed.</string>
<string name="passPhrasesDoNotMatch">The pass phrases didn\'t match.</string> <string name="passPhrasesDoNotMatch">The pass phrases didn\'t match.</string>
<string name="passPhraseMustNotBeEmpty">Empty pass phrases are not allowed.</string> <string name="passPhraseMustNotBeEmpty">Empty pass phrases are not allowed.</string>

View File

@ -60,6 +60,8 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
private String mCurrentPassPhrase = null; private String mCurrentPassPhrase = null;
private String mNewPassPhrase = null; private String mNewPassPhrase = null;
private Button mChangePassPhrase;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -90,6 +92,14 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
} }
} }
mChangePassPhrase = (Button) findViewById(R.id.btn_change_pass_phrase);
mChangePassPhrase.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showDialog(Id.dialog.new_pass_phrase);
}
});
mSaveButton = (Button) findViewById(R.id.btn_save); mSaveButton = (Button) findViewById(R.id.btn_save);
mDiscardButton = (Button) findViewById(R.id.btn_discard); mDiscardButton = (Button) findViewById(R.id.btn_discard);
@ -114,6 +124,8 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
mCurrentPassPhrase = ""; mCurrentPassPhrase = "";
} }
updatePassPhraseButtonText();
Toast.makeText(this, "Warning: Key editing is still kind of beta.", Toast.LENGTH_LONG).show(); Toast.makeText(this, "Warning: Key editing is still kind of beta.", Toast.LENGTH_LONG).show();
} }
@ -131,30 +143,13 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, Id.menu.option.new_pass_phrase, 0, menu.add(0, Id.menu.option.preferences, 0, R.string.menu_preferences)
(havePassPhrase() ? R.string.menu_changePassPhrase : R.string.menu_setPassPhrase))
.setIcon(android.R.drawable.ic_menu_add);
menu.add(0, Id.menu.option.preferences, 1, R.string.menu_preferences)
.setIcon(android.R.drawable.ic_menu_preferences); .setIcon(android.R.drawable.ic_menu_preferences);
menu.add(0, Id.menu.option.about, 2, R.string.menu_about) menu.add(0, Id.menu.option.about, 1, R.string.menu_about)
.setIcon(android.R.drawable.ic_menu_info_details); .setIcon(android.R.drawable.ic_menu_info_details);
return true; return true;
} }
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case Id.menu.option.new_pass_phrase: {
showDialog(Id.dialog.new_pass_phrase);
return true;
}
default: {
return super.onOptionsItemSelected(item);
}
}
}
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { switch (id) {
@ -194,6 +189,7 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
} }
mNewPassPhrase = passPhrase1; mNewPassPhrase = passPhrase1;
updatePassPhraseButtonText();
} }
}); });
@ -289,4 +285,9 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener {
finish(); finish();
} }
} }
private void updatePassPhraseButtonText() {
mChangePassPhrase.setText(
havePassPhrase() ? R.string.btn_changePassPhrase : R.string.btn_setPassPhrase);
}
} }