LoadPolicy::Immediate Waits for ResourceReady Signal 50/159250/4
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Tue, 7 Nov 2017 17:37:29 +0000 (17:37 +0000)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 10 Nov 2017 14:11:24 +0000 (14:11 +0000)
Change-Id: Id6d681bc3f54f32e2952c1000fa64aa59b6cf61c

examples/image-policies/image-policies-example.cpp

index 7f7acc8..a630742 100644 (file)
@@ -98,6 +98,7 @@ class ImagePolicies: public ConnectionTracker
    * param[in] releasePolicy Which ReleasePolicy to use
    * param[in] synchronousLoading If the Image should be loaded synchronously
    * param[in] imageFilenameId Which image to load, referring to the array of filenames for this example.
+   * return An ImageView with the required set up
    */
   ImageView CreateImageView( bool correctionEnabled, DevelImageVisual::LoadPolicy::Type loadPolicy, DevelImageVisual::ReleasePolicy::Type releasePolicy, bool synchronousLoading, unsigned int imageFilenameId )
   {
@@ -121,6 +122,7 @@ class ImagePolicies: public ConnectionTracker
     return imageView;
   }
 
+
   /**
    * To prevent the next button being pressed before an Image has loaded the Button can br disabled.
    * This function will disable the next button.
@@ -185,7 +187,9 @@ class ImagePolicies: public ConnectionTracker
     dualImageViewTable.AddChild( immediate, TableView::CellPosition( 0, 1 ) );
     mTable.AddChild( dualImageViewTable, TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) );
 
+    DisableButtonWhilstLoading();
     mPersistantImageView = CreateImageView( true, DevelImageVisual::LoadPolicy::IMMEDIATE, DevelImageVisual::ReleasePolicy::DESTROYED, false, 4 );
+    mPersistantImageView.ResourceReadySignal().Connect( this, &ImagePolicies::ResourceReadySignal );
   }
 
   /**