{
}
-void WidgetView::InitializeWidgets()
+bool WidgetView::InitializeWidgets()
{
auto self = Self();
char* instanceId = NULL;
if( ret < 0 || !instanceId )
{
DALI_LOG_ERROR("WidgetView::InitializeWidgets: widget_instance_create is failed [%s].\n", mWidgetId.c_str() );
- return;
+ return false;
}
DALI_LOG_RELEASE_INFO("WidgetView::InitializeWidgets: widget_instance_create is called. [widget id = %s, instance id = %s] [%p]\n",
mInstanceId = instanceId;
- SetUpdatePeriod();
+ if(!SetUpdatePeriod())
+ {
+ return false;
+ }
+
SetPreviewImage();
+ return true;
}
-void WidgetView::SetUpdatePeriod()
+bool WidgetView::SetUpdatePeriod()
{
// Set UpdatePeriod
if( mUpdatePeriod > 0.0f)
if( !instance )
{
DALI_LOG_ERROR("WidgetView::SetUpdatePeriod: widget_instance_get_instance is failed. [%s]\n", mInstanceId.c_str() );
- return;
+ return false;
}
int ret = widget_instance_set_period( instance, mUpdatePeriod );
if( ret < 0 )
{
DALI_LOG_ERROR("WidgetView::SetUpdatePeriod: widget_instance_set_period is failed [%s].\n", mWidgetId.c_str() );
- return;
+ return false;
}
}
+ return true;
}
void WidgetView::SetPreviewImage()
void WidgetView::OnInitialize()
{
- InitializeWidgets();
+ if(!InitializeWidgets())
+ {
+ DALI_LOG_ERROR("InitializeWidgets() is failed [%s].\n", mWidgetId.c_str() );
+ return;
+ }
+
InitializeLayout();
LaunchWidget();
InitializeEvents();
/**
* @brief Initilize Widget
*/
- void InitializeWidgets();
+ bool InitializeWidgets();
/**
* @brief Set the update period of widget
*/
- void SetUpdatePeriod();
+ bool SetUpdatePeriod();
/**
* @brief Set the preview image of widget