Skip to content

Commit

Permalink
Shell|GUI: Added a link to Help in the wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 17, 2013
1 parent d12f60f commit 20e09dd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
18 changes: 18 additions & 0 deletions doomsday/tools/shell/shell-gui/src/guishellapp.cpp
Expand Up @@ -26,6 +26,8 @@
#include <de/shell/ServerFinder>
#include <QMenuBar>
#include <QMessageBox>
#include <QUrl>
#include <QDesktopServices>

Q_DECLARE_METATYPE(de::Address)

Expand Down Expand Up @@ -98,11 +100,15 @@ GuiShellApp::GuiShellApp(int &argc, char **argv)
// These will appear in the application menu:
menu->addAction(tr("Preferences..."), this, SLOT(showPreferences()), QKeySequence(tr("Ctrl+,")));
menu->addAction(tr("About"), this, SLOT(aboutShell()));

d->menuBar->addMenu(makeHelpMenu());
#endif

newOrReusedConnectionWindow();
}



LinkWindow *GuiShellApp::newOrReusedConnectionWindow()
{
LinkWindow *found = 0;
Expand Down Expand Up @@ -151,6 +157,13 @@ QMenu *GuiShellApp::localServersMenu()
return d->localMenu;
}

QMenu *GuiShellApp::makeHelpMenu()
{
QMenu *helpMenu = new QMenu(tr("&Help"));
helpMenu->addAction(tr("Shell Help"), this, SLOT(showHelp()));
return helpMenu;
}

ServerFinder &GuiShellApp::serverFinder()
{
return d->finder;
Expand Down Expand Up @@ -259,6 +272,11 @@ void GuiShellApp::aboutShell()
AboutDialog().exec();
}

void GuiShellApp::showHelp()
{
QDesktopServices::openUrl(QUrl(tr("http://dengine.net/dew/index.php?title=Shell_Help")));
}

void GuiShellApp::showPreferences()
{
if(!d->prefs)
Expand Down
2 changes: 2 additions & 0 deletions doomsday/tools/shell/shell-gui/src/guishellapp.h
Expand Up @@ -37,6 +37,7 @@ class GuiShellApp : public QtGuiApp

static GuiShellApp &app();
QMenu *localServersMenu();
QMenu *makeHelpMenu();

public slots:
void connectToServer();
Expand All @@ -47,6 +48,7 @@ public slots:
void stopServer();
void updateLocalServerMenu();
void aboutShell();
void showHelp();
void showPreferences();
void preferencesDone();
void updateMenu();
Expand Down
4 changes: 3 additions & 1 deletion doomsday/tools/shell/shell-gui/src/linkwindow.cpp
Expand Up @@ -190,7 +190,9 @@ LinkWindow::LinkWindow(QWidget *parent)

connect(svMenu, SIGNAL(aboutToShow()), app, SLOT(updateLocalServerMenu()));

QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
QMenu *helpMenu = app->makeHelpMenu();
menuBar()->addMenu(helpMenu);
helpMenu->addSeparator();
helpMenu->addAction(tr("About Doomsday Shell"), app, SLOT(aboutShell()));
#endif

Expand Down

0 comments on commit 20e09dd

Please sign in to comment.