[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    RFC: presentation duration dialog
From:       Thorsten Zachmann <t.zachmann () zagge ! de>
Date:       2004-03-24 17:14:42
Message-ID: 200403241814.43585.t.zachmann () zagge ! de
[Download RAW message or body]

Hello all,

I'm still working on kprcanvas. The attached patch fixes problems which the 
duration time of the slides. The time was shown for the wrong slide if not 
all slides were shown.

During this work I noticed the following:

Up to now the presentation duration shows only the time of the slide when it 
was shown last. So if the presentation goes like

Slide - duration
1 - 2 sec
2 - 4 sec
3 - 5 sec
2 - 1 sec
3 - 1 sec

At the end the duration dialog shows:
1 - 2 sec
2 - 1 sec
3 - 1 sec

Presentation duration 4 sec

Should this be changed so that is shows like
1 - 2 sec
2 - 5 sec
3 - 6 sec

Presentation duration 13 sec ?


I would prefer the later as this shows really the time a slide was shown. 
Should I change it? What do you think?

Have a nice day,

Thorsten

["duration.diff" (text/x-diff)]

Index: kpresenter_view.h
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_view.h,v
retrieving revision 1.320
diff -u -3 -p -r1.320 kpresenter_view.h
--- kpresenter_view.h	20 Mar 2004 08:19:10 -0000	1.320
+++ kpresenter_view.h	24 Mar 2004 17:13:24 -0000
@@ -584,9 +584,11 @@ public:
     bool getPictureGrayscal() const { return grayscal; }
     int getPictureBright() const { return bright; }
 
-    int getPresentationDuration() const;
-    void setPresentationDuration( int _pgNum );
-    void restartPresentationDuration();
+    /**
+     * Set the duration of the give page ( zero based ).
+     * This reads out m_duration and restarts the time.
+     */
+    void setPageDuration( int _pgNum );
 
     KPrPage * stickyPage() const;
 
@@ -1073,7 +1075,9 @@ private:
     bool automaticScreenPresFirstTimer;
     int currentTimer;
 
-    QTime m_presentationDuration;
+    /// timer for duration of a page
+    QTime m_duration;
+    /// list for saving the duration of the pages 
     QValueList<int> m_presentationDurationList;
 
     KoCharSelectDia *m_specialCharDlg;
Index: kpresenter_view.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_view.cc,v
retrieving revision 1.1002
diff -u -3 -p -r1.1002 kpresenter_view.cc
--- kpresenter_view.cc	20 Mar 2004 08:19:09 -0000	1.1002
+++ kpresenter_view.cc	24 Mar 2004 17:13:40 -0000
@@ -1492,9 +1492,9 @@ void KPresenterView::startScreenPres( in
         actionScreenStart->setEnabled( false );
 
         if ( kPresenterDoc()->presentationDuration() ) {
-            m_presentationDuration.start();
+            m_duration.start();
 
-            // ### make m_presentationDuration a QMemArray
+            // ### make m_duration a QMemArray
             for ( unsigned int i = 0; i < kPresenterDoc()->pageList().count(); ++i )
                 m_presentationDurationList.append( 0 ); // initialization
         }
@@ -1538,9 +1538,6 @@ void KPresenterView::screenStop()
             m_pKPresenterDoc->recalcVariables( VT_ALL );
         }
 
-//         if ( kPresenterDoc()->presentationDuration() && !m_presentationDurationList.isEmpty() )
-//             setPresentationDuration( m_canvas->presPage() - 1 );
-
         m_canvas->stopScreenPresentation();
         presStarted = false;
         vert->setEnabled( true );
@@ -5846,26 +5843,16 @@ void KPresenterView::slotViewFormattingC
     m_pKPresenterDoc->repaint(false);
 }
 
-int KPresenterView::getPresentationDuration() const
-{
-    return m_presentationDuration.elapsed();
-}
-
-void KPresenterView::setPresentationDuration( int _pgNum )
+void KPresenterView::setPageDuration( int _pgNum )
 {
     if ( kPresenterDoc()->presentationDuration() )
     {
-        // kdDebug(33001) << "KPresenterView::setPresentationDuration( " << _pgNum << " )" << endl;
-        *m_presentationDurationList.at( _pgNum ) = getPresentationDuration();
-        restartPresentationDuration();
+        // kdDebug(33001) << "KPresenterView::setPageDuration( " << _pgNum << " )" << endl;
+        *m_presentationDurationList.at( _pgNum ) = m_duration.elapsed();
+        m_duration.restart();
     }
 }
 
-void KPresenterView::restartPresentationDuration()
-{
-    m_presentationDuration.restart();
-}
-
 void KPresenterView::openThePresentationDurationDialog()
 {
     int totalTime = 0;
Index: kprcanvas.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kprcanvas.cc,v
retrieving revision 1.394
diff -u -3 -p -r1.394 kprcanvas.cc
--- kprcanvas.cc	23 Mar 2004 05:22:05 -0000	1.394
+++ kprcanvas.cc	24 Mar 2004 17:13:55 -0000
@@ -3199,6 +3199,8 @@ bool KPrCanvas::pNext( bool )
         QPixmap _pix1( desk.width(), desk.height() );
         drawCurrentPageInPix( _pix1 );
 
+        m_view->setPageDuration( m_step.m_pageNumber );
+
         m_step.m_pageNumber = *( ++m_presentationSlidesIterator ) - 1;
         m_step.m_subStep = 0;
         //kdDebug(33001) << "Page::pNext going to page " << m_step.m_pageNumber << endl;
@@ -3247,8 +3249,6 @@ bool KPrCanvas::pNext( bool )
 
         kPchangePages( this, _pix1, _pix2, _pageEffect, pageSpeedFakt() );
 
-        m_view->setPresentationDuration( m_step.m_pageNumber );
-
 
         if ( !spManualSwitch() )
             m_view->autoScreenPresReStartTimer();
@@ -3263,7 +3263,7 @@ bool KPrCanvas::pNext( bool )
     // we display the 'End of presentation' slide.
     if ( ( spManualSwitch() || !spInfiniteLoop() ) && !showingLastSlide )
     {
-        m_view->setPresentationDuration( m_step.m_pageNumber );
+        m_view->setPageDuration( m_step.m_pageNumber );
 
 #if KDE_IS_VERSION(3,1,90)
         QRect desk = KGlobalSettings::desktopGeometry(this);
@@ -3289,7 +3289,7 @@ bool KPrCanvas::pNext( bool )
     }
     else
     {
-        m_view->setPresentationDuration( m_step.m_pageNumber );
+        m_view->setPageDuration( m_step.m_pageNumber );
         emit stopPres(); // tells automatic mode to restart
     }
 
@@ -3317,6 +3317,8 @@ bool KPrCanvas::pPrev( bool /*manual*/ )
             doObjEffects();
             return false;
         }
+        m_view->setPageDuration( m_step.m_pageNumber );
+
         m_step.m_pageNumber = *( --m_presentationSlidesIterator ) - 1;
 
         tmpObjs.clear();
@@ -3331,8 +3333,6 @@ bool KPrCanvas::pPrev( bool /*manual*/ )
         m_pageEffectSteps = doc->getPageEffectSteps( m_step.m_pageNumber );
         m_step.m_step = *( --m_pageEffectSteps.end() );
 
-        m_view->setPresentationDuration( m_step.m_pageNumber + 1 );
-
         return true;
     }
 
@@ -4928,6 +4928,9 @@ void KPrCanvas::slotGotoPage()
 {
     setCursor( blankCursor );
     int pg = m_step.m_pageNumber + 1;
+    
+    m_view->setPageDuration( m_step.m_pageNumber );
+
     pg = KPGotoPage::gotoPage( m_view->kPresenterDoc(), m_presentationSlides, pg, this );
     gotoPage( pg );
 
@@ -4936,8 +4939,6 @@ void KPrCanvas::slotGotoPage()
         setNextPageTimer( true );
     }
 
-    m_view->setPresentationDuration( pg - 1 );
-
     if ( presMenu->isItemChecked ( PM_DM ) )
         setCursor( KPresenterUtils::penCursor() );
 }


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic