add generic script package support for included translations
svn path=/trunk/KDE/kdelibs/; revision=962208
This commit is contained in:
parent
b8e1aab84d
commit
20f309487d
@ -2193,6 +2193,13 @@ void AppletPrivate::setupScriptSupport()
|
|||||||
<< "which is a" << package->structure()->type() << "package"
|
<< "which is a" << package->structure()->type() << "package"
|
||||||
<< ", main script is" << package->filePath("mainscript");
|
<< ", 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");
|
QString xmlPath = package->filePath("mainconfigxml");
|
||||||
if (!xmlPath.isEmpty()) {
|
if (!xmlPath.isEmpty()) {
|
||||||
QFile file(xmlPath);
|
QFile file(xmlPath);
|
||||||
@ -2210,9 +2217,9 @@ void AppletPrivate::setupScriptSupport()
|
|||||||
if (size.isEmpty()) {
|
if (size.isEmpty()) {
|
||||||
size = QSize(200,200);
|
size = QSize(200,200);
|
||||||
}
|
}
|
||||||
|
|
||||||
//kDebug() << "size" << size;
|
//kDebug() << "size" << size;
|
||||||
q->resize(size);
|
q->resize(size);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AppletPrivate::globalName() const
|
QString AppletPrivate::globalName() const
|
||||||
|
@ -58,6 +58,8 @@ PlasmoidPackage::PlasmoidPackage(QObject *parent)
|
|||||||
mimetypes << "text/*";
|
mimetypes << "text/*";
|
||||||
setMimetypes("scripts", mimetypes);
|
setMimetypes("scripts", mimetypes);
|
||||||
|
|
||||||
|
addDirectoryDefinition("translations", "locale", i18n("Translations"));
|
||||||
|
|
||||||
addFileDefinition("mainconfigui", "ui/config.ui", i18n("Main Config UI File"));
|
addFileDefinition("mainconfigui", "ui/config.ui", i18n("Main Config UI File"));
|
||||||
addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
|
addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
|
||||||
addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
addFileDefinition("mainscript", "code/main", i18n("Main Script File"));
|
||||||
|
Loading…
Reference in New Issue
Block a user