Skip to content

Commit

Permalink
Add option for showing offline user guide
Browse files Browse the repository at this point in the history
Navigating directly to the online website is useful, but having the option to
view the locally-installed version is still valuable for development and
perhaps for some users who cannot or do not wish to rely on online resources.

There are now two entries in the Help menu: "User Guide (Online)" and "User
Guide (Local)" to cover both of these options.
  • Loading branch information
Matthew Mott committed Sep 7, 2021
1 parent 5c4a782 commit f8a2d35
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion install/menu.xml
Expand Up @@ -326,6 +326,7 @@

<subMenu name="help" caption="&amp;Help">
<menuItem name="about" caption="&amp;About" command="About" />
<menuItem name="userGuide" caption="&amp;User Guide" command="ShowUserGuide" />
<menuItem name="userGuide" caption="&amp;User Guide (Online)" command="ShowUserGuide" />
<menuItem name="userGuide" caption="&amp;User Guide (Local)" command="ShowOfflineUserGuide" />
</subMenu>
</menu>
7 changes: 7 additions & 0 deletions radiant/ui/Documentation.cpp
Expand Up @@ -2,6 +2,7 @@
#include "registry/registry.h"

#include <wx/utils.h>
#include "imodule.h"

namespace ui
{
Expand All @@ -16,4 +17,10 @@ void Documentation::showUserGuide(const cmd::ArgumentList&)
wxLaunchDefaultBrowser(registry::getValue<std::string>(RKEY_USER_GUIDE_URL));
}

void Documentation::showOfflineUserGuide(const cmd::ArgumentList&)
{
const IApplicationContext& ctx = module::GlobalModuleRegistry().getApplicationContext();
wxLaunchDefaultBrowser(ctx.getHTMLPath() + "manual.html");
}

}
5 changes: 4 additions & 1 deletion radiant/ui/Documentation.h
Expand Up @@ -10,8 +10,11 @@ class Documentation
{
public:

/// Show the user guide
/// Show the user guide online
static void showUserGuide(const cmd::ArgumentList&);

/// Show the locally-installed user guide
static void showOfflineUserGuide(const cmd::ArgumentList&);
};

}
1 change: 1 addition & 0 deletions radiant/ui/UserInterfaceModule.cpp
Expand Up @@ -392,6 +392,7 @@ void UserInterfaceModule::registerUICommands()
GlobalCommandSystem().addCommand("ShowCommandList", CommandList::ShowDialog);
GlobalCommandSystem().addCommand("About", AboutDialog::showDialog);
GlobalCommandSystem().addCommand("ShowUserGuide", Documentation::showUserGuide);
GlobalCommandSystem().addCommand("ShowOfflineUserGuide", Documentation::showOfflineUserGuide);
GlobalCommandSystem().addCommand("ExportSelectedAsModelDialog", ExportAsModelDialog::ShowDialog);

GlobalCommandSystem().addCommand("EntityClassTree", EClassTree::ShowDialog);
Expand Down

0 comments on commit f8a2d35

Please sign in to comment.