|
|
|
@ -54,6 +54,7 @@ NowDockCorona::NowDockCorona(QObject *parent)
|
|
|
|
|
|
|
|
|
|
setKPackage(package);
|
|
|
|
|
qmlRegisterTypes();
|
|
|
|
|
|
|
|
|
|
connect(this, &Corona::containmentAdded, this, &NowDockCorona::addDock);
|
|
|
|
|
|
|
|
|
|
loadLayout();
|
|
|
|
@ -156,6 +157,12 @@ void NowDockCorona::addDock(Plasma::Containment *containment)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (NowDockView *dock, m_containments) {
|
|
|
|
|
if (dock->containment() == containment) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qWarning() << "Adding dock for container...";
|
|
|
|
|
|
|
|
|
|
auto dockView = new NowDockView(this);
|
|
|
|
@ -176,6 +183,7 @@ void NowDockCorona::loadDefaultLayout()
|
|
|
|
|
|
|
|
|
|
QVariantList args;
|
|
|
|
|
auto defaultContainment = createContainmentDelayed("org.kde.latte.containment", args);
|
|
|
|
|
//auto defaultContainment = createContainment("org.kde.latte.containment");
|
|
|
|
|
//auto defaultContainment = createContainmentDelayed("org.kde.panel", args);
|
|
|
|
|
defaultContainment->setContainmentType(Plasma::Types::PanelContainment);
|
|
|
|
|
defaultContainment->init();
|
|
|
|
@ -184,12 +192,9 @@ void NowDockCorona::loadDefaultLayout()
|
|
|
|
|
qWarning() << "the requested containment plugin can not be located or loaded";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto config = defaultContainment->config();
|
|
|
|
|
|
|
|
|
|
config.writeEntry("dock", "initial");
|
|
|
|
|
// config.writeEntry("alignment", (int)Dock::Center);
|
|
|
|
|
// config.deleteEntry("wallpaperplugin");
|
|
|
|
|
defaultContainment->restore(config);
|
|
|
|
|
|
|
|
|
|
switch (containments().size()) {
|
|
|
|
|
case 1:
|
|
|
|
@ -209,9 +214,17 @@ void NowDockCorona::loadDefaultLayout()
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto cfg = defaultContainment->config();
|
|
|
|
|
defaultContainment->save(cfg);
|
|
|
|
|
|
|
|
|
|
//config.writeEntry("dock", "initial");
|
|
|
|
|
//config.writeEntry("alignment", (int)Dock::Center);
|
|
|
|
|
//config.deleteEntry("wallpaperplugin");
|
|
|
|
|
|
|
|
|
|
defaultContainment->updateConstraints(Plasma::Types::StartupCompletedConstraint);
|
|
|
|
|
defaultContainment->save(config);
|
|
|
|
|
requestConfigSync();
|
|
|
|
|
defaultContainment->flushPendingConstraintsEvents();
|
|
|
|
|
emit containmentAdded(defaultContainment);
|
|
|
|
|
emit containmentCreated(defaultContainment);
|
|
|
|
|
|
|
|
|
|
addDock(defaultContainment);
|
|
|
|
|
|
|
|
|
|
defaultContainment->createApplet(QStringLiteral("org.kde.store.nowdock.plasmoid"));
|
|
|
|
|