default import is from keyserver

This commit is contained in:
Dominik Schürmann 2014-01-18 21:17:23 +01:00
parent 5b5f66f514
commit f3638d5b44
4 changed files with 9 additions and 8 deletions

View File

@ -50,8 +50,8 @@
<item>@string/key_size_4096</item>
</string-array>
<string-array name="import_action_list">
<item>@string/menu_import_from_file</item>
<item>@string/menu_key_server</item>
<item>@string/menu_import_from_file</item>
<item>@string/menu_import_from_qr_code</item>
<item>@string/import_from_clipboard</item>
<item>@string/menu_import_from_nfc</item>

View File

@ -310,7 +310,7 @@
<!-- Import -->
<string name="import_import">Import selected keys</string>
<string name="import_sign_and_upload">Import, Sign, and upload selected keys</string>
<string name="import_from_clipboard">Import from Clipboard</string>
<string name="import_from_clipboard">Import from clipboard</string>
<plurals name="import_qr_code_missing">
<item quantity="one">Missing QR Code with ID %1$s</item>

View File

@ -146,10 +146,10 @@ public class ImportKeysActivity extends DrawerActivity implements OnNavigationLi
String importFilename = intent.getData().getPath();
// display selected filename
getSupportActionBar().setSelectedNavigationItem(0);
getSupportActionBar().setSelectedNavigationItem(1);
Bundle args = new Bundle();
args.putString(ImportKeysFileFragment.ARG_PATH, importFilename);
loadFragment(ImportKeysFileFragment.class, args, mNavigationStrings[0]);
loadFragment(ImportKeysFileFragment.class, args, mNavigationStrings[1]);
// directly load data
startListFragment(savedInstanceState, null, importFilename);
@ -164,8 +164,8 @@ public class ImportKeysActivity extends DrawerActivity implements OnNavigationLi
startListFragment(savedInstanceState, null, null);
if (ACTION_IMPORT_KEY_FROM_FILE.equals(action)) {
getSupportActionBar().setSelectedNavigationItem(0);
loadFragment(ImportKeysFileFragment.class, null, mNavigationStrings[0]);
getSupportActionBar().setSelectedNavigationItem(1);
loadFragment(ImportKeysFileFragment.class, null, mNavigationStrings[1]);
} else if (ACTION_IMPORT_KEY_FROM_QR_CODE.equals(action)) {
getSupportActionBar().setSelectedNavigationItem(2);
loadFragment(ImportKeysQrCodeFragment.class, null, mNavigationStrings[2]);
@ -206,10 +206,10 @@ public class ImportKeysActivity extends DrawerActivity implements OnNavigationLi
// Create new fragment from our own Fragment class
switch (itemPosition) {
case 0:
loadFragment(ImportKeysFileFragment.class, null, mNavigationStrings[itemPosition]);
loadFragment(ImportKeysServerFragment.class, null, mNavigationStrings[itemPosition]);
break;
case 1:
loadFragment(ImportKeysServerFragment.class, null, mNavigationStrings[itemPosition]);
loadFragment(ImportKeysFileFragment.class, null, mNavigationStrings[itemPosition]);
break;
case 2:
loadFragment(ImportKeysQrCodeFragment.class, null, mNavigationStrings[itemPosition]);

View File

@ -93,6 +93,7 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte
@Override
public void onClick(View v) {
Intent intentImportFromFile = new Intent(getActivity(), ImportKeysActivity.class);
intentImportFromFile.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE);
startActivityForResult(intentImportFromFile, Id.request.import_from_qr_code);
}
});