change name of dev options to dev mode

This commit is contained in:
Philipp Schaefer 2013-05-03 01:33:07 +02:00
parent 9aa8aaa59d
commit 2c59ae0eaf
3 changed files with 10 additions and 10 deletions

View File

@ -38,8 +38,8 @@
<string name="pref_user_loc">Display user location</string> <string name="pref_user_loc">Display user location</string>
<string name="pref_user_loc_sum">Show users position on map</string> <string name="pref_user_loc_sum">Show users position on map</string>
<string name="pref_developer_options">Developer options</string> <string name="pref_developer_options">Developer options</string>
<string name="pref_enable_dev_options">Enable developer options</string> <string name="pref_enable_dev_mode">Enable developer mode</string>
<string name="pref_enable_dev_options_sum">If enabled, all IITC sources will be loaded from external storage of the Android device. <string name="pref_enable_dev_mode_sum">If enabled, all IITC sources will be loaded from external storage of the Android device.
Please copy all sources from $IITC_folder/build/mobile/ to /sdcard/IITC_Mobile/dev/.</string> Please copy all sources from $IITC_folder/build/mobile/ to /sdcard/IITC_Mobile/dev/.</string>
<string name="pref_select_iitc">IITC source</string> <string name="pref_select_iitc">IITC source</string>

View File

@ -44,8 +44,8 @@
<CheckBoxPreference <CheckBoxPreference
android:key="pref_dev_checkbox" android:key="pref_dev_checkbox"
android:title="@string/pref_enable_dev_options" android:title="@string/pref_enable_dev_mode"
android:summary="@string/pref_enable_dev_options_sum" android:summary="@string/pref_enable_dev_mode_sum"
android:defaultValue="false" /> android:defaultValue="false" />
<ListPreference <ListPreference

View File

@ -61,22 +61,22 @@ public class IITC_WebViewClient extends WebViewClient {
} }
public void loadIITC_JS(Context c) throws java.io.IOException { public void loadIITC_JS(Context c) throws java.io.IOException {
// in developer options, you are able to load the script from external source // You are able to load the script from external source
// if a http address is given, use script from this address. else use the local script // if a http address is given, use script from this address. else use the local script
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(c); SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(c);
String iitc_source = sharedPref.getString("pref_iitc_source", "local"); String iitc_source = sharedPref.getString("pref_iitc_source", "local");
String js = ""; String js = "";
// if developer options are enabled, load all iitc script from external storage // if developer mode are enabled, load all iitc script from external storage
if (sharedPref.getBoolean("pref_dev_checkbox", true)) { if (sharedPref.getBoolean("pref_dev_checkbox", true)) {
File js_file = new File(dev_path + "total-conversion-build.user.js"); File js_file = new File(dev_path + "total-conversion-build.user.js");
if (!js_file.exists()) { if (!js_file.exists()) {
Toast.makeText(context, "File " + dev_path + Toast.makeText(context, "File " + dev_path +
"total-conversion-build.user.js not found. " + "total-conversion-build.user.js not found. " +
"Disable developer options or add iitc files " + "Disable developer mode or add iitc files " +
"to the dev folder.", Toast.LENGTH_LONG).show(); "to the dev folder.", Toast.LENGTH_LONG).show();
} else { } else {
Toast.makeText(context, "Developer options enabled", Toast.LENGTH_SHORT).show(); Toast.makeText(context, "Developer mode enabled", Toast.LENGTH_SHORT).show();
} }
Scanner s = null; Scanner s = null;
s = new Scanner(js_file).useDelimiter("\\A"); s = new Scanner(js_file).useDelimiter("\\A");
@ -141,7 +141,7 @@ public class IITC_WebViewClient extends WebViewClient {
Scanner s = null; Scanner s = null;
String src = ""; String src = "";
try { try {
// load plugins from external storage if dev options are enabled // load plugins from external storage if dev mode are enabled
if (dev_enabled) { if (dev_enabled) {
File js_file = new File(dev_path + "plugins/" + plugin_array[i]); File js_file = new File(dev_path + "plugins/" + plugin_array[i]);
s = new Scanner(js_file).useDelimiter("\\A"); s = new Scanner(js_file).useDelimiter("\\A");
@ -170,7 +170,7 @@ public class IITC_WebViewClient extends WebViewClient {
Scanner s = null; Scanner s = null;
String src = ""; String src = "";
try { try {
// load plugin from external storage if dev options are enabled // load plugin from external storage if dev mode are enabled
if (dev_enabled) { if (dev_enabled) {
File js_file = new File(dev_path + "user-location.user.js"); File js_file = new File(dev_path + "user-location.user.js");
s = new Scanner(js_file).useDelimiter("\\A"); s = new Scanner(js_file).useDelimiter("\\A");