summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.cpp28
-rw-r--r--src/commands.h12
-rw-r--r--src/gui/popupmenu.cpp20
3 files changed, 48 insertions, 12 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index e6d0e9eb6..857212aa3 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1164,6 +1164,34 @@ impHandler1(disableHighlight)
}
}
+impHandler1(dontRemoveName)
+{
+ tab->setRemoveNames(false);
+ if (chatWindow)
+ chatWindow->saveState();
+}
+
+impHandler1(removeName)
+{
+ tab->setRemoveNames(true);
+ if (chatWindow)
+ chatWindow->saveState();
+}
+
+impHandler1(disableAway)
+{
+ tab->setNoAway(true);
+ if (chatWindow)
+ chatWindow->saveState();
+}
+
+impHandler1(enableAway)
+{
+ tab->setNoAway(false);
+ if (chatWindow)
+ chatWindow->saveState();
+}
+
impHandler0(testsdlfont)
{
#if defined USE_OPENGL && defined DEBUG_SDLFONT
diff --git a/src/commands.h b/src/commands.h
index bd0b8107d..f990ab69a 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -116,6 +116,10 @@ namespace Commands
decHandler(testsdlfont);
decHandler(enableHighlight);
decHandler(disableHighlight);
+ decHandler(dontRemoveName);
+ decHandler(removeName);
+ decHandler(disableAway);
+ decHandler(enableAway);
void replaceVars(std::string &str);
} // namespace Commands
@@ -196,6 +200,10 @@ enum
COMMAND_TESTSDLFONT,
COMMAND_ENABLEHIGHLIGHT,
COMMAND_DISABLEHIGHLIGHT,
+ COMMAND_DONTREMOVENAME,
+ COMMAND_REMOVENAME,
+ COMMAND_DISABLEAWAY,
+ COMMAND_ENABLEAWAY,
COMMAND_HACK,
END_COMMANDS,
};
@@ -276,6 +284,10 @@ static const CommandInfo commands[] =
{"testsdlfont", &Commands::testsdlfont},
{"enablehighlight", &Commands::enableHighlight},
{"disablehighlight", &Commands::disableHighlight},
+ {"", &Commands::dontRemoveName},
+ {"", &Commands::removeName},
+ {"disableaway", &Commands::disableAway},
+ {"enableaway", &Commands::enableAway},
{"hack", &Commands::hack}
};
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index f9e2d232d..371798eb7 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -1328,27 +1328,23 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "dont remove name" && mTab)
{
- mTab->setRemoveNames(false);
- if (chatWindow)
- chatWindow->saveState();
+ if (commandHandler)
+ commandHandler->invokeCommand(COMMAND_DONTREMOVENAME, mTab);
}
else if (link == "remove name" && mTab)
{
- mTab->setRemoveNames(true);
- if (chatWindow)
- chatWindow->saveState();
+ if (commandHandler)
+ commandHandler->invokeCommand(COMMAND_REMOVENAME, mTab);
}
else if (link == "disable away" && mTab)
{
- mTab->setNoAway(true);
- if (chatWindow)
- chatWindow->saveState();
+ if (commandHandler)
+ commandHandler->invokeCommand(COMMAND_DISABLEAWAY, mTab);
}
else if (link == "enable away" && mTab)
{
- mTab->setNoAway(false);
- if (chatWindow)
- chatWindow->saveState();
+ if (commandHandler)
+ commandHandler->invokeCommand(COMMAND_ENABLEAWAY, mTab);
}
else if (link == "chat clipboard" && mTab)
{