From 8181a7b6089d1b04ef4ee21745b02659917e9f24 Mon Sep 17 00:00:00 2001 From: Rachit Gupta Date: Fri, 20 Jun 2014 15:38:26 +0530 Subject: 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 --- cui/source/options/personalization.cxx | 21 +++++++++------------ cui/source/options/personalization.hxx | 2 +- cui/uiconfig/ui/select_persona_dialog.ui | 4 ++++ 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'cui') 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 &rImageList ) +void SelectPersonaDialog::SetImages( Image aImage, sal_Int32 nIndex ) { - sal_Int32 nCount = 0; - for( std::vector::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 vLearnmoreURLs = pHandler->getLearnmoreURLs(); std::vector::iterator it; - std::vector 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&); + 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 @@ True 6 6 + 624 + 219 + True + True True -- cgit