summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-12 13:54:02 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-12 13:54:02 +0300
commitc9d8a97059e24d24011870fae89199e1cb44e5ef (patch)
tree1319aa49a8e4fac0d8307e2393d45f62f99224cd /src
parent3121b17f34cb74e1b54ef5bde8b3937627d79d91 (diff)
downloadmv-c9d8a97059e24d24011870fae89199e1cb44e5ef.tar.gz
mv-c9d8a97059e24d24011870fae89199e1cb44e5ef.tar.bz2
mv-c9d8a97059e24d24011870fae89199e1cb44e5ef.tar.xz
mv-c9d8a97059e24d24011870fae89199e1cb44e5ef.zip
Move GuildTab from net namespace into gui.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/Makefile.am4
-rw-r--r--src/gui/widgets/tabs/chat/guildtab.cpp (renamed from src/net/ea/gui/guildtab.cpp)31
-rw-r--r--src/gui/widgets/tabs/chat/guildtab.h (renamed from src/net/ea/gui/guildtab.h)11
-rw-r--r--src/net/ea/guildhandler.cpp5
-rw-r--r--src/net/ea/guildhandler.h7
-rw-r--r--src/net/eathena/generalhandler.cpp4
-rw-r--r--src/net/eathena/guildhandler.cpp12
-rw-r--r--src/net/eathena/guildhandler.h1
-rw-r--r--src/net/tmwa/generalhandler.cpp4
-rw-r--r--src/net/tmwa/guildhandler.cpp12
-rw-r--r--src/net/tmwa/guildhandler.h3
12 files changed, 49 insertions, 53 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 43a9f748b..f8b42f8c7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -174,6 +174,10 @@ SET(SRCS
gui/widgets/tabs/chat/emulateguildtab.h
gui/widgets/tabs/chat/gmtab.cpp
gui/widgets/tabs/chat/gmtab.h
+ gui/widgets/tabs/chat/guildtab.cpp
+ gui/widgets/tabs/chat/guildtab.h
+ net/ea/gui/partytab.cpp
+ net/ea/gui/partytab.h
gui/widgets/horizontcontainer.cpp
gui/widgets/horizontcontainer.h
gui/widgets/icon.cpp
@@ -1250,10 +1254,6 @@ SET(DYE_CMD_SRCS
)
SET(SRCS_EVOL
- net/ea/gui/guildtab.cpp
- net/ea/gui/guildtab.h
- net/ea/gui/partytab.cpp
- net/ea/gui/partytab.h
net/ea/adminhandler.cpp
net/ea/adminhandler.h
net/ea/beinghandler.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index aed69a54d..a85149b8e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1182,8 +1182,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
resources/map/walklayer.cpp \
resources/map/walklayer.h \
winver.h \
- net/ea/gui/guildtab.cpp \
- net/ea/gui/guildtab.h \
+ gui/widgets/tabs/chat/guildtab.cpp \
+ gui/widgets/tabs/chat/guildtab.h \
net/ea/gui/partytab.cpp \
net/ea/gui/partytab.h \
net/ea/adminhandler.cpp \
diff --git a/src/net/ea/gui/guildtab.cpp b/src/gui/widgets/tabs/chat/guildtab.cpp
index 044df87e7..109c2459b 100644
--- a/src/net/ea/gui/guildtab.cpp
+++ b/src/gui/widgets/tabs/chat/guildtab.cpp
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "net/ea/gui/guildtab.h"
+#include "gui/widgets/tabs/chat/guildtab.h"
#include "chatlogger.h"
#include "configuration.h"
@@ -38,7 +38,8 @@
namespace Ea
{
-extern Guild *taGuild;
+ extern Guild *taGuild;
+} // namespace Ea
GuildTab::GuildTab(const Widget2 *const widget) :
// TRANSLATORS: guild chat tab name
@@ -72,25 +73,25 @@ bool GuildTab::handleCommand(const std::string &restrict type,
guildHandler->create(args);
}
*/
- if (type == "invite" && taGuild)
+ if (type == "invite" && Ea::taGuild)
{
- guildHandler->invite(taGuild->getId(), args);
+ guildHandler->invite(Ea::taGuild->getId(), args);
}
- else if (type == "leave" && taGuild)
+ else if (type == "leave" && Ea::taGuild)
{
- guildHandler->leave(taGuild->getId());
+ guildHandler->leave(Ea::taGuild->getId());
}
- else if (type == "kick" && taGuild)
+ else if (type == "kick" && Ea::taGuild)
{
- guildHandler->kick(taGuild->getMember(args), "");
+ guildHandler->kick(Ea::taGuild->getMember(args), "");
}
- else if (type == "notice" && taGuild)
+ else if (type == "notice" && Ea::taGuild)
{
std::string str1 = args.substr(0, 60);
std::string str2("");
if (args.size() > 60)
str2 = args.substr(60);
- guildHandler->changeNotice(taGuild->getId(), str1, str2);
+ guildHandler->changeNotice(Ea::taGuild->getId(), str1, str2);
}
else
{
@@ -102,17 +103,17 @@ bool GuildTab::handleCommand(const std::string &restrict type,
void GuildTab::handleInput(const std::string &msg)
{
- if (!taGuild)
+ if (!Ea::taGuild)
return;
- guildHandler->chat(taGuild->getId(),
+ guildHandler->chat(Ea::taGuild->getId(),
ChatWindow::doReplace(msg));
}
void GuildTab::getAutoCompleteList(StringVect &names) const
{
- if (taGuild)
- taGuild->getNames(names);
+ if (Ea::taGuild)
+ Ea::taGuild->getNames(names);
}
void GuildTab::getAutoCompleteCommands(StringVect &names) const
@@ -140,5 +141,3 @@ void GuildTab::optionChanged(const std::string &value)
if (value == "showGuildOnline")
mShowOnline = config.getBoolValue("showGuildOnline");
}
-
-} // namespace Ea
diff --git a/src/net/ea/gui/guildtab.h b/src/gui/widgets/tabs/chat/guildtab.h
index 01965f538..e7c38368d 100644
--- a/src/net/ea/gui/guildtab.h
+++ b/src/gui/widgets/tabs/chat/guildtab.h
@@ -20,15 +20,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NET_EA_GUI_GUILDTAB_H
-#define NET_EA_GUI_GUILDTAB_H
+#ifndef GUI_WIDGETS_TABS_CHAT_GUILDTAB_H
+#define GUI_WIDGETS_TABS_CHAT_GUILDTAB_H
#include "gui/widgets/tabs/chat/chattab.h"
#include "gui/widgets/tabs/chat/chattabtype.h"
-namespace Ea
-{
-
/**
* A tab for a guild chat channel.
*/
@@ -62,6 +59,4 @@ class GuildTab notfinal : public ChatTab,
void getAutoCompleteCommands(StringVect &names) const override final;
};
-} // namespace Ea
-
-#endif // NET_EA_GUI_GUILDTAB_H
+#endif // GUI_WIDGETS_TABS_CHAT_GUILDTAB_H
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index ebbb93eaf..605adbebf 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -32,7 +32,7 @@
#include "net/messagein.h"
-#include "net/ea/gui/guildtab.h"
+#include "gui/widgets/tabs/chat/guildtab.h"
#include "utils/delete2.h"
#include "utils/gettext.h"
@@ -42,9 +42,10 @@
#include "debug.h"
+GuildTab *guildTab = nullptr;
+
namespace Ea
{
-GuildTab *guildTab = nullptr;
Guild *taGuild = nullptr;
GuildHandler::GuildHandler() :
diff --git a/src/net/ea/guildhandler.h b/src/net/ea/guildhandler.h
index 3c7446605..fb5bc1a6c 100644
--- a/src/net/ea/guildhandler.h
+++ b/src/net/ea/guildhandler.h
@@ -29,10 +29,10 @@ namespace Net
class MessageIn;
}
-namespace Ea
-{
class GuildTab;
+namespace Ea
+{
class GuildHandler notfinal : public Net::GuildHandler
{
public:
@@ -106,7 +106,8 @@ class GuildHandler notfinal : public Net::GuildHandler
};
extern Guild *taGuild;
-extern GuildTab *guildTab;
} // namespace Ea
+extern GuildTab *guildTab;
+
#endif // NET_EA_GUILDHANDLER_H
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index 2bf88ed68..25a036bb4 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -35,7 +35,7 @@
#include "net/ea/guildhandler.h"
-#include "net/ea/gui/guildtab.h"
+#include "gui/widgets/tabs/chat/guildtab.h"
#include "net/ea/gui/partytab.h"
#include "net/eathena/adminhandler.h"
@@ -379,7 +379,7 @@ void GeneralHandler::gameEnded() const
socialWindow->removeTab(Ea::taParty);
}
- delete2(Ea::guildTab);
+ delete2(guildTab);
delete2(Ea::partyTab);
}
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index a1ea449c5..f64569d10 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -30,7 +30,7 @@
#include "gui/windows/chatwindow.h"
#include "gui/windows/socialwindow.h"
-#include "net/ea/gui/guildtab.h"
+#include "gui/widgets/tabs/chat/guildtab.h"
#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
@@ -372,11 +372,11 @@ void GuildHandler::processGuildPositionInfo(Net::MessageIn &msg) const
g->setEmblemId(emblem);
if (!Ea::taGuild)
Ea::taGuild = g;
- if (!Ea::guildTab && chatWindow)
+ if (!guildTab && chatWindow)
{
- Ea::guildTab = new Ea::GuildTab(chatWindow);
+ guildTab = new GuildTab(chatWindow);
if (config.getBoolValue("showChatHistory"))
- Ea::guildTab->loadFromLogFile("#Guild");
+ guildTab->loadFromLogFile("#Guild");
if (localPlayer)
localPlayer->addGuild(Ea::taGuild);
memberList(guildId);
@@ -406,8 +406,8 @@ void GuildHandler::processGuildMemberLogin(Net::MessageIn &msg) const
m->setOnline(online);
if (online)
m->setGender(gender);
- if (Ea::guildTab)
- Ea::guildTab->showOnline(m->getName(), online);
+ if (guildTab)
+ guildTab->showOnline(m->getName(), online);
if (socialWindow)
socialWindow->updateGuildCounter();
}
diff --git a/src/net/eathena/guildhandler.h b/src/net/eathena/guildhandler.h
index af070a3e3..8b19ea51d 100644
--- a/src/net/eathena/guildhandler.h
+++ b/src/net/eathena/guildhandler.h
@@ -85,7 +85,6 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler
void processGuildExpulsionList(Net::MessageIn &msg) const;
};
-// extern Ea::GuildTab *guildTab;
} // namespace EAthena
namespace Ea
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 9bd209354..fb64617a0 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -35,7 +35,7 @@
#include "net/ea/guildhandler.h"
-#include "net/ea/gui/guildtab.h"
+#include "gui/widgets/tabs/chat/guildtab.h"
#include "net/ea/gui/partytab.h"
#include "net/tmwa/adminhandler.h"
@@ -351,7 +351,7 @@ void GeneralHandler::gameEnded() const
socialWindow->removeTab(Ea::taParty);
}
- delete2(Ea::guildTab);
+ delete2(guildTab);
delete2(Ea::partyTab);
}
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index a22cd69b0..3e9faa4c8 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -32,7 +32,7 @@
#include "net/serverfeatures.h"
-#include "net/ea/gui/guildtab.h"
+#include "gui/widgets/tabs/chat/guildtab.h"
#include "net/tmwa/messageout.h"
#include "net/tmwa/protocol.h"
@@ -360,11 +360,11 @@ void GuildHandler::processGuildPositionInfo(Net::MessageIn &msg) const
g->setEmblemId(emblem);
if (!Ea::taGuild)
Ea::taGuild = g;
- if (!Ea::guildTab && chatWindow)
+ if (!guildTab && chatWindow)
{
- Ea::guildTab = new Ea::GuildTab(chatWindow);
+ guildTab = new GuildTab(chatWindow);
if (config.getBoolValue("showChatHistory"))
- Ea::guildTab->loadFromLogFile("#Guild");
+ guildTab->loadFromLogFile("#Guild");
if (localPlayer)
localPlayer->addGuild(Ea::taGuild);
memberList(guildId);
@@ -391,8 +391,8 @@ void GuildHandler::processGuildMemberLogin(Net::MessageIn &msg) const
if (m)
{
m->setOnline(online);
- if (Ea::guildTab)
- Ea::guildTab->showOnline(m->getName(), online);
+ if (guildTab)
+ guildTab->showOnline(m->getName(), online);
if (socialWindow)
socialWindow->updateGuildCounter();
}
diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h
index 35f10bbbf..506de89dd 100644
--- a/src/net/tmwa/guildhandler.h
+++ b/src/net/tmwa/guildhandler.h
@@ -83,9 +83,10 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler
void processGuildExpulsionList(Net::MessageIn &msg) const;
};
- extern Ea::GuildTab *guildTab;
} // namespace TmwAthena
+extern GuildTab *guildTab;
+
namespace Ea
{
extern Guild *taGuild;