TaskWidgetConfig::TaskWidgetConfig(InstallerContext& installContext) :
DPL::TaskDecl<TaskWidgetConfig>(this),
- WidgetInstallPopup(installContext),
m_installContext(installContext)
{
AddStep(&TaskWidgetConfig::StepProcessConfigurationFile);
AddStep(&TaskWidgetConfig::ProcessWidgetInstalledPath);
AddStep(&TaskWidgetConfig::StepVerifyFeatures);
AddStep(&TaskWidgetConfig::StepCheckMinVersionInfo);
-
- if (!GlobalSettings::TestModeEnabled() && !m_installContext.m_quiet) {
- AddStep(
- &TaskWidgetConfig::
- StepCancelWidgetInstallationAfterVerifyFeatures);
- AddStep(&TaskWidgetConfig::StepShowWidgetInfo);
- AddStep(&TaskWidgetConfig::StepCancelWidgetInstallation);
- AddStep(&TaskWidgetConfig::StepCancelWidgetInstallationAfterMinVersion);
- AddStep(&TaskWidgetConfig::StepDeletePopupWin);
- }
}
void TaskWidgetConfig::StepProcessConfigurationFile()
m_installContext.locations->getPackageInstallationDir());
}
-void TaskWidgetConfig::StepCancelWidgetInstallationAfterVerifyFeatures()
-{
- LogDebug("StepCancelWidgetInstallationAfterVerifyFeatures");
- if (InfoPopupButton::WRT_POPUP_BUTTON_CANCEL == m_installCancel) {
- m_installCancel = WRT_POPUP_BUTTON;
- destroyPopup();
- ThrowMsg(Exceptions::WidgetConfigFileInvalid, "Widget not allowed");
- }
-}
-
-void TaskWidgetConfig::StepCancelWidgetInstallation()
-{
- if (InfoPopupButton::WRT_POPUP_BUTTON_CANCEL == m_installCancel) {
- m_installCancel = WRT_POPUP_BUTTON;
- destroyPopup();
- ThrowMsg(Exceptions::NotAllowed, "Widget not allowed");
- }
-}
-
-void TaskWidgetConfig::StepCancelWidgetInstallationAfterMinVersion()
-{
- if (InfoPopupButton::WRT_POPUP_BUTTON_CANCEL == m_installCancel) {
- m_installCancel = WRT_POPUP_BUTTON;
- destroyPopup();
- ThrowMsg(Exceptions::NotAllowed, "WRT version incompatible.");
- }
-}
-
-void TaskWidgetConfig::createInstallPopup(PopupType type,
- const std::string &label)
-{
- m_installContext.job->Pause();
- if (m_popup) {
- destroyPopup();
- }
-
- bool ret = createPopup();
- if (ret) {
- loadPopup(type, label);
- showPopup();
- }
-}
-
-void TaskWidgetConfig::StepDeletePopupWin()
-{
- destroyPopup();
-}
-
-void TaskWidgetConfig::StepShowWidgetInfo()
-{
- if (!m_popupData.widgetInfo.empty()) {
- std::string label = DPL::ToUTF8String(m_popupData.widgetInfo);
- createInstallPopup(PopupType::WIDGET_FEATURE_INFO, label);
- m_installContext.job->UpdateProgress(
- InstallerContext::INSTALL_WIDGET_CONFIG2,
- "Show Widget Info Finished");
- }
-}
-
void TaskWidgetConfig::StepCheckMinVersionInfo()
{
if (!isMinVersionCompatible(
m_installContext.widgetConfig.webAppType.appType,
m_installContext.widgetConfig.minVersion))
{
- if (!GlobalSettings::TestModeEnabled() && !m_installContext.m_quiet) {
- LogDebug("Platform version to low - launching");
- std::string label = WIDGET_NOT_COMPATIBLE + QUESTION;
- createInstallPopup(PopupType::WIDGET_MIN_VERSION, label);
- } else {
- LogError(
- "Platform version lower than required -> cancelling installation");
- ThrowMsg(Exceptions::NotAllowed,
- "Platform version does not meet requirements");
- }
+ LogError(
+ "Platform version lower than required -> cancelling installation");
+ ThrowMsg(Exceptions::NotAllowed,
+ "Platform version does not meet requirements");
}
m_installContext.job->UpdateProgress(