summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp27
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();