diff options
-rw-r--r-- | res/layout/faq.xml | 31 | ||||
-rw-r--r-- | res/layout/file_dialog_main.xml | 7 | ||||
-rw-r--r-- | res/values/strings.xml | 6 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/FaqFragment.java | 9 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/FileSelectionFragment.java | 29 |
5 files changed, 56 insertions, 26 deletions
diff --git a/res/layout/faq.xml b/res/layout/faq.xml index 4107ea7e..b18446c0 100644 --- a/res/layout/faq.xml +++ b/res/layout/faq.xml @@ -8,17 +8,22 @@ android:layout_height="wrap_content" android:orientation="vertical" > - + <TextView + style="@style/faqhead" + android:text="@string/faq_howto_title" /> + + <TextView + android:id="@+id/faq_howto" + style="@style/faqitem" /> + <TextView style="@style/faqhead" android:text="@string/faq_system_dialogs_title" /> - - + <TextView style="@style/faqitem" android:text="@string/faq_system_dialogs" /> - - + <TextView style="@style/faqhead" android:text="@string/tap_mode" /> @@ -35,22 +40,18 @@ style="@style/faqitem" android:text="@string/faq_security" /> - <TextView style="@style/faqhead" - android:text="@string/broken_images" - /> - + android:text="@string/broken_images" /> + <TextView - style="@style/faqitem" - android:id="@+id/brokenimages" /> - - + android:id="@+id/brokenimages" + style="@style/faqitem" /> + <TextView style="@style/faqhead" android:text="@string/faq_shortcut" /> - - + <TextView style="@style/faqitem" android:text="@string/faq_howto_shortcut" /> diff --git a/res/layout/file_dialog_main.xml b/res/layout/file_dialog_main.xml index 68af9b18..2a623dc6 100644 --- a/res/layout/file_dialog_main.xml +++ b/res/layout/file_dialog_main.xml @@ -25,6 +25,13 @@ android:layout_height="wrap_content" android:text="@string/select_file" > </Button> + + <Button + android:id="@+id/fdClear" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/clear" > + </Button> </LinearLayout> <LinearLayout diff --git a/res/values/strings.xml b/res/values/strings.xml index 6e280c19..d3493fd2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -235,6 +235,6 @@ <string name="export_config_title">ICS Openvpn Config</string> <string name="warn_no_dns">No DNS servers being used. Name resolution may not work. Consider setting custom DNS Servers</string> <string name="dns_add_error">Could not add DNS Server \"%1$s\", rejected by the system: %2$s</string> - - -</resources>
\ No newline at end of file + <string name="faq_howto"><p>Get a working config (tested on your computer or download from your provider/organisation)</p><p>If it is a single file no with no extra pem/pks12 files you can email the file yourself and open the attachment. If you have multiple files put them on your sd card.</p><p>Click on the email attachment/Use the folder icon in the vpn list to import the config file</p><p>If there are errors about missing files put the missing files on your sd card.</p><p>Click on the save symbol to add the imported VPN to your VPN list</p><p>Connect the VPN by clicking on the name of the VPN</p><p>If there are error or warnings in the log try to understand the warnings/error and try to fix them</p> </string> + <string name="faq_howto_title">Quick Start</string> +</resources> diff --git a/src/de/blinkt/openvpn/FaqFragment.java b/src/de/blinkt/openvpn/FaqFragment.java index 09c6cbdc..c4d1913d 100644 --- a/src/de/blinkt/openvpn/FaqFragment.java +++ b/src/de/blinkt/openvpn/FaqFragment.java @@ -3,6 +3,7 @@ package de.blinkt.openvpn; import android.app.Fragment; import android.os.Bundle; import android.text.Html; +import android.text.Spanned; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; @@ -25,7 +26,15 @@ public class FaqFragment extends Fragment { TextView bImages = (TextView) v.findViewById(R.id.brokenimages); bImages.setText(Html.fromHtml(getActivity().getString(R.string.broken_images_faq))); bImages.setMovementMethod(LinkMovementMethod.getInstance()); + + TextView quickstart = (TextView) v.findViewById(R.id.faq_howto); + Spanned htmltext = Html.fromHtml(getActivity().getString(R.string.faq_howto)); + quickstart.setText(htmltext); + quickstart.setMovementMethod(LinkMovementMethod.getInstance()); + return v; + + } diff --git a/src/de/blinkt/openvpn/FileSelectionFragment.java b/src/de/blinkt/openvpn/FileSelectionFragment.java index c030bba0..1761c395 100644 --- a/src/de/blinkt/openvpn/FileSelectionFragment.java +++ b/src/de/blinkt/openvpn/FileSelectionFragment.java @@ -47,7 +47,8 @@ public class FileSelectionFragment extends ListFragment { private File selectedFile; private HashMap<String, Integer> lastPositions = new HashMap<String, Integer>(); private String mStartPath; - private Button importFile; + private Button mImportFile; + private Button mClearButton; private boolean mHideImport=false; @@ -71,11 +72,22 @@ public class FileSelectionFragment extends ListFragment { } }); + mClearButton = (Button) v.findViewById(R.id.fdClear); + mClearButton.setEnabled(false); + mClearButton.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + + } + }); + mClearButton.setVisibility(View.GONE); - importFile = (Button) v.findViewById(R.id.importfile); - importFile.setEnabled(false); - importFile.setOnClickListener(new OnClickListener() { - + + mImportFile = (Button) v.findViewById(R.id.importfile); + mImportFile.setEnabled(false); + mImportFile.setOnClickListener(new OnClickListener() { + @Override public void onClick(View v) { ((FileSelect) getActivity()).importFile(selectedFile.getPath()); @@ -83,9 +95,10 @@ public class FileSelectionFragment extends ListFragment { }); if(mHideImport== true) { - importFile.setVisibility(View.GONE); + mImportFile.setVisibility(View.GONE); } + return v; } @@ -224,7 +237,7 @@ public class FileSelectionFragment extends ListFragment { if (file.isDirectory()) { selectButton.setEnabled(false); - importFile.setEnabled(false); + mImportFile.setEnabled(false); if (file.canRead()) { lastPositions.put(currentPath, position); @@ -238,7 +251,7 @@ public class FileSelectionFragment extends ListFragment { selectedFile = file; v.setSelected(true); selectButton.setEnabled(true); - importFile.setEnabled(true); + mImportFile.setEnabled(true); } } |