Libksieve

managesievetreeview.cpp
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #include "managesievetreeview.h"
8 
9 #include <KLocalizedString>
10 
11 using namespace KSieveUi;
12 
13 ManageSieveTreeView::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);
23 }
24 
25 ManageSieveTreeView::~ManageSieveTreeView()
26 {
27 }
28 
29 void ManageSieveTreeView::setNoImapFound(bool found)
30 {
31  if (mShowDefaultText != found) {
32  setDefaultText(i18n("No IMAP server configured..."));
33  mShowDefaultText = found;
34  update();
35  }
36 }
37 
38 void ManageSieveTreeView::setNetworkDown(bool state)
39 {
40  if (!state) {
41  setDefaultText(i18n("Network down."));
42  }
43  update();
44 }
void update()
CustomContextMenu
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Apr 11 2021 23:09:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.