aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-03-13 19:01:24 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-03-13 19:01:24 +0100
commit4c5ae3cdaa525ca925b5e7229a7c02b89b8cefd7 (patch)
tree9b8be141192f9b10a820db3a1c7851ebde2b6332 /OpenPGP-Keychain/src/main/java
parentcf51e5ff56070bbec52c70b36f4109484e84adb7 (diff)
downloadopen-keychain-4c5ae3cdaa525ca925b5e7229a7c02b89b8cefd7.tar.gz
open-keychain-4c5ae3cdaa525ca925b5e7229a7c02b89b8cefd7.tar.bz2
open-keychain-4c5ae3cdaa525ca925b5e7229a7c02b89b8cefd7.zip
Readd create key menu items
Diffstat (limited to 'OpenPGP-Keychain/src/main/java')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java50
1 files changed, 38 insertions, 12 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
index 9eebbed64..684ee6959 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
@@ -53,19 +53,45 @@ public class KeyListActivity extends DrawerActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case R.id.menu_key_list_import:
- Intent intentImport = new Intent(this, ImportKeysActivity.class);
- startActivityForResult(intentImport, 0);
-
- return true;
- case R.id.menu_key_list_export:
- // TODO fix this for unified keylist
- mExportHelper.showExportKeysDialog(null, Id.type.public_key, Constants.path.APP_DIR_FILE_PUB);
-
- return true;
- default:
- return super.onOptionsItemSelected(item);
+ case R.id.menu_key_list_import:
+ Intent intentImport = new Intent(this, ImportKeysActivity.class);
+ startActivityForResult(intentImport, 0);
+
+ return true;
+ case R.id.menu_key_list_export:
+ // TODO fix this for unified keylist
+ mExportHelper.showExportKeysDialog(null, Id.type.public_key, Constants.path.APP_DIR_FILE_PUB);
+
+ return true;
+ case R.id.menu_key_list_create:
+ createKey();
+
+ return true;
+ case R.id.menu_key_list_create_expert:
+ createKeyExpert();
+
+ return true;
+ case R.id.menu_key_list_secret_export:
+ mExportHelper.showExportKeysDialog(null, Id.type.secret_key, Constants.path.APP_DIR_FILE_SEC);
+
+
+ default:
+ return super.onOptionsItemSelected(item);
}
}
+ private void createKey() {
+ Intent intent = new Intent(this, EditKeyActivity.class);
+ intent.setAction(EditKeyActivity.ACTION_CREATE_KEY);
+ intent.putExtra(EditKeyActivity.EXTRA_GENERATE_DEFAULT_KEYS, true);
+ intent.putExtra(EditKeyActivity.EXTRA_USER_IDS, ""); // show user id view
+ startActivityForResult(intent, 0);
+ }
+
+ private void createKeyExpert() {
+ Intent intent = new Intent(this, EditKeyActivity.class);
+ intent.setAction(EditKeyActivity.ACTION_CREATE_KEY);
+ startActivityForResult(intent, 0);
+ }
+
}