Libksieve

managesievetreeview.cpp
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-only
5*/
6
7#include "managesievetreeview.h"
8
9#include <KLocalizedString>
10
11using namespace KSieveUi;
12
13ManageSieveTreeView::ManageSieveTreeView(QWidget *parent)
14 : PimCommon::CustomTreeView(parent)
15{
16 setDefaultText(i18n("No IMAP server configured…"));
17 setRootIsDecorated(true);
18 setAlternatingRowColors(true);
19 setSelectionMode(QAbstractItemView::SingleSelection);
20 setHeaderLabel(i18n("Available Scripts"));
21 setSortingEnabled(true);
22 setContextMenuPolicy(Qt::CustomContextMenu);
23}
24
25ManageSieveTreeView::~ManageSieveTreeView() = default;
26
27void ManageSieveTreeView::setNoImapFound(bool found)
28{
29 if (mShowDefaultText != found) {
30 setDefaultText(i18n("No IMAP server configured…"));
31 mShowDefaultText = found;
32 update();
33 }
34}
35
36void ManageSieveTreeView::setNetworkDown(bool state)
37{
38 if (!state) {
39 setDefaultText(i18n("Network down."));
40 }
41 update();
42}
43
44#include "moc_managesievetreeview.cpp"
QString i18n(const char *text, const TYPE &arg...)
State state() const const
CustomContextMenu
void update()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.