From 2097538559ca82d4c2336da63a5e45e10ca53af0 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 16 Jul 2012 22:48:23 +0200 Subject: Start work on clear setting for file dialog Add a quick start quide stating the obvious (*sigh*) --- res/layout/faq.xml | 31 ++++++++++++------------ res/layout/file_dialog_main.xml | 7 ++++++ res/values/strings.xml | 6 ++--- src/de/blinkt/openvpn/FaqFragment.java | 9 +++++++ 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" > - + + + + - - + - - + @@ -35,22 +40,18 @@ style="@style/faqitem" android:text="@string/faq_security" /> - - + android:text="@string/broken_images" /> + - - + android:id="@+id/brokenimages" + style="@style/faqitem" /> + - - + 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" > + + ICS Openvpn Config No DNS servers being used. Name resolution may not work. Consider setting custom DNS Servers Could not add DNS Server \"%1$s\", rejected by the system: %2$s - - - \ No newline at end of file + <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> + Quick Start + 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 lastPositions = new HashMap(); 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); } } -- cgit v1.2.3