[Libreoffice-commits] core.git: Branch 'feature/gsoc14-personas' - cui/source cui/uiconfig

Rachit Gupta rachitgupta1792 at gmail.com
Mon Jun 2 10:58:31 PDT 2014


 cui/source/options/personalization.cxx   |   28 +++++-----
 cui/source/options/personalization.hxx   |    2 
 cui/uiconfig/ui/select_persona_dialog.ui |   83 ++++++++++++++++++++-----------
 3 files changed, 72 insertions(+), 41 deletions(-)

New commits:
commit 8c5811cc945fea05d75f52bf917f315b1a09069d
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date:   Mon Jun 2 23:26:11 2014 +0530

    Changed images to buttons so they are clickable.
    
    Changed some variable names too.
    
    Change-Id: I166d996389c84d00782cba42169c991f8f0f923e

diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index e4d82ef..9c8d345 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -43,15 +43,15 @@ SelectPersonaDialog::SelectPersonaDialog( Window *pParent )
 
     get( m_pProgressLabel, "progress_label" );
 
-    get(m_vImageList[0], "image1");
-    get(m_vImageList[1], "image2");
-    get(m_vImageList[2], "image3");
-    get(m_vImageList[3], "image4");
-    get(m_vImageList[4], "image5");
-    get(m_vImageList[5], "image6");
-    get(m_vImageList[6], "image7");
-    get(m_vImageList[7], "image8");
-    get(m_vImageList[8], "image9");
+    get(m_vResultList[0], "result1");
+    get(m_vResultList[1], "result2");
+    get(m_vResultList[2], "result3");
+    get(m_vResultList[3], "result4");
+    get(m_vResultList[4], "result5");
+    get(m_vResultList[5], "result6");
+    get(m_vResultList[6], "result7");
+    get(m_vResultList[7], "result8");
+    get(m_vResultList[8], "result9");
 }
 
 OUString SelectPersonaDialog::GetPersonaURL() const
@@ -86,7 +86,9 @@ void SelectPersonaDialog::SetImages( std::vector<Image> &rImageList )
     sal_Int32 nCount = 0;
     for( std::vector<Image>::iterator it=rImageList.begin(); it!=rImageList.end(); ++it )
     {
-        m_vImageList[nCount++]->SetImage( *it );
+        m_vResultList[nCount]->Show();
+        m_vResultList[nCount]->SetModeImage( *it );
+        nCount++;
     }
 }
 
@@ -357,7 +359,7 @@ void SearchAndParseThread::execute()
 
     std::vector<OUString> vLearnmoreURLs = pHandler->getLearnmoreURLs();
     std::vector<OUString>::iterator it;
-    std::vector<Image> vImageList;
+    std::vector<Image> vResultList;
     GraphicFilter aFilter;
     Graphic aGraphic;
 
@@ -367,9 +369,9 @@ void SearchAndParseThread::execute()
         INetURLObject aURLObj( sHeaderFile );
         aFilter.ImportGraphic( aGraphic, aURLObj );
         Bitmap aBmp = aGraphic.GetBitmap();
-        vImageList.push_back( Image( aBmp ) );
+        vResultList.push_back( Image( aBmp ) );
     }
-    m_pPersonaDialog->SetImages( vImageList );
+    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 e7f02c9..9bc99a7 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -65,7 +65,7 @@ private:
     Edit *m_pEdit;                          ///< The input line for the Persona URL
     PushButton *m_pButton;
     FixedText *m_pProgressLabel;
-    FixedImage *m_vImageList[9];
+    PushButton *m_vResultList[9];
 
 public:
     SelectPersonaDialog( Window *pParent );
diff --git a/cui/uiconfig/ui/select_persona_dialog.ui b/cui/uiconfig/ui/select_persona_dialog.ui
index ab4c89c..2c9f5a1 100644
--- a/cui/uiconfig/ui/select_persona_dialog.ui
+++ b/cui/uiconfig/ui/select_persona_dialog.ui
@@ -132,11 +132,16 @@
               <object class="GtkGrid" id="grid1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <property name="column_spacing">6</property>
                 <child>
-                  <object class="GtkImage" id="image1">
+                  <object class="GtkButton" id="result1">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -146,10 +151,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image2">
+                  <object class="GtkButton" id="result2">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -159,10 +167,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image3">
+                  <object class="GtkButton" id="result3">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">2</property>
@@ -172,10 +183,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image4">
+                  <object class="GtkButton" id="result4">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -185,10 +199,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image5">
+                  <object class="GtkButton" id="result5">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -198,10 +215,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image6">
+                  <object class="GtkButton" id="result6">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">2</property>
@@ -211,10 +231,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image7">
+                  <object class="GtkButton" id="result7">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -224,10 +247,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image8">
+                  <object class="GtkButton" id="result8">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -237,10 +263,13 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image9">
+                  <object class="GtkButton" id="result9">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="stock">gtk-missing-image</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">2</property>


More information about the Libreoffice-commits mailing list