Bug 1007431 - Add menu item that links to SUMO help r=rnewman

This commit is contained in:
Mark Finkle 2014-05-22 16:31:40 -04:00
parent 15338c2825
commit ceb49ca779
7 changed files with 35 additions and 2 deletions

View File

@ -1306,8 +1306,10 @@ abstract public class BrowserApp extends GeckoApp
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
if (menu != null)
if (menu != null) {
menu.findItem(R.id.settings).setEnabled(true);
menu.findItem(R.id.help).setEnabled(true);
}
}
});
@ -2282,8 +2284,10 @@ abstract public class BrowserApp extends GeckoApp
if (aMenu == null)
return false;
if (!GeckoThread.checkLaunchState(GeckoThread.LaunchState.GeckoRunning))
if (!GeckoThread.checkLaunchState(GeckoThread.LaunchState.GeckoRunning)) {
aMenu.findItem(R.id.settings).setEnabled(false);
aMenu.findItem(R.id.help).setEnabled(false);
}
Tab tab = Tabs.getInstance().getSelectedTab();
MenuItem bookmark = aMenu.findItem(R.id.bookmark);
@ -2496,6 +2500,16 @@ abstract public class BrowserApp extends GeckoApp
return true;
}
if (itemId == R.id.help) {
final String VERSION = AppConstants.MOZ_APP_VERSION;
final String OS = AppConstants.OS_TARGET;
final String LOCALE = BrowserLocaleManager.getLanguageTag(Locale.getDefault());
final String URL = getResources().getString(R.string.help_link, VERSION, OS, LOCALE);
Tabs.getInstance().loadUrlInTab(URL);
return true;
}
if (itemId == R.id.addons) {
Tabs.getInstance().loadUrlInTab(AboutPages.ADDONS);
return true;

View File

@ -229,6 +229,9 @@ size. -->
<!ENTITY pref_update_autodownload_never "Never">
<!ENTITY pref_update_autodownload_always "Always">
<!-- Localization note (help_menu) : This string is used in the main menu-->
<!ENTITY help_menu "Help">
<!ENTITY quit "Quit">
<!ENTITY addons "Add-ons">

View File

@ -108,6 +108,9 @@
android:icon="@drawable/ic_menu_settings"
android:title="@string/settings" />
<item android:id="@+id/help"
android:title="@string/help_menu" />
<item android:id="@+id/exit_guest_session"
android:icon="@drawable/ic_menu_guest"
android:visible="false"

View File

@ -108,6 +108,9 @@
android:icon="@drawable/ic_menu_settings"
android:title="@string/settings" />
<item android:id="@+id/help"
android:title="@string/help_menu" />
<item android:id="@+id/exit_guest_session"
android:icon="@drawable/ic_menu_guest"
android:visible="false"

View File

@ -109,6 +109,9 @@
android:icon="@drawable/ic_menu_settings"
android:title="@string/settings" />
<item android:id="@+id/help"
android:title="@string/help_menu" />
<item android:id="@+id/exit_guest_session"
android:icon="@drawable/ic_menu_guest"
android:visible="false"

View File

@ -59,6 +59,9 @@
<item android:id="@+id/settings"
android:title="@string/settings" />
<item android:id="@+id/help"
android:title="@string/help_menu" />
<item android:id="@+id/new_guest_session"
android:icon="@drawable/ic_menu_guest"
android:visible="false"

View File

@ -60,6 +60,10 @@
<string name="url_bar_default_text">&url_bar_default_text;</string>
<!-- https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/ -->
<string name="help_link">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/</string>
<string name="help_menu">&help_menu;</string>
<string name="quit">&quit;</string>
<string name="bookmark">&bookmark;</string>
<string name="bookmark_added">&bookmark_added;</string>