diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-12-06 08:29:02 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-01-08 16:12:47 +0100 |
commit | f3478203c1dd360c1eae7b733a262923985c3b96 (patch) | |
tree | 57479f0c0f83819aa6b8646efd9879d1f36c79bf /cui | |
parent | c060f9d29d0373b76a519daa55b5f83e4c9848d2 (diff) |
Personas: Force selection when the 'own' clicked, but nothing chosen yet.
Change-Id: Iaf5a82a7f12ed7112f86bfa1c5f243ab00ca4285
Signed-off-by: Cor Nouws <oolst@nouenoff.nl>
Signed-off-by: Olivier Hallot <olivier.hallot@documentfoundation.org>
Signed-off-by: Adolfo Jayme Barrientos <fitoschido@ubuntu.com>
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
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 7d302082b6c4..7d31b0fa4cc0 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 ); }; |