2007-07-20 05:16:40 +02:00
|
|
|
/******************************************************************************
|
2007-08-06 13:20:02 +02:00
|
|
|
* Copyright 2007 by Aaron Seigo <aseigo@kde.org> *
|
2007-07-20 05:16:40 +02:00
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
*******************************************************************************/
|
|
|
|
|
2007-07-20 05:19:17 +02:00
|
|
|
#include "packages_p.h"
|
2007-07-20 05:16:40 +02:00
|
|
|
|
2008-07-03 07:45:07 +02:00
|
|
|
#include <KConfigGroup>
|
|
|
|
#include <KDesktopFile>
|
2007-07-20 10:06:27 +02:00
|
|
|
#include <KLocale>
|
|
|
|
|
2007-07-20 05:16:40 +02:00
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
2008-02-26 05:07:07 +01:00
|
|
|
PlasmoidPackage::PlasmoidPackage(QObject *parent)
|
|
|
|
: Plasma::PackageStructure(parent, QString("Plasmoid"))
|
2007-07-20 05:16:40 +02:00
|
|
|
{
|
|
|
|
addDirectoryDefinition("images", "images", i18n("Images"));
|
|
|
|
QStringList mimetypes;
|
|
|
|
mimetypes << "image/svg+xml" << "image/png" << "image/jpeg";
|
|
|
|
setMimetypes("images", mimetypes);
|
|
|
|
|
2007-12-06 20:45:57 +01:00
|
|
|
addDirectoryDefinition("config", "config/", i18n("Configuration Definitions"));
|
2007-07-20 05:16:40 +02:00
|
|
|
mimetypes.clear();
|
|
|
|
mimetypes << "text/xml";
|
|
|
|
setMimetypes("config", mimetypes);
|
|
|
|
setMimetypes("configui", mimetypes);
|
|
|
|
|
2007-12-06 20:45:57 +01:00
|
|
|
addDirectoryDefinition("ui", "ui", i18n("Executable Scripts"));
|
|
|
|
setMimetypes("ui", mimetypes);
|
|
|
|
|
2007-07-20 05:16:40 +02:00
|
|
|
addDirectoryDefinition("scripts", "code", i18n("Executable Scripts"));
|
|
|
|
mimetypes.clear();
|
|
|
|
mimetypes << "text/*";
|
|
|
|
setMimetypes("scripts", mimetypes);
|
|
|
|
|
2007-12-06 20:45:57 +01:00
|
|
|
addFileDefinition("mainconfiggui", "ui/config.ui", i18n("Main Config UI File"));
|
|
|
|
addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
|
2007-07-20 05:16:40 +02:00
|
|
|
addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
|
|
|
setRequired("mainscript", true);
|
|
|
|
}
|
|
|
|
|
2008-07-03 07:45:07 +02:00
|
|
|
void PlasmoidPackage::pathChanged()
|
|
|
|
{
|
|
|
|
KDesktopFile config(path() + "/metadata.desktop");
|
|
|
|
KConfigGroup cg = config.desktopGroup();
|
|
|
|
QString mainScript = cg.readEntry("X-Plasma-MainScript", QString());
|
|
|
|
if (!mainScript.isEmpty()) {
|
|
|
|
addFileDefinition("mainscript", mainScript, i18n("Main Script File"));
|
|
|
|
setRequired("mainscript", true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-26 05:07:07 +01:00
|
|
|
ThemePackage::ThemePackage(QObject *parent)
|
|
|
|
: Plasma::PackageStructure(parent, QString("Plasma Theme"))
|
2007-07-20 05:16:40 +02:00
|
|
|
{
|
2007-11-05 00:07:52 +01:00
|
|
|
addDirectoryDefinition("dialogs", "dialogs/", i18n("Images for dialogs"));
|
2007-07-20 05:16:40 +02:00
|
|
|
addFileDefinition("dialogs/background", "dialogs/background.svg",
|
|
|
|
i18n("Generic dialog background"));
|
2007-12-30 19:45:15 +01:00
|
|
|
addFileDefinition("dialogs/shutdowndialog", "dialogs/shutdowndialog.svg",
|
2008-04-21 23:20:03 +02:00
|
|
|
i18n("Theme for the logout dialog"));
|
2007-07-20 05:16:40 +02:00
|
|
|
|
2008-07-11 21:38:47 +02:00
|
|
|
addDirectoryDefinition("wallpapers", "wallpapers/", "Wallpaper packages");
|
2008-06-28 22:13:28 +02:00
|
|
|
|
2007-11-05 00:07:52 +01:00
|
|
|
addDirectoryDefinition("widgets", "widgets/", i18n("Images for widgets"));
|
2007-07-20 05:16:40 +02:00
|
|
|
addFileDefinition("widgets/background", "widgets/background.svg",
|
|
|
|
i18n("Background image for plasmoids"));
|
|
|
|
addFileDefinition("widgets/clock", "widgets/clock.svg",
|
|
|
|
i18n("Analog clock face"));
|
2007-12-06 20:45:57 +01:00
|
|
|
addFileDefinition("widgets/panel-background", "widgets/panel-background.svg",
|
2008-02-13 02:39:06 +01:00
|
|
|
i18n("Background image for panels"));
|
2007-07-20 05:16:40 +02:00
|
|
|
addFileDefinition("widgets/plot-background", "widgets/plot-background.svg",
|
|
|
|
i18n("Background for graphing widgets"));
|
2008-02-13 02:39:06 +01:00
|
|
|
addFileDefinition("widgets/tooltip", "widgets/tooltip.svg",
|
|
|
|
i18n("Background image for tooltips"));
|
|
|
|
|
|
|
|
addDirectoryDefinition("opaque/dialogs", "opaque/dialogs/", i18n("Opaque images for dialogs"));
|
|
|
|
addFileDefinition("opaque/dialogs/background", "opaque/dialogs/background.svg",
|
|
|
|
i18n("Opaque generic dialog background"));
|
|
|
|
addFileDefinition("opaque/dialogs/shutdowndialog", "opaque/dialogs/shutdowndialog.svg",
|
2008-04-21 23:20:03 +02:00
|
|
|
i18n("Opaque theme for the logout dialog"));
|
2008-02-13 02:39:06 +01:00
|
|
|
|
|
|
|
addDirectoryDefinition("opaque/widgets", "opaque/widgets/", i18n("Opaque images for widgets"));
|
|
|
|
addFileDefinition("opaque/widgets/panel-background", "opaque/widgets/panel-background.svg",
|
|
|
|
i18n("Opaque background image for panels"));
|
|
|
|
addFileDefinition("opaque/widgets/tooltip", "opaque/widgets/tooltip.svg",
|
|
|
|
i18n("Opaque background image for tooltips"));
|
|
|
|
|
|
|
|
addDirectoryDefinition("locolor/dialogs", "locolor/dialogs/", i18n("Low color images for dialogs"));
|
|
|
|
addFileDefinition("locolor/dialogs/background", "locolor/dialogs/background.svg",
|
|
|
|
i18n("Low color generic dialog background"));
|
|
|
|
addFileDefinition("locolor/dialogs/shutdowndialog", "locolor/dialogs/shutdowndialog.svg",
|
2008-04-21 23:20:03 +02:00
|
|
|
i18n("Low color theme for the logout dialog"));
|
2008-02-13 02:39:06 +01:00
|
|
|
|
|
|
|
addDirectoryDefinition("locolor/widgets", "locolor/widgets/", i18n("Images for widgets"));
|
|
|
|
addFileDefinition("locolor/widgets/background", "locolor/widgets/background.svg",
|
|
|
|
i18n("Low color background image for plasmoids"));
|
|
|
|
addFileDefinition("locolor/widgets/clock", "locolor/widgets/clock.svg",
|
|
|
|
i18n("Low color analog clock face"));
|
|
|
|
addFileDefinition("locolor/widgets/panel-background", "locolor/widgets/panel-background.svg",
|
|
|
|
i18n("Low color background image for panels"));
|
|
|
|
addFileDefinition("locolor/widgets/plot-background", "locolor/widgets/plot-background.svg",
|
|
|
|
i18n("Low color background for graphing widgets"));
|
|
|
|
addFileDefinition("locolor/widgets/tooltip", "locolor/widgets/tooltip.svg",
|
|
|
|
i18n("Low color background image for tooltips"));
|
2007-11-05 00:07:52 +01:00
|
|
|
|
|
|
|
addFileDefinition("colors", "colors", i18n("KColorScheme configuration file"));
|
2007-07-20 05:16:40 +02:00
|
|
|
|
|
|
|
QStringList mimetypes;
|
|
|
|
mimetypes << "image/svg+xml";
|
|
|
|
setDefaultMimetypes(mimetypes);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Plasma
|
|
|
|
|
2008-02-26 05:07:07 +01:00
|
|
|
#include "packages_p.moc"
|
2007-07-20 05:16:40 +02:00
|
|
|
|