diff options
author | Rachit Gupta <rachitgupta1792@gmail.com> | 2014-06-20 15:38:26 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-08-14 19:43:28 +0200 |
commit | 8181a7b6089d1b04ef4ee21745b02659917e9f24 (patch) | |
tree | df99cc9f96cf5e9fc6b0aa53c8d44edd5e1ee5ce /cui | |
parent | 27f4c752d062df6c3f9c33c62e5de7c541aeca34 (diff) |
Improved search: the images are displayed as they are downloaded.
Previously, all the search result images were displayed in one go,
but now the images are shown as they are downloaded.
Change-Id: I95990f36c242a0c90bd2b2fd65fd76953f46bcc2
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/personalization.cxx | 21 | ||||
-rw-r--r-- | cui/source/options/personalization.hxx | 2 | ||||
-rw-r--r-- | cui/uiconfig/ui/select_persona_dialog.ui | 4 |
3 files changed, 14 insertions, 13 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 65a312a88836..bf048224bcef 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -166,15 +166,10 @@ void SelectPersonaDialog::SetProgress( OUString& rProgress ) } } -void SelectPersonaDialog::SetImages( std::vector<Image> &rImageList ) +void SelectPersonaDialog::SetImages( Image aImage, sal_Int32 nIndex ) { - sal_Int32 nCount = 0; - for( std::vector<Image>::iterator it=rImageList.begin(); it!=rImageList.end(); ++it ) - { - m_vResultList[nCount]->Show(); - m_vResultList[nCount]->SetModeImage( *it ); - nCount++; - } + m_vResultList[nIndex]->Show(); + m_vResultList[nIndex]->SetModeImage( aImage ); } void SelectPersonaDialog::AddPersonaSetting( OUString& rPersonaSetting ) @@ -465,7 +460,7 @@ void SearchAndParseThread::execute() std::vector<OUString> vLearnmoreURLs = pHandler->getLearnmoreURLs(); std::vector<OUString>::iterator it; - std::vector<Image> vResultList; + sal_Int32 nIndex = 0; GraphicFilter aFilter; Graphic aGraphic; @@ -476,14 +471,16 @@ void SearchAndParseThread::execute() INetURLObject aURLObj( sPreviewFile ); aFilter.ImportGraphic( aGraphic, aURLObj ); Bitmap aBmp = aGraphic.GetBitmap(); - vResultList.push_back( Image( aBmp ) ); + + // for VCL to be able to do visual changes in the thread + SolarMutexGuard aGuard; + m_pPersonaDialog->SetImages( Image( aBmp ), nIndex++ ); + m_pPersonaDialog->setOptimalLayoutSize(); m_pPersonaDialog->AddPersonaSetting( aPersonaSetting ); } - // for VCL to be able to do visual changes in the thread SolarMutexGuard aGuard; - m_pPersonaDialog->SetImages( vResultList ); sProgress = ""; m_pPersonaDialog->SetProgress( sProgress ); m_pPersonaDialog->setOptimalLayoutSize(); diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index 0d211ed82d03..3fcabf2eb281 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -87,7 +87,7 @@ public: OUString GetSelectedPersona() const; void SetProgress( OUString& ); - void SetImages( std::vector<Image>&); + void SetImages( Image, sal_Int32 ); void AddPersonaSetting( OUString& ); void ClearSearchResults(); void SetAppliedPersonaSetting( OUString& ); diff --git a/cui/uiconfig/ui/select_persona_dialog.ui b/cui/uiconfig/ui/select_persona_dialog.ui index cf551dc52f22..51d8bcb9e00d 100644 --- a/cui/uiconfig/ui/select_persona_dialog.ui +++ b/cui/uiconfig/ui/select_persona_dialog.ui @@ -154,6 +154,10 @@ <property name="vexpand">True</property> <property name="row_spacing">6</property> <property name="column_spacing">6</property> + <property name="width_request">624</property> + <property name="height_request">219</property> + <property name="row_homogeneous">True</property> + <property name="column_homogeneous">True</property> <child> <object class="GtkButton" id="result1"> <property name="can_focus">True</property> |