Changeset View
Changeset View
Standalone View
Standalone View
src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
Show All 24 Lines | |||||
25 | #include "sieveincludewidget.h" | 25 | #include "sieveincludewidget.h" | ||
26 | #include "sieveeditorgraphicalmodewidget.h" | 26 | #include "sieveeditorgraphicalmodewidget.h" | ||
27 | #include <QXmlStreamReader> | 27 | #include <QXmlStreamReader> | ||
28 | #include <QHBoxLayout> | 28 | #include <QHBoxLayout> | ||
29 | #include <KMessageBox> | 29 | #include <KMessageBox> | ||
30 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
31 | #include <QInputDialog> | 31 | #include <QInputDialog> | ||
32 | #include <QPushButton> | 32 | #include <QPushButton> | ||
33 | #include <KIconLoader> | | |||
34 | #include <QIcon> | 33 | #include <QIcon> | ||
35 | 34 | | |||
36 | #include <QVBoxLayout> | 35 | #include <QVBoxLayout> | ||
37 | #include <QListWidget> | 36 | #include <QListWidget> | ||
38 | #include <QPointer> | 37 | #include <QPointer> | ||
39 | #include "libksieve_debug.h" | 38 | #include "libksieve_debug.h" | ||
40 | 39 | | |||
41 | namespace { | 40 | namespace { | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 99 | { | |||
106 | QWidget *hb = new QWidget(this); | 105 | QWidget *hb = new QWidget(this); | ||
107 | QHBoxLayout *hbHBoxLayout = new QHBoxLayout(hb); | 106 | QHBoxLayout *hbHBoxLayout = new QHBoxLayout(hb); | ||
108 | hbHBoxLayout->setContentsMargins(0, 0, 0, 0); | 107 | hbHBoxLayout->setContentsMargins(0, 0, 0, 0); | ||
109 | hbHBoxLayout->setSpacing(4); | 108 | hbHBoxLayout->setSpacing(4); | ||
110 | 109 | | |||
111 | mBtnTop = new QPushButton(hb); | 110 | mBtnTop = new QPushButton(hb); | ||
112 | hbHBoxLayout->addWidget(mBtnTop); | 111 | hbHBoxLayout->addWidget(mBtnTop); | ||
113 | mBtnTop->setIcon(QIcon::fromTheme(QStringLiteral("go-top"))); | 112 | mBtnTop->setIcon(QIcon::fromTheme(QStringLiteral("go-top"))); | ||
114 | mBtnTop->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
115 | mBtnTop->setMinimumSize(mBtnTop->sizeHint() * 1.2); | 113 | mBtnTop->setMinimumSize(mBtnTop->sizeHint() * 1.2); | ||
116 | 114 | | |||
117 | mBtnUp = new QPushButton(hb); | 115 | mBtnUp = new QPushButton(hb); | ||
118 | hbHBoxLayout->addWidget(mBtnUp); | 116 | hbHBoxLayout->addWidget(mBtnUp); | ||
119 | mBtnUp->setAutoRepeat(true); | 117 | mBtnUp->setAutoRepeat(true); | ||
120 | mBtnUp->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); | 118 | mBtnUp->setIcon(QIcon::fromTheme(QStringLiteral("go-up"))); | ||
121 | mBtnUp->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
122 | mBtnUp->setMinimumSize(mBtnUp->sizeHint() * 1.2); | 119 | mBtnUp->setMinimumSize(mBtnUp->sizeHint() * 1.2); | ||
123 | mBtnDown = new QPushButton(hb); | 120 | mBtnDown = new QPushButton(hb); | ||
124 | hbHBoxLayout->addWidget(mBtnDown); | 121 | hbHBoxLayout->addWidget(mBtnDown); | ||
125 | mBtnDown->setAutoRepeat(true); | 122 | mBtnDown->setAutoRepeat(true); | ||
126 | mBtnDown->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); | 123 | mBtnDown->setIcon(QIcon::fromTheme(QStringLiteral("go-down"))); | ||
127 | mBtnDown->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
128 | mBtnDown->setMinimumSize(mBtnDown->sizeHint() * 1.2); | 124 | mBtnDown->setMinimumSize(mBtnDown->sizeHint() * 1.2); | ||
129 | 125 | | |||
130 | mBtnBottom = new QPushButton(hb); | 126 | mBtnBottom = new QPushButton(hb); | ||
131 | hbHBoxLayout->addWidget(mBtnBottom); | 127 | hbHBoxLayout->addWidget(mBtnBottom); | ||
132 | mBtnBottom->setIcon(QIcon::fromTheme(QStringLiteral("go-bottom"))); | 128 | mBtnBottom->setIcon(QIcon::fromTheme(QStringLiteral("go-bottom"))); | ||
133 | mBtnBottom->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
134 | mBtnBottom->setMinimumSize(mBtnBottom->sizeHint() * 1.2); | 129 | mBtnBottom->setMinimumSize(mBtnBottom->sizeHint() * 1.2); | ||
135 | 130 | | |||
136 | mBtnUp->setToolTip(i18nc("Move selected filter up.", "Up")); | 131 | mBtnUp->setToolTip(i18nc("Move selected filter up.", "Up")); | ||
137 | mBtnDown->setToolTip(i18nc("Move selected filter down.", "Down")); | 132 | mBtnDown->setToolTip(i18nc("Move selected filter down.", "Down")); | ||
138 | mBtnTop->setToolTip(i18nc("Move selected filter to the top.", "Top")); | 133 | mBtnTop->setToolTip(i18nc("Move selected filter to the top.", "Top")); | ||
139 | mBtnBottom->setToolTip(i18nc("Move selected filter to the bottom.", "Bottom")); | 134 | mBtnBottom->setToolTip(i18nc("Move selected filter to the bottom.", "Bottom")); | ||
140 | 135 | | |||
141 | layout->addWidget(hb); | 136 | layout->addWidget(hb); | ||
142 | 137 | | |||
143 | hb = new QWidget(this); | 138 | hb = new QWidget(this); | ||
144 | hbHBoxLayout = new QHBoxLayout(hb); | 139 | hbHBoxLayout = new QHBoxLayout(hb); | ||
145 | hbHBoxLayout->setContentsMargins(0, 0, 0, 0); | 140 | hbHBoxLayout->setContentsMargins(0, 0, 0, 0); | ||
146 | hbHBoxLayout->setSpacing(4); | 141 | hbHBoxLayout->setSpacing(4); | ||
147 | 142 | | |||
148 | mBtnNew = new QPushButton(hb); | 143 | mBtnNew = new QPushButton(hb); | ||
149 | hbHBoxLayout->addWidget(mBtnNew); | 144 | hbHBoxLayout->addWidget(mBtnNew); | ||
150 | mBtnNew->setIcon(QIcon::fromTheme(QStringLiteral("document-new"))); | 145 | mBtnNew->setIcon(QIcon::fromTheme(QStringLiteral("document-new"))); | ||
151 | mBtnNew->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
152 | mBtnNew->setToolTip(i18n("New Script")); | 146 | mBtnNew->setToolTip(i18n("New Script")); | ||
153 | mBtnNew->setMinimumSize(mBtnNew->sizeHint() * 1.2); | 147 | mBtnNew->setMinimumSize(mBtnNew->sizeHint() * 1.2); | ||
154 | 148 | | |||
155 | mBtnDelete = new QPushButton(hb); | 149 | mBtnDelete = new QPushButton(hb); | ||
156 | hbHBoxLayout->addWidget(mBtnDelete); | 150 | hbHBoxLayout->addWidget(mBtnDelete); | ||
157 | mBtnDelete->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete"))); | 151 | mBtnDelete->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete"))); | ||
158 | mBtnDelete->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
159 | mBtnDelete->setToolTip(i18n("Delete Script")); | 152 | mBtnDelete->setToolTip(i18n("Delete Script")); | ||
160 | mBtnDelete->setMinimumSize(mBtnDelete->sizeHint() * 1.2); | 153 | mBtnDelete->setMinimumSize(mBtnDelete->sizeHint() * 1.2); | ||
161 | 154 | | |||
162 | mBtnRename = new QPushButton(hb); | 155 | mBtnRename = new QPushButton(hb); | ||
163 | mBtnRename->setToolTip(i18n("Rename Script")); | 156 | mBtnRename->setToolTip(i18n("Rename Script")); | ||
164 | mBtnRename->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename"))); | 157 | mBtnRename->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename"))); | ||
165 | mBtnRename->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
166 | mBtnRename->setMinimumSize(mBtnRename->sizeHint() * 1.2); | 158 | mBtnRename->setMinimumSize(mBtnRename->sizeHint() * 1.2); | ||
167 | hbHBoxLayout->addWidget(mBtnRename); | 159 | hbHBoxLayout->addWidget(mBtnRename); | ||
168 | 160 | | |||
169 | mBtnDescription = new QPushButton(hb); | 161 | mBtnDescription = new QPushButton(hb); | ||
170 | mBtnDescription->setToolTip(i18n("Edit Script Description")); | 162 | mBtnDescription->setToolTip(i18n("Edit Script Description")); | ||
171 | mBtnDescription->setIcon(QIcon::fromTheme(QStringLiteral("edit-comment"))); | 163 | mBtnDescription->setIcon(QIcon::fromTheme(QStringLiteral("edit-comment"))); | ||
172 | mBtnDescription->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall)); | | |||
173 | mBtnDescription->setMinimumSize(mBtnDescription->sizeHint() * 1.2); | 164 | mBtnDescription->setMinimumSize(mBtnDescription->sizeHint() * 1.2); | ||
174 | 165 | | |||
175 | hbHBoxLayout->addWidget(mBtnDescription); | 166 | hbHBoxLayout->addWidget(mBtnDescription); | ||
176 | 167 | | |||
177 | layout->addWidget(hb); | 168 | layout->addWidget(hb); | ||
178 | 169 | | |||
179 | connect(mBtnNew, &QPushButton::clicked, this, &SieveScriptListBox::slotNew); | 170 | connect(mBtnNew, &QPushButton::clicked, this, &SieveScriptListBox::slotNew); | ||
180 | connect(mBtnDelete, &QPushButton::clicked, this, &SieveScriptListBox::slotDelete); | 171 | connect(mBtnDelete, &QPushButton::clicked, this, &SieveScriptListBox::slotDelete); | ||
▲ Show 20 Lines • Show All 379 Lines • Show Last 20 Lines |