summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r--src/gui/widgets/tabs/chattab.cpp11
-rw-r--r--src/gui/widgets/tabs/guildchattab.cpp6
-rw-r--r--src/gui/widgets/tabs/setup_input.cpp9
-rw-r--r--src/gui/widgets/tabs/setup_input.h9
-rw-r--r--src/gui/widgets/tabs/setuptabscroll.h2
-rw-r--r--src/gui/widgets/tabs/whispertab.cpp5
6 files changed, 15 insertions, 27 deletions
diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp
index 1795fd03e..331101209 100644
--- a/src/gui/widgets/tabs/chattab.cpp
+++ b/src/gui/widgets/tabs/chattab.cpp
@@ -418,15 +418,8 @@ void ChatTab::clearText()
void ChatTab::handleInput(const std::string &msg)
{
- if (chatWindow)
- {
- Net::getChatHandler()->talk(chatWindow->doReplace(msg),
- mChannelName);
- }
- else
- {
- Net::getChatHandler()->talk(msg, mChannelName);
- }
+ Net::getChatHandler()->talk(ChatWindow::doReplace(msg),
+ mChannelName);
}
void ChatTab::handleCommand(const std::string &msg)
diff --git a/src/gui/widgets/tabs/guildchattab.cpp b/src/gui/widgets/tabs/guildchattab.cpp
index 364b83968..8de95991f 100644
--- a/src/gui/widgets/tabs/guildchattab.cpp
+++ b/src/gui/widgets/tabs/guildchattab.cpp
@@ -107,11 +107,7 @@ void GuildChatTab::handleInput(const std::string &msg)
{
if (!guildManager)
return;
-
- if (chatWindow)
- guildManager->chat(chatWindow->doReplace(msg));
- else
- guildManager->chat(msg);
+ guildManager->chat(ChatWindow::doReplace(msg));
}
void GuildChatTab::showHelp()
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp
index 2ce99d971..9ce6fd616 100644
--- a/src/gui/widgets/tabs/setup_input.cpp
+++ b/src/gui/widgets/tabs/setup_input.cpp
@@ -270,7 +270,7 @@ void Setup_Input::action(const gcn::ActionEvent &event)
else if (id == "resetkeys")
{
inputManager.resetKeys();
- inputManager.update();
+ InputManager::update();
refreshKeys();
}
else if (id == "default")
@@ -378,8 +378,9 @@ void Setup_Input::keyUnresolved()
}
void Setup_Input::fixTranslation(SetupActionData *const actionDatas,
- const int actionStart, const int actionEnd,
- const std::string &text) const
+ const int actionStart,
+ const int actionEnd,
+ const std::string &text)
{
int k = 0;
@@ -397,7 +398,7 @@ void Setup_Input::fixTranslation(SetupActionData *const actionDatas,
}
}
-void Setup_Input::fixTranslations() const
+void Setup_Input::fixTranslations()
{
fixTranslation(setupActionData1, static_cast<int>(Input::KEY_SHORTCUT_1),
static_cast<int>(Input::KEY_SHORTCUT_20), "Item Shortcut %d");
diff --git a/src/gui/widgets/tabs/setup_input.h b/src/gui/widgets/tabs/setup_input.h
index cb2e5cac0..135cb3339 100644
--- a/src/gui/widgets/tabs/setup_input.h
+++ b/src/gui/widgets/tabs/setup_input.h
@@ -82,11 +82,12 @@ class Setup_Input final : public SetupTab
std::string keyToString(const int index) const A_WARN_UNUSED;
private:
- void fixTranslations() const;
+ static void fixTranslations();
- void fixTranslation(SetupActionData *const actionDatas,
- const int actionStart, const int actionEnd,
- const std::string &text) const;
+ static void fixTranslation(SetupActionData *const actionDatas,
+ const int actionStart,
+ const int actionEnd,
+ const std::string &text);
KeyListModel *mKeyListModel;
ListBox *mKeyList;
diff --git a/src/gui/widgets/tabs/setuptabscroll.h b/src/gui/widgets/tabs/setuptabscroll.h
index e3d495690..fb7de574d 100644
--- a/src/gui/widgets/tabs/setuptabscroll.h
+++ b/src/gui/widgets/tabs/setuptabscroll.h
@@ -60,7 +60,7 @@ class SetupTabScroll : public SetupTab
override final
{ }
- int getPreferredFirstItemSize() A_WARN_UNUSED
+ int getPreferredFirstItemSize() const A_WARN_UNUSED
{ return mPreferredFirstItemSize; }
void widgetResized(const gcn::Event &event) override final;
diff --git a/src/gui/widgets/tabs/whispertab.cpp b/src/gui/widgets/tabs/whispertab.cpp
index 659704638..2d1e2969a 100644
--- a/src/gui/widgets/tabs/whispertab.cpp
+++ b/src/gui/widgets/tabs/whispertab.cpp
@@ -52,10 +52,7 @@ WhisperTab::~WhisperTab()
void WhisperTab::handleInput(const std::string &msg)
{
std::string newMsg;
- if (chatWindow)
- newMsg = chatWindow->doReplace(msg);
- else
- newMsg = msg;
+ newMsg = ChatWindow::doReplace(msg);
Net::getChatHandler()->privateMessage(mNick, newMsg);
if (player_node)