diff options
author | Irgaliev Amin <irgaliev01@mail.ru> | 2023-10-16 19:19:18 +0400 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2023-10-17 09:55:28 +0200 |
commit | 0e14912af0c449396f10c2ae4be3c7f2a3a98bc2 (patch) | |
tree | 693d58e401c4beaf02f96f5d64d82f558dfd40c1 /sd/source/ui | |
parent | 07a80b8940a16ba1b7fd047865179809bd74a563 (diff) |
tdf#157788 Saving the "Show navigation panel" setting for a device
Currently, the value of the "Show navigation panel" parameter for
presentations is not saved. The section in which this setting is
now located, apparently, is saved in files. It might make sense
to move this setting to Tools -> Options -> LibreOffice Impress -> General,
because it relates to the device rather than the slideshow.
Change-Id: I2286a4a6d432b11fce2b9c3e65fa6b82e004275f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158057
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/app/optsitem.cxx | 19 | ||||
-rw-r--r-- | sd/source/ui/dlg/present.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/func/fusldlg.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/inc/optsitem.hxx | 6 | ||||
-rw-r--r-- | sd/source/ui/inc/present.hxx | 1 | ||||
-rw-r--r-- | sd/source/ui/inc/tpoption.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshow.cxx | 19 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 6 |
9 files changed, 34 insertions, 40 deletions
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx index fe8bf5ea3b9f..0492be483658 100644 --- a/sd/source/ui/app/optsitem.cxx +++ b/sd/source/ui/app/optsitem.cxx @@ -420,6 +420,7 @@ SdOptionsMisc::SdOptionsMisc( bool bImpress, bool bUseConfig ) : bPreviewNewEffects( true ), bPreviewChangedEffects( false ), bPreviewTransitions( true ), + bShowNavigationPanel( false ), mnDisplay( 0 ), mnPenColor( 0xff0000 ), mnPenWidth( 150.0 ), @@ -463,7 +464,9 @@ bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const IsShowComments() == rOpt.IsShowComments() && GetPresentationPenColor() == rOpt.GetPresentationPenColor() && GetPresentationPenWidth() == rOpt.GetPresentationPenWidth() && - GetDragThresholdPixels() == rOpt.GetDragThresholdPixels() + GetDragThresholdPixels() == rOpt.GetDragThresholdPixels() && + + IsShowNavigationPanel() == rOpt.IsShowNavigationPanel() ); } @@ -506,10 +509,11 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) "Start/EnableSdremote", "Start/EnablePresenterScreen", "Start/PresenterScreenFullScreen", - "TabBarVisible" + "TabBarVisible", + "Start/ShowNavigationPanel" }; - rCount = ( IsImpress() ? SAL_N_ELEMENTS(aPropNames) : 15 ); + rCount = ( IsImpress() ? SAL_N_ELEMENTS(aPropNames) : 16 ); ppNames = aPropNames; } @@ -576,6 +580,9 @@ bool SdOptionsMisc::ReadData( const Any* pValues ) if( pValues[28].hasValue() ) { SetTabBarVisible( *o3tl::doAccess<bool>(pValues[ 28 ]) ); } + if( pValues[29].hasValue() ) + SetShowNavigationPanel( *o3tl::doAccess<bool>(pValues[ 29 ]) ); + } return true; @@ -621,6 +628,8 @@ bool SdOptionsMisc::WriteData( Any* pValues ) const pValues[ 27 ] <<= IsPresenterScreenFullScreen(); pValues[ 28 ] <<= IsTabBarVisible(); + pValues[ 29 ] <<= IsShowNavigationPanel(); + } return true; @@ -664,6 +673,8 @@ SdOptionsMiscItem::SdOptionsMiscItem( SdOptions const * pOpts, ::sd::FrameView c maOptionsMisc.SetPresentationPenColor(pOpts->GetPresentationPenColor() ); maOptionsMisc.SetPresentationPenWidth(pOpts->GetPresentationPenWidth() ); + + maOptionsMisc.SetShowNavigationPanel( pOpts->IsShowNavigationPanel() ); } if( pView ) @@ -748,6 +759,8 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const pOpts->SetPresentationPenWidth( maOptionsMisc.GetPresentationPenWidth() ); pOpts->SetDragThreshold( maOptionsMisc.GetDragThresholdPixels() ); + + pOpts->SetShowNavigationPanel( maOptionsMisc.IsShowNavigationPanel() ); } /************************************************************************* diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index df7089e25405..d72b152ef7f8 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -54,7 +54,6 @@ SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* pWindow, const SfxI , m_xCbxAnimationAllowed(m_xBuilder->weld_check_button("animationsallowed")) , m_xCbxChangePage(m_xBuilder->weld_check_button("changeslidesbyclick")) , m_xCbxAlwaysOnTop(m_xBuilder->weld_check_button("alwaysontop")) - , m_xCbxShowNavigationButton(m_xBuilder->weld_check_button("shownavigationbutton")) , m_xFtMonitor(m_xBuilder->weld_label("presdisplay_label")) , m_xLBMonitor(m_xBuilder->weld_combo_box("presdisplay_cb")) , m_xMonitor(m_xBuilder->weld_label("monitor_str")) @@ -113,7 +112,6 @@ SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* pWindow, const SfxI m_xCbxAnimationAllowed->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ANIMATION_ALLOWED ) ).GetValue() ); m_xCbxChangePage->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_CHANGE_PAGE ) ).GetValue() ); m_xCbxAlwaysOnTop->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ALWAYS_ON_TOP ) ).GetValue() ); - m_xCbxShowNavigationButton->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS) ).GetValue() ); const bool bEndless = static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue(); const bool bWindow = !static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue(); @@ -258,7 +256,6 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr ) rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ANIMATION_ALLOWED, m_xCbxAnimationAllowed->get_active() ) ); rAttr.Put( SfxBoolItem ( ATTR_PRESENT_CHANGE_PAGE, m_xCbxChangePage->get_active() ) ); rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ALWAYS_ON_TOP, m_xCbxAlwaysOnTop->get_active() ) ); - rAttr.Put( SfxBoolItem ( ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS, m_xCbxShowNavigationButton->get_active() ) ); rAttr.Put( SfxBoolItem ( ATTR_PRESENT_FULLSCREEN, !m_xRbtWindow->get_active() ) ); rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ENDLESS, m_xRbtAuto->get_active() ) ); rAttr.Put( SfxUInt32Item ( ATTR_PRESENT_PAUSE_TIMEOUT, m_xFormatter->GetTime().GetMSFromTime() / 1000 ) ); diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index b1fc4bd18d55..2703161a17e1 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -210,6 +210,7 @@ SdTpOptionsMisc::SdTpOptionsMisc(weld::Container* pPage, weld::DialogController* , m_xCbxEnablePresenterScreen(m_xBuilder->weld_check_button("enprsntcons")) , m_xCbxPresenterScreenFullScreen(m_xBuilder->weld_check_button("enprsntconsfullscreen")) , m_xCbxCompatibility(m_xBuilder->weld_check_button("cbCompatibility")) + , m_xCbxShowNavigationPanel(m_xBuilder->weld_check_button("shwnavpan")) , m_xScaleFrame(m_xBuilder->weld_frame("scaleframe")) , m_xCbScale(m_xBuilder->weld_combo_box("scaleBox")) , m_xNewDocLb(m_xBuilder->weld_label("newdoclbl")) @@ -364,7 +365,7 @@ OUString SdTpOptionsMisc::GetAllStrings() OUString checkButton[] = { "startwithwizard", "copywhenmove", "backgroundback", "objalwymov", "distortcb", "cbCompatibility", "enremotcont", "enprsntcons", "enprsntconsfullscreen", - "qickedit", "textselected" }; + "qickedit", "textselected", "shwnavpan" }; for (const auto& check : checkButton) { @@ -389,7 +390,8 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) m_xCbxEnablePresenterScreen->get_state_changed_from_saved() || m_xCbxPresenterScreenFullScreen->get_state_changed_from_saved() || m_xCbxCompatibility->get_state_changed_from_saved() || - m_xCbxDistort->get_state_changed_from_saved()) + m_xCbxDistort->get_state_changed_from_saved() || + m_xCbxShowNavigationPanel->get_state_changed_from_saved()) { SdOptionsMiscItem aOptsItem; @@ -404,6 +406,7 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) aOptsItem.GetOptionsMisc().SetPresenterScreenFullScreen( m_xCbxPresenterScreenFullScreen->get_active() ); aOptsItem.GetOptionsMisc().SetSummationOfParagraphs( m_xCbxCompatibility->get_active() ); aOptsItem.GetOptionsMisc().SetCrookNoContortion( m_xCbxDistort->get_active() ); + aOptsItem.GetOptionsMisc().SetShowNavigationPanel( m_xCbxShowNavigationPanel->get_active() ); rAttrs->Put( aOptsItem ); bModified = true; @@ -454,6 +457,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) m_xCbxPresenterScreenFullScreen->set_active( aOptsItem.GetOptionsMisc().IsPresenterScreenFullScreen() ); m_xCbxCompatibility->set_active( aOptsItem.GetOptionsMisc().IsSummationOfParagraphs() ); m_xCbxDistort->set_active( aOptsItem.GetOptionsMisc().IsCrookNoContortion() ); + m_xCbxShowNavigationPanel->set_active( aOptsItem.GetOptionsMisc().IsShowNavigationPanel() ); m_xCbxStartWithTemplate->save_state(); m_xCbxMarkedHitMovesAlways->save_state(); m_xCbxQuickEdit->save_state(); @@ -466,6 +470,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) m_xCbxPresenterScreenFullScreen->save_state(); m_xCbxCompatibility->save_state(); m_xCbxDistort->save_state(); + m_xCbxShowNavigationPanel->save_state(); // metric sal_uInt16 nWhich = GetWhich( SID_ATTR_METRIC ); @@ -563,6 +568,7 @@ void SdTpOptionsMisc::SetDrawMode() m_xMtrFldOriginalHeight->show(); m_xCbxDistort->show(); m_xCbxCompatibility->hide(); + m_xCbxShowNavigationPanel->hide(); } OUString SdTpOptionsMisc::GetScale( sal_Int32 nX, sal_Int32 nY ) diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index ddb8f2ccf7cb..ab076b872cf4 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -99,7 +99,6 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_ANIMATION_ALLOWED, rPresentationSettings.mbAnimationAllowed ) ); aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_CHANGE_PAGE, !rPresentationSettings.mbLockedPages ) ); aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_ALWAYS_ON_TOP, rPresentationSettings.mbAlwaysOnTop ) ); - aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS, rPresentationSettings.mbUseNavigation ) ); aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_FULLSCREEN, rPresentationSettings.mbFullScreen ) ); aDlgSet.Put( SfxUInt32Item( ATTR_PRESENT_PAUSE_TIMEOUT, rPresentationSettings.mnPauseTimeout ) ); aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_SHOW_PAUSELOGO, rPresentationSettings.mbShowPauseLogo ) ); @@ -194,13 +193,6 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) rPresentationSettings.mbAlwaysOnTop = bValue; } - bValue = ITEMVALUE(aDlgSet, ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS, SfxBoolItem); - if (bValue != rPresentationSettings.mbUseNavigation) - { - bValuesChanged = true; - rPresentationSettings.mbUseNavigation = bValue; - } - bValue = ITEMVALUE( aDlgSet, ATTR_PRESENT_FULLSCREEN, SfxBoolItem ); if ( bValue != rPresentationSettings.mbFullScreen ) { diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx index ffa8de612c61..7308b9137155 100644 --- a/sd/source/ui/inc/optsitem.hxx +++ b/sd/source/ui/inc/optsitem.hxx @@ -210,6 +210,8 @@ private: bool bPreviewChangedEffects; bool bPreviewTransitions; + bool bShowNavigationPanel : 1; // Misc/Start/ShowNavigationPanel + sal_Int32 mnDisplay; @@ -256,6 +258,8 @@ public: bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs; }; bool IsTabBarVisible() const { Init(); return bTabBarVisible; }; + bool IsShowNavigationPanel() const { Init(); return bShowNavigationPanel; } + /** Return the currently selected printer independent layout mode. @return Returns 1 for printer independent layout enabled and 0 when it @@ -317,6 +321,8 @@ public: bool IsShowComments() const { Init(); return bShowComments; } void SetShowComments( bool bShow ) { if( bShowComments != bShow ) { OptionsChanged(); bShowComments = bShow; } } + + void SetShowNavigationPanel( bool bOn ) { if( bShowNavigationPanel != bOn ) { OptionsChanged(); bShowNavigationPanel = bOn; } } }; class SD_DLLPUBLIC SdOptionsMiscItem final : public SfxPoolItem diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx index aba8839bdfd2..00c78ac79328 100644 --- a/sd/source/ui/inc/present.hxx +++ b/sd/source/ui/inc/present.hxx @@ -54,7 +54,6 @@ private: std::unique_ptr<weld::CheckButton> m_xCbxAnimationAllowed; std::unique_ptr<weld::CheckButton> m_xCbxChangePage; std::unique_ptr<weld::CheckButton> m_xCbxAlwaysOnTop; - std::unique_ptr<weld::CheckButton> m_xCbxShowNavigationButton; std::unique_ptr<weld::Label> m_xFtMonitor; std::unique_ptr<weld::ComboBox> m_xLBMonitor; diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx index 55e4e4e0166c..91077a63bbe4 100644 --- a/sd/source/ui/inc/tpoption.hxx +++ b/sd/source/ui/inc/tpoption.hxx @@ -93,6 +93,8 @@ private: std::unique_ptr<weld::CheckButton> m_xCbxPresenterScreenFullScreen; std::unique_ptr<weld::CheckButton> m_xCbxCompatibility; + std::unique_ptr<weld::CheckButton> m_xCbxShowNavigationPanel; + //Scale std::unique_ptr<weld::Frame> m_xScaleFrame; std::unique_ptr<weld::ComboBox> m_xCbScale; diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 52f66d5afdea..1c21ef7ee08a 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -114,7 +114,6 @@ static std::span<const SfxItemPropertyMapEntry> ImplGetPresentationPropertyMap() { u"Display"_ustr, ATTR_PRESENT_DISPLAY, ::cppu::UnoType<sal_Int32>::get(), 0, 0 }, { u"FirstPage"_ustr, ATTR_PRESENT_DIANAME, ::cppu::UnoType<OUString>::get(), 0, 0 }, { u"IsAlwaysOnTop"_ustr, ATTR_PRESENT_ALWAYS_ON_TOP, cppu::UnoType<bool>::get(), 0, 0 }, - { u"IsShowNavigationButtons"_ustr, ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS, cppu::UnoType<bool>::get(), 0, 0 }, { u"IsAutomatic"_ustr, ATTR_PRESENT_MANUEL, cppu::UnoType<bool>::get(), 0, 0 }, { u"IsEndless"_ustr, ATTR_PRESENT_ENDLESS, cppu::UnoType<bool>::get(), 0, 0 }, { u"IsFullScreen"_ustr, ATTR_PRESENT_FULLSCREEN, cppu::UnoType<bool>::get(), 0, 0 }, @@ -440,22 +439,6 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const } break; } - case ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS: - { - bool bVal = false; - - if (aValue >>= bVal) - { - bIllegalArgument = false; - - if (rPresSettings.mbUseNavigation != bVal) - { - bValuesChanged = true; - rPresSettings.mbUseNavigation = bVal; - } - } - break; - } case ATTR_PRESENT_NAVIGATOR: bIllegalArgument = false; //ignored, but exists in some older documents @@ -582,8 +565,6 @@ Any SAL_CALL SlideShow::getPropertyValue( const OUString& PropertyName ) return Any( rPresSettings.mbMouseVisible ); case ATTR_PRESENT_ALWAYS_ON_TOP: return Any( rPresSettings.mbAlwaysOnTop ); - case ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS: - return Any(rPresSettings.mbUseNavigation); case ATTR_PRESENT_NAVIGATOR: return Any( false ); case ATTR_PRESENT_PEN: diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 903e7d925baf..be8a84a81cdd 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -757,7 +757,6 @@ bool SlideshowImpl::startPreview( maPresSettings.mbMouseAsPen = false; maPresSettings.mbLockedPages = false; maPresSettings.mbAlwaysOnTop = false; - maPresSettings.mbUseNavigation = false; maPresSettings.mbFullScreen = false; maPresSettings.mbAnimationAllowed = true; maPresSettings.mnPauseTimeout = 0; @@ -878,7 +877,6 @@ bool SlideshowImpl::startShow( PresentationSettingsEx const * pPresSettings ) maPresSettings.mbMouseAsPen = false; maPresSettings.mnPauseTimeout = 0; maPresSettings.mbShowPauseLogo = false; - maPresSettings.mbUseNavigation = false; } if( pStartPage ) @@ -1080,8 +1078,8 @@ bool SlideshowImpl::startShowImpl( const Sequence< beans::PropertyValue >& aProp Any( xPointerBitmap ), beans::PropertyState_DIRECT_VALUE ) ); } - - if (maPresSettings.mbUseNavigation) + SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + if (pOptions->IsShowNavigationPanel()) { BitmapEx prevSlideBm(BMP_PREV_SLIDE); const Reference<rendering::XBitmap> xPrevSBitmap( |