From b18f76cc44fe069071a6451e84e913c2ca865270 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Sun, 28 Sep 2008 15:11:03 +0100 Subject: [PATCH] Added unipresent presentation goToSlide to slide double click event --- kworship/kworship.cpp | 13 +++++++++++++ kworship/kworship.h | 1 + unipresent/common/UpPresentation.h | 5 ++++- unipresent/kpresenter1/UpKpr1Presentation.cpp | 4 ++++ unipresent/kpresenter1/UpKpr1Presentation.h | 4 +++- unipresent/openoffice.org/UpOoPresentation.cpp | 4 ++++ unipresent/openoffice.org/UpOoPresentation.h | 4 +++- 7 files changed, 32 insertions(+), 3 deletions(-) diff --git a/kworship/kworship.cpp b/kworship/kworship.cpp index 64a9e64..47a3d55 100644 --- a/kworship/kworship.cpp +++ b/kworship/kworship.cpp @@ -226,6 +226,7 @@ kworship::kworship() KToggleAction* fullscreenPresAction = new KToggleAction(KIcon("fullscreen"), "Fullscreen Presentation Mode", presToolBar); presToolBar->addAction(fullscreenPresAction); + connect(m_view->listSlides, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slide_doubleClicked(QModelIndex))); QToolBar* slidesToolBar = new QToolBar("Slides"); m_view->layoutSlidesToolbar->layout()->addWidget(slidesToolBar); @@ -497,4 +498,16 @@ void kworship::presentationToggled(bool checked) } } +void kworship::slide_doubleClicked(QModelIndex index) +{ + // Find the listviews current index + UpPresentationsModel* model = m_presentationManager->presentationsModel(); + QModelIndex parentIndex = model->parent(index); + UpPresentationNode* presNode = dynamic_cast(model->itemFromIndex(parentIndex)); + if (0 != presNode) + { + presNode->getItem()->goToSlide(index.row()); + } +} + #include "kworship.moc" diff --git a/kworship/kworship.h b/kworship/kworship.h index a4c3f6c..aaf954f 100644 --- a/kworship/kworship.h +++ b/kworship/kworship.h @@ -80,6 +80,7 @@ private slots: void playlist_doubleClicked(QModelIndex); void presentationSelected(int); void presentationToggled(bool); + void slide_doubleClicked(QModelIndex); private: void setupActions(); diff --git a/unipresent/common/UpPresentation.h b/unipresent/common/UpPresentation.h index cd09791..e89d7be 100644 --- a/unipresent/common/UpPresentation.h +++ b/unipresent/common/UpPresentation.h @@ -66,7 +66,7 @@ class UpPresentation : public QObject virtual int numSlides() = 0; /// Get a specific slide. - virtual UpSlide* slide(int) = 0; + virtual UpSlide* slide(int index) = 0; /* * Slideshow control @@ -77,6 +77,9 @@ class UpPresentation : public QObject /// Stop the slideshow. virtual void stopSlideshow() = 0; + + /// Go to a specific slide. + virtual void goToSlide(int index) = 0; }; #endif // _UpPresentation_h_ diff --git a/unipresent/kpresenter1/UpKpr1Presentation.cpp b/unipresent/kpresenter1/UpKpr1Presentation.cpp index 0987f18..9f13183 100644 --- a/unipresent/kpresenter1/UpKpr1Presentation.cpp +++ b/unipresent/kpresenter1/UpKpr1Presentation.cpp @@ -91,5 +91,9 @@ void UpKpr1Presentation::stopSlideshow() } } +void UpKpr1Presentation::goToSlide(int index) +{ +} + #include "UpKpr1Presentation.moc" diff --git a/unipresent/kpresenter1/UpKpr1Presentation.h b/unipresent/kpresenter1/UpKpr1Presentation.h index 338adb7..958ed45 100644 --- a/unipresent/kpresenter1/UpKpr1Presentation.h +++ b/unipresent/kpresenter1/UpKpr1Presentation.h @@ -58,7 +58,7 @@ class UpKpr1Presentation : public UpPresentation virtual int numSlides(); - virtual UpSlide* slide(int); + virtual UpSlide* slide(int index); /* * Slideshow control @@ -68,6 +68,8 @@ class UpKpr1Presentation : public UpPresentation virtual void stopSlideshow(); + virtual void goToSlide(int index); + private: /* diff --git a/unipresent/openoffice.org/UpOoPresentation.cpp b/unipresent/openoffice.org/UpOoPresentation.cpp index 1702cc4..5ce77ec 100644 --- a/unipresent/openoffice.org/UpOoPresentation.cpp +++ b/unipresent/openoffice.org/UpOoPresentation.cpp @@ -114,5 +114,9 @@ void UpOoPresentation::stopSlideshow() presentation->end(); } +void UpOoPresentation::goToSlide(int index) +{ +} + #include "UpOoPresentation.moc" diff --git a/unipresent/openoffice.org/UpOoPresentation.h b/unipresent/openoffice.org/UpOoPresentation.h index df958d4..74a936e 100644 --- a/unipresent/openoffice.org/UpOoPresentation.h +++ b/unipresent/openoffice.org/UpOoPresentation.h @@ -62,7 +62,7 @@ class UpOoPresentation : public UpPresentation virtual int numSlides(); - virtual UpSlide* slide(int); + virtual UpSlide* slide(int index); /* * Slideshow control @@ -72,6 +72,8 @@ class UpOoPresentation : public UpPresentation virtual void stopSlideshow(); + virtual void goToSlide(int index); + private: /* -- 2.11.4.GIT