summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-02-03 16:13:58 +0100
committerArne Schwabe <arne@rfc2549.org>2015-02-03 16:13:58 +0100
commit1627dfc9aa8d6115adcbe396d5e8788bdc26ae46 (patch)
tree41690bb62010486439db7c866acd5bd09aed4d32
parent29c0c3eeb07d77c6a0b00cb42c82897148d4732d (diff)
User cannot find the import button, add more of themv0.6.28
-rw-r--r--main/build.gradle5
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java68
2 files changed, 42 insertions, 31 deletions
diff --git a/main/build.gradle b/main/build.gradle
index 658958b9..912dcb59 100644
--- a/main/build.gradle
+++ b/main/build.gradle
@@ -18,8 +18,9 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
- versionCode = 108
- versionName = "0.6.27"
+ versionCode = 109
+ versionName = "0.6.28"
+ useJack true
}
sourceSets {
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
index 5bd552f8..01352916 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
@@ -208,19 +208,23 @@ public class VPNProfileList extends ListFragment {
onAddOrDuplicateProfile(null);
return true;
} else if (itemId == MENU_IMPORT_PROFILE) {
- boolean startOldFileDialog=true;
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
- startOldFileDialog = ! startFilePicker();
-
- if (startOldFileDialog)
- startImportConfig();
-
- return true;
+ return startImportConfigFilePicker();
} else {
return super.onOptionsItemSelected(item);
}
}
+ private boolean startImportConfigFilePicker() {
+ boolean startOldFileDialog=true;
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
+ startOldFileDialog = ! startFilePicker();
+
+ if (startOldFileDialog)
+ startImportConfig();
+
+ return true;
+ }
+
@TargetApi(Build.VERSION_CODES.KITKAT)
private boolean startFilePicker() {
@@ -258,28 +262,34 @@ public class VPNProfileList extends ListFragment {
dialog.setMessage(R.string.add_profile_name_prompt);
dialog.setView(entry);
-
+ dialog.setNeutralButton(R.string.menu_import_short,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ startImportConfigFilePicker();
+ }
+ });
dialog.setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- String name = entry.getText().toString();
- if (getPM().getProfileByName(name)==null) {
- VpnProfile profile;
- if (mCopyProfile!=null)
- profile= mCopyProfile.copy(name);
- else
- profile = new VpnProfile(name);
-
- addProfile(profile);
- editVPN(profile);
- } else {
- Toast.makeText(getActivity(), R.string.duplicate_profile_name, Toast.LENGTH_LONG).show();
- }
- }
-
-
- });
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ String name = entry.getText().toString();
+ if (getPM().getProfileByName(name) == null) {
+ VpnProfile profile;
+ if (mCopyProfile != null)
+ profile = mCopyProfile.copy(name);
+ else
+ profile = new VpnProfile(name);
+
+ addProfile(profile);
+ editVPN(profile);
+ } else {
+ Toast.makeText(getActivity(), R.string.duplicate_profile_name, Toast.LENGTH_LONG).show();
+ }
+ }
+
+
+ });
dialog.setNegativeButton(android.R.string.cancel, null);
dialog.create().show();
}