From a3fa1e49d32ccb5367b3a3472363dc80b28a8fdb Mon Sep 17 00:00:00 2001 From: Martin Ertsaas Date: Thu, 12 Sep 2019 09:32:21 +0200 Subject: [PATCH] Let the R key reset all clocks This allows for testing if the clicker works without messing up the timer --- dspdfviewer.cpp | 9 +++++++++ dspdfviewer.h | 1 + pdfviewerwindow.cpp | 3 +++ pdfviewerwindow.h | 1 + 4 files changed, 14 insertions(+) diff --git a/dspdfviewer.cpp b/dspdfviewer.cpp index f41b065a..3a4dd443 100644 --- a/dspdfviewer.cpp +++ b/dspdfviewer.cpp @@ -80,6 +80,7 @@ DSPDFViewer::DSPDFViewer(const RuntimeConfiguration& r): sconnect( &audienceWindow, SIGNAL(quitRequested()), this, SLOT(exit())); sconnect( &audienceWindow, SIGNAL(rerenderRequested()), this, SLOT(renderPage())); sconnect( &audienceWindow, SIGNAL(restartRequested()), this, SLOT(goToStartAndResetClocks())); + sconnect( &audienceWindow, SIGNAL(resetClocksRequested()), this, SLOT(resetClocks())); sconnect( &audienceWindow, SIGNAL(screenSwapRequested()), this, SLOT(swapScreens()) ); @@ -102,6 +103,7 @@ DSPDFViewer::DSPDFViewer(const RuntimeConfiguration& r): sconnect( &secondaryWindow, SIGNAL(quitRequested()), this, SLOT(exit())); sconnect( &secondaryWindow, SIGNAL(rerenderRequested()), this, SLOT(renderPage())); sconnect( &secondaryWindow, SIGNAL(restartRequested()), this, SLOT(goToStartAndResetClocks())); + sconnect( &secondaryWindow, SIGNAL(resetClocksRequested()), this, SLOT(resetClocks())); sconnect( &secondaryWindow, SIGNAL(screenSwapRequested()), this, SLOT(swapScreens()) ); @@ -268,6 +270,13 @@ QTime DSPDFViewer::slideClock() const return timeSince( slideStart ); } +void DSPDFViewer::resetClocks() +{ + presentationStart = QTime(0,0); + presentationClockRunning = false; + slideStart = QTime(0,0); +} + void DSPDFViewer::resetSlideClock() { /* Always resets the slide clock. */ diff --git a/dspdfviewer.h b/dspdfviewer.h index 160c8d7d..50900192 100644 --- a/dspdfviewer.h +++ b/dspdfviewer.h @@ -65,6 +65,7 @@ class DSPDFViewer: public QObject private slots: void sendAllClockSignals() const; + void resetClocks(); public: DSPDFViewer(const RuntimeConfiguration& r); diff --git a/pdfviewerwindow.cpp b/pdfviewerwindow.cpp index 4a5bcaf0..904a0b3c 100644 --- a/pdfviewerwindow.cpp +++ b/pdfviewerwindow.cpp @@ -222,6 +222,9 @@ void PDFViewerWindow::keyPressEvent(QKeyEvent* e) case Qt::Key_H: //Home emit restartRequested(); break; + case Qt::Key_R: //Home + emit resetClocksRequested(); + break; } } diff --git a/pdfviewerwindow.h b/pdfviewerwindow.h index 252bc736..e8bbf654 100644 --- a/pdfviewerwindow.h +++ b/pdfviewerwindow.h @@ -130,6 +130,7 @@ public slots: void previousPageRequested(); void pageRequested(unsigned requestedPageNumber); void restartRequested(); + void resetClocksRequested(); void screenSwapRequested();