Skip to content

Commit

Permalink
Let the R key reset all clocks
Browse files Browse the repository at this point in the history
This allows for testing if the clicker works without messing up the
timer
  • Loading branch information
martiert committed Sep 12, 2019
1 parent 555d28b commit a3fa1e4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dspdfviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) );

Expand All @@ -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()) );

Expand Down Expand Up @@ -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. */
Expand Down
1 change: 1 addition & 0 deletions dspdfviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class DSPDFViewer: public QObject

private slots:
void sendAllClockSignals() const;
void resetClocks();

public:
DSPDFViewer(const RuntimeConfiguration& r);
Expand Down
3 changes: 3 additions & 0 deletions pdfviewerwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
1 change: 1 addition & 0 deletions pdfviewerwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public slots:
void previousPageRequested();
void pageRequested(unsigned requestedPageNumber);
void restartRequested();
void resetClocksRequested();

void screenSwapRequested();

Expand Down

0 comments on commit a3fa1e4

Please sign in to comment.