KWallet

kbetterthankdialog.cpp
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2004 George Staikos <staikos@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#include "kbetterthankdialog.h"
9#include <QIcon>
10
11KBetterThanKDialog::KBetterThanKDialog(QWidget *parent)
12 : QDialog(parent)
13{
14 setupUi(this);
15 connect(_allowOnce, &QPushButton::clicked, this, &KBetterThanKDialog::allowOnceClicked);
16 connect(_allowAlways, &QPushButton::clicked, this, &KBetterThanKDialog::allowAlwaysClicked);
17 connect(_deny, &QPushButton::clicked, this, &KBetterThanKDialog::denyClicked);
18 connect(_denyForever, &QPushButton::clicked, this, &KBetterThanKDialog::denyForeverClicked);
19
20 init();
21}
22
23void KBetterThanKDialog::init()
24{
25 _allowOnce->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok")));
26 _allowAlways->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok")));
27 _deny->setIcon(QIcon::fromTheme(QStringLiteral("dialog-cancel")));
28 _denyForever->setIcon(QIcon::fromTheme(QStringLiteral("dialog-cancel")));
29
30 _allowOnce->setFocus();
31}
32
33void KBetterThanKDialog::setLabel(const QString &label)
34{
35 _label->setText(label);
36}
37
38void KBetterThanKDialog::accept()
39{
40 setResult(0);
41}
42
43void KBetterThanKDialog::reject()
44{
46 setResult(2);
47}
48
49void KBetterThanKDialog::allowOnceClicked()
50{
51 done(0);
52}
53
54void KBetterThanKDialog::allowAlwaysClicked()
55{
56 done(1);
57}
58
59void KBetterThanKDialog::denyClicked()
60{
61 done(2);
62}
63
64void KBetterThanKDialog::denyForeverClicked()
65{
66 done(3);
67}
68
69#include "moc_kbetterthankdialog.cpp"
QCA_EXPORT void init()
void clicked(bool checked)
virtual void done(int r)
virtual void reject()
void setResult(int i)
QIcon fromTheme(const QString &name)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.