[Libreoffice-commits] core.git: icon-themes/galaxy officecfg/registry sdext/source sd/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Oct 5 22:48:22 PDT 2015


 icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerMouseOver.png |binary
 icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerNormal.png    |binary
 officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu         |   53 +++++++++-
 sd/source/ui/app/res_bmp.src                                              |   10 +
 sd/source/ui/inc/res_bmp.hrc                                              |    2 
 sd/source/ui/presenter/PresenterHelper.cxx                                |    4 
 sdext/source/presenter/PresenterController.cxx                            |   14 ++
 sdext/source/presenter/PresenterController.hxx                            |   12 ++
 sdext/source/presenter/PresenterProtocolHandler.cxx                       |   28 +++++
 sdext/source/presenter/PresenterToolBar.cxx                               |   10 +
 10 files changed, 129 insertions(+), 4 deletions(-)

New commits:
commit b1a6a99b9a78689c6d3649ce066fad66912188e2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Oct 6 07:47:08 2015 +0200

    presenter console: add 'Restart Timer' button
    
    Use case is that the presentation is started a few minutes in advance,
    so the audience can check if they are at the correct room, seeing the
    title side. Then previously the presentation had to be stopped and
    started again, so the presenter had an idea how much time the talk took
    so far. The side effect of this workaround was that the audience saw a
    short flash while the presentation was not running.
    
    Fix this by adding a button to just restart the timer, then it's not
    needed to stop/start the presentation manually.
    
    The two icons are just placeholders for now, real design is still
    needed.
    
    Change-Id: Id67e7e53a339ea5672dfb1c261f63d43466e9eff

diff --git a/icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerMouseOver.png b/icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerMouseOver.png
new file mode 100644
index 0000000..d43a1d2
Binary files /dev/null and b/icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerMouseOver.png differ
diff --git a/icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerNormal.png b/icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerNormal.png
new file mode 100644
index 0000000..651fe06
Binary files /dev/null and b/icon-themes/galaxy/sd/res/presenterscreen-ButtonRestartTimerNormal.png differ
diff --git a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
index 26d9483..513da54 100644
--- a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
@@ -345,6 +345,53 @@
             </prop>
           </node>
           <node oor:name="k" oor:op="replace">
+            <prop oor:name="Name">
+              <value>RestartTimer</value>
+            </prop>
+            <prop oor:name="Type">
+              <value>Button</value>
+            </prop>
+            <node oor:name="Normal">
+              <prop oor:name="Text">
+                <value xml:lang="en-US">Restart</value>
+              </prop>
+              <node oor:name="Icon">
+                <prop oor:name="NormalFileName">
+                  <value>bitmaps/ButtonRestartTimerNormal.png</value>
+                </prop>
+              </node>
+              <prop oor:name="Action">
+                <value>vnd.org.libreoffice.presenterscreen:RestartTimer</value>
+              </prop>
+              <node oor:name="Font">
+                <prop oor:name="Size">
+                  <value>12</value>
+                </prop>
+                <prop oor:name="Style">
+                  <value>Bold</value>
+                </prop>
+                <prop oor:name="Color">
+                  <value>B3B7BC</value>
+                </prop>
+                <prop oor:name="Anchor">
+                  <value>Center</value>
+                </prop>
+              </node>
+            </node>
+            <node oor:name="MouseOver">
+              <node oor:name="Icon">
+                <prop oor:name="NormalFileName">
+                  <value>bitmaps/ButtonRestartTimerMouseOver.png</value>
+                </prop>
+              </node>
+              <node oor:name="Font">
+                <prop oor:name="Color">
+                  <value>FFFFFF</value>
+                </prop>
+              </node>
+            </node>
+          </node>
+          <node oor:name="l" oor:op="replace">
             <prop oor:name="Type">
               <value>VerticalSeparator</value>
             </prop>
@@ -356,7 +403,7 @@
               </node>
             </node>
           </node>
-          <node oor:name="l" oor:op="replace">
+          <node oor:name="m" oor:op="replace">
             <prop oor:name="Name">
               <value>SwitchMonitor</value>
             </prop>
@@ -410,7 +457,7 @@
               </node>
             </node>
           </node>
-          <node oor:name="m" oor:op="replace">
+          <node oor:name="n" oor:op="replace">
             <prop oor:name="Type">
               <value>VerticalSeparator</value>
             </prop>
@@ -422,7 +469,7 @@
               </node>
             </node>
           </node>
-          <node oor:name="n" oor:op="replace">
+          <node oor:name="o" oor:op="replace">
             <prop oor:name="Name">
               <value>Help</value>
             </prop>
diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src
index 6d8cc04..45fc2df 100644
--- a/sd/source/ui/app/res_bmp.src
+++ b/sd/source/ui/app/res_bmp.src
@@ -553,6 +553,11 @@ Bitmap BMP_PRESENTERSCREEN_BUTTON_SWITCH_MONITOR_NORMAL
     File = "presenterscreen-ButtonSwitchMonitorNormal.png";
 };
 
+Bitmap BMP_PRESENTERSCREEN_BUTTON_RESTART_TIMER_NORMAL
+{
+    File = "presenterscreen-ButtonRestartTimerNormal.png";
+};
+
 Bitmap BMP_PRESENTERSCREEN_BORDER_TOOLBAR_RIGHT
 {
     File = "presenterscreen-BorderToolbarRight.png";
@@ -608,6 +613,11 @@ Bitmap BMP_PRESENTERSCREEN_BUTTON_SWITCH_MONITOR_MOUSE_OVER
     File = "presenterscreen-ButtonSwitchMonitorMouseOver.png";
 };
 
+Bitmap BMP_PRESENTERSCREEN_BUTTON_RESTART_TIMER_MOUSE_OVER
+{
+    File = "presenterscreen-ButtonRestartTimerMouseOver.png";
+};
+
 Bitmap BMP_PRESENTERSCREEN_BUTTON_SLIDE_PREVIOUS_DISABLED
 {
     File = "presenterscreen-ButtonSlidePreviousDisabled.png";
diff --git a/sd/source/ui/inc/res_bmp.hrc b/sd/source/ui/inc/res_bmp.hrc
index 23a4014..93ec740 100644
--- a/sd/source/ui/inc/res_bmp.hrc
+++ b/sd/source/ui/inc/res_bmp.hrc
@@ -189,6 +189,8 @@
 #define BMP_PRESENTERSCREEN_ANIMATION (RID_SD_START+591)
 #define BMP_PRESENTERSCREEN_TRANSITION (RID_SD_START+592)
 #define BMP_PRESENTATION_MINIMIZER (RID_SD_START+593)
+#define BMP_PRESENTERSCREEN_BUTTON_RESTART_TIMER_MOUSE_OVER (RID_SD_START+594)
+#define BMP_PRESENTERSCREEN_BUTTON_RESTART_TIMER_NORMAL (RID_SD_START+595)
 
 // ResourceIDs for Popup-Menus do not need a dummy string!!!
 
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 970c1b4..8fc22bc 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -344,6 +344,10 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
           BMP_PRESENTERSCREEN_BUTTON_SWITCH_MONITOR_MOUSE_OVER },
         { "bitmaps/ButtonSwitchMonitorNormal.png",
           BMP_PRESENTERSCREEN_BUTTON_SWITCH_MONITOR_NORMAL },
+        { "bitmaps/ButtonRestartTimerMouseOver.png",
+          BMP_PRESENTERSCREEN_BUTTON_SWITCH_MONITOR_MOUSE_OVER },
+        { "bitmaps/ButtonRestartTimerNormal.png",
+          BMP_PRESENTERSCREEN_BUTTON_SWITCH_MONITOR_NORMAL },
         { "bitmaps/LabelMouseOverCenter.png",
           BMP_PRESENTERSCREEN_LABEL_MOUSE_OVER_CENTER },
         { "bitmaps/LabelMouseOverLeft.png",
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index ce3e365..d33db36 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -70,6 +70,10 @@ namespace {
 
 namespace sdext { namespace presenter {
 
+IPresentationTime::~IPresentationTime()
+{
+}
+
 PresenterController::InstanceContainer PresenterController::maInstances;
 
 ::rtl::Reference<PresenterController> PresenterController::Instance (
@@ -704,6 +708,16 @@ void PresenterController::RequestViews (
     }
 }
 
+void PresenterController::SetPresentationTime(IPresentationTime* pPresentationTime)
+{
+    mpPresentationTime = pPresentationTime;
+}
+
+IPresentationTime* PresenterController::GetPresentationTime()
+{
+    return mpPresentationTime;
+}
+
 //----- XConfigurationChangeListener ------------------------------------------
 
 void SAL_CALL PresenterController::notifyConfigurationChange (
diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx
index f7a7023..06548f0 100644
--- a/sdext/source/presenter/PresenterController.hxx
+++ b/sdext/source/presenter/PresenterController.hxx
@@ -68,6 +68,14 @@ namespace {
     > PresenterControllerInterfaceBase;
 }
 
+/// Represents an element in the toolbar that shows the time elapsed since the presentation started.
+class IPresentationTime
+{
+public:
+    virtual void restart() = 0;
+    virtual ~IPresentationTime();
+};
+
 /** The controller of the presenter screen is responsible for telling the
     individual views which slides to show.  Additionally it provides access
     to frequently used values of the current theme.
@@ -133,6 +141,9 @@ public:
         const bool bIsNotesViewActive,
         const bool bIsHelpViewActive);
 
+    void SetPresentationTime(IPresentationTime* pPresentationTime);
+    IPresentationTime* GetPresentationTime();
+
     // XConfigurationChangeListener
 
     virtual void SAL_CALL notifyConfigurationChange (
@@ -215,6 +226,7 @@ private:
     css::uno::Reference<css::util::XURLTransformer> mxUrlTransformer;
     ::rtl::Reference<PresenterAccessible> mpAccessibleObject;
     bool mbIsAccessibilityActive;
+    IPresentationTime* mpPresentationTime;
 
     void GetSlides (const sal_Int32 nOffset);
     void UpdateViews();
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index 9dbefb2..709a22e 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -104,6 +104,17 @@ namespace {
         rtl::Reference<PresenterController> mpPresenterController;
     };
 
+    /// This command restarts the presentation timer.
+    class RestartTimerCommand : public Command
+    {
+    public:
+        explicit RestartTimerCommand(const rtl::Reference<PresenterController>& rpPresenterController);
+        virtual ~RestartTimerCommand();
+        virtual void Execute() SAL_OVERRIDE;
+    private:
+        rtl::Reference<PresenterController> mpPresenterController;
+    };
+
     class SetNotesViewCommand : public Command
     {
     public:
@@ -408,6 +419,8 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand (
         return new GotoPreviousSlideCommand(rpPresenterController);
     if (rsURLPath == "SwitchMonitor")
         return new SwitchMonitorCommand(rpPresenterController);
+    if (rsURLPath == "RestartTimer")
+        return new RestartTimerCommand(rpPresenterController);
     if (rsURLPath == "ShowNotes")
         return new SetNotesViewCommand(true, rpPresenterController);
     if (rsURLPath == "ShowSlideSorter")
@@ -612,6 +625,21 @@ void SwitchMonitorCommand::Execute()
     mpPresenterController->SwitchMonitors();
 }
 
+RestartTimerCommand::RestartTimerCommand (const rtl::Reference<PresenterController>& rpPresenterController)
+: mpPresenterController(rpPresenterController)
+{
+}
+
+RestartTimerCommand::~RestartTimerCommand()
+{
+}
+
+void RestartTimerCommand::Execute()
+{
+    if (IPresentationTime* pPresentationTime = mpPresenterController->GetPresentationTime())
+        pPresentationTime->restart();
+}
+
 //===== SetNotesViewCommand ===================================================
 
 SetNotesViewCommand::SetNotesViewCommand (
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index 3b10247..0b514b3 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -310,7 +310,7 @@ namespace {
         virtual void TimeHasChanged (const oslDateTime& rCurrentTime) SAL_OVERRIDE;
     };
 
-    class PresentationTimeLabel : public TimeLabel
+    class PresentationTimeLabel : public TimeLabel, public IPresentationTime
     {
     public:
         static ::rtl::Reference<Element> Create (
@@ -320,6 +320,7 @@ namespace {
             const SharedElementMode& rpMouseOverMode,
             const SharedElementMode& rpSelectedMode,
             const SharedElementMode& rpDisabledMode) SAL_OVERRIDE;
+        virtual void restart() SAL_OVERRIDE;
     private:
         TimeFormatter maTimeFormatter;
         TimeValue maStartTimeValue;
@@ -1909,6 +1910,7 @@ void CurrentTimeLabel::SetModes (
 
 PresentationTimeLabel::~PresentationTimeLabel()
 {
+    mpToolBar->GetPresenterController()->SetPresentationTime(0);
 }
 
 PresentationTimeLabel::PresentationTimeLabel (
@@ -1917,6 +1919,12 @@ PresentationTimeLabel::PresentationTimeLabel (
       maTimeFormatter(),
       maStartTimeValue()
 {
+    restart();
+    mpToolBar->GetPresenterController()->SetPresentationTime(this);
+}
+
+void PresentationTimeLabel::restart()
+{
     maStartTimeValue.Seconds = 0;
     maStartTimeValue.Nanosec = 0;
 }


More information about the Libreoffice-commits mailing list