Libksieve

managesievetreeview.cpp
1 /*
2  Copyright (C) 2013-2020 Laurent Montel <[email protected]>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include "managesievetreeview.h"
19 
20 #include <KLocalizedString>
21 
22 using namespace KSieveUi;
23 
24 ManageSieveTreeView::ManageSieveTreeView(QWidget *parent)
25  : PimCommon::CustomTreeView(parent)
26 {
27  setDefaultText(i18n("No IMAP server configured..."));
28  setRootIsDecorated(true);
29  setAlternatingRowColors(true);
30  setSelectionMode(QAbstractItemView::SingleSelection);
31  setHeaderLabel(i18n("Available Scripts"));
33 }
34 
35 ManageSieveTreeView::~ManageSieveTreeView()
36 {
37 }
38 
39 void ManageSieveTreeView::setNoImapFound(bool found)
40 {
41  if (mShowDefaultText != found) {
42  setDefaultText(i18n("No IMAP server configured..."));
43  mShowDefaultText = found;
44  update();
45  }
46 }
47 
48 void ManageSieveTreeView::setNetworkDown(bool state)
49 {
50  if (!state) {
51  setDefaultText(i18n("Network down."));
52  }
53  update();
54 }
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-2020 The KDE developers.
Generated on Mon Jul 6 2020 23:07:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.