shell package partly working
This commit is contained in:
parent
4746d9074e
commit
8646393758
@ -319,8 +319,8 @@ CoronaPrivate::CoronaPrivate(Corona *corona)
|
||||
actions(corona)
|
||||
{
|
||||
//TODO: make Package path configurable
|
||||
package = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
|
||||
package.setPath("org.kde.homescreen.desktop");
|
||||
package = Plasma::PluginLoader::self()->loadPackage("Plasma/Shell");
|
||||
package.setPath("org.kde.desktop");
|
||||
|
||||
if (QCoreApplication::instance()) {
|
||||
configName = QCoreApplication::instance()->applicationName() + "-appletsrc";
|
||||
|
@ -114,7 +114,7 @@ void AppletInterface::init()
|
||||
}
|
||||
reason = i18n("Error loading QML file: %1", reason);
|
||||
|
||||
m_qmlObject->setSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("ui", "AppletError.qml")));
|
||||
m_qmlObject->setSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("appleterror")));
|
||||
m_qmlObject->completeInitialization();
|
||||
|
||||
|
||||
@ -515,7 +515,7 @@ void AppletInterface::geometryChanged(const QRectF &newGeometry, const QRectF &o
|
||||
return;
|
||||
}
|
||||
|
||||
m_compactUiObject = m_qmlObject->createObjectFromSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("ui", "CompactApplet.qml")));
|
||||
m_compactUiObject = m_qmlObject->createObjectFromSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("compactapplet")));
|
||||
|
||||
QObject *compactRepresentation = 0;
|
||||
|
||||
@ -526,7 +526,7 @@ void AppletInterface::geometryChanged(const QRectF &newGeometry, const QRectF &o
|
||||
if (compactComponent) {
|
||||
compactRepresentation = compactComponent->create(m_qmlObject->engine()->rootContext());
|
||||
} else {
|
||||
compactRepresentation = m_qmlObject->createObjectFromSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("ui", "DefaultCompactRepresentation.qml")));
|
||||
compactRepresentation = m_qmlObject->createObjectFromSource(QUrl::fromLocalFile(applet()->containment()->corona()->package().filePath("defaultcompactrepresentation")));
|
||||
}
|
||||
|
||||
if (compactRepresentation && compactComponent) {
|
||||
|
@ -127,7 +127,7 @@ QVariant ConfigModel::data(const QModelIndex& index, int role) const
|
||||
return m_categories.at(index.row())->icon();
|
||||
case SourceRole:
|
||||
if (m_appletInterface) {
|
||||
return QUrl::fromLocalFile(m_appletInterface.data()->applet()->package().filePath("ui", m_categories.at(index.row())->source()));
|
||||
return QUrl::fromLocalFile(m_appletInterface.data()->applet()->package().filePath("components", m_categories.at(index.row())->source()));
|
||||
} else {
|
||||
return m_categories.at(index.row())->source();
|
||||
}
|
||||
@ -146,7 +146,7 @@ QVariant ConfigModel::get(int row) const
|
||||
value["name"] = m_categories.at(row)->name();
|
||||
value["icon"] = m_categories.at(row)->icon();
|
||||
if (m_appletInterface) {
|
||||
value["source"] = QUrl::fromLocalFile(m_appletInterface.data()->applet()->package().filePath("ui", m_categories.at(row)->source()));
|
||||
value["source"] = QUrl::fromLocalFile(m_appletInterface.data()->applet()->package().filePath("components", m_categories.at(row)->source()));
|
||||
} else {
|
||||
value["source"] = m_categories.at(row)->source();
|
||||
}
|
||||
@ -272,7 +272,7 @@ ConfigView::ConfigView(AppletInterface *interface, QWindow *parent)
|
||||
|
||||
engine()->rootContext()->setContextProperty("plasmoid", interface);
|
||||
engine()->rootContext()->setContextProperty("configDialog", this);
|
||||
setSource(QUrl::fromLocalFile(m_appletInterface->applet()->containment()->corona()->package().filePath("ui", "Configuration.qml")));
|
||||
setSource(QUrl::fromLocalFile(m_appletInterface->applet()->containment()->corona()->package().filePath("configurationui")));
|
||||
}
|
||||
|
||||
ConfigView::~ConfigView()
|
||||
|
@ -136,7 +136,7 @@ void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
|
||||
|
||||
//if an appletGraphicObject is not set, we have to display some error message
|
||||
} else if (applet && contGraphicObject) {
|
||||
QObject *errorUi = qmlObject()->createObjectFromSource(QUrl::fromLocalFile(containment()->corona()->package().filePath("ui", "AppletError.qml")));
|
||||
QObject *errorUi = qmlObject()->createObjectFromSource(QUrl::fromLocalFile(containment()->corona()->package().filePath("appleterror")));
|
||||
|
||||
if (errorUi) {
|
||||
errorUi->setProperty("visible", false);
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include "panelview.h"
|
||||
#include "shellpluginloader.h"
|
||||
#include "view.h"
|
||||
|
||||
|
||||
@ -34,9 +33,6 @@ DesktopCorona::DesktopCorona(QObject *parent)
|
||||
: Plasma::Corona(parent),
|
||||
m_desktopWidget(QApplication::desktop())
|
||||
{
|
||||
m_pluginLoader = new ShellPluginLoader();
|
||||
Plasma::PluginLoader::setPluginLoader(m_pluginLoader);
|
||||
|
||||
connect(m_desktopWidget, SIGNAL(resized(int)),
|
||||
this, SLOT(screenResized(int)));
|
||||
connect(m_desktopWidget, SIGNAL(screenCountChanged(int)),
|
||||
|
@ -30,7 +30,6 @@ class View;
|
||||
namespace Plasma
|
||||
{
|
||||
class Applet;
|
||||
class PluginLoader;
|
||||
} // namespace Plasma
|
||||
|
||||
|
||||
@ -77,7 +76,6 @@ private:
|
||||
QDesktopWidget *m_desktopWidget;
|
||||
QList <View *> m_views;
|
||||
QHash<Plasma::Containment *, PanelView *> m_panelViews;
|
||||
Plasma::PluginLoader *m_pluginLoader;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -25,10 +25,11 @@
|
||||
#include <kcmdlineargs.h>
|
||||
#include <klocalizedstring.h>
|
||||
|
||||
|
||||
#include <Plasma/Containment>
|
||||
|
||||
#include "desktopcorona.h"
|
||||
#include <plasma/containment.h>
|
||||
#include "shellpluginloader.h"
|
||||
|
||||
|
||||
static const char description[] = "Plasma2 library tests";
|
||||
static const char version[] = "1.0";
|
||||
@ -46,7 +47,7 @@ int main(int argc, char** argv)
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
|
||||
Plasma::PluginLoader::setPluginLoader(new ShellPluginLoader);
|
||||
DesktopCorona *corona = new DesktopCorona();
|
||||
corona->loadLayout();
|
||||
if (corona->containments().isEmpty()) {
|
||||
|
@ -89,7 +89,7 @@ void PanelView::init()
|
||||
}
|
||||
|
||||
setResizeMode(View::SizeRootObjectToView);
|
||||
setSource(QUrl::fromLocalFile(corona()->package().filePath("ui", "PanelView.qml")));
|
||||
setSource(QUrl::fromLocalFile(corona()->package().filePath("views", "Panel.qml")));
|
||||
}
|
||||
|
||||
void PanelView::positionPanel()
|
||||
|
@ -1,5 +1,5 @@
|
||||
project(desktop_homescreen)
|
||||
|
||||
install(DIRECTORY . DESTINATION ${DATA_INSTALL_DIR}/plasma/packages/org.kde.homescreen.desktop PATTERN .svn EXCLUDE PATTERN CMakeLists.txt EXCLUDE PATTERN Messages.sh EXCLUDE)
|
||||
install(DIRECTORY . DESTINATION ${DATA_INSTALL_DIR}/plasma/shells/org.kde.desktop PATTERN .svn EXCLUDE PATTERN CMakeLists.txt EXCLUDE PATTERN Messages.sh EXCLUDE)
|
||||
|
||||
|
||||
|
@ -21,13 +21,12 @@ Name[uk]=Стільниця
|
||||
Name[x-test]=xxDesktopxx
|
||||
Type=Service
|
||||
|
||||
X-KDE-ServiceTypes=Plasma/GenericPackage
|
||||
X-KDE-ServiceTypes=Plasma/Shell
|
||||
X-KDE-ParentApp=
|
||||
X-KDE-PluginInfo-Author=Marco Martin
|
||||
X-KDE-PluginInfo-Category=
|
||||
X-KDE-PluginInfo-Email=mart@kde.org
|
||||
X-KDE-PluginInfo-License=GPLv2+
|
||||
X-KDE-PluginInfo-Name=org.kde.homescreen.desktop
|
||||
X-KDE-PluginInfo-Name=org.kde.desktop
|
||||
X-KDE-PluginInfo-Version=
|
||||
X-KDE-PluginInfo-Website=
|
||||
X-Plasma-MainScript=ui/main.qml
|
||||
|
@ -44,8 +44,9 @@ void ShellPackageStructure::initPackage(Plasma::Package *package)
|
||||
|
||||
package->addFileDefinition("appleterror", "components/AppletError.qml", i18n("Error message shown when an applet fails loading"));
|
||||
package->addFileDefinition("compactapplet", "components/CompactApplet.qml", i18n("QML component that shows an applet in a popup"));
|
||||
package->addFileDefinition("configurationui", "components/Configuration.qml", i18n("QML component for the configuratuion dialog"));
|
||||
package->addFileDefinition("defaultcompactrepresentation", "components/DefaultCompactRepresentation.qml", i18n("Compact representation of an applet when collapsed in a popup, for instance as an icon. applets can override this component."));
|
||||
package->addFileDefinition("widgetexplorer", "components/WidgetExplorer.qml", i18n("Widgets explorer ui"));
|
||||
package->addFileDefinition("widgetexplorer", "components/WidgetExplorer.qml", i18n("Widgets explorer UI"));
|
||||
|
||||
//package->setRequired("mainscript", true);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ void View::init()
|
||||
}
|
||||
|
||||
setResizeMode(View::SizeRootObjectToView);
|
||||
setSource(QUrl::fromLocalFile(m_corona->package().filePath("mainscript")));
|
||||
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Desktop.qml")));
|
||||
}
|
||||
|
||||
void View::setContainment(Plasma::Containment *cont)
|
||||
|
Loading…
Reference in New Issue
Block a user