diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-11 21:10:53 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-11 21:10:53 +0100 |
commit | 66599a9896e0cf69b58c0a73152aba4750d87af2 (patch) | |
tree | 034b6b4a05ea1b4fc87887f48734f630e757e6f7 /src/gui/updaterwindow.cpp | |
parent | 0694d89c4147882561ff44c6d0d80e7414dcb24a (diff) | |
download | Mana-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.cpp | 5 |
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); |