Messagelib

tablockedwarning.cpp
1 /*
2  SPDX-FileCopyrightText: 2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 
6 */
7 
8 #include "tablockedwarning.h"
9 #include <KLocalizedString>
10 using namespace MessageList::Core;
11 TabLockedWarning::TabLockedWarning(QWidget *parent)
12  : KMessageWidget(parent)
13 {
14  setCloseButtonVisible(false);
15  setMessageType(Warning);
16  setWordWrap(true);
17  setText(QStringLiteral("%1 <a href=\"unlock\">%2</a>").arg(i18n("Current Tab is locked."), i18n("(Unlock it)")));
18  setVisible(false);
19  connect(this, &TabLockedWarning::linkActivated, this, &TabLockedWarning::slotLinkActivated);
20 }
21 
22 TabLockedWarning::~TabLockedWarning() = default;
23 
24 void TabLockedWarning::slotLinkActivated(const QString &contents)
25 {
26  if (contents == QLatin1String("unlock")) {
27  Q_EMIT unlockTabRequested();
28  }
29 }
The implementation independent part of the MessageList library.
Definition: aggregation.h:21
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 Mon Dec 6 2021 23:04:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.