got rid of iitc source setting
* the developer mode makes it pretty much useless * it's broken since the new fileManager was introduced. nobody complained that it doesn't work -> nobody uses this feature.
This commit is contained in:
parent
cfcc18f3a6
commit
0d852b5043
@ -121,8 +121,6 @@
|
|||||||
<string name="pref_fake_user_agent">Fake User Agent</string>
|
<string name="pref_fake_user_agent">Fake User Agent</string>
|
||||||
<string name="pref_fake_user_agent_sum">Let IITCm appear as a desktop browser for the intel site.
|
<string name="pref_fake_user_agent_sum">Let IITCm appear as a desktop browser for the intel site.
|
||||||
Note: If just want to use the desktop mode use the \'force desktop mode\' setting</string>
|
Note: If just want to use the desktop mode use the \'force desktop mode\' setting</string>
|
||||||
<string name="pref_select_iitc">IITC source</string>
|
|
||||||
<string name="pref_select_iitc_sum">Load IITC main script from url or use local script. Currently used source:</string>
|
|
||||||
|
|
||||||
<string-array name="pref_hide_fullscreen">
|
<string-array name="pref_hide_fullscreen">
|
||||||
<item>System Bar</item>
|
<item>System Bar</item>
|
||||||
|
@ -71,13 +71,6 @@
|
|||||||
android:key="pref_dev_checkbox"
|
android:key="pref_dev_checkbox"
|
||||||
android:summary="@string/pref_enable_dev_mode_sum"
|
android:summary="@string/pref_enable_dev_mode_sum"
|
||||||
android:title="@string/pref_enable_dev_mode"/>
|
android:title="@string/pref_enable_dev_mode"/>
|
||||||
|
|
||||||
<!-- summary is set in settings fragment -->
|
|
||||||
<EditTextPreference
|
|
||||||
android:defaultValue="local"
|
|
||||||
android:key="pref_iitc_source"
|
|
||||||
android:title="@string/pref_select_iitc"/>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="pref_advanced_ui_cat"
|
android:key="pref_advanced_ui_cat"
|
||||||
android:title="@string/pref_ui_cat">
|
android:title="@string/pref_ui_cat">
|
||||||
|
@ -27,7 +27,6 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.PipedInputStream;
|
import java.io.PipedInputStream;
|
||||||
import java.io.PipedOutputStream;
|
import java.io.PipedOutputStream;
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@ -155,27 +154,6 @@ public class IITC_FileManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String source = mPrefs.getString("pref_iitc_source", "local");
|
|
||||||
if (!source.equals("local")) {
|
|
||||||
// load iitc script from web or asset folder
|
|
||||||
if (source.contains("http")) {
|
|
||||||
try {
|
|
||||||
final URL context = new URL(source);
|
|
||||||
final URL url = new URL(context, filename);
|
|
||||||
return url.openStream();
|
|
||||||
} catch (final IOException e) {
|
|
||||||
Log.w(e);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
final File file = new File(source + File.separatorChar + filename);
|
|
||||||
try {
|
|
||||||
return new FileInputStream(file);
|
|
||||||
} catch (final FileNotFoundException e) {
|
|
||||||
Log.w(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// load plugins from asset folder
|
// load plugins from asset folder
|
||||||
return mAssetManager.open(filename);
|
return mAssetManager.open(filename);
|
||||||
}
|
}
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
package com.cradle.iitc_mobile.async;
|
|
||||||
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
|
|
||||||
import com.cradle.iitc_mobile.IITC_FileManager;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* this class parses the content of a web page.
|
|
||||||
* since network operations shouldn't be done on main UI thread
|
|
||||||
* (NetworkOnMainThread exception is thrown) we use an async task for this.
|
|
||||||
*/
|
|
||||||
public class UrlContentToString extends AsyncTask<URL, Integer, String> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String doInBackground(URL... urls) {
|
|
||||||
String js = "";
|
|
||||||
URL url = urls[0];
|
|
||||||
try {
|
|
||||||
FileInputStream is = new FileInputStream(new File(url.getPath()));
|
|
||||||
js = IITC_FileManager.readStream(is);
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return js;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -44,20 +44,6 @@ public class MainSettings extends PreferenceFragment {
|
|||||||
IITC_AboutDialogPreference pref_about = (IITC_AboutDialogPreference) findPreference("pref_about");
|
IITC_AboutDialogPreference pref_about = (IITC_AboutDialogPreference) findPreference("pref_about");
|
||||||
pref_about.setVersions(iitcVersion, buildVersion);
|
pref_about.setVersions(iitcVersion, buildVersion);
|
||||||
|
|
||||||
// set iitc source
|
|
||||||
EditTextPreference pref_iitc_source = (EditTextPreference) findPreference("pref_iitc_source");
|
|
||||||
pref_iitc_source.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
preference.setSummary(getString(R.string.pref_select_iitc_sum) + " " + newValue);
|
|
||||||
// TODO: update mIitcVersion when iitc source has changed
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// first init of summary
|
|
||||||
String pref_iitc_source_sum = getString(R.string.pref_select_iitc_sum) + " " + pref_iitc_source.getText();
|
|
||||||
pref_iitc_source.setSummary(pref_iitc_source_sum);
|
|
||||||
|
|
||||||
final ListPreference pref_user_location_mode = (ListPreference) findPreference("pref_user_location_mode");
|
final ListPreference pref_user_location_mode = (ListPreference) findPreference("pref_user_location_mode");
|
||||||
pref_user_location_mode.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
pref_user_location_mode.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user