summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-06 07:47:08 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-06 07:47:54 +0200
commitb1a6a99b9a78689c6d3649ce066fad66912188e2 (patch)
tree6966cac52f89d4a89693e3ed751ef552320dc188 /sdext
parentcd5906358bed831c3811bcb658eeaf98d5dba9b9 (diff)
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
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/presenter/PresenterController.cxx14
-rw-r--r--sdext/source/presenter/PresenterController.hxx12
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx28
-rw-r--r--sdext/source/presenter/PresenterToolBar.cxx10
4 files changed, 63 insertions, 1 deletions
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index ce3e365952c2..d33db36ac460 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 f7a7023a5f3f..06548f0b213c 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 9dbefb239ca3..709a22e66e2d 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 3b102475398d..0b514b3e3850 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;
}