GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/widgets/tabs/chat/clantab.cpp Lines: 1 9 11.1 %
Date: 2018-09-20 Branches: 2 14 14.3 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2011-2018  The ManaPlus Developers
4
 *
5
 *  This file is part of The ManaPlus Client.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#include "gui/widgets/tabs/chat/clantab.h"
22
23
#include "soundmanager.h"
24
25
#include "const/sound.h"
26
27
#include "gui/windows/chatwindow.h"
28
29
#include "net/clanhandler.h"
30
31
#include "utils/gettext.h"
32
33
#include "debug.h"
34
35
ClanTab *clanTab = nullptr;
36
37
ClanTab::ClanTab(const Widget2 *const widget) :
38
    // TRANSLATORS: clan chat tab name
39
    ChatTab(widget, _("Clan"), "", "#Clan", ChatTabType::CLAN)
40
{
41
    setTabColors(ThemeColorId::CLAN_CHAT_TAB);
42
}
43
44
ClanTab::~ClanTab()
45
{
46
}
47
48
void ClanTab::handleInput(const std::string &msg)
49
{
50
    clanHandler->chat(ChatWindow::doReplace(msg));
51
}
52
53
void ClanTab::playNewMessageSound() const
54
{
55
    soundManager.playGuiSound(SOUND_CLAN);
56

3
}