aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2014-03-12 02:58:42 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2014-03-15 18:20:42 +0100
commitdb25c56b6479a3679a8abe01e865ad5231be73ee (patch)
tree1bd9586639c3d9e79e494d4cb9fd24c26abe1de1 /OpenPGP-Keychain
parent0922a8cf0410fb7ea3e6cca131d834b71caaf22f (diff)
downloadopen-keychain-db25c56b6479a3679a8abe01e865ad5231be73ee.tar.gz
open-keychain-db25c56b6479a3679a8abe01e865ad5231be73ee.tar.bz2
open-keychain-db25c56b6479a3679a8abe01e865ad5231be73ee.zip
certify: add certify action button to viewkeymainfragment
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java21
-rw-r--r--OpenPGP-Keychain/src/main/res/layout/view_key_main_fragment.xml11
2 files changed, 32 insertions, 0 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java
index a361b24b6..0915fa2e2 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java
@@ -62,6 +62,7 @@ public class ViewKeyMainFragment extends Fragment implements
private TextView mSecretKey;
private BootstrapButton mActionEdit;
private BootstrapButton mActionEncrypt;
+ private BootstrapButton mActionCertify;
private ListView mUserIds;
private ListView mKeys;
@@ -92,6 +93,7 @@ public class ViewKeyMainFragment extends Fragment implements
mKeys = (ListView) view.findViewById(R.id.keys);
mActionEdit = (BootstrapButton) view.findViewById(R.id.action_edit);
mActionEncrypt = (BootstrapButton) view.findViewById(R.id.action_encrypt);
+ mActionCertify = (BootstrapButton) view.findViewById(R.id.action_certify);
return view;
}
@@ -128,6 +130,11 @@ public class ViewKeyMainFragment extends Fragment implements
mSecretKey.setTextColor(getResources().getColor(R.color.emphasis));
mSecretKey.setText(R.string.secret_key_yes);
+ // certify button
+ // TODO this button MIGHT be useful if the user wants to
+ // certify a private key with another...
+ // mActionCertify.setVisibility(View.GONE);
+
// edit button
mActionEdit.setVisibility(View.VISIBLE);
mActionEdit.setOnClickListener(new View.OnClickListener() {
@@ -144,8 +151,22 @@ public class ViewKeyMainFragment extends Fragment implements
} else {
mSecretKey.setTextColor(Color.BLACK);
mSecretKey.setText(getResources().getString(R.string.secret_key_no));
+
+ // certify button
+ mActionCertify.setVisibility(View.VISIBLE);
+ // edit button
mActionEdit.setVisibility(View.GONE);
}
+
+ // TODO see todo note above, doing this here for now
+ mActionCertify.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View view) {
+ certifyKey(KeychainContract.KeyRings.buildPublicKeyRingsByMasterKeyIdUri(
+ Long.toString(masterKeyId)
+ ));
+ }
+ });
+
}
mActionEncrypt.setOnClickListener(new View.OnClickListener() {
diff --git a/OpenPGP-Keychain/src/main/res/layout/view_key_main_fragment.xml b/OpenPGP-Keychain/src/main/res/layout/view_key_main_fragment.xml
index 3c8a4270b..6ef3f3072 100644
--- a/OpenPGP-Keychain/src/main/res/layout/view_key_main_fragment.xml
+++ b/OpenPGP-Keychain/src/main/res/layout/view_key_main_fragment.xml
@@ -251,6 +251,17 @@
bootstrapbutton:bb_icon_left="fa-lock"
bootstrapbutton:bb_type="info" />
+
+ <com.beardedhen.androidbootstrap.BootstrapButton
+ android:id="@+id/action_certify"
+ android:layout_width="match_parent"
+ android:layout_height="60dp"
+ android:padding="4dp"
+ android:layout_marginBottom="10dp"
+ android:text="@string/key_view_action_certify"
+ bootstrapbutton:bb_icon_left="fa-pencil"
+ bootstrapbutton:bb_type="info" />
+
</LinearLayout>
</ScrollView> \ No newline at end of file