Commit 93656d7eceb0a8ebe4136432785c534783f5efbc
1 parent
68b461fd
LoadPolicy::Immediate Waits for ResourceReady Signal
Change-Id: Id6d681bc3f54f32e2952c1000fa64aa59b6cf61c
Showing
1 changed file
with
4 additions
and
0 deletions
examples/image-policies/image-policies-example.cpp
| ... | ... | @@ -98,6 +98,7 @@ class ImagePolicies: public ConnectionTracker |
| 98 | 98 | * param[in] releasePolicy Which ReleasePolicy to use |
| 99 | 99 | * param[in] synchronousLoading If the Image should be loaded synchronously |
| 100 | 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 | 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 | 122 | return imageView; |
| 122 | 123 | } |
| 123 | 124 | |
| 125 | + | |
| 124 | 126 | /** |
| 125 | 127 | * To prevent the next button being pressed before an Image has loaded the Button can br disabled. |
| 126 | 128 | * This function will disable the next button. |
| ... | ... | @@ -185,7 +187,9 @@ class ImagePolicies: public ConnectionTracker |
| 185 | 187 | dualImageViewTable.AddChild( immediate, TableView::CellPosition( 0, 1 ) ); |
| 186 | 188 | mTable.AddChild( dualImageViewTable, TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) ); |
| 187 | 189 | |
| 190 | + DisableButtonWhilstLoading(); | |
| 188 | 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 | /** | ... | ... |