diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-01-16 14:41:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-01-16 14:41:11 +0300 |
commit | 70d4f24f38a4036f84c1f71803173199e95ad675 (patch) | |
tree | 0abd0ad2c45092e07a39011602fbd6ab60b3a513 /src/gui/popupmenu.cpp | |
parent | 90752e4a52d85ac3c77ed2ed28227e8a45b250ab (diff) | |
download | mv-70d4f24f38a4036f84c1f71803173199e95ad675.tar.gz mv-70d4f24f38a4036f84c1f71803173199e95ad675.tar.bz2 mv-70d4f24f38a4036f84c1f71803173199e95ad675.tar.xz mv-70d4f24f38a4036f84c1f71803173199e95ad675.zip |
Add context menu to browserbox http links.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 844fc4e3f..807f5413e 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -69,7 +69,9 @@ #include "resources/iteminfo.h" +#include "utils/copynpaste.h" #include "utils/gettext.h" +#include "utils/process.h" #include <guichan/listmodel.hpp> @@ -1549,6 +1551,14 @@ void PopupMenu::handleLink(const std::string &link, if (mTextField) mTextField->handlePaste(); } + else if (link == "open link" && !mNick.empty()) + { + openBrowser(mNick); + } + else if (link == "clipboard link" && !mNick.empty()) + { + sendBuffer(mNick); + } else if (!link.compare(0, 10, "guild-pos-")) { if (player_node) @@ -2079,6 +2089,23 @@ void PopupMenu::showTextFieldPopup(int x, int y, TextField *input) showPopup(x, y); } +void PopupMenu::showLinkPopup(const int x, const int y, + const std::string &link) +{ + mX = x; + mY = y; + mNick = link; + + mBrowserBox->clearRows(); + + mBrowserBox->addRow("open link", _("Open link")); + mBrowserBox->addRow("clipboard link", _("Copy to clipboard")); + mBrowserBox->addRow("##3---"); + mBrowserBox->addRow("cancel", _("Cancel")); + + showPopup(x, y); +} + void PopupMenu::showPopup(int x, int y) { const int pad2 = 2 * getPadding(); |