Changeset View
Changeset View
Standalone View
Standalone View
src/pimcommon/widgets/simplestringlisteditor.cpp
Show All 29 Lines | 1 | /* | |||
---|---|---|---|---|---|
30 | your version of the file, but you are not obligated to do so. If | 30 | your version of the file, but you are not obligated to do so. If | ||
31 | you do not wish to do so, delete this exception statement from | 31 | you do not wish to do so, delete this exception statement from | ||
32 | your version. | 32 | your version. | ||
33 | */ | 33 | */ | ||
34 | 34 | | |||
35 | #include "simplestringlisteditor.h" | 35 | #include "simplestringlisteditor.h" | ||
36 | 36 | | |||
37 | #include <QInputDialog> | 37 | #include <QInputDialog> | ||
38 | #include <kiconloader.h> | | |||
39 | #include <QIcon> | 38 | #include <QIcon> | ||
40 | #include <KLocalizedString> | 39 | #include <KLocalizedString> | ||
41 | #include <KMessageBox> | 40 | #include <KMessageBox> | ||
42 | #include "pimcommon_debug.h" | 41 | #include "pimcommon_debug.h" | ||
43 | #include <QPushButton> | 42 | #include <QPushButton> | ||
44 | #include <QMenu> | 43 | #include <QMenu> | ||
45 | #include <QVBoxLayout> | 44 | #include <QVBoxLayout> | ||
46 | #include <QHBoxLayout> | 45 | #include <QHBoxLayout> | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 73 | { | |||
131 | 130 | | |||
132 | if (buttons & Up) { | 131 | if (buttons & Up) { | ||
133 | if (!(buttons & Down)) { | 132 | if (!(buttons & Down)) { | ||
134 | qCDebug(PIMCOMMON_LOG) << "Are you sure you want to use an Up button" | 133 | qCDebug(PIMCOMMON_LOG) << "Are you sure you want to use an Up button" | ||
135 | "without a Down button??"; | 134 | "without a Down button??"; | ||
136 | } | 135 | } | ||
137 | d->mUpButton = new QPushButton(QString(), this); | 136 | d->mUpButton = new QPushButton(QString(), this); | ||
138 | d->mUpButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); | 137 | d->mUpButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); | ||
139 | d->mUpButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
140 | d->mUpButton->setAutoDefault(false); | 138 | d->mUpButton->setAutoDefault(false); | ||
141 | d->mUpButton->setEnabled(false); // no selection yet | 139 | d->mUpButton->setEnabled(false); // no selection yet | ||
142 | d->mButtonLayout->addWidget(d->mUpButton); | 140 | d->mButtonLayout->addWidget(d->mUpButton); | ||
143 | connect(d->mUpButton, &QPushButton::clicked, this, &SimpleStringListEditor::slotUp); | 141 | connect(d->mUpButton, &QPushButton::clicked, this, &SimpleStringListEditor::slotUp); | ||
144 | } | 142 | } | ||
145 | 143 | | |||
146 | if (buttons & Down) { | 144 | if (buttons & Down) { | ||
147 | if (!(buttons & Up)) { | 145 | if (!(buttons & Up)) { | ||
148 | qCDebug(PIMCOMMON_LOG) << "Are you sure you want to use a Down button" | 146 | qCDebug(PIMCOMMON_LOG) << "Are you sure you want to use a Down button" | ||
149 | "without an Up button??"; | 147 | "without an Up button??"; | ||
150 | } | 148 | } | ||
151 | d->mDownButton = new QPushButton(QString(), this); | 149 | d->mDownButton = new QPushButton(QString(), this); | ||
152 | d->mDownButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); | 150 | d->mDownButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); | ||
153 | d->mDownButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
154 | d->mDownButton->setAutoDefault(false); | 151 | d->mDownButton->setAutoDefault(false); | ||
155 | d->mDownButton->setEnabled(false); // no selection yet | 152 | d->mDownButton->setEnabled(false); // no selection yet | ||
156 | d->mButtonLayout->addWidget(d->mDownButton); | 153 | d->mButtonLayout->addWidget(d->mDownButton); | ||
157 | connect(d->mDownButton, &QPushButton::clicked, this, &SimpleStringListEditor::slotDown); | 154 | connect(d->mDownButton, &QPushButton::clicked, this, &SimpleStringListEditor::slotDown); | ||
158 | } | 155 | } | ||
159 | 156 | | |||
160 | d->mButtonLayout->addStretch(1); // spacer | 157 | d->mButtonLayout->addStretch(1); // spacer | ||
161 | 158 | | |||
▲ Show 20 Lines • Show All 306 Lines • Show Last 20 Lines |