diff options
author | Mohamed Zenadi <mohamed@zenadi.com> | 2016-12-11 17:32:53 +0100 |
---|---|---|
committer | Mohamed Zenadi <mohamed@zenadi.com> | 2016-12-11 17:32:53 +0100 |
commit | 5644c06f2a51bf495ceaab2a27b0482436093c31 (patch) | |
tree | 9b9228ab9afa623ba8c1596d32119932065a3e93 /app/src/main/java/com/zeapo | |
parent | 737d2819273e7ba07d3a993422b138b93b852415 (diff) |
remove useless and confusing option from the preferences
Diffstat (limited to 'app/src/main/java/com/zeapo')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 14 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/UserPreference.java | 24 |
2 files changed, 14 insertions, 24 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 3f6d225e..6449ca65 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -415,6 +415,20 @@ public class PasswordStore extends AppCompatActivity { return; } + if (settings.getStringSet("openpgp_key_ids_set", new HashSet<String>()).isEmpty()) { + new AlertDialog.Builder(this) + .setTitle("OpenPGP key not selected") + .setMessage("We will redirect you to settings. Please select your OpenPGP Key.") + .setPositiveButton(this.getResources().getString(R.string.dialog_ok), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + Intent intent = new Intent(activity, UserPreference.class); + startActivity(intent); + } + }).show(); + return; + } + this.currentDir = getCurrentDir(); Log.i("PWDSTR", "Adding file to : " + this.currentDir.getAbsolutePath()); diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java index 8a38de1b..8c612771 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java @@ -40,7 +40,6 @@ import com.zeapo.pwdstore.utils.PasswordRepository; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; -import org.openintents.openpgp.util.OpenPgpKeyPreference; import org.openintents.openpgp.util.OpenPgpUtils; import java.io.File; @@ -54,7 +53,6 @@ public class UserPreference extends AppCompatActivity { private final static int IMPORT_SSH_KEY = 1; private final static int IMPORT_PGP_KEY = 2; private final static int EDIT_GIT_INFO = 3; - private OpenPgpKeyPreference mKey; private final static int SELECT_GIT_DIRECTORY = 4; private final static int REQUEST_EXTERNAL_STORAGE = 50; private PrefsFragment prefsFragment; @@ -151,20 +149,6 @@ public class UserPreference extends AppCompatActivity { } }); - callingActivity.mKey = (OpenPgpKeyPreference) findPreference("openpgp_key"); - - if (sharedPreferences.getString("openpgp_provider_list", null) != null) { - ((UserPreference) getActivity()).mKey.setOpenPgpProvider(sharedPreferences.getString("openpgp_provider_list", "")); - } - - findPreference("openpgp_provider_list").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { - @Override - public boolean onPreferenceChange(Preference preference, Object o) { - callingActivity.mKey.setOpenPgpProvider((String) o); - return true; - } - }); - final Preference externalRepo = findPreference("pref_select_external"); externalRepo.setSummary(getPreferenceManager().getSharedPreferences().getString("git_external_repo", callingActivity.getString(R.string.no_repo_selected))); externalRepo.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @@ -445,14 +429,6 @@ public class UserPreference extends AppCompatActivity { } break; - case OpenPgpKeyPreference.REQUEST_CODE_KEY_PREFERENCE: { - if (mKey.handleOnActivityResult(requestCode, resultCode, data)) { - // handled by OpenPgpKeyPreference - PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()).edit().putLong("openpgp_sign_key", mKey.getValue()).apply(); - return; - } - } - break; case SELECT_GIT_DIRECTORY: { final Uri uri = data.getData(); |