diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-05-10 10:47:53 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-05-10 12:08:29 +0200 |
commit | 67bbbfe91da47e5a58befca54c361db5846d59e1 (patch) | |
tree | 1f2f529f65b56f7d84b9609ea7da07f512480cfd | |
parent | c660329e9f866fcd0f1ef6ce417c9490f92f498a (diff) |
Personas: Kill the non-finished "Background Image" feature.
It seems not to be a too good idea anyway - the image has to have some
specifics, so the value of setting any random image as the background of
Writer / Calc / Impress is questionable.
Either way, if anybody wants to finish that, easy to recover from the
history ;-) - better than keeping the unused code around.
Change-Id: I5079210bd91b5e70ce20681e5477b860bb28ff07
-rw-r--r-- | cui/source/options/personalization.cxx | 76 | ||||
-rw-r--r-- | cui/source/options/personalization.hxx | 11 | ||||
-rw-r--r-- | cui/uiconfig/ui/personalization_tab.ui | 118 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 34 |
4 files changed, 13 insertions, 226 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 1f88044f5094..453fc30e131a 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -83,19 +83,8 @@ IMPL_LINK( SelectPersonaDialog, VisitPersonas, PushButton*, /*pButton*/ ) } SvxPersonalizationTabPage::SvxPersonalizationTabPage( Window *pParent, const SfxItemSet &rSet ) - : SfxTabPage( pParent, "PersonalizationTabPage", "cui/ui/personalization_tab.ui", rSet ), - m_aBackgroundURL() + : SfxTabPage( pParent, "PersonalizationTabPage", "cui/ui/personalization_tab.ui", rSet ) { - // 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 ) ); - // persona get( m_pNoPersona, "no_persona" ); get( m_pDefaultPersona, "default_persona" ); @@ -118,13 +107,6 @@ SfxTabPage* SvxPersonalizationTabPage::Create( Window *pParent, const SfxItemSet sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & ) { - // background image - OUString aBackground( "default" ); - if ( m_pNoBackground->IsChecked() ) - aBackground = "no"; - else if ( m_pOwnBackground->IsChecked() ) - aBackground = "own"; - // persona OUString aPersona( "default" ); if ( m_pNoPersona->IsChecked() ) @@ -135,9 +117,7 @@ sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & ) bool bModified = false; uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); if ( xContext.is() && - ( aBackground != officecfg::Office::Common::Misc::BackgroundImage::get( xContext ) || - m_aBackgroundURL != officecfg::Office::Common::Misc::BackgroundImageURL::get( xContext ) || - aPersona != officecfg::Office::Common::Misc::Persona::get( xContext ) || + ( aPersona != officecfg::Office::Common::Misc::Persona::get( xContext ) || m_aPersonaSettings != officecfg::Office::Common::Misc::PersonaSettings::get( xContext ) ) ) { bModified = true; @@ -146,8 +126,6 @@ sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & ) // write boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); - officecfg::Office::Common::Misc::BackgroundImage::set( aBackground, batch ); - officecfg::Office::Common::Misc::BackgroundImageURL::set( m_aBackgroundURL, batch ); officecfg::Office::Common::Misc::Persona::set( aPersona, batch ); officecfg::Office::Common::Misc::PersonaSettings::set( m_aPersonaSettings, batch ); @@ -167,21 +145,6 @@ void SvxPersonalizationTabPage::Reset( const SfxItemSet & ) { uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); - // background image - OUString aBackground( "default" ); - if ( xContext.is() ) - { - aBackground = officecfg::Office::Common::Misc::BackgroundImage::get( xContext ); - m_aBackgroundURL = officecfg::Office::Common::Misc::BackgroundImageURL::get( xContext ); - } - - if ( aBackground == "no" ) - m_pNoBackground->Check(); - else if ( aBackground == "own" ) - m_pOwnBackground->Check(); - else - m_pDefaultBackground->Check(); - // persona OUString aPersona( "default" ); if ( xContext.is() ) @@ -198,37 +161,6 @@ void SvxPersonalizationTabPage::Reset( const SfxItemSet & ) m_pDefaultPersona->Check(); } -IMPL_LINK( SvxPersonalizationTabPage, SelectBackground, PushButton*, /*pButton*/ ) -{ - uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - - uno::Reference< ui::dialogs::XFilePicker3 > xFilePicker = ui::dialogs::FilePicker::createWithMode(xContext, ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE); - - xFilePicker->setMultiSelectionMode( false ); - - uno::Reference< ui::dialogs::XFilePickerControlAccess > xController( xFilePicker, uno::UNO_QUERY ); - if ( xController.is() ) - xController->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, uno::makeAny( sal_True ) ); - - xFilePicker->appendFilter( "Background images (*.jpg;*.png)", "*.jpg;*.png" ); // TODO localize - - while ( xFilePicker->execute() == ui::dialogs::ExecutableDialogResults::OK ) - { - OUString aFile( xFilePicker->getFiles()[0] ); - - if ( aFile.startsWith( "file:///" ) && ( aFile.endsWith( ".png" ) || aFile.endsWith( ".jpg" ) ) ) - { - m_aBackgroundURL = aFile; - m_pOwnBackground->Check(); - break; - } - - // TODO display what is wrong (not a file:// or not .png / .jpg) - } - - return 0; -} - IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ ) { SelectPersonaDialog aDialog( NULL ); @@ -250,9 +182,7 @@ IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ ) IMPL_LINK( SvxPersonalizationTabPage, ForceSelect, RadioButton*, pButton ) { - if ( pButton == m_pOwnBackground && m_aBackgroundURL.isEmpty() ) - SelectBackground( m_pSelectBackground ); - else if ( pButton == m_pOwnPersona && m_aPersonaSettings.isEmpty() ) + if ( pButton == m_pOwnPersona && m_aPersonaSettings.isEmpty() ) SelectPersona( m_pSelectPersona ); return 0; diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index 067e4705015d..4ac31f005964 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -19,12 +19,6 @@ class SvxPersonalizationTabPage : public SfxTabPage using SfxTabPage::DeactivatePage; private: - RadioButton *m_pNoBackground; ///< Just the default look, without any bitmap - RadioButton *m_pDefaultBackground; ///< Use the built-in bitmap for Writer background - RadioButton *m_pOwnBackground; ///< Use the user-defined bitmap - PushButton *m_pSelectBackground; ///< Let the user select in the 'own' case - OUString m_aBackgroundURL; ///< URL of the background image in the 'own' case - RadioButton *m_pNoPersona; ///< Just the default look, without any bitmap RadioButton *m_pDefaultPersona; ///< Use the built-in bitmap RadioButton *m_pOwnPersona; ///< Use the user-defined bitmap @@ -44,13 +38,10 @@ public: virtual void Reset( const SfxItemSet &rSet ); private: - /// Handle the bacground selection - DECL_LINK( SelectBackground, PushButton* ); - /// Handle the Persona selection DECL_LINK( SelectPersona, PushButton* ); - /// When 'own' is chosen, but the background image or Persona is not chosen yet. + /// When 'own' is chosen, but the Persona is not chosen yet. DECL_LINK( ForceSelect, RadioButton* ); /// Download the bitmaps + color settings, and copy them to user's profile. diff --git a/cui/uiconfig/ui/personalization_tab.ui b/cui/uiconfig/ui/personalization_tab.ui index 806915e9f47a..92e8d961c31e 100644 --- a/cui/uiconfig/ui/personalization_tab.ui +++ b/cui/uiconfig/ui/personalization_tab.ui @@ -7,114 +7,7 @@ <property name="border_width">6</property> <property name="spacing">12</property> <child> - <object class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</property> - <child> - <object class="GtkVBox" id="vbox3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkRadioButton" id="no_background"> - <property name="label" translatable="yes">Plain look, do not use background images</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <property name="group">default_background</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="default_background"> - <property name="label" translatable="yes">Pre-installed background image (if available)</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <property name="group">own_background</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="homogeneous">True</property> - <child> - <object class="GtkRadioButton" id="own_background"> - <property name="label" translatable="yes">Own image</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="xalign">0</property> - <property name="draw_indicator">True</property> - <property name="group">no_background</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="select_background"> - <property name="label" translatable="yes">Select Background Image</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Background Image</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> + <placeholder/> </child> <child> <object class="GtkFrame" id="frame2"> @@ -135,9 +28,11 @@ <child> <object class="GtkRadioButton" id="no_persona"> <property name="label" translatable="yes">Plain look, do not use Themes</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> <property name="group">default_persona</property> @@ -151,9 +46,11 @@ <child> <object class="GtkRadioButton" id="default_persona"> <property name="label" translatable="yes">Pre-installed Theme (if available)</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> <property name="group">own_persona</property> @@ -172,9 +69,11 @@ <child> <object class="GtkRadioButton" id="own_persona"> <property name="label" translatable="yes">Own Theme</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> <property name="group">no_persona</property> @@ -188,9 +87,11 @@ <child> <object class="GtkButton" id="select_persona"> <property name="label" translatable="yes">Select Theme</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> </object> <packing> <property name="expand">False</property> @@ -232,7 +133,6 @@ </object> <object class="GtkSizeGroup" id="sizegroup1"> <widgets> - <widget name="select_background"/> <widget name="select_persona"/> </widgets> </object> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 76fba96a829b..dfffccda3b81 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5608,40 +5608,6 @@ </constraints> <value>auto</value> </prop> - <prop oor:name="BackgroundImage" oor:type="xs:string" oor:nillable="false"> - <!-- UIHints: Tools Options General Personalization --> - <info> - <desc>Specifies whether we should use background image in the - workplace.</desc> - </info> - <constraints> - <enumeration oor:value="no"> - <info> - <desc>No - the user wants only solid bacground.</desc> - </info> - </enumeration> - <enumeration oor:value="default"> - <info> - <desc>Default - the LibreOffice default background image.</desc> - </info> - </enumeration> - <enumeration oor:value="own"> - <info> - <desc>The user installed an own background image, and wants to - use that. It's URL is in BackgroundImageURL.</desc> - </info> - </enumeration> - </constraints> - <value>default</value> - </prop> - <prop oor:name="BackgroundImageURL" oor:type="xs:string" oor:nillable="false"> - <!-- UIHints: Tools Options General Personalization --> - <info> - <desc>URL of the image the user wants to use; it is used only when - BackgroundImage is 'own'.</desc> - </info> - <value/> - </prop> <prop oor:name="Persona" oor:type="xs:string" oor:nillable="false"> <!-- UIHints: Tools Options General Personalization --> <info> |