* @param window
* @param callbacks passed to viewLogic
*/
- virtual void PrepareView(const std::string &startUrl,
+ virtual bool PrepareView(const std::string &startUrl,
Evas_Object *window) = 0;
/**
* Shows widget asynchronously. Callback will be called when
}
}
-void RunnableWidgetObject::PrepareView(const std::string &startUrl,
+bool RunnableWidgetObject::PrepareView(const std::string &startUrl,
Evas_Object *window)
{
State::StateChange change = m_guardstate->allowPrepareView();
Assert(window);
ADD_PROFILING_POINT("view_logic_init", "start");
- m_view->createWebView(m_ewkContext, window);
+ if(!m_view->createWebView(m_ewkContext, window))
+ {
+ return false;
+ }
m_view->initialize();
m_view->prepareView(m_widgetModel.get(), startUrl);
ADD_PROFILING_POINT("view_logic_init", "stop");
change.commit();
+ return true;
}
void RunnableWidgetObject::Show()
virtual ~RunnableWidgetObject();
bool CheckBeforeLaunch();
- void PrepareView(const std::string &startUrl,
+ bool PrepareView(const std::string &startUrl,
Evas_Object *window);
void Show(); //asynchronous function
void Hide();
class IViewModule
{
public:
- virtual void createWebView(Ewk_Context* context,
+ virtual bool createWebView(Ewk_Context* context,
Evas_Object* window) = 0;
virtual void destroyWebView() = 0;
virtual void initialize() = 0;
detachFromCustomHandlersDao();
}
-void ViewLogic::createWebView(Ewk_Context* context,
+bool ViewLogic::createWebView(Ewk_Context* context,
Evas_Object* window)
{
LogDebug("");
Assert(NULL != m_ewkContext);
Assert(window);
m_window = window;
- createEwkView(evas_object_evas_get(m_window));
+ if(!createEwkView(evas_object_evas_get(m_window)))
+ {
+ return false;
+ }
+ return true;
}
void ViewLogic::destroyWebView()
}
}
-void ViewLogic::createEwkView(Evas* canvas)
+bool ViewLogic::createEwkView(Evas* canvas)
{
LogDebug("createEwkVeiw");
Assert(canvas);
ADD_PROFILING_POINT("ewk_view_add_with_context", "stop");
if (!newEwkView) {
- LogError("WKView creation failed");
- Assert(false);
+ LogError("View creation failed");
+ Wrt::Popup::PopupInvoker().showInfo(
+ "Info", "View creation failed","close");
+ return false;
}
// set cookie policy
LogInfo("push webview: " << newEwkView);
m_ewkViewList.push_back(newEwkView);
m_currentEwkView = newEwkView;
+ return true;
}
void ViewLogic::setStartPage()
ViewLogic();
virtual ~ViewLogic();
- void createWebView(Ewk_Context* context,
+ bool createWebView(Ewk_Context* context,
Evas_Object* window);
void destroyWebView();
void initialize();
// EwkView operations
void ewkClientInit(Evas_Object *wkView);
void ewkClientDeinit(Evas_Object *wkView);
- void createEwkView(Evas* canvas);
+ bool createEwkView(Evas* canvas);
void setStartPage();
void prepareEwkView(Evas_Object *wkView);
void removeEwkView(Evas_Object *wkView);
}
ADD_PROFILING_POINT("Create splash screen", "stop");
DPL::OptionalString startUrl = W3CFileLocalization::getStartFile(m_dao);
- m_widget->PrepareView(DPL::ToUTF8String(*startUrl),
- m_windowData->m_win);
+ if (!m_widget->PrepareView(DPL::ToUTF8String(*startUrl),
+ m_windowData->m_win))
+ {
+ DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
+ NextStepEvent());
+ return;
+ }
//you can't show window with splash screen before PrepareView
//ewk_view_add_with_context() in viewLogic breaks window
void WrtClient::shutdownStep()
{
LogDebug("Closing Wrt connection ...");
- if (m_initialized && m_widget) {
+
+ if (m_widget && m_widgetState)
+ {
m_widgetState = WidgetState_Stopped;
m_widget->Hide();
m_widget.reset();
- m_windowData.reset();
WRT::CoreModuleSingleton::Instance().Terminate();
+ }
+ if (m_initialized)
+ {
m_initialized = false;
}
+ m_windowData.reset();
Quit();
}