From c8d0ff77b10bc5e0103df473076fc7cacadf9014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 1 Jan 2014 20:29:56 +0100 Subject: show layout not before passphrase is entered --- .../keychain/ui/EditKeyActivity.java | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 7abee78f3..2995a839a 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -119,12 +119,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { } }); - setContentView(R.layout.edit_key); - - // find views - mChangePassPhrase = (Button) findViewById(R.id.edit_key_btn_change_pass_phrase); - mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase); - mUserIds = new Vector(); mKeys = new Vector(); mKeysUsages = new Vector(); @@ -138,28 +132,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { handleActionEditKey(intent); } - mChangePassPhrase.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - showSetPassphraseDialog(); - } - }); - - // disable passphrase when no passphrase checkobox is checked! - mNoPassphrase.setOnCheckedChangeListener(new OnCheckedChangeListener() { - - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (isChecked) { - // remove passphrase - mNewPassPhrase = null; - - mChangePassPhrase.setVisibility(View.GONE); - } else { - mChangePassPhrase.setVisibility(View.VISIBLE); - } - } - }); - if (mBuildLayout) { buildLayout(); } @@ -402,6 +374,12 @@ public class EditKeyActivity extends SherlockFragmentActivity { * id and key. */ private void buildLayout() { + setContentView(R.layout.edit_key); + + // find views + mChangePassPhrase = (Button) findViewById(R.id.edit_key_btn_change_pass_phrase); + mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase); + // Build layout based on given userIds and keys LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); @@ -418,6 +396,28 @@ public class EditKeyActivity extends SherlockFragmentActivity { container.addView(mKeysView); updatePassPhraseButtonText(); + + mChangePassPhrase.setOnClickListener(new OnClickListener() { + public void onClick(View v) { + showSetPassphraseDialog(); + } + }); + + // disable passphrase when no passphrase checkobox is checked! + mNoPassphrase.setOnCheckedChangeListener(new OnCheckedChangeListener() { + + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (isChecked) { + // remove passphrase + mNewPassPhrase = null; + + mChangePassPhrase.setVisibility(View.GONE); + } else { + mChangePassPhrase.setVisibility(View.VISIBLE); + } + } + }); } private long getMasterKeyId() { -- cgit v1.2.3 From 1d91804dc7943e7149d02141a46c3eb0763e2b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 1 Jan 2014 22:26:19 +0100 Subject: Simple new list implementations, remove library, use simple adapter with headings --- .../src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 2995a839a..7aeb51c8f 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Dominik Schürmann + * Copyright (C) 2012-2013 Dominik Schürmann * Copyright (C) 2010 Thialfihar * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -268,7 +268,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { * * @param intent */ - @SuppressWarnings("unchecked") private void handleActionEditKey(Intent intent) { Bundle extras = intent.getExtras(); @@ -291,7 +290,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { finallyEdit(masterKeyId, masterCanSign); } - } } } -- cgit v1.2.3 From bc0edfda0bae21a567b9ea340cab323f9a15a086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 2 Jan 2014 22:45:24 +0100 Subject: fix nullpointer in EditKeyActivity --- .../keychain/ui/EditKeyActivity.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 7aeb51c8f..4dcaa6d73 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -295,17 +295,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { } private void finallyEdit(final long masterKeyId, final boolean masterCanSign) { - // TODO: ??? - if (mCurrentPassPhrase == null) { - mCurrentPassPhrase = ""; - } - - if (mCurrentPassPhrase.equals("")) { - // check "no passphrase" checkbox and remove button - mNoPassphrase.setChecked(true); - mChangePassPhrase.setVisibility(View.GONE); - } - if (masterKeyId != 0) { PGPSecretKey masterKey = null; mKeyRing = ProviderHelper.getPGPSecretKeyRingByMasterKeyId(this, masterKeyId); @@ -328,6 +317,17 @@ public class EditKeyActivity extends SherlockFragmentActivity { } buildLayout(); + + // TODO: ??? + if (mCurrentPassPhrase == null) { + mCurrentPassPhrase = ""; + } + + if (mCurrentPassPhrase.equals("")) { + // check "no passphrase" checkbox and remove button + mNoPassphrase.setChecked(true); + mChangePassPhrase.setVisibility(View.GONE); + } } /** -- cgit v1.2.3 From 44117fb191763e16a8ca3418522d3d5be6582a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 7 Jan 2014 21:02:31 +0100 Subject: key edit fixes --- .../keychain/ui/EditKeyActivity.java | 157 +++++++++++++-------- 1 file changed, 98 insertions(+), 59 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 4dcaa6d73..c0c81b969 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -34,6 +34,7 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.PassphraseCacheService; +import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment; import org.sufficientlysecure.keychain.ui.widget.KeyEditor; @@ -45,6 +46,7 @@ import org.sufficientlysecure.keychain.util.Log; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; @@ -60,9 +62,10 @@ import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.LinearLayout; import android.widget.Toast; -import com.actionbarsherlock.app.SherlockFragmentActivity; +import com.actionbarsherlock.view.Menu; +import com.actionbarsherlock.view.MenuItem; -public class EditKeyActivity extends SherlockFragmentActivity { +public class EditKeyActivity extends KeyActivity { // Actions for internal use only: public static final String ACTION_CREATE_KEY = Constants.INTENT_PREFIX + "CREATE_KEY"; @@ -72,13 +75,14 @@ public class EditKeyActivity extends SherlockFragmentActivity { public static final String EXTRA_USER_IDS = "user_ids"; public static final String EXTRA_NO_PASSPHRASE = "no_passphrase"; public static final String EXTRA_GENERATE_DEFAULT_KEYS = "generate_default_keys"; - public static final String EXTRA_MASTER_KEY_ID = "master_key_id"; - public static final String EXTRA_MASTER_CAN_SIGN = "master_can_sign"; // results when saving key public static final String RESULT_EXTRA_MASTER_KEY_ID = "master_key_id"; public static final String RESULT_EXTRA_USER_ID = "user_id"; + // EDIT + private Uri mDataUri; + private PGPSecretKeyRing mKeyRing = null; private SectionView mUserIdsView; @@ -96,29 +100,10 @@ public class EditKeyActivity extends SherlockFragmentActivity { Vector mKeysUsages; boolean masterCanSign = true; - // will be set to false to build layout later in handler - private boolean mBuildLayout = true; - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // Inflate a "Done"/"Cancel" custom action bar - ActionBarHelper.setDoneCancelView(getSupportActionBar(), R.string.btn_save, - new View.OnClickListener() { - @Override - public void onClick(View v) { - // save - saveClicked(); - } - }, R.string.btn_do_not_save, new View.OnClickListener() { - @Override - public void onClick(View v) { - // cancel - cancelClicked(); - } - }); - mUserIds = new Vector(); mKeys = new Vector(); mKeysUsages = new Vector(); @@ -131,10 +116,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { } else if (ACTION_EDIT_KEY.equals(action)) { handleActionEditKey(intent); } - - if (mBuildLayout) { - buildLayout(); - } } /** @@ -143,6 +124,20 @@ public class EditKeyActivity extends SherlockFragmentActivity { * @param intent */ private void handleActionCreateKey(Intent intent) { + // Inflate a "Done"/"Cancel" custom action bar + ActionBarHelper.setDoneCancelView(getSupportActionBar(), R.string.btn_save, + new View.OnClickListener() { + @Override + public void onClick(View v) { + saveClicked(); + } + }, R.string.btn_do_not_save, new View.OnClickListener() { + @Override + public void onClick(View v) { + cancelClicked(); + } + }); + Bundle extras = intent.getExtras(); mCurrentPassPhrase = ""; @@ -169,9 +164,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { boolean generateDefaultKeys = extras.getBoolean(EXTRA_GENERATE_DEFAULT_KEYS); if (generateDefaultKeys) { - // build layout in handler after generating keys not directly in onCreate - mBuildLayout = false; - // Send all information needed to service generate keys in other thread Intent serviceIntent = new Intent(this, KeychainIntentService.class); serviceIntent.setAction(KeychainIntentService.ACTION_GENERATE_DEFAULT_RSA_KEYS); @@ -228,12 +220,55 @@ public class EditKeyActivity extends SherlockFragmentActivity { startService(serviceIntent); } } + } else { + buildLayout(); + } + } + + /** + * Handle intent action to edit existing key + * + * @param intent + */ + private void handleActionEditKey(Intent intent) { + // Inflate a "Done"/"Cancel" custom action bar + ActionBarHelper.setDoneView(getSupportActionBar(), R.string.btn_save, + new View.OnClickListener() { + @Override + public void onClick(View v) { + saveClicked(); + } + }); + + mDataUri = intent.getData(); + if (mDataUri == null) { + Log.e(Constants.TAG, "Intent data missing. Should be Uri of key!"); + finish(); + return; + } else { + Log.d(Constants.TAG, "uri: " + mDataUri); + + long keyRingRowId = Long.valueOf(mDataUri.getLastPathSegment()); + + // get master key id using row id + long masterKeyId = ProviderHelper.getSecretMasterKeyId(this, keyRingRowId); + + boolean masterCanSign = ProviderHelper.getSecretMasterKeyCanSign(this, keyRingRowId); + + String passphrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId); + if (passphrase == null) { + showPassphraseDialog(masterKeyId, masterCanSign); + } else { + // PgpMain.setEditPassPhrase(passPhrase); + mCurrentPassPhrase = passphrase; + + finallyEdit(masterKeyId, masterCanSign); + } } } private void showPassphraseDialog(final long masterKeyId, final boolean masterCanSign) { // Message is received after passphrase is cached - final boolean mCanSign = masterCanSign; Handler returnHandler = new Handler() { @Override public void handleMessage(Message message) { @@ -263,37 +298,41 @@ public class EditKeyActivity extends SherlockFragmentActivity { } } - /** - * Handle intent action to edit existing key - * - * @param intent - */ - private void handleActionEditKey(Intent intent) { - Bundle extras = intent.getExtras(); - - if (extras != null) { - if (extras.containsKey(EXTRA_MASTER_CAN_SIGN)) { - masterCanSign = extras.getBoolean(EXTRA_MASTER_CAN_SIGN); - } - if (extras.containsKey(EXTRA_MASTER_KEY_ID)) { - long masterKeyId = extras.getLong(EXTRA_MASTER_KEY_ID); - - // build layout in edit() - mBuildLayout = false; + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + // show menu only on edit + if (mDataUri != null) { + return super.onPrepareOptionsMenu(menu); + } else { + return false; + } + } - String passPhrase = PassphraseCacheService.getCachedPassphrase(this, masterKeyId); - if (passPhrase == null) { - showPassphraseDialog(masterKeyId, masterCanSign); - } else { - // PgpMain.setEditPassPhrase(passPhrase); - mCurrentPassPhrase = passPhrase; + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + getSupportMenuInflater().inflate(R.menu.key_edit, menu); + return true; + } - finallyEdit(masterKeyId, masterCanSign); - } - } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.menu_key_edit_cancel: + cancelClicked(); + return true; + case R.id.menu_key_edit_export_file: + showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR + + "/secexport.asc"); + return true; + case R.id.menu_key_edit_delete: + deleteKey(mDataUri, Id.type.secret_key); + return true; } + return super.onOptionsItemSelected(item); } + @SuppressWarnings("unchecked") private void finallyEdit(final long masterKeyId, final boolean masterCanSign) { if (masterKeyId != 0) { PGPSecretKey masterKey = null; @@ -316,13 +355,13 @@ public class EditKeyActivity extends SherlockFragmentActivity { } } - buildLayout(); - // TODO: ??? if (mCurrentPassPhrase == null) { mCurrentPassPhrase = ""; } + buildLayout(); + if (mCurrentPassPhrase.equals("")) { // check "no passphrase" checkbox and remove button mNoPassphrase.setChecked(true); -- cgit v1.2.3 From caf3b02042f94b7b2a9b019b01d45c41bf035140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 7 Jan 2014 22:40:18 +0100 Subject: reorder menus, cleanup code, add experimental tab activity --- .../sufficientlysecure/keychain/ui/EditKeyActivity.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index c0c81b969..d141fbe3a 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -325,10 +325,22 @@ public class EditKeyActivity extends KeyActivity { showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR + "/secexport.asc"); return true; - case R.id.menu_key_edit_delete: - deleteKey(mDataUri, Id.type.secret_key); + case R.id.menu_key_edit_delete: { + // Message is received after key is deleted + Handler returnHandler = new Handler() { + @Override + public void handleMessage(Message message) { + if (message.what == DeleteKeyDialogFragment.MESSAGE_OKAY) { + setResult(RESULT_CANCELED); + finish(); + } + } + }; + + deleteKey(mDataUri, Id.type.secret_key, returnHandler); return true; } + } return super.onOptionsItemSelected(item); } -- cgit v1.2.3 From 2162c85c125a2155f29ddcd436d36ff9a472c3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 9 Jan 2014 15:12:41 +0100 Subject: use bootstrap buttons --- .../org/sufficientlysecure/keychain/ui/EditKeyActivity.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index d141fbe3a..569a16c41 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -55,7 +55,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; @@ -64,6 +63,7 @@ import android.widget.Toast; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; +import com.beardedhen.androidbootstrap.BootstrapButton; public class EditKeyActivity extends KeyActivity { @@ -91,7 +91,7 @@ public class EditKeyActivity extends KeyActivity { private String mCurrentPassPhrase = null; private String mNewPassPhrase = null; - private Button mChangePassPhrase; + private BootstrapButton mChangePassPhrase; private CheckBox mNoPassphrase; @@ -336,7 +336,7 @@ public class EditKeyActivity extends KeyActivity { } } }; - + deleteKey(mDataUri, Id.type.secret_key, returnHandler); return true; } @@ -426,7 +426,7 @@ public class EditKeyActivity extends KeyActivity { setContentView(R.layout.edit_key); // find views - mChangePassPhrase = (Button) findViewById(R.id.edit_key_btn_change_pass_phrase); + mChangePassPhrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_pass_phrase); mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase); // Build layout based on given userIds and keys @@ -653,7 +653,7 @@ public class EditKeyActivity extends KeyActivity { } private void updatePassPhraseButtonText() { - mChangePassPhrase.setText(isPassphraseSet() ? R.string.btn_change_passphrase - : R.string.btn_set_passphrase); + mChangePassPhrase.setText(isPassphraseSet() ? getString(R.string.btn_change_passphrase) + : getString(R.string.btn_set_passphrase)); } } -- cgit v1.2.3 From 37fd7dbbc70d6fc033db4101eaf89bad627fe499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 9 Jan 2014 23:13:23 +0100 Subject: fix bad crashes --- .../keychain/ui/EditKeyActivity.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 569a16c41..b79200ba1 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -27,6 +27,7 @@ import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.helper.ActionBarHelper; +import org.sufficientlysecure.keychain.helper.ExportHelper; import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; @@ -61,11 +62,12 @@ import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.LinearLayout; import android.widget.Toast; +import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; import com.beardedhen.androidbootstrap.BootstrapButton; -public class EditKeyActivity extends KeyActivity { +public class EditKeyActivity extends SherlockFragmentActivity { // Actions for internal use only: public static final String ACTION_CREATE_KEY = Constants.INTENT_PREFIX + "CREATE_KEY"; @@ -100,10 +102,14 @@ public class EditKeyActivity extends KeyActivity { Vector mKeysUsages; boolean masterCanSign = true; + ExportHelper mExportHelper; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + mExportHelper = new ExportHelper(this); + mUserIds = new Vector(); mKeys = new Vector(); mKeysUsages = new Vector(); @@ -322,7 +328,7 @@ public class EditKeyActivity extends KeyActivity { cancelClicked(); return true; case R.id.menu_key_edit_export_file: - showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR + mExportHelper.showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR + "/secexport.asc"); return true; case R.id.menu_key_edit_delete: { @@ -337,7 +343,7 @@ public class EditKeyActivity extends KeyActivity { } }; - deleteKey(mDataUri, Id.type.secret_key, returnHandler); + mExportHelper.deleteKey(mDataUri, Id.type.secret_key, returnHandler); return true; } } @@ -656,4 +662,11 @@ public class EditKeyActivity extends KeyActivity { mChangePassPhrase.setText(isPassphraseSet() ? getString(R.string.btn_change_passphrase) : getString(R.string.btn_set_passphrase)); } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + if (!mExportHelper.handleActivityResult(requestCode, resultCode, data)) { + super.onActivityResult(requestCode, resultCode, data); + } + } } -- cgit v1.2.3 From 100ae50e02ef3dfd0330a6e1e7084726ddea69a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 12 Jan 2014 21:33:37 +0100 Subject: cleanup layouts, prepare layouts for new key view --- .../src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java') diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index b79200ba1..be2e4115b 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -429,7 +429,7 @@ public class EditKeyActivity extends SherlockFragmentActivity { * id and key. */ private void buildLayout() { - setContentView(R.layout.edit_key); + setContentView(R.layout.edit_key_activity); // find views mChangePassPhrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_pass_phrase); -- cgit v1.2.3