Bug 888533 - Part 4: Display toast for port forwarding. r=lucasr

This commit is contained in:
Chenxia Liu 2013-07-31 15:38:48 -07:00
parent d5bd347451
commit b484d49d32
3 changed files with 18 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceGroup;
import android.preference.PreferenceManager;
@ -74,6 +75,7 @@ public class GeckoPreferences
private static String PREFS_UPDATER_AUTODOWNLOAD = "app.update.autodownload";
private static String PREFS_GEO_REPORTING = "app.geo.reportdata";
private static String PREFS_HEALTHREPORT_LINK = NON_PREF_PREFIX + "healthreport.link";
private static String PREFS_DEVTOOLS_REMOTE_ENABLED = "devtools.debugger.remote-enabled";
public static String PREFS_RESTORE_SESSION = NON_PREF_PREFIX + "restoreSession";
@ -307,6 +309,18 @@ public class GeckoPreferences
preferences.removePreference(pref);
i--;
continue;
} else if (PREFS_DEVTOOLS_REMOTE_ENABLED.equals(key)) {
final Context thisContext = this;
pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
// Display toast to remind setting up tcp forwarding.
if (((CheckBoxPreference) preference).isChecked()) {
Toast.makeText(thisContext, R.string.devtools_remote_debugging_forward, Toast.LENGTH_SHORT).show();
}
return true;
}
});
}
// Some Preference UI elements are not actually preferences,

View File

@ -343,6 +343,8 @@ just addresses the organization to follow, e.g. "This site is run by " -->
<!ENTITY searchable_description "Bookmarks and history">
<!ENTITY devtools_remote_debugging_forward "Don\'t forget to set up port forwarding!">
<!-- Updater notifications -->
<!ENTITY updater_start_title2 "Update available for &brandShortName;">
<!ENTITY updater_start_select2 "Touch to download">

View File

@ -300,6 +300,8 @@
<string name="searchable_description">&searchable_description;</string>
<string name="devtools_remote_debugging_forward">&devtools_remote_debugging_forward;</string>
<!-- Updater notifications -->
<string name="updater_start_title">&updater_start_title2;</string>
<string name="updater_start_select">&updater_start_select2;</string>