diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-20 14:20:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-20 14:20:26 +0300 |
commit | 31acb66791e27b6cfa846302156ad2e7a88f5f04 (patch) | |
tree | 77b67fbb0dfb2e7cba3c2edcc1fbbb4b257bf15f /src/gui/updaterwindow.cpp | |
parent | b4eae25edc2b75af41fdb98c4d0a332ee3dcf500 (diff) | |
download | manaplus-31acb66791e27b6cfa846302156ad2e7a88f5f04.tar.gz manaplus-31acb66791e27b6cfa846302156ad2e7a88f5f04.tar.bz2 manaplus-31acb66791e27b6cfa846302156ad2e7a88f5f04.tar.xz manaplus-31acb66791e27b6cfa846302156ad2e7a88f5f04.zip |
Show clickable update links for manaplus.
Site url and download link.
Diffstat (limited to 'src/gui/updaterwindow.cpp')
-rw-r--r-- | src/gui/updaterwindow.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index 71aec58a0..49977ae4b 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -46,6 +46,7 @@ #include "utils/gettext.h" #include "utils/mkdir.h" #include "utils/paths.h" +#include "utils/process.h" #include "utils/stringutils.h" #include "utils/xml.h" @@ -174,6 +175,7 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost, mProgressBar->setSmoothProgress(false); mBrowserBox->setOpaque(false); + mBrowserBox->setLinkHandler(this); mPlayButton->setEnabled(false); ContainerPlacer placer; @@ -374,7 +376,12 @@ void UpdaterWindow::loadPatch() if (version > CHECK_VERSION) { mBrowserBox->addRow("", true); - mBrowserBox->addRow(" ##1http://manaplus.evolonline.org/", true); +#ifdef WIN32 + mBrowserBox->addRow(" ##1[@@http://download.evolonline.org/" + "manaplus/download/manaplus-win32.exe|download here@@]", true); +#endif + mBrowserBox->addRow(" ##1@@http://manaplus.evolonline.org/|" + "http://manaplus.evolonline.org/@@", true); mBrowserBox->addRow("##1You can download it from", true); mBrowserBox->addRow("##1ManaPlus updated.", true); } @@ -833,3 +840,10 @@ bool UpdaterWindow::validateFile(std::string filePath, unsigned long hash) fclose(file); return adler == hash; } + +void UpdaterWindow::handleLink(const std::string &link, + gcn::MouseEvent *event A_UNUSED) +{ + if (strStartWith(link, "http://")) + openBrowser(link); +} |