move ShellPackage in libplasma
the shell plugin loader only has the look and feel package now
This commit is contained in:
parent
b32a42c8e8
commit
03b812ea06
@ -452,6 +452,8 @@ Package PluginLoader::loadPackage(const QString &packageFormat, const QString &s
|
||||
structure = new ThemePackage();
|
||||
} else if (packageFormat.endsWith("/ContainmentActions")) {
|
||||
structure = new ContainmentActionsPackage();
|
||||
} else if (packageFormat.endsWith("/Shell")) {
|
||||
structure = new ShellPackage();
|
||||
} else if (packageFormat.endsWith("/Generic")) {
|
||||
structure = new GenericPackage();
|
||||
}
|
||||
|
@ -257,5 +257,43 @@ void ContainmentActionsPackage::initPackage(Package *package)
|
||||
package->setDefaultPackageRoot("plasma/containmentactions/");
|
||||
}
|
||||
|
||||
void ShellPackage::initPackage(Plasma::Package *package)
|
||||
{
|
||||
package->setDefaultPackageRoot("plasma/shells/");
|
||||
|
||||
//Directories
|
||||
package->addDirectoryDefinition("applet", "applet", i18n("Applets furniture"));
|
||||
package->addDirectoryDefinition("configuration", "configuration", i18n("Applets furniture"));
|
||||
package->addDirectoryDefinition("explorer", "explorer", i18n("Explorer UI for adding widgets"));
|
||||
package->addDirectoryDefinition("views", "views", i18n("User interface for the views that will show containments"));
|
||||
|
||||
package->setMimeTypes("applet", QStringList() << "text/x-qml");
|
||||
package->setMimeTypes("configuration", QStringList() << "text/x-qml");
|
||||
package->setMimeTypes("views", QStringList() << "text/x-qml");
|
||||
|
||||
//Files
|
||||
//Default layout
|
||||
package->addFileDefinition("defaultlayout", "layout.js", i18n("Default layout file"));
|
||||
package->addFileDefinition("defaults", "defaults", i18n("Default plugins for containments, containmentActions etc"));
|
||||
package->setMimeTypes("defaultlayout", QStringList() << "application/javascript");
|
||||
package->setMimeTypes("defaults", QStringList() << "text/plain");
|
||||
|
||||
//Applet furniture
|
||||
package->addFileDefinition("appleterror", "applet/AppletError.qml", i18n("Error message shown when an applet fails to load"));
|
||||
package->addFileDefinition("compactapplet", "applet/CompactApplet.qml", i18n("QML component that shows an applet in a popup"));
|
||||
package->addFileDefinition("defaultcompactrepresentation", "applet/DefaultCompactRepresentation.qml", i18n("Compact representation of an applet when collapsed in a popup, for instance as an icon. applets can override this component."));
|
||||
|
||||
//Configuration
|
||||
package->addFileDefinition("appletconfigurationui", "configuration/AppletConfiguration.qml", i18n("QML component for the configuration dialog for applets"));
|
||||
package->addFileDefinition("containmentconfigurationui", "configuration/ContainmentConfiguration.qml", i18n("QML component for the configuration dialog for containments"));
|
||||
package->addFileDefinition("panelconfigurationui", "configuration/PanelConfiguration.qml", i18n("Panel configuration UI"));
|
||||
|
||||
//Widget explorer
|
||||
package->addFileDefinition("widgetexplorer", "explorer/WidgetExplorer.qml", i18n("Widgets explorer UI"));
|
||||
|
||||
|
||||
//package->setRequired("mainscript", true);
|
||||
}
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
|
@ -78,6 +78,13 @@ public:
|
||||
void initPackage(Package *package);
|
||||
};
|
||||
|
||||
class ShellPackage: public Plasma::PackageStructure
|
||||
{
|
||||
public:
|
||||
void initPackage(Plasma::Package *package);
|
||||
};
|
||||
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
#endif // LIBS_PLASMA_PACKAGES_P_H
|
||||
|
@ -70,7 +70,6 @@ add_executable(plasma-shell
|
||||
panelshadows.cpp
|
||||
panelview.cpp
|
||||
shellpluginloader.cpp
|
||||
shellpackage.cpp
|
||||
shellmanager.cpp
|
||||
lookandfeelpackage.cpp
|
||||
view.cpp
|
||||
|
@ -1,65 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2007-2009 by Aaron Seigo <aseigo@kde.org> *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public License *
|
||||
* along with this library; see the file COPYING.LIB. If not, write to *
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
|
||||
* Boston, MA 02110-1301, USA. *
|
||||
*******************************************************************************/
|
||||
|
||||
#include "shellpackage.h"
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <Plasma/Package>
|
||||
|
||||
|
||||
void ShellPackageStructure::initPackage(Plasma::Package *package)
|
||||
{
|
||||
package->setDefaultPackageRoot("plasma/shells/");
|
||||
|
||||
//Directories
|
||||
package->addDirectoryDefinition("applet", "applet", i18n("Applets furniture"));
|
||||
package->addDirectoryDefinition("configuration", "configuration", i18n("Applets furniture"));
|
||||
package->addDirectoryDefinition("explorer", "explorer", i18n("Explorer UI for adding widgets"));
|
||||
package->addDirectoryDefinition("views", "views", i18n("User interface for the views that will show containments"));
|
||||
|
||||
package->setMimeTypes("applet", QStringList() << "text/x-qml");
|
||||
package->setMimeTypes("configuration", QStringList() << "text/x-qml");
|
||||
package->setMimeTypes("views", QStringList() << "text/x-qml");
|
||||
|
||||
//Files
|
||||
//Default layout
|
||||
package->addFileDefinition("defaultlayout", "layout.js", i18n("Default layout file"));
|
||||
package->addFileDefinition("defaults", "defaults", i18n("Default plugins for containments, containmentActions etc"));
|
||||
package->setMimeTypes("defaultlayout", QStringList() << "application/javascript");
|
||||
package->setMimeTypes("defaults", QStringList() << "text/plain");
|
||||
|
||||
//Applet furniture
|
||||
package->addFileDefinition("appleterror", "applet/AppletError.qml", i18n("Error message shown when an applet fails to load"));
|
||||
package->addFileDefinition("compactapplet", "applet/CompactApplet.qml", i18n("QML component that shows an applet in a popup"));
|
||||
package->addFileDefinition("defaultcompactrepresentation", "applet/DefaultCompactRepresentation.qml", i18n("Compact representation of an applet when collapsed in a popup, for instance as an icon. applets can override this component."));
|
||||
|
||||
//Configuration
|
||||
package->addFileDefinition("appletconfigurationui", "configuration/AppletConfiguration.qml", i18n("QML component for the configuration dialog for applets"));
|
||||
package->addFileDefinition("containmentconfigurationui", "configuration/ContainmentConfiguration.qml", i18n("QML component for the configuration dialog for containments"));
|
||||
package->addFileDefinition("panelconfigurationui", "configuration/PanelConfiguration.qml", i18n("Panel configuration UI"));
|
||||
|
||||
//Widget explorer
|
||||
package->addFileDefinition("widgetexplorer", "explorer/WidgetExplorer.qml", i18n("Widgets explorer UI"));
|
||||
|
||||
|
||||
//package->setRequired("mainscript", true);
|
||||
}
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2007 by Aaron Seigo <aseigo@kde.org> *
|
||||
* Copyright 2013 by Marco Martin <mart@kde.org> *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public License *
|
||||
* along with this library; see the file COPYING.LIB. If not, write to *
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
|
||||
* Boston, MA 02110-1301, USA. *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef SHELLPACKAGE_H
|
||||
#define SHELLPACKAGE_H
|
||||
|
||||
#include <Plasma/PackageStructure>
|
||||
#include <Plasma/Plasma>
|
||||
|
||||
|
||||
|
||||
class ShellPackageStructure : public Plasma::PackageStructure
|
||||
{
|
||||
public:
|
||||
void initPackage(Plasma::Package *package);
|
||||
};
|
||||
|
||||
|
||||
#endif // SHELLPACKAGE_H
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "shellpluginloader.h"
|
||||
#include "shellpackage.h"
|
||||
#include "lookandfeelpackage.h"
|
||||
|
||||
|
||||
ShellPluginLoader::ShellPluginLoader()
|
||||
@ -34,8 +34,8 @@ Plasma::Package ShellPluginLoader::internalLoadPackage(const QString &packageFor
|
||||
{
|
||||
Q_UNUSED(specialization)
|
||||
|
||||
if (packageFormat.endsWith("/Shell")) {
|
||||
Plasma::PackageStructure *structure = new ShellPackageStructure();
|
||||
if (packageFormat.endsWith("/LookAndFeel")) {
|
||||
Plasma::PackageStructure *structure = new LookAndFeelPackageStructure();
|
||||
return Plasma::Package(structure);
|
||||
} else {
|
||||
return Plasma::Package();
|
||||
|
Loading…
Reference in New Issue
Block a user