Changeset View
Changeset View
Standalone View
Standalone View
ui/presentationwidget.cpp
Show All 37 Lines | |||||
38 | #include <klineedit.h> | 38 | #include <klineedit.h> | ||
39 | #include <KLocalizedString> | 39 | #include <KLocalizedString> | ||
40 | #include <kiconloader.h> | 40 | #include <kiconloader.h> | ||
41 | #include <kmessagebox.h> | 41 | #include <kmessagebox.h> | ||
42 | #include <kselectaction.h> | 42 | #include <kselectaction.h> | ||
43 | #include <QDialog> | 43 | #include <QDialog> | ||
44 | 44 | | |||
45 | #ifdef Q_OS_LINUX | 45 | #ifdef Q_OS_LINUX | ||
46 | #include <mpris2/mpris2service.h> | ||||
46 | #include <QDBusUnixFileDescriptor> | 47 | #include <QDBusUnixFileDescriptor> | ||
47 | #include <unistd.h> // For ::close() for sleep inhibition | 48 | #include <unistd.h> // For ::close() for sleep inhibition | ||
48 | #endif | 49 | #endif | ||
49 | 50 | | |||
50 | // system includes | 51 | // system includes | ||
51 | #include <stdlib.h> | 52 | #include <stdlib.h> | ||
52 | #include <math.h> | 53 | #include <math.h> | ||
53 | 54 | | |||
▲ Show 20 Lines • Show All 211 Lines • ▼ Show 20 Line(s) | 265 | { | |||
265 | setCursor( QCursor( Qt::BlankCursor ) ); | 266 | setCursor( QCursor( Qt::BlankCursor ) ); | ||
266 | } | 267 | } | ||
267 | 268 | | |||
268 | setupActions(); | 269 | setupActions(); | ||
269 | 270 | | |||
270 | // inhibit power management | 271 | // inhibit power management | ||
271 | inhibitPowerManagement(); | 272 | inhibitPowerManagement(); | ||
272 | 273 | | |||
274 | #ifdef Q_OS_LINUX | ||||
275 | m_mpris2Service = new Okular::Mpris2Service(m_document , m_ac, this, this); | ||||
276 | #endif | ||||
277 | | ||||
273 | show(); | 278 | show(); | ||
274 | 279 | | |||
275 | QTimer::singleShot( 0, this, &PresentationWidget::slotDelayedEvents ); | 280 | QTimer::singleShot( 0, this, &PresentationWidget::slotDelayedEvents ); | ||
276 | 281 | | |||
277 | // setFocus() so KCursor::setAutoHideCursor() goes into effect if it's enabled | 282 | // setFocus() so KCursor::setAutoHideCursor() goes into effect if it's enabled | ||
278 | setFocus( Qt::OtherFocusReason ); | 283 | setFocus( Qt::OtherFocusReason ); | ||
279 | } | 284 | } | ||
280 | 285 | | |||
Show All 23 Lines | 287 | { | |||
304 | delete m_drawingEngine; | 309 | delete m_drawingEngine; | ||
305 | 310 | | |||
306 | // delete frames | 311 | // delete frames | ||
307 | QVector< PresentationFrame * >::iterator fIt = m_frames.begin(), fEnd = m_frames.end(); | 312 | QVector< PresentationFrame * >::iterator fIt = m_frames.begin(), fEnd = m_frames.end(); | ||
308 | for ( ; fIt != fEnd; ++fIt ) | 313 | for ( ; fIt != fEnd; ++fIt ) | ||
309 | delete *fIt; | 314 | delete *fIt; | ||
310 | } | 315 | } | ||
311 | 316 | | |||
317 | bool PresentationWidget::isAdvancingSlides() const | ||||
318 | { | ||||
319 | return m_advanceSlides; | ||||
320 | } | ||||
312 | 321 | | |||
313 | void PresentationWidget::notifySetup( const QVector< Okular::Page * > & pageSet, int setupFlags ) | 322 | void PresentationWidget::notifySetup( const QVector< Okular::Page * > & pageSet, int setupFlags ) | ||
314 | { | 323 | { | ||
315 | // same document, nothing to change - here we assume the document sets up | 324 | // same document, nothing to change - here we assume the document sets up | ||
316 | // us with the whole document set as first notifySetup() | 325 | // us with the whole document set as first notifySetup() | ||
317 | if ( !( setupFlags & Okular::DocumentObserver::DocumentChanged ) ) | 326 | if ( !( setupFlags & Okular::DocumentObserver::DocumentChanged ) ) | ||
318 | return; | 327 | return; | ||
319 | 328 | | |||
▲ Show 20 Lines • Show All 2127 Lines • ▼ Show 20 Line(s) | 2453 | { | |||
2447 | if ( m_advanceSlides ) | 2456 | if ( m_advanceSlides ) | ||
2448 | { | 2457 | { | ||
2449 | startAutoChangeTimer(); | 2458 | startAutoChangeTimer(); | ||
2450 | } | 2459 | } | ||
2451 | else | 2460 | else | ||
2452 | { | 2461 | { | ||
2453 | m_nextPageTimer->stop(); | 2462 | m_nextPageTimer->stop(); | ||
2454 | } | 2463 | } | ||
2464 | | ||||
2465 | emit advancingSlidesChanged(m_advanceSlides); | ||||
2455 | } | 2466 | } | ||
2456 | 2467 | | |||
2457 | #include "presentationwidget.moc" | 2468 | #include "presentationwidget.moc" |