diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-12-06 08:29:02 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-12-06 08:42:02 +0100 |
commit | 93fce951784cd561f308c5019aa0b3a178116a92 (patch) | |
tree | 2778fac2c43f181c5f6847e1087bdd8b78205cda /cui | |
parent | Personas: Read the info from the Persona page, and store it. (diff) | |
download | core-93fce951784cd561f308c5019aa0b3a178116a92.tar.gz core-93fce951784cd561f308c5019aa0b3a178116a92.zip |
Personas: Force selection when the 'own' clicked, but nothing chosen yet.
Change-Id: Iaf5a82a7f12ed7112f86bfa1c5f243ab00ca4285
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/personalization.cxx | 15 | ||||
-rw-r--r-- | cui/source/options/personalization.hxx | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 33fb11d77056..562b7b48d16a 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -90,7 +90,9 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage( Window *pParent, const Sfx // background image get( m_pNoBackground, "no_background" ); get( m_pDefaultBackground, "default_background" ); + get( m_pOwnBackground, "own_background" ); + m_pOwnBackground->SetClickHdl( LINK( this, SvxPersonalizationTabPage, ForceSelect ) ); get( m_pSelectBackground, "select_background" ); m_pSelectBackground->SetClickHdl( LINK( this, SvxPersonalizationTabPage, SelectBackground ) ); @@ -98,10 +100,11 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage( Window *pParent, const Sfx // persona get( m_pNoPersona, "no_persona" ); get( m_pDefaultPersona, "default_persona" ); + get( m_pOwnPersona, "own_persona" ); + m_pOwnPersona->SetClickHdl( LINK( this, SvxPersonalizationTabPage, ForceSelect ) ); get( m_pSelectPersona, "select_persona" ); - LINK( this, SvxPersonalizationTabPage, SelectPersona ); m_pSelectPersona->SetClickHdl( LINK( this, SvxPersonalizationTabPage, SelectPersona ) ); } @@ -245,6 +248,16 @@ IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ ) return 0; } +IMPL_LINK( SvxPersonalizationTabPage, ForceSelect, RadioButton*, pButton ) +{ + if ( pButton == m_pOwnBackground && m_aBackgroundURL.isEmpty() ) + SelectBackground( m_pSelectBackground ); + else if ( pButton == m_pOwnPersona && m_aPersonaSettings.isEmpty() ) + SelectPersona( m_pSelectPersona ); + + return 0; +} + /// Find the value on the Persona page, and convert it to a usable form. static OUString searchValue( const OString &rBuffer, sal_Int32 from, const OString &rIdentifier ) { diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index 499a0a0e8287..c3ff06e3bcf5 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -50,6 +50,9 @@ private: /// Handle the Persona selection DECL_LINK( SelectPersona, PushButton* ); + /// When 'own' is chosen, but the background image or Persona is not chosen yet. + DECL_LINK( ForceSelect, RadioButton* ); + /// Download the bitmaps + color settings, and copy them to user's profile. bool CopyPersonaToGallery( const OUString &rURL ); }; |