1.0.x changes merged into trunk

This commit is contained in:
Thialfihar 2010-07-16 20:18:43 +00:00
parent f5efd73d33
commit 93835f5595
10 changed files with 94 additions and 86 deletions

View File

@ -127,6 +127,7 @@ public class Apg {
public static final String EXTRA_SIGNATURE_SUCCESS = "signatureSuccess"; public static final String EXTRA_SIGNATURE_SUCCESS = "signatureSuccess";
public static final String EXTRA_SIGNATURE_UNKNOWN = "signatureUnknown"; public static final String EXTRA_SIGNATURE_UNKNOWN = "signatureUnknown";
public static final String EXTRA_USER_ID = "userId"; public static final String EXTRA_USER_ID = "userId";
public static final String EXTRA_USER_IDS = "userIds";
public static final String EXTRA_KEY_ID = "keyId"; public static final String EXTRA_KEY_ID = "keyId";
public static final String EXTRA_REPLY_TO = "replyTo"; public static final String EXTRA_REPLY_TO = "replyTo";
public static final String EXTRA_SEND_TO = "sendTo"; public static final String EXTRA_SEND_TO = "sendTo";

View File

@ -141,17 +141,21 @@ public class SelectPublicKeyListActivity extends BaseActivity {
private void okClicked() { private void okClicked() {
Intent data = new Intent(); Intent data = new Intent();
Vector<Long> vector = new Vector<Long>(); Vector<Long> keys = new Vector<Long>();
Vector<String> userIds = new Vector<String>();
for (int i = 0; i < mList.getCount(); ++i) { for (int i = 0; i < mList.getCount(); ++i) {
if (mList.isItemChecked(i)) { if (mList.isItemChecked(i)) {
vector.add(mList.getItemIdAtPosition(i)); keys.add(mList.getItemIdAtPosition(i));
userIds.add((String) mList.getItemAtPosition(i));
} }
} }
long selectedKeyIds[] = new long[vector.size()]; long selectedKeyIds[] = new long[keys.size()];
for (int i = 0; i < vector.size(); ++i) { for (int i = 0; i < keys.size(); ++i) {
selectedKeyIds[i] = vector.get(i); selectedKeyIds[i] = keys.get(i);
} }
String userIdArray[] = new String[0];
data.putExtra(Apg.EXTRA_SELECTION, selectedKeyIds); data.putExtra(Apg.EXTRA_SELECTION, selectedKeyIds);
data.putExtra(Apg.EXTRA_USER_IDS, userIds.toArray(userIdArray));
setResult(RESULT_OK, data); setResult(RESULT_OK, data);
finish(); finish();
} }

View File

@ -150,7 +150,8 @@ public class SelectPublicKeyListAdapter extends BaseAdapter {
@Override @Override
public Object getItem(int position) { public Object getItem(int position) {
return position; mCursor.moveToPosition(position);
return mCursor.getString(2); // USER_ID
} }
@Override @Override

View File

@ -52,6 +52,7 @@ public class SelectSecretKeyListActivity extends BaseActivity {
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
Intent data = new Intent(); Intent data = new Intent();
data.putExtra(Apg.EXTRA_KEY_ID, id); data.putExtra(Apg.EXTRA_KEY_ID, id);
data.putExtra(Apg.EXTRA_USER_ID, (String)mList.getItemAtPosition(position));
setResult(RESULT_OK, data); setResult(RESULT_OK, data);
finish(); finish();
} }

View File

@ -109,7 +109,8 @@ public class SelectSecretKeyListAdapter extends BaseAdapter {
@Override @Override
public Object getItem(int position) { public Object getItem(int position) {
return position; mCursor.moveToPosition(position);
return mCursor.getString(2); // USER_ID
} }
@Override @Override