switch wallpaper plugins
This commit is contained in:
parent
647e265b0e
commit
18a663228f
@ -117,4 +117,9 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper)
|
|||||||
emit currentWallpaperChanged();
|
emit currentWallpaperChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContainmentConfigView::applyWallpaper()
|
||||||
|
{
|
||||||
|
m_contianmentInterface->containment()->setWallpaper(m_currentWallpaper);
|
||||||
|
}
|
||||||
|
|
||||||
#include "moc_containmentconfigview.cpp"
|
#include "moc_containmentconfigview.cpp"
|
||||||
|
@ -44,6 +44,8 @@ public:
|
|||||||
void setCurrentWallpaper(const QString &wallpaper);
|
void setCurrentWallpaper(const QString &wallpaper);
|
||||||
ConfigPropertyMap *wallpaperConfiguration() const;
|
ConfigPropertyMap *wallpaperConfiguration() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void applyWallpaper();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void currentWallpaperChanged();
|
void currentWallpaperChanged();
|
||||||
|
|
||||||
|
@ -91,6 +91,8 @@ void WallpaperInterface::syncWallpaperPackage()
|
|||||||
|
|
||||||
m_configLoader->deleteLater();
|
m_configLoader->deleteLater();
|
||||||
m_configuration->deleteLater();
|
m_configuration->deleteLater();
|
||||||
|
m_configLoader = 0;
|
||||||
|
m_configuration = 0;
|
||||||
if (configScheme()) {
|
if (configScheme()) {
|
||||||
m_configuration = new ConfigPropertyMap(configScheme(), this);
|
m_configuration = new ConfigPropertyMap(configScheme(), this);
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ Column {
|
|||||||
configDialog.wallpaperConfiguration[key] = main.currentPage["cfg_"+key]
|
configDialog.wallpaperConfiguration[key] = main.currentPage["cfg_"+key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
configDialog.applyWallpaper()
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreConfig() {
|
function restoreConfig() {
|
||||||
@ -65,10 +66,10 @@ Column {
|
|||||||
}
|
}
|
||||||
width: 64
|
width: 64
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
configDialog.currentWallpaper = model.pluginName
|
||||||
if (delegate.current) {
|
if (delegate.current) {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
configDialog.currentWallpaper = model.pluginName
|
|
||||||
main.sourceFile = model.source
|
main.sourceFile = model.source
|
||||||
root.restoreConfig()
|
root.restoreConfig()
|
||||||
}
|
}
|
||||||
@ -78,10 +79,28 @@ Column {
|
|||||||
categoriesView.currentIndex = index
|
categoriesView.currentIndex = index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (configDialog.currentWallpaper == model.pluginName) {
|
||||||
|
loadWallpaperTimer.pendingCurrent = model
|
||||||
|
loadWallpaperTimer.restart()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
highlight: Rectangle {
|
highlight: Rectangle {
|
||||||
color: theme.highlightColor
|
color: theme.highlightColor
|
||||||
}
|
}
|
||||||
|
Timer {
|
||||||
|
id: loadWallpaperTimer
|
||||||
|
interval: 100
|
||||||
|
property variant pendingCurrent
|
||||||
|
onTriggered: {
|
||||||
|
if (pendingCurrent) {
|
||||||
|
main.sourceFile = pendingCurrent.source
|
||||||
|
root.restoreConfig()
|
||||||
|
categoriesView.currentIndex = pendingCurrent.index
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents.PageStack {
|
PlasmaComponents.PageStack {
|
||||||
id: main
|
id: main
|
||||||
|
Loading…
Reference in New Issue
Block a user