setWidgetOtherInfo(uiApp);
setAppServiceInfo(uiApp);
setAppCategory(uiApp);
+ setLiveBoxInfo(manifest);
manifest.addUiApplication(uiApp);
manifest.generate(path);
{
LogWarning("No manifest file found: " << manifest_file);
}
+}
+
+void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
+{
+
+ FOREACH(it, m_context.widgetConfig.configInfo.m_livebox) {
+
+ LogInfo("setLiveBoxInfo");
+ LiveBoxInfo liveBox;
+ DPL::String pkgname;
+ DPL::Optional<WrtDB::ConfigParserData::LiveboxInfo> ConfigInfo = *it;
+
+ if(!!m_context.widgetConfig.pkgname)
+ {
+ pkgname =
+ *m_context.widgetConfig.pkgname+DPL::String(L".")
+ +ConfigInfo->m_appId;
+ liveBox.setAppid(pkgname);
+ }
+
+ if(ConfigInfo->m_autoLaunch !=L"") {
+ liveBox.setAutoLaunch(ConfigInfo->m_autoLaunch);
+ }
+
+ if(ConfigInfo->m_period !=L"")
+ liveBox.setPeriod(ConfigInfo->m_period);
+
+ if(ConfigInfo->m_network !=L"")
+ liveBox.setNetwork(ConfigInfo->m_network);
+
+ if(ConfigInfo->m_nodisplay !=L"")
+ liveBox.setNodisplay(ConfigInfo->m_nodisplay);
+
+ if(ConfigInfo->m_primary !=L"")
+ liveBox.setPrimary(ConfigInfo->m_primary);
+
+ if(ConfigInfo->m_timeout !=L"")
+ liveBox.setTimeout(ConfigInfo->m_timeout);
+
+ if(ConfigInfo->m_label !=L"")
+ liveBox.setLabel(ConfigInfo->m_label);
+
+ DPL::String defaultLocale
+ = DPL::FromUTF8String(m_context.locations->getPackageInstallationDir())
+ + DPL::String(L"/res/wgt/");
+
+ if(ConfigInfo->m_icon!=L"") {
+ liveBox.setIcon(defaultLocale+ConfigInfo->m_icon);
+ }
+
+ if (ConfigInfo->m_boxInfo.m_boxSrc.empty() || ConfigInfo->m_boxInfo.m_boxSize.empty()) {
+ LogInfo("Widget doesn't contain box");
+ return;
+ } else {
+ BoxInfoType box;
+ if (!ConfigInfo->m_boxInfo.m_boxSrc.empty()) {
+ if((std::string::npos != ConfigInfo->m_boxInfo.m_boxSrc.find(L"http"))
+ || (std::string::npos != ConfigInfo->m_boxInfo.m_boxSrc.find(L"https")))
+ box.boxSrc = ConfigInfo->m_boxInfo.m_boxSrc;
+ else
+ box.boxSrc = defaultLocale + ConfigInfo->m_boxInfo.m_boxSrc;
+ }
+
+ std::list<std::pair<DPL::String,DPL::String>> BoxSizeList
+ = ConfigInfo->m_boxInfo.m_boxSize;
+ FOREACH(im, BoxSizeList) {
+ std::pair<DPL::String, DPL::String> boxSize = *im;
+ if(!boxSize.second.empty())
+ boxSize.second = defaultLocale + boxSize.second;
+ box.boxSize.push_back(boxSize);
+ }
+
+ if (!ConfigInfo->m_boxInfo.m_pdSrc.empty()
+ && !ConfigInfo->m_boxInfo.m_pdWidth.empty()
+ && !ConfigInfo->m_boxInfo.m_pdHeight.empty()) {
+ box.pdSrc = defaultLocale + ConfigInfo->m_boxInfo.m_pdSrc;
+ box.pdWidth = ConfigInfo->m_boxInfo.m_pdWidth;
+ box.pdHeight = ConfigInfo->m_boxInfo.m_pdHeight;
+ }
+
+ liveBox.setBox(box);
+ }
+
+ manifest.addLivebox(liveBox);
+ }
}