summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRachit Gupta <rachitgupta1792@gmail.com>2014-08-05 21:27:20 +0530
committerRachit Gupta <rachitgupta1792@gmail.com>2014-08-05 21:51:10 +0530
commitadd94e482716809ca667b494eba15d145e7abdc6 (patch)
tree3c0af8b04ab48a5946b48c797debd8407c9c2413
parent7809ac111d78c64a46d87266a40acdde677c2609 (diff)
Changed Select Persona Dialog.
The result buttons are visible initially but are disabled. These get enabled when the results are available. A little code clean up. Change-Id: I6217d59220d871909bd001a6c7f3636b05cdf911
-rw-r--r--cui/source/options/personalization.cxx30
-rw-r--r--cui/uiconfig/ui/select_persona_dialog.ui9
2 files changed, 20 insertions, 19 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 2e53087ece47..90ce9a3f69fc 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -74,31 +74,20 @@ SelectPersonaDialog::SelectPersonaDialog( Window *pParent )
m_pCancelButton->SetClickHdl( LINK( this, SelectPersonaDialog, ActionCancel ) );
get( m_vResultList[0], "result1" );
- m_vResultList[0]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[1], "result2" );
- m_vResultList[1]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[2], "result3" );
- m_vResultList[2]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[3], "result4" );
- m_vResultList[3]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[4], "result5" );
- m_vResultList[4]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[5], "result6" );
- m_vResultList[5]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[6], "result7" );
- m_vResultList[6]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[7], "result8" );
- m_vResultList[7]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
-
get( m_vResultList[8], "result9" );
- m_vResultList[8]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
+
+ for (sal_Int32 nIndex = 0; nIndex < 9; ++nIndex)
+ {
+ m_vResultList[nIndex]->SetClickHdl( LINK( this, SelectPersonaDialog, SelectPersona ) );
+ m_vResultList[nIndex]->Disable();
+ }
}
OUString SelectPersonaDialog::GetSelectedPersona() const
@@ -216,7 +205,7 @@ void SelectPersonaDialog::SetProgress( OUString& rProgress )
void SelectPersonaDialog::SetImages( Image aImage, sal_Int32 nIndex )
{
- m_vResultList[nIndex]->Show();
+ m_vResultList[nIndex]->Enable();
m_vResultList[nIndex]->SetModeImage( aImage );
}
@@ -230,7 +219,10 @@ void SelectPersonaDialog::ClearSearchResults()
m_vPersonaSettings.clear();
m_aSelectedPersona = "";
for( sal_Int32 nIndex = 0; nIndex < 9; nIndex++ )
- m_vResultList[nIndex]->Hide();
+ {
+ m_vResultList[nIndex]->Disable();
+ m_vResultList[nIndex]->SetModeImage(Image());
+ }
}
SvxPersonalizationTabPage::SvxPersonalizationTabPage( Window *pParent, const SfxItemSet &rSet )
diff --git a/cui/uiconfig/ui/select_persona_dialog.ui b/cui/uiconfig/ui/select_persona_dialog.ui
index 0d99baea1121..2826a19d3f80 100644
--- a/cui/uiconfig/ui/select_persona_dialog.ui
+++ b/cui/uiconfig/ui/select_persona_dialog.ui
@@ -262,6 +262,7 @@
<property name="column_homogeneous">True</property>
<child>
<object class="GtkButton" id="result1">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -276,6 +277,7 @@
</child>
<child>
<object class="GtkButton" id="result2">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -290,6 +292,7 @@
</child>
<child>
<object class="GtkButton" id="result3">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -304,6 +307,7 @@
</child>
<child>
<object class="GtkButton" id="result4">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -318,6 +322,7 @@
</child>
<child>
<object class="GtkButton" id="result5">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -332,6 +337,7 @@
</child>
<child>
<object class="GtkButton" id="result6">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -346,6 +352,7 @@
</child>
<child>
<object class="GtkButton" id="result7">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -360,6 +367,7 @@
</child>
<child>
<object class="GtkButton" id="result8">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
@@ -374,6 +382,7 @@
</child>
<child>
<object class="GtkButton" id="result9">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>