File indexing completed on 2024-06-23 05:14:07

0001 /*
0002     main.cpp
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2001, 2002, 2004 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #include <config-kleopatra.h>
0011 
0012 #include "tray.h"
0013 
0014 #include "kwatchgnupgmainwin.h"
0015 
0016 #include "kwatchgnupg_debug.h"
0017 #include <KIconLoader>
0018 #include <KLocalizedString>
0019 
0020 KWatchGnuPGTray::KWatchGnuPGTray(KWatchGnuPGMainWindow *mainwin)
0021     : KStatusNotifierItem(mainwin)
0022 {
0023     qCDebug(KWATCHGNUPG_LOG) << "KWatchGnuPGTray::KWatchGnuPGTray";
0024 
0025     setObjectName(QLatin1StringView("KWatchGnuPG Tray Window"));
0026     KIconLoader::global()->addAppDir(QStringLiteral("kwatchgnupg"));
0027 
0028     mNormalPix.addPixmap(KIconLoader::global()->loadIcon(QStringLiteral("kwatchgnupg"), KIconLoader::Panel));
0029     mAttentionPix.addPixmap(KIconLoader::global()->loadIcon(QStringLiteral("kwatchgnupg2"), KIconLoader::Panel));
0030     setToolTipTitle(i18n("KWatchGnuPG Log Viewer"));
0031 }
0032 
0033 KWatchGnuPGTray::~KWatchGnuPGTray()
0034 {
0035 }
0036 
0037 void KWatchGnuPGTray::setAttention(bool att)
0038 {
0039     if (att) {
0040         setIconByPixmap(mAttentionPix);
0041     } else {
0042         setIconByPixmap(mNormalPix);
0043     }
0044 }
0045 
0046 #include "moc_tray.cpp"