akonadi
20#include "renamefavoritedialog.h"
23#include <KLocalizedString>
26RenameFavoriteDialog::RenameFavoriteDialog(
const QString &caption,
const QString &text,
const QString &value,
const QString &defaultName, QWidget *parent)
28 , m_defaultName(defaultName)
31 setButtons(Ok | Cancel | User1);
32 setButtonGuiItem(User1, KGuiItem(i18n(
"Default Name")));
36 QWidget *frame =
new QWidget(
this);
37 QVBoxLayout *layout =
new QVBoxLayout(frame);
40 m_label =
new QLabel(text, frame);
41 m_label->setWordWrap(
true);
42 layout->addWidget(m_label);
44 m_lineEdit =
new KLineEdit(value, frame);
45 m_lineEdit->setClearButtonShown(
true);
46 layout->addWidget(m_lineEdit);
48 m_lineEdit->setFocus();
49 m_label->setBuddy(m_lineEdit);
53 connect(m_lineEdit, SIGNAL(textChanged(QString)),
54 SLOT(slotEditTextChanged(QString)));
55 connect(
this, SIGNAL(user1Clicked()),
this, SLOT(slotDefaultName()));
58 slotEditTextChanged(value);
63RenameFavoriteDialog::~RenameFavoriteDialog()
67void RenameFavoriteDialog::slotDefaultName()
69 m_lineEdit->setText(m_defaultName);
72void RenameFavoriteDialog::slotEditTextChanged(
const QString &text)
74 enableButton(Ok, !text.trimmed().isEmpty());
77QString RenameFavoriteDialog::newName()
const
79 return m_lineEdit->text();
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by
doxygen 1.9.5 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.