GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/widgets/tabs/socialpickuptab.h Lines: 13 17 76.5 %
Date: 2017-11-29 Branches: 7 60 11.7 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2011-2017  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
#ifndef GUI_WIDGETS_TABS_SOCIALPICKUPTAB_H
22
#define GUI_WIDGETS_TABS_SOCIALPICKUPTAB_H
23
24
#include "gui/widgets/tabs/socialtab.h"
25
26
#include "being/localplayer.h"
27
28
#include "gui/models/beingslistmodel.h"
29
30
#include "gui/widgets/tabs/socialtabbase.h"
31
32
#include "utils/delete2.h"
33
#include "utils/gettext.h"
34
35
#include "localconsts.h"
36
37
class SocialPickupTab final : public SocialTab
38
{
39
    public:
40
2
        SocialPickupTab(const Widget2 *const widget,
41
2
                        const Opaque showBackground) :
42
            SocialTab(widget),
43
4
            mBeings(new BeingsListModel)
44
        {
45
2
            createControls(mBeings, showBackground);
46
47
            // TRANSLATORS: Pickup filter tab name in social window.
48
            // TRANSLATORS: Should be small
49

8
            setCaption(_("Pik"));
50
4
            mMenuAction = "pickup";
51
2
        }
52
53
        A_DELETE_COPY(SocialPickupTab)
54
55
4
        ~SocialPickupTab()
56
4
        {
57
2
            delete2(mList)
58
2
            delete2(mScroll)
59
4
            delete2(mBeings)
60
4
        }
61
62
        void updateList() override final
63
        {
64
            updateAtkListStart();
65
            // TRANSLATORS: items group name in social window
66
            addAvatars(PickupItem, _("Pickup items"), PICKUP);
67
            // TRANSLATORS: items group name in social window
68
            addAvatars(IgnorePickupItem, _("Ignore items"), NOPICKUP);
69
        }
70
71
    private:
72
        BeingsListModel *mBeings;
73
};
74
75
#endif  // GUI_WIDGETS_TABS_SOCIALPICKUPTAB_H