diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-05-20 14:36:00 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-05-20 14:36:00 +0200 |
commit | 376ecb5c8cb9dceb7cd88ea5527292e81712ec25 (patch) | |
tree | 6f00e49697c6553c4f319c0133e0ba2bf9500f6a /src/de/blinkt/openvpn/ConfigConverter.java | |
parent | 42423ebf890bc51a9d8d24539fb05a200d878885 (diff) |
- Fix missing about
- Fix vpn list saving to sharedpreferences (closes issue #27)
- Version 0.5.5a
Diffstat (limited to 'src/de/blinkt/openvpn/ConfigConverter.java')
-rw-r--r-- | src/de/blinkt/openvpn/ConfigConverter.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/ConfigConverter.java b/src/de/blinkt/openvpn/ConfigConverter.java index 952ab96..8aebc66 100644 --- a/src/de/blinkt/openvpn/ConfigConverter.java +++ b/src/de/blinkt/openvpn/ConfigConverter.java @@ -41,8 +41,11 @@ public class ConfigConverter extends ListActivity { log("Importing the config had error, cannot save it");
return true;
}
+
Intent result = new Intent();
ProfileManager vpl = ProfileManager.getInstance(this);
+
+ setUniqueProfileName(vpl);
vpl.addProfile(mResult);
vpl.saveProfile(this, mResult);
vpl.saveProfileList(this);
@@ -56,6 +59,19 @@ public class ConfigConverter extends ListActivity { }
+
+ private void setUniqueProfileName(ProfileManager vpl) {
+ int i=1;
+ String newname = getString(R.string.converted_profile);
+
+ while(vpl.getProfileByName(newname)!=null) {
+ i++;
+ newname = getString(R.string.converted_profile_i,i);
+ }
+
+ mResult.mName=newname;
+ }
+
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
|