Commit 54da7c68bf1bebe9fcd10671387fa9b041f2e874

Authored by Adeel Kazmi
Committed by Gerrit Code Review
2 parents 18feedec 93656d7e

Merge "LoadPolicy::Immediate Waits for ResourceReady Signal" into devel/master

examples/image-policies/image-policies-example.cpp
@@ -98,6 +98,7 @@ class ImagePolicies: public ConnectionTracker @@ -98,6 +98,7 @@ class ImagePolicies: public ConnectionTracker
98 * param[in] releasePolicy Which ReleasePolicy to use 98 * param[in] releasePolicy Which ReleasePolicy to use
99 * param[in] synchronousLoading If the Image should be loaded synchronously 99 * param[in] synchronousLoading If the Image should be loaded synchronously
100 * param[in] imageFilenameId Which image to load, referring to the array of filenames for this example. 100 * param[in] imageFilenameId Which image to load, referring to the array of filenames for this example.
  101 + * return An ImageView with the required set up
101 */ 102 */
102 ImageView CreateImageView( bool correctionEnabled, DevelImageVisual::LoadPolicy::Type loadPolicy, DevelImageVisual::ReleasePolicy::Type releasePolicy, bool synchronousLoading, unsigned int imageFilenameId ) 103 ImageView CreateImageView( bool correctionEnabled, DevelImageVisual::LoadPolicy::Type loadPolicy, DevelImageVisual::ReleasePolicy::Type releasePolicy, bool synchronousLoading, unsigned int imageFilenameId )
103 { 104 {
@@ -121,6 +122,7 @@ class ImagePolicies: public ConnectionTracker @@ -121,6 +122,7 @@ class ImagePolicies: public ConnectionTracker
121 return imageView; 122 return imageView;
122 } 123 }
123 124
  125 +
124 /** 126 /**
125 * To prevent the next button being pressed before an Image has loaded the Button can br disabled. 127 * To prevent the next button being pressed before an Image has loaded the Button can br disabled.
126 * This function will disable the next button. 128 * This function will disable the next button.
@@ -185,7 +187,9 @@ class ImagePolicies: public ConnectionTracker @@ -185,7 +187,9 @@ class ImagePolicies: public ConnectionTracker
185 dualImageViewTable.AddChild( immediate, TableView::CellPosition( 0, 1 ) ); 187 dualImageViewTable.AddChild( immediate, TableView::CellPosition( 0, 1 ) );
186 mTable.AddChild( dualImageViewTable, TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) ); 188 mTable.AddChild( dualImageViewTable, TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) );
187 189
  190 + DisableButtonWhilstLoading();
188 mPersistantImageView = CreateImageView( true, DevelImageVisual::LoadPolicy::IMMEDIATE, DevelImageVisual::ReleasePolicy::DESTROYED, false, 4 ); 191 mPersistantImageView = CreateImageView( true, DevelImageVisual::LoadPolicy::IMMEDIATE, DevelImageVisual::ReleasePolicy::DESTROYED, false, 4 );
  192 + mPersistantImageView.ResourceReadySignal().Connect( this, &ImagePolicies::ResourceReadySignal );
189 } 193 }
190 194
191 /** 195 /**