Skip to content

Commit

Permalink
Client|Homepage: Opening the homepage in a web browser
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 17, 2013
1 parent 8383719 commit 83882fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doomsday/client/include/clientapp.h
Expand Up @@ -34,6 +34,8 @@
*/
class ClientApp : public de::GuiApp
{
Q_OBJECT

public:
ClientApp(int &argc, char **argv);

Expand All @@ -58,6 +60,9 @@ class ClientApp : public de::GuiApp
static de::Games &games();
static de::World &world();

public slots:
void openHomepageInBrowser();

private:
DENG2_PRIVATE(d)
};
Expand Down
13 changes: 13 additions & 0 deletions doomsday/client/src/clientapp.cpp
Expand Up @@ -21,6 +21,7 @@
#include <QMenuBar>
#include <QAction>
#include <QNetworkProxyFactory>
#include <QDesktopServices>
#include <QDebug>
#include <stdlib.h>

Expand Down Expand Up @@ -299,3 +300,15 @@ World &ClientApp::world()
{
return app().d->world;
}

void ClientApp::openHomepageInBrowser()
{
// Get out of fullscreen mode.
int windowed[] = {
ClientWindow::Fullscreen, false,
ClientWindow::End
};
ClientWindow::main().changeAttributes(windowed);

QDesktopServices::openUrl(QUrl(DOOMSDAY_HOMEURL));
}

0 comments on commit 83882fa

Please sign in to comment.