summaryrefslogtreecommitdiff
path: root/src/gui/updaterwindow.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-11 21:10:53 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-11 21:10:53 +0100
commit66599a9896e0cf69b58c0a73152aba4750d87af2 (patch)
tree034b6b4a05ea1b4fc87887f48734f630e757e6f7 /src/gui/updaterwindow.cpp
parent0694d89c4147882561ff44c6d0d80e7414dcb24a (diff)
downloadmana-66599a9896e0cf69b58c0a73152aba4750d87af2.tar.gz
mana-66599a9896e0cf69b58c0a73152aba4750d87af2.tar.bz2
mana-66599a9896e0cf69b58c0a73152aba4750d87af2.tar.xz
mana-66599a9896e0cf69b58c0a73152aba4750d87af2.zip
Implemented ability to open external links in news and chat
* Use ConfirmDialog to confirm the opening of the external link. * ConfirmDialog now centers on its parent window when provided. * Reset hovered link when mouse exits the BrowserBox.
Diffstat (limited to 'src/gui/updaterwindow.cpp')
-rw-r--r--src/gui/updaterwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp
index 8c63ef6a..c8ed66e1 100644
--- a/src/gui/updaterwindow.cpp
+++ b/src/gui/updaterwindow.cpp
@@ -33,6 +33,7 @@
#include "gui/widgets/layout.h"
#include "gui/widgets/progressbar.h"
#include "gui/widgets/scrollarea.h"
+#include "gui/widgets/itemlinkhandler.h"
#include "net/download.h"
@@ -123,7 +124,8 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost,
mUpdateHost(updateHost),
mUpdatesDir(updatesDir),
mCurrentFile("news.txt"),
- mLoadUpdates(applyUpdates)
+ mLoadUpdates(applyUpdates),
+ mLinkHandler(std::make_unique<ItemLinkHandler>(this))
{
setWindowName("UpdaterWindow");
setResizable(true);
@@ -138,6 +140,7 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost,
mCancelButton = new Button(_("Cancel"), "cancel", this);
mPlayButton = new Button(_("Play"), "play", this);
+ mBrowserBox->setLinkHandler(mLinkHandler.get());
mProgressBar->setSmoothProgress(false);
mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mPlayButton->setEnabled(false);