summaryrefslogtreecommitdiff
path: root/src/gui/windows/updaterwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-27 01:02:06 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-27 01:02:06 +0300
commit5fadfbab5faec52d5ba22fae5046b26740955d52 (patch)
treef45cf2c8e14a03201e820fbc8fe0f9b269833ba1 /src/gui/windows/updaterwindow.cpp
parent56e977fec61485b993b60b9da456198e28a243a0 (diff)
downloadmanaverse-5fadfbab5faec52d5ba22fae5046b26740955d52.tar.gz
manaverse-5fadfbab5faec52d5ba22fae5046b26740955d52.tar.bz2
manaverse-5fadfbab5faec52d5ba22fae5046b26740955d52.tar.xz
manaverse-5fadfbab5faec52d5ba22fae5046b26740955d52.zip
Use for links in updater window ItemLinkHandler.
Diffstat (limited to 'src/gui/windows/updaterwindow.cpp')
-rw-r--r--src/gui/windows/updaterwindow.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 9d93c7020..037a5aad6 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -30,6 +30,7 @@
#include "gui/widgets/browserbox.h"
#include "gui/widgets/button.h"
#include "gui/widgets/containerplacer.h"
+#include "gui/widgets/itemlinkhandler.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layout.h"
#include "gui/widgets/layouttype.h"
@@ -184,6 +185,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost,
mUpdateFiles(),
mTempUpdateFiles(),
mUpdateServerPath(mUpdateHost),
+ mItemLinkHandler(new ItemLinkHandler),
// TRANSLATORS: updater window label
mLabel(new Label(this, _("Connecting..."))),
// TRANSLATORS: updater window button
@@ -217,7 +219,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost,
mProgressBar->setSmoothProgress(false);
mBrowserBox->setOpaque(Opaque_false);
- mBrowserBox->setLinkHandler(this);
+ mBrowserBox->setLinkHandler(mItemLinkHandler);
mBrowserBox->setProcessVars(true);
mBrowserBox->setEnableKeys(true);
mBrowserBox->setEnableTabs(true);
@@ -270,6 +272,7 @@ UpdaterWindow::~UpdaterWindow()
delete2(mDownload)
}
free(mMemoryBuffer);
+ delete2(mItemLinkHandler);
}
void UpdaterWindow::setProgress(const float p)
@@ -1069,15 +1072,6 @@ unsigned long UpdaterWindow::getFileHash(const std::string &filePath)
return Net::Download::adlerBuffer(buf, size);
}
-void UpdaterWindow::handleLink(const std::string &link,
- MouseEvent *const event A_UNUSED)
-{
- if (strStartWith(link, "http://") || strStartWith(link, "https://"))
- openBrowser(link);
- else if (link == "news")
- loadFile("news");
-}
-
void UpdaterWindow::loadFile(std::string file)
{
mBrowserBox->clearRows();