diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java index 6fb0db0e5..a05b77ea5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java @@ -168,11 +168,13 @@ public abstract class OperationResults { public static class EditKeyResult extends OperationResultParcel { private transient UncachedKeyRing mRing; + public final long mRingMasterKeyId; public EditKeyResult(int result, OperationLog log, UncachedKeyRing ring) { super(result, log); mRing = ring; + mRingMasterKeyId = ring.getMasterKeyId(); } public UncachedKeyRing getRing() { @@ -181,6 +183,13 @@ public abstract class OperationResults { public EditKeyResult(Parcel source) { super(source); + mRingMasterKeyId = source.readLong(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); + dest.writeLong(mRingMasterKeyId); } public static Creator CREATOR = new Creator() { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java index 5e20b24b5..3c69fb071 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java @@ -136,6 +136,8 @@ public class CertifyKeyActivity extends ActionBarActivity implements if (mPubKeyId != 0) { if (mMasterKeyId == 0) { mSelectKeyFragment.setError(getString(R.string.select_key_to_certify)); + Notify.showNotify(CertifyKeyActivity.this, getString(R.string.select_key_to_certify), + Notify.Style.ERROR); } else { initiateSigning(); } @@ -256,7 +258,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements // Bail out if there is not at least one user id selected ArrayList userIds = mUserIdsAdapter.getSelectedUserIds(); if (userIds.isEmpty()) { - Notify.showNotify(CertifyKeyActivity.this, "No Notify.Style IDs to sign selected!", + Notify.showNotify(CertifyKeyActivity.this, "No identities selected!", Notify.Style.ERROR); return; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java index 7bccb8995..c083539da 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java @@ -20,8 +20,11 @@ package org.sufficientlysecure.keychain.ui; import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; +import android.database.ContentObserver; import android.net.Uri; import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; import android.os.Message; import android.os.Messenger; import android.support.v4.app.Fragment; @@ -35,6 +38,7 @@ import android.widget.TextView; import org.spongycastle.bcpg.sig.KeyFlags; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.helper.Preferences; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; @@ -188,22 +192,22 @@ public class CreateKeyFinalFragment extends Fragment { private void uploadKey(final OperationResults.EditKeyResult editKeyResult) { // Send all information needed to service to upload key in other thread - Intent intent = new Intent(getActivity(), KeychainIntentService.class); + final Intent intent = new Intent(getActivity(), KeychainIntentService.class); intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING); // set data uri as path to keyring Uri blobUri = KeychainContract.KeyRingData.buildPublicKeyRingUri( - Long.toString(editKeyResult.getRing().getMasterKeyId()) + Long.toString(editKeyResult.mRingMasterKeyId) ); intent.setData(blobUri); // fill values for this action Bundle data = new Bundle(); - Spinner keyServer = (Spinner) getActivity().findViewById(R.id.upload_key_keyserver); - String server = (String) keyServer.getSelectedItem(); - data.putString(KeychainIntentService.UPLOAD_KEY_SERVER, server); + // upload to favorite keyserver + String keyserver = Preferences.getPreferences(getActivity()).getKeyServers()[0]; + data.putString(KeychainIntentService.UPLOAD_KEY_SERVER, keyserver); intent.putExtra(KeychainIntentService.EXTRA_DATA, data); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java index 30a48e63e..a1fdc09cc 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyInputFragment.java @@ -147,7 +147,6 @@ public class CreateKeyInputFragment extends Fragment { mCreateKeyActivity = (CreateKeyActivity) getActivity(); } - private void createKeyCheck() { if (isEditTextNotEmpty(getActivity(), mNameEdit) && isEditTextNotEmpty(getActivity(), mEmailEdit) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index cb59afa93..5f340019f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -354,9 +354,8 @@ public class ImportKeysActivity extends ActionBarActivity { ImportKeysServerFragment f = (ImportKeysServerFragment) getActiveFragment(mViewPager, TAB_KEYSERVER); - // TODO: Currently it simply uses keyserver nr 0 - String keyserver = Preferences.getPreferences(ImportKeysActivity.this) - .getKeyServers()[0]; + // ask favorite keyserver + String keyserver = Preferences.getPreferences(ImportKeysActivity.this).getKeyServers()[0]; // set fields of ImportKeysServerFragment f.setQueryAndKeyserver(query, keyserver); diff --git a/OpenKeychain/src/main/res/layout/certify_key_activity.xml b/OpenKeychain/src/main/res/layout/certify_key_activity.xml index d9c1b806b..11bc70331 100644 --- a/OpenKeychain/src/main/res/layout/certify_key_activity.xml +++ b/OpenKeychain/src/main/res/layout/certify_key_activity.xml @@ -1,183 +1,191 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + android:layout_height="wrap_content" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:orientation="vertical"> - - + android:layout_height="wrap_content" + android:layout_marginBottom="4dp" + android:layout_marginTop="14dp" + android:text="@string/section_certification_key" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - \ No newline at end of file + diff --git a/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml b/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml index ccc2f2bdd..30ccc05ab 100644 --- a/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml +++ b/OpenKeychain/src/main/res/layout/create_key_input_fragment.xml @@ -74,28 +74,56 @@ android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:background="?android:attr/listDivider" - android:layout_alignTop="@+id/create_key_button" + android:layout_alignTop="@+id/create_key_buttons" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" /> - + android:layout_alignParentStart="true" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + android:id="@+id/create_key_buttons"> + + + + + + \ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/first_time_activity.xml b/OpenKeychain/src/main/res/layout/first_time_activity.xml index e1a67a077..fad1a3b26 100644 --- a/OpenKeychain/src/main/res/layout/first_time_activity.xml +++ b/OpenKeychain/src/main/res/layout/first_time_activity.xml @@ -23,6 +23,29 @@ android:layout_height="wrap_content" android:orientation="horizontal"> + + + + - - -