summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-27 17:20:34 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-27 17:20:34 +0300
commite1233ab2508be02b0bd59c90f42b1c3406b60564 (patch)
tree17eaec58892287d214a1c86aee18fdfdd0448f1c
parent2363866d00316240e025ebf479536ac68510d4b4 (diff)
downloadmanaplus-e1233ab2508be02b0bd59c90f42b1c3406b60564.tar.gz
manaplus-e1233ab2508be02b0bd59c90f42b1c3406b60564.tar.bz2
manaplus-e1233ab2508be02b0bd59c90f42b1c3406b60564.tar.xz
manaplus-e1233ab2508be02b0bd59c90f42b1c3406b60564.zip
Remove copy to clipboard action in chat popup.
-rw-r--r--src/actions/chat.cpp13
-rw-r--r--src/actions/chat.h1
-rw-r--r--src/dyetool/actions/chat.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/gui/popups/popupmenu.cpp7
-rw-r--r--src/input/inputactionmap.h6
6 files changed, 23 insertions, 6 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index 9d9be4279..62213c5cc 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -604,4 +604,17 @@ impHandler(hat)
return true;
}
+impHandler(chatClipboard)
+{
+ int x = 0;
+ int y = 0;
+
+ if (chatWindow && parse2Int(event.args, x, y))
+ {
+ chatWindow->copyToClipboard(x, y);
+ return true;
+ }
+ return false;
+}
+
} // namespace Actions
diff --git a/src/actions/chat.h b/src/actions/chat.h
index 3a433e49a..158de5580 100644
--- a/src/actions/chat.h
+++ b/src/actions/chat.h
@@ -59,6 +59,7 @@ namespace Actions
decHandler(chatPartyTab);
decHandler(chatGuildTab);
decHandler(hat);
+ decHandler(chatClipboard);
} // namespace Actions
#undef decHandler
diff --git a/src/dyetool/actions/chat.cpp b/src/dyetool/actions/chat.cpp
index afc854fe8..9d54e2771 100644
--- a/src/dyetool/actions/chat.cpp
+++ b/src/dyetool/actions/chat.cpp
@@ -59,5 +59,6 @@ impHandlerVoid(chatGmTab)
impHandlerVoid(chatPartyTab)
impHandlerVoid(chatGuildTab)
impHandlerVoid(hat)
+impHandlerVoid(chatClipboard)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index f5fa6b675..150c6282d 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -617,6 +617,7 @@ enumStart(InputAction)
CRAFT_8,
CRAFT_9,
CRAFT,
+ CHAT_CLIPBOARD,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 74908fd98..9cc00b06d 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -810,7 +810,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
}
// TRANSLATORS: popup menu item
// TRANSLATORS: copy selected text to clipboard
- mBrowserBox->addRow("chat clipboard", _("Copy to clipboard"));
+ mBrowserBox->addRow("/chatclipboard 'X' 'Y'", _("Copy to clipboard"));
mBrowserBox->addRow("##3---");
if (type == ChatTabType::WHISPER)
@@ -1134,11 +1134,6 @@ void PopupMenu::handleLink(const std::string &link,
inputManager.executeChatCommand(InputAction::ENABLE_AWAY,
std::string(), mTab);
}
- else if (link == "chat clipboard" && mTab)
- {
- if (chatWindow)
- chatWindow->copyToClipboard(mX, mY);
- }
else if (link == "npc clipboard" && mBeingId != BeingId_zero)
{
NpcDialog::copyToClipboard(mBeingId, mX, mY);
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 1daf6f856..21060b74f 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5191,6 +5191,12 @@ static const InputActionData inputActionData
"craft",
UseArgs_true,
Protected_true},
+ {"keyChatClipboard",
+ defaultAction(&Actions::chatClipboard),
+ InputCondition::INGAME,
+ "chatclipboard",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction