Changeset View
Changeset View
Standalone View
Standalone View
plasmoid/applet/bodr/kalzium_plasma.cpp
Context not available. | |||||
14 | 14 | | |||
---|---|---|---|---|---|
15 | #include "kalzium_plasma.h" | 15 | #include "kalzium_plasma.h" | ||
16 | 16 | | |||
17 | #include <KDialog> | | |||
18 | #include <KConfigGroup> | 17 | #include <KConfigGroup> | ||
19 | #include <KFontDialog> | 18 | #include <KFontDialog> | ||
20 | #include <QLineEdit> | | |||
21 | 19 | | |||
20 | #include <QDialog> | ||||
21 | #include <QLineEdit> | ||||
22 | #include <QDebug> | 22 | #include <QDebug> | ||
23 | #include <QPainter> | 23 | #include <QPainter> | ||
24 | #include <QPen> | 24 | #include <QPen> | ||
25 | #include <QColor> | 25 | #include <QColor> | ||
26 | #include <QDialogButtonBox> | ||||
27 | #include <QPushButton> | ||||
28 | #include <QVBoxLayout> | ||||
26 | 29 | | |||
27 | KalziumPlasma::KalziumPlasma(QObject *parent, const QVariantList &args) | 30 | KalziumPlasma::KalziumPlasma(QObject *parent, const QVariantList &args) | ||
28 | : Plasma::Applet(parent, args), | 31 | : Plasma::Applet(parent, args), | ||
Context not available. | |||||
133 | void KalziumPlasma::showConfigurationInterface() | 136 | void KalziumPlasma::showConfigurationInterface() | ||
134 | { | 137 | { | ||
135 | if (m_dialog == 0) { | 138 | if (m_dialog == 0) { | ||
136 | m_dialog = new KDialog; | 139 | m_dialog = new QDialog; | ||
137 | m_dialog->setWindowIcon(QIcon::fromTheme("kalzium")); | 140 | m_dialog->setWindowIcon(QIcon::fromTheme("kalzium")); | ||
138 | m_dialog->setCaption(i18n("KalziumPlasma Configuration")); | 141 | m_dialog->setWindowTitle(i18n("KalziumPlasma Configuration")); | ||
139 | ui.setupUi(m_dialog->mainWidget()); | 142 | ui.setupUi(m_dialog->mainWidget()); | ||
140 | m_dialog->mainWidget()->layout()->setMargin(0); | 143 | m_dialog->mainWidget()->layout()->setMargin(0); | ||
141 | m_dialog->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply); | 144 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply); | ||
142 | connect(m_dialog, SIGNAL(applyClicked()), | 145 | QWidget *mainWidget = new QWidget(this); | ||
143 | this, SLOT(configAccepted())); | 146 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||
144 | connect(m_dialog, SIGNAL(okClicked()), | 147 | m_dialog->setLayout(mainLayout); | ||
145 | this, SLOT(configAccepted())); | 148 | mainLayout->addWidget(mainWidget); | ||
149 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | ||||
150 | okButton->setDefault(true); | ||||
151 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | ||||
152 | m_dialog->connect(buttonBox, &QDialogButtonBox::accepted, this, &KalziumPlasma::accept); | ||||
153 | m_dialog->connect(buttonBox, &QDialogButtonBox::rejected, this, &KalziumPlasma::reject); | ||||
154 | mainLayout->addWidget(buttonBox); | ||||
155 | connect(okButton, &QPushButton::clicked, | ||||
156 | this, &KalziumPlasma::configAccepted); | ||||
157 | connect(buttonBox, &QDialogButtonBox::Apply::clicked, | ||||
158 | this, &KalziumPlasma::configAccepted); | ||||
146 | connect(ui.fontSelectButton, SIGNAL(clicked()), | 159 | connect(ui.fontSelectButton, SIGNAL(clicked()), | ||
147 | this, SLOT(showFontSelectDlg())); | 160 | this, SLOT(showFontSelectDlg())); | ||
148 | } | 161 | } | ||
Context not available. |