Added WIDGET_INSTANCE_EVENT_CREATE_ABORTED 78/148778/1 submit/tizen_3.0/20170911.004826
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Fri, 8 Sep 2017 08:44:01 +0000 (17:44 +0900)
committerSemun Lee <semun.lee@samsung.com>
Mon, 11 Sep 2017 00:44:51 +0000 (09:44 +0900)
Change-Id: Ie1580b292f9a275be8456991383b63ccd2b0764b

widget_viewer_dali/internal/widget_view/widget_view_impl.cpp
widget_viewer_dali/internal/widget_view/widget_view_impl.h

index 1b69ef0bc7c4cb8f67c7d4b7198f7a6e688e5c99..a89d00e017f62a0f4c54e3f2545871fe76bc3d0d 100644 (file)
@@ -200,7 +200,8 @@ WidgetView::WidgetView()
   mRetryState( false ),
   mPermanentDelete( false ),
   mWatcherHandle( NULL ),
-  mRemoteSurface( NULL )
+  mRemoteSurface( NULL ),
+  mAborted( false )
 {
 }
 
@@ -222,7 +223,8 @@ WidgetView::WidgetView( const std::string& widgetId, const std::string& contentI
   mRetryState( false ),
   mPermanentDelete( false ),
   mWatcherHandle( NULL ),
-  mRemoteSurface( NULL )
+  mRemoteSurface( NULL ),
+  mAborted( false )
 {
 }
 
@@ -350,7 +352,7 @@ void WidgetView::SetLoadingTextVisible( bool visible )
 
     if( visible )
     {
-      mLoadingText.SetProperty( Toolkit::TextLabel::Property::TEXT, 
+      mLoadingText.SetProperty( Toolkit::TextLabel::Property::TEXT,
                                 ( mLoadingTextString.empty() )? GET_LOCALE_TEXT( "IDS_ST_POP_LOADING_ING" ) : mLoadingTextString );
     }
     mLoadingText.SetVisible( visible );
@@ -384,7 +386,7 @@ bool WidgetView::IsRetryTextVisible()
 
 void WidgetView::ActivateFaultedWidget()
 {
-  if( mPid < 0 )
+  if( mPid < 0 || mAborted )
   {
     // Enable preview and loading text
     ShowRetryState( false );
@@ -392,7 +394,8 @@ void WidgetView::ActivateFaultedWidget()
 
     // launch widget again
     mPid = widget_instance_launch( mInstanceId.c_str(), (char *)mContentInfo.c_str(), mWidth, mHeight );
-    if( mPid < 0)
+
+    if( mPid < 0 || mAborted )
     {
       DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::ActivateFaultedWidget: widget_instance_launch is failed. [%s]\n", mWidgetId.c_str() );
 
@@ -410,7 +413,7 @@ void WidgetView::ActivateFaultedWidget()
     ops.updated_cb = OnBufferUpdated;
     ops.removed_cb = OnSurfaceRemoved;
     ops.added_cb = OnBufferAdded;
-    mWatcherHandle = screen_connector_toolkit_add(&ops, (char *)mInstanceId.c_str(), SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, this);    
+    mWatcherHandle = screen_connector_toolkit_add(&ops, (char *)mInstanceId.c_str(), SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, this);
 
     DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::ActivateFaultedWidget: widget_instance_launch is called. [%s, mPid = %d]\n", mWidgetId.c_str(), mPid );
   }
@@ -533,6 +536,12 @@ void WidgetView::SendWidgetEvent( int event )
       RemoveWidgetImage();
       break;
     }
+    case WIDGET_INSTANCE_EVENT_CREATE_ABORTED:
+    {
+      mAborted = true;
+      mWidgetCreationAbortedSignal.Emit( handle );
+      break;
+    }
     default:
     {
       break;
index 8783aa2e02603cc8c466363481249bcac5071497..b7aa0cac68689ccd0e77c35f650ac098f9655f05 100644 (file)
@@ -289,6 +289,7 @@ private:
   bool mPermanentDelete;
   screen_connector_toolkit_h mWatcherHandle;
   tizen_remote_surface* mRemoteSurface;
+  bool mAborted;
 
   Dali::Property::Map mWidgetImagePropertyMap;