Bug 58505 - Tweak F5 for slide display, and add Shift-F5
Summary: Tweak F5 for slide display, and add Shift-F5
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.0.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Jakub Golebiewski
URL:
Whiteboard: target:4.1.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2012-12-19 09:36 UTC by Michael Meeks
Modified: 2015-12-15 23:56 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2012-12-19 09:36:48 UTC
UX guys suggest that slide-jockeys would appreciate the familiar: F5 to start the slideshow from the beginning, and Shift-F5 to start from the current slide.

To do that we need to go hack some code:

officecfg/registry/data/org/openoffice/Office/Accelerators.xcu

and search for .uno:Presentation.

We need to add a new name here eg. .uno:PresentationThisSlide next to .uno:Presentation.

Then we need to add a description of that to:

officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu

so it can be translated.

Then we need to add an SID:

sd/inc/sdcommands.h:#define CMD_SID_PRESENTATION                        ".uno:Presentation"

Then add this SID to the switch in:

sd/source/ui/slidesorter/controller/SlsSlotManager.cxx

and a new case to:

void SlotManager::ShowSlideShow( SfxRequest& rReq)

A:

git grep CMD_SID_PRESENTATION

will prolly show us other places to poke, perhaps a bit of addition to the help - and of course a new line to reset the current slide to the first when starting the slideshow would be great.

Hopefully not so hard :-)
Comment 1 Jorendc 2013-01-05 02:19:04 UTC
(In reply to comment #0)
> UX guys suggest that slide-jockeys would appreciate the familiar: F5 to
> start the slideshow from the beginning, and Shift-F5 to start from the
> current slide.
> 
> To do that we need to go hack some code:
> 
> officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
> 
> and search for .uno:Presentation.
> 
> We need to add a new name here eg. .uno:PresentationThisSlide next to
> .uno:Presentation.
There is already a SHIFT-F5:

    <node oor:name="F5_SHIFT" oor:op="replace">
     <prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
      <value xml:lang="en-US">.uno:RestoreEditingView</value>
     </prop>
    </node>

What I did (NOT pushed to gerrit right now): I didn't change something here, but I used this '.uno:RestoreEditingView' in the next steps
> 
> Then we need to add a description of that to:
> 
> officecfg/registry/data/org/openoffice/OfFuTemporaryfice/UI/DrawImpressCommands.xcu
> 
> so it can be translated.

      <node oor:name=".uno:RestoreEditingView" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">

          <value xml:lang="en-US">Slide Show Current Slide</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>

> 
> Then we need to add an SID:
> 
> sd/inc/sdcommands.h:#define CMD_SID_PRESENTATION                       
> ".uno:Presentation"

#define CMD_SID_PRESENTATION                        ".uno:Presentation"
#define CMD_SID_PRESENTATIONCURRENT                 ".uno:RestoreEditingView"

> 
> Then add this SID to the switch in:
> 
> sd/source/ui/slidesorter/controller/SlsSlotManager.cxx

    switch (rRequest.GetSlot())
    {
        case SID_PRESENTATION:
        case SID_PRESENTATIONCURRENT:
        case SID_REHEARSE_TIMINGS:
            ShowSlideShow (rRequest);
            pShell->Cancel();
            rRequest.Done();
            break;

> 
> and a new case to:
> 
> void SlotManager::ShowSlideShow( SfxRequest& rReq)

This is the initial version: http://opengrok.libreoffice.org/xref/core/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx#856


This is what I did (so far)


void SlotManager::ShowSlideShow( SfxRequest& rReq)
{
    Reference< XPresentation2 > xPresentation( mrSlideSorter.GetModel().GetDocument()->getPresentation() );
    if( xPresentation.is() )
    {
        if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() && SID_PRESENTATIONCURRENT != rReq.getSlot() ) )
            xPresentation->start(); //start presentation from beginning
        elseif( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() && SID_PRESENTATIONCURRENT = rReq.getSlot() ) )
            //start presentation from current slide
        else
            xPresentation->rehearseTimings();
    }
}


As you can see in the 'initial version' ... Following http://www.openoffice.org/api/docs/common/ref/com/sun/star/presentation/XPresentation.html calling the start() function SHOULD start the presentation from the beginning ... but it don't (I tested it with LO 4.1, build today with Ubuntu 12.10 and Mac OSX). So I don't get it right now, why the presentation start from current/selected presentation already.

Can you please put me back on rails :-).

Thanks in advance (and thanks for setting up this easyhack).
Kind regards,
Joren
Comment 2 Jakub Golebiewski 2013-02-04 18:58:27 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > UX guys suggest that slide-jockeys would appreciate the familiar: F5 to
> > start the slideshow from the beginning, and Shift-F5 to start from the
> > current slide.
> > 
> > To do that we need to go hack some code:
> > 
> > officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
> > 
> > and search for .uno:Presentation.
> > 
> > We need to add a new name here eg. .uno:PresentationThisSlide next to
> > .uno:Presentation.
> There is already a SHIFT-F5:
> 
>     <node oor:name="F5_SHIFT" oor:op="replace">
>      <prop oor:name="Command"><value xml:lang="x-no-translate">I10N
> SHORTCUTS - NO TRANSLATE</value>
>       <value xml:lang="en-US">.uno:RestoreEditingView</value>
>      </prop>
>     </node>
> 
> What I did (NOT pushed to gerrit right now): I didn't change something here,
> but I used this '.uno:RestoreEditingView' in the next steps
> > 
> > Then we need to add a description of that to:
> > 
> > officecfg/registry/data/org/openoffice/OfFuTemporaryfice/UI/DrawImpressCommands.xcu
> > 
> > so it can be translated.
> 
>       <node oor:name=".uno:RestoreEditingView" oor:op="replace">
>         <prop oor:name="Label" oor:type="xs:string">
> 
>           <value xml:lang="en-US">Slide Show Current Slide</value>
>         </prop>
>         <prop oor:name="Properties" oor:type="xs:int">
>           <value>1</value>
>         </prop>
>       </node>
> 
> > 
> > Then we need to add an SID:
> > 
> > sd/inc/sdcommands.h:#define CMD_SID_PRESENTATION                       
> > ".uno:Presentation"
> 
> #define CMD_SID_PRESENTATION                        ".uno:Presentation"
> #define CMD_SID_PRESENTATIONCURRENT                 ".uno:RestoreEditingView"
> 
> > 
> > Then add this SID to the switch in:
> > 
> > sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
> 
>     switch (rRequest.GetSlot())
>     {
>         case SID_PRESENTATION:
>         case SID_PRESENTATIONCURRENT:
>         case SID_REHEARSE_TIMINGS:
>             ShowSlideShow (rRequest);
>             pShell->Cancel();
>             rRequest.Done();
>             break;
> 
> > 
> > and a new case to:
> > 
> > void SlotManager::ShowSlideShow( SfxRequest& rReq)
> 
> This is the initial version:
> http://opengrok.libreoffice.org/xref/core/sd/source/ui/slidesorter/
> controller/SlsSlotManager.cxx#856
> 
> 
> This is what I did (so far)
> 
> 
> void SlotManager::ShowSlideShow( SfxRequest& rReq)
> {
>     Reference< XPresentation2 > xPresentation(
> mrSlideSorter.GetModel().GetDocument()->getPresentation() );
>     if( xPresentation.is() )
>     {
>         if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() &&
> SID_PRESENTATIONCURRENT != rReq.getSlot() ) )
>             xPresentation->start(); //start presentation from beginning
>         elseif( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() &&
> SID_PRESENTATIONCURRENT = rReq.getSlot() ) )
>             //start presentation from current slide
>         else
>             xPresentation->rehearseTimings();
>     }
> }
> 
> 
> As you can see in the 'initial version' ... Following
> http://www.openoffice.org/api/docs/common/ref/com/sun/star/presentation/
> XPresentation.html calling the start() function SHOULD start the
> presentation from the beginning ... but it don't (I tested it with LO 4.1,
> build today with Ubuntu 12.10 and Mac OSX). So I don't get it right now, why
> the presentation start from current/selected presentation already.
> 
> Can you please put me back on rails :-).
> 
> Thanks in advance (and thanks for setting up this easyhack).
> Kind regards,
> Joren

(In reply to comment #0)
> UX guys suggest that slide-jockeys would appreciate the familiar: F5 to
> start the slideshow from the beginning, and Shift-F5 to start from the
> current slide.
> 
> To do that we need to go hack some code:
> 
> officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
> 
> and search for .uno:Presentation.
> 
> We need to add a new name here eg. .uno:PresentationThisSlide next to
> .uno:Presentation.
> 
> Then we need to add a description of that to:
> 
> officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
> 
> so it can be translated.
> 
> Then we need to add an SID:
> 
> sd/inc/sdcommands.h:#define CMD_SID_PRESENTATION                       
> ".uno:Presentation"
> 
> Then add this SID to the switch in:
> 
> sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
> 
> and a new case to:
> 
> void SlotManager::ShowSlideShow( SfxRequest& rReq)
> 
> A:
> 
> git grep CMD_SID_PRESENTATION
> 
> will prolly show us other places to poke, perhaps a bit of addition to the
> help - and of course a new line to reset the current slide to the first when
> starting the slideshow would be great.
> 
> Hopefully not so hard :-)

(In reply to comment #1)
> (In reply to comment #0)
> > UX guys suggest that slide-jockeys would appreciate the familiar: F5 to
> > start the slideshow from the beginning, and Shift-F5 to start from the
> > current slide.
> > 
> > To do that we need to go hack some code:
> > 
> > officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
> > 
> > and search for .uno:Presentation.
> > 
> > We need to add a new name here eg. .uno:PresentationThisSlide next to
> > .uno:Presentation.
> There is already a SHIFT-F5:
> 
>     <node oor:name="F5_SHIFT" oor:op="replace">
>      <prop oor:name="Command"><value xml:lang="x-no-translate">I10N
> SHORTCUTS - NO TRANSLATE</value>
>       <value xml:lang="en-US">.uno:RestoreEditingView</value>
>      </prop>
>     </node>
> 
> What I did (NOT pushed to gerrit right now): I didn't change something here,
> but I used this '.uno:RestoreEditingView' in the next steps
> > 
> > Then we need to add a description of that to:
> > 
> > officecfg/registry/data/org/openoffice/OfFuTemporaryfice/UI/DrawImpressCommands.xcu
> > 
> > so it can be translated.
> 
>       <node oor:name=".uno:RestoreEditingView" oor:op="replace">
>         <prop oor:name="Label" oor:type="xs:string">
> 
>           <value xml:lang="en-US">Slide Show Current Slide</value>
>         </prop>
>         <prop oor:name="Properties" oor:type="xs:int">
>           <value>1</value>
>         </prop>
>       </node>
> 
> > 
> > Then we need to add an SID:
> > 
> > sd/inc/sdcommands.h:#define CMD_SID_PRESENTATION                       
> > ".uno:Presentation"
> 
> #define CMD_SID_PRESENTATION                        ".uno:Presentation"
> #define CMD_SID_PRESENTATIONCURRENT                 ".uno:RestoreEditingView"
> 
> > 
> > Then add this SID to the switch in:
> > 
> > sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
> 
>     switch (rRequest.GetSlot())
>     {
>         case SID_PRESENTATION:
>         case SID_PRESENTATIONCURRENT:
>         case SID_REHEARSE_TIMINGS:
>             ShowSlideShow (rRequest);
>             pShell->Cancel();
>             rRequest.Done();
>             break;
> 
> > 
> > and a new case to:
> > 
> > void SlotManager::ShowSlideShow( SfxRequest& rReq)
> 
> This is the initial version:
> http://opengrok.libreoffice.org/xref/core/sd/source/ui/slidesorter/
> controller/SlsSlotManager.cxx#856
> 
> 
> This is what I did (so far)
> 
> 
> void SlotManager::ShowSlideShow( SfxRequest& rReq)
> {
>     Reference< XPresentation2 > xPresentation(
> mrSlideSorter.GetModel().GetDocument()->getPresentation() );
>     if( xPresentation.is() )
>     {
>         if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() &&
> SID_PRESENTATIONCURRENT != rReq.getSlot() ) )
>             xPresentation->start(); //start presentation from beginning
>         elseif( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() &&
> SID_PRESENTATIONCURRENT = rReq.getSlot() ) )
>             //start presentation from current slide
>         else
>             xPresentation->rehearseTimings();
>     }
> }
> 
> 
> As you can see in the 'initial version' ... Following
> http://www.openoffice.org/api/docs/common/ref/com/sun/star/presentation/
> XPresentation.html calling the start() function SHOULD start the
> presentation from the beginning ... but it don't (I tested it with LO 4.1,
> build today with Ubuntu 12.10 and Mac OSX). So I don't get it right now, why
> the presentation start from current/selected presentation already.
> 
> Can you please put me back on rails :-).
> 
> Thanks in advance (and thanks for setting up this easyhack).
> Kind regards,
> Joren

Hey,
I will take this bug if you don't mind.
Regards,
Kuba
Comment 3 Jorendc 2013-02-04 20:22:33 UTC
Sure! No problem with that.

Kind regards,
Joren
Comment 4 Jakub Golebiewski 2013-02-11 17:00:15 UTC
I'm still working on this, need more time :c

Kind regards,
Kuba
Comment 5 Jorendc 2013-02-11 17:17:16 UTC
(In reply to comment #4)
> I'm still working on this, need more time :c

Sure, I placed you in the 'assigned to' field. Thanks for hacking this one!

Kind regards,
Joren
Comment 6 Jakub Golebiewski 2013-02-18 18:46:05 UTC
Still need more time, but I'll do it no matter what :).
Comment 7 Jakub Golebiewski 2013-02-25 22:06:31 UTC
Still working on this.
Comment 8 Jakub Golebiewski 2013-03-04 20:38:02 UTC Comment hidden (obsolete)
Comment 9 Jakub Golebiewski 2013-03-11 20:01:34 UTC
I'm making some progress, still need some time though.
Comment 10 Jakub Golebiewski 2013-03-18 22:31:24 UTC
I'm almost done.
Comment 11 Thorsten Behrens (allotropia) 2013-03-23 16:27:10 UTC
(In reply to comment #10)
> I'm almost done.
>
Hi Jakub, we're at the Impress sprint and kind of blocked by this bug - any chance you could paste a work-in-progress patch, or come to IRC (freenode, #libreoffice-dev), and then we finish it interactively?
Comment 12 Jakub Golebiewski 2013-03-24 10:56:51 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > I'm almost done.
> >
> Hi Jakub, we're at the Impress sprint and kind of blocked by this bug - any
> chance you could paste a work-in-progress patch,

I'm working on it

> or come to IRC (freenode,

I'm on irc as kubusg

> #libreoffice-dev), and then we finish it interactively?
Comment 13 Lior Kaplan 2013-04-17 07:56:37 UTC
Please notice commit baffab9a4ffca9a4940a3310937d6e858e66cc1f is related to this bug, hopefully also fixes it.
Comment 14 Thorsten Behrens (allotropia) 2013-04-23 09:05:40 UTC
I would think this is fixed now - please reopen if builds from http://dev-builds.libreoffice.org/daily/master/ don't cut it
Comment 15 Samuel Mehrbrodt (allotropia) 2013-04-25 12:08:29 UTC
Verified it works.
Comment 16 Robinson Tryon (qubit) 2015-12-15 23:56:10 UTC Comment hidden (obsolete)