[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: [patch] partial solution for bug#69261
From: Brad Hards <bhards () bigpond ! net ! au>
Date: 2004-04-28 11:30:21
Message-ID: 200404282130.26903.bhards () bigpond ! net ! au
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
As requested by bug#69261 (http://bugs.kde.org/show_bug.cgi?id=69261), I've
modified the dialog.
The bug requested three things:
1. radiobuttons instead of a checkbox for the manual / automatic transition
2. inclusion of the speed slider in the same box, and disabling it in manual
mode
3. QWhatsThis help
I've done 1 as suggested
2 is done for now - I think it is better to just put it closer to the
transition selector. The disable logic is done.
3 is next, if this is OK.
During testing, I was surprised to find out what "Show presentation duration" \
checkbox did - I was expecting it to show me a real-time display. In an attempt to \
fix this, I've renamed the checkbox label to "Record presentation duration".
I've also refactored a tiny function out.
Can this patch please be reviewed (Sorry, but I'm not very confident with
KOffice), before I commit it, along with the WhatsThis support. Then
I'll look to fix the docs....
Index: pgconfdia.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/pgconfdia.cc,v
retrieving revision 1.67
diff -u -4 -p -r1.67 pgconfdia.cc
- --- pgconfdia.cc 3 Jan 2004 06:58:45 -0000 1.67
+++ pgconfdia.cc 28 Apr 2004 11:28:53 -0000
@@ -31,9 +31,11 @@
#include <qlayout.h>
#include <qlistview.h>
#include <qpen.h>
#include <qpushbutton.h>
+#include <qradiobutton.h>
#include <qvaluelist.h>
+#include <qvbuttongroup.h>
#include <kcolorbutton.h>
#include <kglobal.h>
#include <klocale.h>
@@ -57,31 +59,42 @@ void PgConfDia::setupPageGeneral()
QFrame* generalPage = addPage( i18n("&General") );
QVBoxLayout *generalLayout = new QVBoxLayout( generalPage, \
KDialog::marginHint(), KDialog::spacingHint() ); generalLayout->setAutoAdd( true );
- - manualSwitch = new QCheckBox( i18n( "&Manual switch to next step" ), \
generalPage );
- - manualSwitch->setChecked( m_doc->spManualSwitch() );
- - connect( manualSwitch, SIGNAL( toggled(bool) ), this, SLOT( \
manualSwitchToggled(bool) ) );
- -
- - infiniteLoop = new QCheckBox( i18n( "&Infinite loop" ), generalPage );
- - infiniteLoop->setChecked( m_doc->spInfiniteLoop() );
- - infiniteLoop->setEnabled( !m_doc->spManualSwitch() );
- -
- - presentationDuration = new QCheckBox( i18n( "Show presentation &duration" ), \
generalPage );
- - presentationDuration->setChecked( m_doc->presentationDuration() );
- -
- - new QLabel( i18n("Speed:"), generalPage );
+ QVButtonGroup *switchGroup = new QVButtonGroup( i18n("&Transition type"), \
generalPage ); + manualButton = new QRadioButton( i18n("&Manual transition to next \
step or slide"), switchGroup ); + manualButton->setChecked( \
m_doc->spManualSwitch() ); + autoButton = new QRadioButton( i18n("&Automatic \
transition to next step or slide"), switchGroup ); +
+ QLabel *speedLabel = new QLabel( i18n("Speed:"), generalPage );
+ speedLabel->setEnabled( !m_doc->spManualSwitch() );
+ connect( autoButton, SIGNAL( toggled(bool) ), speedLabel, SLOT( setEnabled(bool) \
) );
QWidget* sp = new QWidget( generalPage );
QBoxLayout* speedLayout = new QHBoxLayout( sp, 0, spacingHint() );
speedLayout->setAutoAdd( true );
- - new QLabel( i18n("Slow"), sp );
+ QLabel *slowLabel = new QLabel( i18n("Slow"), sp );
+ slowLabel->setEnabled( !m_doc->spManualSwitch() );
+ connect( autoButton, SIGNAL( toggled(bool) ), slowLabel, SLOT( setEnabled(bool) \
) ); speedSlider = new QSlider( 1, 10, 1, 1, Qt::Horizontal, sp );
speedSlider->setValue( m_doc->getPresSpeed() );
speedSlider->setTickmarks( QSlider::Below );
speedSlider->setTickInterval( 1 );
- - new QLabel( i18n("Fast"), sp );
+ speedSlider->setEnabled( !m_doc->spManualSwitch() );
+ connect( autoButton, SIGNAL( toggled(bool) ), speedSlider, SLOT( \
setEnabled(bool) ) ); + QLabel *fastLabel = new QLabel( i18n("Fast"), sp );
+ fastLabel->setEnabled( !m_doc->spManualSwitch() );
+ connect( autoButton, SIGNAL( toggled(bool) ), fastLabel, SLOT( setEnabled(bool) \
) ); +
+
+ infiniteLoop = new QCheckBox( i18n( "&Infinite loop" ), generalPage );
+ infiniteLoop->setChecked( m_doc->spInfiniteLoop() );
+ infiniteLoop->setEnabled( !m_doc->spManualSwitch() );
+ connect( autoButton, SIGNAL( toggled(bool) ), infiniteLoop, SLOT( \
setEnabled(bool) ) ); +
+ presentationDuration = new QCheckBox( i18n( "Record presentation &duration" ), \
generalPage ); + presentationDuration->setChecked( m_doc->presentationDuration() \
);
// presentation pen (color and width)
QGroupBox* penGroup = new QGroupBox( 1, Qt::Horizontal, i18n("Presentation Pen") \
, generalPage ); @@ -145,9 +158,9 @@ bool PgConfDia::getInfiniteLoop() const
}
bool PgConfDia::getManualSwitch() const
{
- - return manualSwitch->isChecked();
+ return manualButton->isChecked();
}
bool PgConfDia::getPresentationDuration() const
{
@@ -196,13 +209,8 @@ void PgConfDia::deselectAllSlides()
item = item->nextSibling();
}
}
- -void PgConfDia::manualSwitchToggled( bool state )
- -{
- - infiniteLoop->setEnabled( !state );
- -}
- -
PresSpeed PgConfDia::getPresSpeed() const
{
int value = speedSlider->value();
if( value <= 0 ) value = 1;
Index: pgconfdia.h
===================================================================
RCS file: /home/kde/koffice/kpresenter/pgconfdia.h,v
retrieving revision 1.34
diff -u -4 -p -r1.34 pgconfdia.h
- --- pgconfdia.h 27 Aug 2003 14:45:40 -0000 1.34
+++ pgconfdia.h 28 Apr 2004 11:28:53 -0000
@@ -35,8 +35,9 @@ class KPresenterDoc;
class QCheckBox;
class QComboBox;
class QColor;
class QListView;
+class QRadioButton;
class KIntNumInput;
class KColorButton;
class QSlider;
@@ -60,9 +61,10 @@ public:
protected:
KPresenterDoc* m_doc;
- - QCheckBox *infiniteLoop, *manualSwitch, *presentationDuration;
+ QCheckBox *infiniteLoop, *presentationDuration;
+ QRadioButton *manualButton, *autoButton;
KColorButton* penColor;
KIntNumInput* penWidth;
QListView *slides;
@@ -79,9 +81,7 @@ signals:
protected slots:
void selectAllSlides();
void deselectAllSlides();
- - void manualSwitchToggled( bool state );
- -
};
#endif
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAj5XSGwwszQ/PZzgRAoeiAJ9yXPuQF/HE+mQQMB80thOkxFT2NACfZNhJ
wUY7WZ1KkEOhWIJdlgHGO70=
=XKG3
-----END PGP SIGNATURE-----
_______________________________________________
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