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.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 844fc4e3f..09389f3ea 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -2,7 +2,7 @@
* The ManaPlus Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
- * Copyright (C) 2011-2012 The ManaPlus Developers
+ * Copyright (C) 2011-2013 The ManaPlus Developers
*
* This file is part of The ManaPlus Client.
*
@@ -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();