add generic script package support for included translations

svn path=/trunk/KDE/kdelibs/; revision=962208
This commit is contained in:
Aaron J. Seigo 2009-05-01 18:31:14 +00:00
parent b8e1aab84d
commit 20f309487d
2 changed files with 10 additions and 1 deletions

View File

@ -2193,6 +2193,13 @@ void AppletPrivate::setupScriptSupport()
<< "which is a" << package->structure()->type() << "package"
<< ", main script is" << package->filePath("mainscript");
QString translationsPath = package->filePath("translations");
if (!translationsPath.isEmpty()) {
//FIXME: we should _probably_ use a KComponentData to segregate the applets
// from each other; but I want to get the basics working first :)
KGlobal::dirs()->addResourceDir("locale", translationsPath);
}
QString xmlPath = package->filePath("mainconfigxml");
if (!xmlPath.isEmpty()) {
QFile file(xmlPath);
@ -2210,9 +2217,9 @@ void AppletPrivate::setupScriptSupport()
if (size.isEmpty()) {
size = QSize(200,200);
}
//kDebug() << "size" << size;
q->resize(size);
}
QString AppletPrivate::globalName() const

View File

@ -58,6 +58,8 @@ PlasmoidPackage::PlasmoidPackage(QObject *parent)
mimetypes << "text/*";
setMimetypes("scripts", mimetypes);
addDirectoryDefinition("translations", "locale", i18n("Translations"));
addFileDefinition("mainconfigui", "ui/config.ui", i18n("Main Config UI File"));
addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
addFileDefinition("mainscript", "code/main", i18n("Main Script File"));