small improvements
This commit is contained in:
@@ -98,7 +98,7 @@
|
|||||||
<string name="menu_search">Search</string>
|
<string name="menu_search">Search</string>
|
||||||
<string name="menu_help">Help</string>
|
<string name="menu_help">Help</string>
|
||||||
<string name="menu_keyServer">Key Server</string>
|
<string name="menu_keyServer">Key Server</string>
|
||||||
<string name="menu_updateKey">Update</string>
|
<string name="menu_updateKey">Update from Server</string>
|
||||||
<string name="menu_exportKeyToServer">Export To Server</string>
|
<string name="menu_exportKeyToServer">Export To Server</string>
|
||||||
<string name="menu_share">Share public key with QR Code</string>
|
<string name="menu_share">Share public key with QR Code</string>
|
||||||
<string name="menu_scanQRCode">Scan QR Code</string>
|
<string name="menu_scanQRCode">Scan QR Code</string>
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ public class ApgProvider extends ContentProvider {
|
|||||||
case PUBLIC_KEY_RING_BY_MASTER_KEY_ID:
|
case PUBLIC_KEY_RING_BY_MASTER_KEY_ID:
|
||||||
case SECRET_KEY_RING_BY_MASTER_KEY_ID:
|
case SECRET_KEY_RING_BY_MASTER_KEY_ID:
|
||||||
defaultSelection = KeyRings.MASTER_KEY_ID + "=" + uri.getLastPathSegment();
|
defaultSelection = KeyRings.MASTER_KEY_ID + "=" + uri.getLastPathSegment();
|
||||||
|
// corresponding keys and userIds are deleted by ON DELETE CASCADE
|
||||||
count = db.delete(Tables.KEY_RINGS,
|
count = db.delete(Tables.KEY_RINGS,
|
||||||
buildDefaultKeyRingsSelection(defaultSelection, getKeyType(match), selection),
|
buildDefaultKeyRingsSelection(defaultSelection, getKeyType(match), selection),
|
||||||
selectionArgs);
|
selectionArgs);
|
||||||
@@ -623,6 +623,16 @@ public class ApgProvider extends ContentProvider {
|
|||||||
case SECRET_KEY_RING_BY_ROW_ID:
|
case SECRET_KEY_RING_BY_ROW_ID:
|
||||||
defaultSelection = BaseColumns._ID + "=" + uri.getLastPathSegment();
|
defaultSelection = BaseColumns._ID + "=" + uri.getLastPathSegment();
|
||||||
|
|
||||||
|
count = db.update(
|
||||||
|
Tables.KEY_RINGS,
|
||||||
|
values,
|
||||||
|
buildDefaultKeyRingsSelection(defaultSelection, getKeyType(match),
|
||||||
|
selection), selectionArgs);
|
||||||
|
break;
|
||||||
|
case PUBLIC_KEY_RING_BY_MASTER_KEY_ID:
|
||||||
|
case SECRET_KEY_RING_BY_MASTER_KEY_ID:
|
||||||
|
defaultSelection = KeyRings.MASTER_KEY_ID + "=" + uri.getLastPathSegment();
|
||||||
|
|
||||||
count = db.update(
|
count = db.update(
|
||||||
Tables.KEY_RINGS,
|
Tables.KEY_RINGS,
|
||||||
values,
|
values,
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class ApgService extends IntentService implements ProgressDialogUpdater {
|
|||||||
|
|
||||||
// upload key
|
// upload key
|
||||||
public static final String UPLOAD_KEY_SERVER = "uploadKeyServer";
|
public static final String UPLOAD_KEY_SERVER = "uploadKeyServer";
|
||||||
public static final String UPLOAD_KEY_KEYRING_ID = "uploadKeyRingId";
|
public static final String UPLOAD_KEY_KEYRING_ROW_ID = "uploadKeyRingId";
|
||||||
|
|
||||||
// query key
|
// query key
|
||||||
public static final String QUERY_KEY_SERVER = "queryKeyServer";
|
public static final String QUERY_KEY_SERVER = "queryKeyServer";
|
||||||
@@ -736,14 +736,13 @@ public class ApgService extends IntentService implements ProgressDialogUpdater {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
/* Input */
|
/* Input */
|
||||||
int keyRingId = data.getInt(UPLOAD_KEY_KEYRING_ID);
|
int keyRingRowId = data.getInt(UPLOAD_KEY_KEYRING_ROW_ID);
|
||||||
String keyServer = data.getString(UPLOAD_KEY_SERVER);
|
String keyServer = data.getString(UPLOAD_KEY_SERVER);
|
||||||
|
|
||||||
/* Operation */
|
/* Operation */
|
||||||
HkpKeyServer server = new HkpKeyServer(keyServer);
|
HkpKeyServer server = new HkpKeyServer(keyServer);
|
||||||
|
|
||||||
PGPPublicKeyRing keyring = ProviderHelper.getPGPPublicKeyRingByMasterKeyId(this,
|
PGPPublicKeyRing keyring = ProviderHelper.getPGPPublicKeyRing(this, keyRingRowId);
|
||||||
keyRingId);
|
|
||||||
if (keyring != null) {
|
if (keyring != null) {
|
||||||
boolean uploaded = PGPMain.uploadKeyRingToServer(server,
|
boolean uploaded = PGPMain.uploadKeyRingToServer(server,
|
||||||
(PGPPublicKeyRing) keyring);
|
(PGPPublicKeyRing) keyring);
|
||||||
|
|||||||
@@ -110,12 +110,9 @@ public class KeyListPublicFragment extends KeyListFragment implements
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Id.menu.exportToServer:
|
case Id.menu.exportToServer:
|
||||||
// TODO: do it better directly with keyRingRowId?
|
|
||||||
long masterKeyId = ProviderHelper.getPublicMasterKeyId(mKeyListActivity, keyRingRowId);
|
|
||||||
|
|
||||||
Intent uploadIntent = new Intent(mKeyListActivity, KeyServerUploadActivity.class);
|
Intent uploadIntent = new Intent(mKeyListActivity, KeyServerUploadActivity.class);
|
||||||
uploadIntent.setAction(KeyServerUploadActivity.ACTION_EXPORT_KEY_TO_SERVER);
|
uploadIntent.setAction(KeyServerUploadActivity.ACTION_EXPORT_KEY_TO_SERVER);
|
||||||
uploadIntent.putExtra(KeyServerUploadActivity.EXTRA_KEY_ID, masterKeyId);
|
uploadIntent.putExtra(KeyServerUploadActivity.EXTRA_KEYRING_ROW_ID, keyRingRowId);
|
||||||
startActivityForResult(uploadIntent, Id.request.export_to_server);
|
startActivityForResult(uploadIntent, Id.request.export_to_server);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class KeyServerUploadActivity extends SherlockFragmentActivity {
|
|||||||
public static final String ACTION_EXPORT_KEY_TO_SERVER = Constants.INTENT_PREFIX
|
public static final String ACTION_EXPORT_KEY_TO_SERVER = Constants.INTENT_PREFIX
|
||||||
+ "EXPORT_KEY_TO_SERVER";
|
+ "EXPORT_KEY_TO_SERVER";
|
||||||
|
|
||||||
public static final String EXTRA_KEY_ID = "keyId";
|
public static final String EXTRA_KEYRING_ROW_ID = "keyId";
|
||||||
|
|
||||||
private Button export;
|
private Button export;
|
||||||
private Spinner keyServer;
|
private Spinner keyServer;
|
||||||
@@ -109,8 +109,8 @@ public class KeyServerUploadActivity extends SherlockFragmentActivity {
|
|||||||
// fill values for this action
|
// fill values for this action
|
||||||
Bundle data = new Bundle();
|
Bundle data = new Bundle();
|
||||||
|
|
||||||
int keyRingId = getIntent().getIntExtra(EXTRA_KEY_ID, -1);
|
int keyRingId = getIntent().getIntExtra(EXTRA_KEYRING_ROW_ID, -1);
|
||||||
data.putInt(ApgService.UPLOAD_KEY_KEYRING_ID, keyRingId);
|
data.putInt(ApgService.UPLOAD_KEY_KEYRING_ROW_ID, keyRingId);
|
||||||
|
|
||||||
String server = (String) keyServer.getSelectedItem();
|
String server = (String) keyServer.getSelectedItem();
|
||||||
data.putString(ApgService.UPLOAD_KEY_SERVER, server);
|
data.putString(ApgService.UPLOAD_KEY_SERVER, server);
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ public class SignKeyActivity extends SherlockFragmentActivity {
|
|||||||
// fill values for this action
|
// fill values for this action
|
||||||
Bundle data = new Bundle();
|
Bundle data = new Bundle();
|
||||||
|
|
||||||
data.putLong(ApgService.UPLOAD_KEY_KEYRING_ID, mPubKeyId);
|
data.putLong(ApgService.UPLOAD_KEY_KEYRING_ROW_ID, mPubKeyId);
|
||||||
|
|
||||||
Spinner keyServer = (Spinner) findViewById(R.id.keyServer);
|
Spinner keyServer = (Spinner) findViewById(R.id.keyServer);
|
||||||
String server = (String) keyServer.getSelectedItem();
|
String server = (String) keyServer.getSelectedItem();
|
||||||
|
|||||||
Reference in New Issue
Block a user