summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRachit Gupta <rachitgupta1792@gmail.com>2014-06-20 15:38:26 +0530
committerRachit Gupta <rachitgupta1792@gmail.com>2014-08-04 20:27:53 +0530
commit99ebf4f1c2b53448a7090939e0c1bbb64e104460 (patch)
tree445ba94d5ac14f404b5cd8cc2478ad88e66baa37
parent6825d2a70bdcab5813b6c642468375424c0790dd (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
-rw-r--r--cui/source/options/personalization.cxx21
-rw-r--r--cui/source/options/personalization.hxx2
-rw-r--r--cui/uiconfig/ui/select_persona_dialog.ui4
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>