Kaydet (Commit) b8608fdd authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt Kaydeden (comit) Luboš Luňák

fdo#45233 Allow editing pps/ppsx Autoplay Presentations

Added a context menu "Edit Presentation" when in Autplay mode.
This has been discussed and approved by the Design team: https://wiki.documentfoundation.org/Design/Meetings/2013-07-20

Change-Id: Ic229e54bd10d23f999f1d746cce38c4004504d28
Reviewed-on: https://gerrit.libreoffice.org/4960Reviewed-by: 's avatarLuboš Luňák <l.lunak@suse.cz>
Tested-by: 's avatarLuboš Luňák <l.lunak@suse.cz>
üst dd9c97d5
......@@ -164,6 +164,7 @@ private:
sal_Bool mbOnlineSpell;
sal_Bool mbSummationOfParagraphs;
bool mbStartWithPresentation; ///< is set to true when starting with command line parameter -start
bool mbExitAfterPresenting = false; ///< true if mbStartWithPresentation AND Presentation was shown fully
LanguageType meLanguage;
LanguageType meLanguageCJK;
LanguageType meLanguageCTL;
......@@ -258,6 +259,9 @@ public:
bool IsStartWithPresentation() const;
void SetStartWithPresentation( bool bStartWithPresentation );
bool IsExitAfterPresenting() const;
void SetExitAfterPresenting( bool bExitAfterPresenting );
/** Insert pages into this document
This method inserts whole pages into this document, either
......
......@@ -935,6 +935,16 @@ void SdDrawDocument::SetStartWithPresentation( bool bStartWithPresentation )
mbStartWithPresentation = bStartWithPresentation;
}
bool SdDrawDocument::IsExitAfterPresenting() const
{
return mbExitAfterPresenting;
}
void SdDrawDocument::SetExitAfterPresenting( bool bExitAfterPresenting )
{
mbExitAfterPresenting = bExitAfterPresenting;
}
void SdDrawDocument::PageListChanged()
{
mpDrawPageListWatcher->Invalidate();
......
......@@ -802,9 +802,9 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
}
}
if( pViewShell->GetDoc()->IsStartWithPresentation() )
if( pViewShell->GetDoc()->IsExitAfterPresenting() )
{
pViewShell->GetDoc()->SetStartWithPresentation( false );
pViewShell->GetDoc()->SetExitAfterPresenting( false );
Reference<frame::XDispatchProvider> xProvider(pViewShell->GetViewShellBase().GetController()->getFrame(),
UNO_QUERY);
......
......@@ -41,6 +41,8 @@
#define CM_WIDTH_PEN_VERY_THICK 17
#define CM_PEN_MODE 18
#define CM_EDIT_PRESENTATION 19
#define CM_SLIDES 21 // this must be the last id!
#endif
......
......@@ -141,6 +141,11 @@ Menu RID_SLIDESHOW_CONTEXTMENU
};
};
MenuItem
{
Identifier = CM_EDIT_PRESENTATION ;
Text [ en-US ] = "E~dit Presentation" ;
};
MenuItem
{
Identifier = CM_ENDSHOW ;
Text [ en-US ] = "~End Show" ;
......
......@@ -897,6 +897,11 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
if (mpParentWindow == NULL)
return false;
// Autoplay (pps/ppsx)
if (mpViewShell->GetDoc()->IsStartWithPresentation()){
mpViewShell->GetDoc()->SetExitAfterPresenting(true);
}
bool bRet = false;
try
......@@ -2158,6 +2163,7 @@ IMPL_LINK_NOARG(SlideshowImpl, ContextMenuHdl)
const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) );
pMenu->EnableItem( CM_PREV_SLIDE, ( mpSlideController->getPreviousSlideIndex() != -1 ) || (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) );
pMenu->EnableItem( CM_EDIT_PRESENTATION, mpViewShell->GetDoc()->IsStartWithPresentation());
PopupMenu* pPageMenu = pMenu->GetPopupMenu( CM_GOTO );
......@@ -2384,6 +2390,19 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu )
mbWasPaused = false;
}
break;
case CM_EDIT_PRESENTATION:
// When in autoplay mode (pps/ppsx), offer editing of the presentation
// Turn autostart off, else Impress will close when exiting the Presentation
mpViewShell->GetDoc()->SetExitAfterPresenting(false);
if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) )
{
if( mpSlideController->getCurrentSlideNumber() != -1 )
{
mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
}
}
endPresentation();
break;
case CM_ENDSHOW:
// in case the user cancels the presentation, switch to current slide
// in edit mode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment