mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-24 01:32:16 -05:00
Add export... button and functionality in multi-select
This commit is contained in:
parent
361c45a481
commit
43a20ad1da
@ -43,6 +43,8 @@ public final class Constants {
|
|||||||
public static final class path {
|
public static final class path {
|
||||||
public static final String APP_DIR = Environment.getExternalStorageDirectory()
|
public static final String APP_DIR = Environment.getExternalStorageDirectory()
|
||||||
+ "/OpenPGP-Keychain";
|
+ "/OpenPGP-Keychain";
|
||||||
|
public static final String APP_DIR_FILE_SEC = APP_DIR + "/secexport.asc";
|
||||||
|
public static final String APP_DIR_FILE_PUB = APP_DIR + "/pubexport.asc";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class pref {
|
public static final class pref {
|
||||||
|
@ -20,7 +20,6 @@ import org.sufficientlysecure.keychain.Constants;
|
|||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
|
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
|
||||||
|
@ -330,8 +330,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_edit_export_file:
|
case R.id.menu_key_edit_export_file:
|
||||||
long[] ids = new long[]{Long.valueOf(mDataUri.getLastPathSegment())};
|
long[] ids = new long[]{Long.valueOf(mDataUri.getLastPathSegment())};
|
||||||
mExportHelper.showExportKeysDialog(ids, Id.type.secret_key, Constants.path.APP_DIR
|
mExportHelper.showExportKeysDialog(ids, Id.type.secret_key, Constants.path.APP_DIR_FILE_SEC);
|
||||||
+ "/secexport.asc");
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_edit_delete: {
|
case R.id.menu_key_edit_delete: {
|
||||||
// Message is received after key is deleted
|
// Message is received after key is deleted
|
||||||
|
@ -59,8 +59,7 @@ public class KeyListPublicActivity extends DrawerActivity {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_list_public_export:
|
case R.id.menu_key_list_public_export:
|
||||||
mExportHelper.showExportKeysDialog(null, Id.type.public_key, Constants.path.APP_DIR
|
mExportHelper.showExportKeysDialog(null, Id.type.public_key, Constants.path.APP_DIR_FILE_PUB);
|
||||||
+ "/pubexport.asc");
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
@ -18,10 +18,11 @@
|
|||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ExportHelper;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
||||||
@ -47,6 +48,7 @@ import android.support.v4.app.LoaderManager;
|
|||||||
import android.support.v4.content.CursorLoader;
|
import android.support.v4.content.CursorLoader;
|
||||||
import android.support.v4.content.Loader;
|
import android.support.v4.content.Loader;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.support.v7.widget.SearchView;
|
import android.support.v7.widget.SearchView;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.ActionMode;
|
import android.view.ActionMode;
|
||||||
@ -179,6 +181,11 @@ public class KeyListPublicFragment extends Fragment implements SearchView.OnQuer
|
|||||||
encrypt(mode, ids);
|
encrypt(mode, ids);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case R.id.menu_key_list_public_multi_export: {
|
||||||
|
ExportHelper mExportHelper = new ExportHelper((ActionBarActivity) getActivity());
|
||||||
|
mExportHelper.showExportKeysDialog(ids, Id.type.public_key, Constants.path.APP_DIR_FILE_PUB);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case R.id.menu_key_list_public_multi_delete: {
|
case R.id.menu_key_list_public_multi_delete: {
|
||||||
showDeleteKeyDialog(mode, ids);
|
showDeleteKeyDialog(mode, ids);
|
||||||
break;
|
break;
|
||||||
|
@ -62,8 +62,7 @@ public class KeyListSecretActivity extends DrawerActivity {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_list_secret_export:
|
case R.id.menu_key_list_secret_export:
|
||||||
mExportHelper.showExportKeysDialog(null, Id.type.secret_key, Constants.path.APP_DIR
|
mExportHelper.showExportKeysDialog(null, Id.type.secret_key, Constants.path.APP_DIR_FILE_SEC);
|
||||||
+ "/secexport.asc");
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_list_secret_import:
|
case R.id.menu_key_list_secret_import:
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.Set;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ExportHelper;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
||||||
@ -41,6 +41,7 @@ import android.support.v4.app.ListFragment;
|
|||||||
import android.support.v4.app.LoaderManager;
|
import android.support.v4.app.LoaderManager;
|
||||||
import android.support.v4.content.CursorLoader;
|
import android.support.v4.content.CursorLoader;
|
||||||
import android.support.v4.content.Loader;
|
import android.support.v4.content.Loader;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.view.ActionMode;
|
import android.view.ActionMode;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@ -106,6 +107,12 @@ public class KeyListSecretFragment extends ListFragment implements
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case R.id.menu_key_list_public_multi_export: {
|
||||||
|
ExportHelper mExportHelper = new ExportHelper((ActionBarActivity) getActivity());
|
||||||
|
mExportHelper.showExportKeysDialog(ids, Id.type.secret_key, Constants.path.APP_DIR_FILE_SEC);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -119,8 +119,7 @@ public class ViewKeyActivity extends ActionBarActivity {
|
|||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_view_export_file:
|
case R.id.menu_key_view_export_file:
|
||||||
long[] ids = new long[]{Long.valueOf(mDataUri.getLastPathSegment())};
|
long[] ids = new long[]{Long.valueOf(mDataUri.getLastPathSegment())};
|
||||||
mExportHelper.showExportKeysDialog(ids, Id.type.public_key, Constants.path.APP_DIR
|
mExportHelper.showExportKeysDialog(ids, Id.type.public_key, Constants.path.APP_DIR_FILE_PUB);
|
||||||
+ "/pubexport.asc");
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_view_share_default_fingerprint:
|
case R.id.menu_key_view_share_default_fingerprint:
|
||||||
shareKey(mDataUri, true);
|
shareKey(mDataUri, true);
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
android:id="@+id/menu_key_list_public_multi_select_all"
|
android:id="@+id/menu_key_list_public_multi_select_all"
|
||||||
android:icon="@drawable/ic_action_select_all"
|
android:icon="@drawable/ic_action_select_all"
|
||||||
android:title="@string/menu_select_all" />
|
android:title="@string/menu_select_all" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_key_list_public_multi_export"
|
||||||
|
android:icon="@drawable/ic_action_import_export"
|
||||||
|
android:title="@string/menu_export_key" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_key_list_public_multi_encrypt"
|
android:id="@+id/menu_key_list_public_multi_encrypt"
|
||||||
android:icon="@drawable/ic_action_secure"
|
android:icon="@drawable/ic_action_secure"
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
android:id="@+id/menu_key_list_public_multi_select_all"
|
android:id="@+id/menu_key_list_public_multi_select_all"
|
||||||
android:icon="@drawable/ic_action_select_all"
|
android:icon="@drawable/ic_action_select_all"
|
||||||
android:title="@string/menu_select_all" />
|
android:title="@string/menu_select_all" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_key_list_public_multi_export"
|
||||||
|
android:icon="@drawable/ic_action_import_export"
|
||||||
|
android:title="@string/menu_export_key" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_key_list_public_multi_delete"
|
android:id="@+id/menu_key_list_public_multi_delete"
|
||||||
android:icon="@drawable/ic_action_discard"
|
android:icon="@drawable/ic_action_discard"
|
||||||
|
Loading…
Reference in New Issue
Block a user