Changeset View
Changeset View
Standalone View
Standalone View
shell/scripting/widget.cpp
Show All 14 Lines | |||||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "widget.h" | 20 | #include "widget.h" | ||
21 | 21 | | |||
22 | #include <QAction> | 22 | #include <QAction> | ||
23 | #include <QMetaEnum> | ||||
23 | 24 | | |||
24 | #include <Plasma/Applet> | 25 | #include <Plasma/Applet> | ||
25 | #include <Plasma/Containment> | 26 | #include <Plasma/Containment> | ||
26 | #include <Plasma/Corona> | 27 | #include <Plasma/Corona> | ||
27 | 28 | | |||
28 | namespace WorkspaceScripting | 29 | namespace WorkspaceScripting | ||
29 | { | 30 | { | ||
30 | 31 | | |||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Line(s) | |||||
171 | 172 | | |||
172 | void Widget::showConfigurationInterface() | 173 | void Widget::showConfigurationInterface() | ||
173 | { | 174 | { | ||
174 | /* if (d->applet) { | 175 | /* if (d->applet) { | ||
175 | d->applet.data()->showConfigurationInterface(); | 176 | d->applet.data()->showConfigurationInterface(); | ||
176 | }*/ | 177 | }*/ | ||
177 | } | 178 | } | ||
178 | 179 | | |||
180 | QString Widget::userBackgroundHints() const | ||||
181 | {qWarning()<<"DJENT"; | ||||
182 | QMetaEnum hintEnum = QMetaEnum::fromType<Plasma::Types::BackgroundHints>(); | ||||
183 | return hintEnum.valueToKey(applet()->userBackgroundHints()); | ||||
184 | } | ||||
185 | | ||||
186 | void Widget::setUserBackgroundHints(QString hint) | ||||
187 | { | ||||
188 | QMetaEnum hintEnum = QMetaEnum::fromType<Plasma::Types::BackgroundHints>(); | ||||
189 | bool ok; | ||||
190 | int value = hintEnum.keyToValue(hint.toUtf8().constData(), &ok); | ||||
191 | if (ok) { | ||||
192 | applet()->setUserBackgroundHints(Plasma::Types::BackgroundHints(value)); | ||||
193 | } | ||||
194 | } | ||||
195 | | ||||
179 | } | 196 | } | ||
180 | 197 | | |||
181 | 198 | | |||
182 | 199 | |