[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Patch for KPresenter (Auto Presentation wait time)
From: Toshitaka Fujioka <toshitaka () kde ! gr ! jp>
Date: 2001-07-29 10:49:47
[Download RAW message or body]
On Friday 27 July 2001 04:10, Carsten Pfeiffer wrote:
> On Donnerstag, 26. Juli 2001 19:58 David Faure wrote:
> > A sleep is a much better idea. What's the problem with sleep, Niko ?
> > This is about the presentation mode, there is no "the application doesn't
> > repaint" issue...
>
> how would you abort the presentation for example? Or use a pen to paint
> something into a slide (does kpresenter support that at all, yet?). Better
> use a timer to jump to the next slide.
Ah, I see. Thank you for advice. I remade a patch.
Even "Effect for changing to next page: No effect" works fine.
Please review.
PS: Had better I change pgconfdia.cc and pgconfdia.h after
1.1 release ?
--
Toshitaka Fujioka
http://www.kde.org The K Desktop Environment Project
fujioka@kde.org
http://www.kde.gr.jp Japan KDE User's Group
toshitaka@kde.gr.jp
-- We offer the best Desktop Environment to you. (This is my goal. ;-)) --
["koffice-kpresenter-autoPresentationWaitTime-20010729.diff" (text/x-diff)]
Index: kpresenter_view.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_view.cc,v
retrieving revision 1.370
diff -u -3 -d -p -r1.370 kpresenter_view.cc
--- kpresenter_view.cc 2001/07/26 13:53:57 1.370
+++ kpresenter_view.cc 2001/07/29 10:42:08
@@ -1080,7 +1080,8 @@ void KPresenterView::startScreenPres( in
if ( !kPresenterDoc()->spManualSwitch() ) {
continuePres = true;
exitPres = false;
- doAutomaticScreenPres();
+ page->repaint( false );
+ QTimer::singleShot( kPresenterDoc()->getPresSpeed()*1000, this, SLOT( \
doAutomaticScreenPres() ) ); }
}
}
@@ -2825,17 +2826,21 @@ void KPresenterView::keyPressEvent( QKey
/*====================== do automatic screenpresentation ========*/
void KPresenterView::doAutomaticScreenPres()
{
- page->repaint( false );
-
- while ( continuePres && !exitPres )
- screenNext();
-
- if ( !exitPres && kPresenterDoc()->spInfinitLoop() ) {
- screenStop();
- screenStart();
+ if ( exitPres ) // A user pushed Escape key or clicked "Exit presentation" \
button. + return;
+ else if ( !continuePres && kPresenterDoc()->spInfinitLoop() ) {
+ continuePres = true;
+ // return to first page.
+ page->gotoPage( 1 );
+ }
+ else if ( !continuePres ) {
+ screenStop();
+ return;
}
+ else
+ screenNext();
- screenStop();
+ QTimer::singleShot( kPresenterDoc()->getPresSpeed()*1000, this, SLOT( \
doAutomaticScreenPres() ) ); }
void KPresenterView::updateReadWrite( bool readwrite )
Index: kpresenter_view.h
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_view.h,v
retrieving revision 1.133
diff -u -3 -d -p -r1.133 kpresenter_view.h
--- kpresenter_view.h 2001/07/20 13:48:25 1.133
+++ kpresenter_view.h 2001/07/29 10:42:09
@@ -385,6 +385,8 @@ protected slots:
void search();
+ void doAutomaticScreenPres();
+
protected:
// ********* functions ***********
@@ -408,7 +410,6 @@ protected:
void setupRulers();
void startScreenPres( int pgNum = -1 );
- void doAutomaticScreenPres();
virtual void updateReadWrite( bool readwrite );
Index: pgconfdia.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/pgconfdia.cc,v
retrieving revision 1.31
diff -u -3 -d -p -r1.31 pgconfdia.cc
--- pgconfdia.cc 2001/06/10 16:24:35 1.31
+++ pgconfdia.cc 2001/07/29 10:42:26
@@ -29,10 +29,10 @@
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qheader.h>
-#include <qspinbox.h>
#include <klocale.h>
#include <kbuttonbox.h>
+#include <knuminput.h>
/******************************************************************/
/* class PgConfDia */
@@ -56,11 +56,11 @@ PgConfDia::PgConfDia( QWidget* parent, c
manualSwitch = new QCheckBox( i18n( "&Manual switch to next step" ), general );
manualSwitch->setChecked( swMan );
-
- label4 = new QLabel( i18n( "Speed of the presentation:" ), general );
- speedSpinBox = new QSpinBox( general, "speedSpinBox" );
- speedSpinBox->setValue( presSpeed );
+ speedOfPresentation = new KIntNumInput( presSpeed, general );
+ speedOfPresentation->setRange( 1, 600, 1 );
+ speedOfPresentation->setLabel( i18n( "Speed of the presentation:" ) );
+ speedOfPresentation->setSuffix( i18n( " seconds" ) );
back->addWidget(general);
@@ -158,7 +158,7 @@ PageEffect PgConfDia::getPageEffect()
/*================================================================*/
PresSpeed PgConfDia::getPresSpeed()
{
- return speedSpinBox->value();
+ return speedOfPresentation->value();
}
#include <pgconfdia.moc>
Index: pgconfdia.h
===================================================================
RCS file: /home/kde/koffice/kpresenter/pgconfdia.h,v
retrieving revision 1.16
diff -u -3 -d -p -r1.16 pgconfdia.h
--- pgconfdia.h 2001/04/19 08:05:23 1.16
+++ pgconfdia.h 2001/07/29 10:42:26
@@ -34,7 +34,7 @@ class KPresenterDoc;
class QRadioButton;
class QComboBox;
class QCheckBox;
-class QSpinBox;
+class KIntNumInput;
/******************************************************************/
/* class PgConfDia */
@@ -59,12 +59,12 @@ protected:
QButtonGroup *general, *page, *slides;
QCheckBox *infinitLoop, *manualSwitch;
QRadioButton *slidesAll, *slidesCurrent, *slidesSelected;
- QLabel *label1, *label2, *label3, *label4;
+ QLabel *label1, *label2, *label3;
QPushButton *cancelBut, *okBut;
QComboBox *effectCombo;
- QSpinBox *speedSpinBox;
QVBoxLayout *back;
QListView *lSlides;
+ KIntNumInput* speedOfPresentation;
public slots:
void confDiaOk() { emit pgConfDiaOk(); }
_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.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