summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorrecurrence.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeditorrecurrence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorrecurrence.cpp94
1 files changed, 51 insertions, 43 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index e0380c4..e0ae3a0 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -21,19 +21,27 @@
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qfiledialog.h>
+#include <q3filedialog.h>
#include <qlayout.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
-#include <qwidgetstack.h>
+#include <q3vbox.h>
+#include <q3buttongroup.h>
+#include <q3vgroupbox.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qspinbox.h>
#include <qcheckbox.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <QLabel>
+#include <Q3GridLayout>
+#include <Q3PtrList>
+#include <Q3Frame>
+#include <Q3VBoxLayout>
#include <kdialog.h>
#include <kglobal.h>
#include <klocale.h>
@@ -80,9 +88,9 @@ int RecurBase::frequency()
RecurDaily::RecurDaily( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QHBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3HBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
QLabel *preLabel = new QLabel( i18n("Recur every"), this );
@@ -99,15 +107,15 @@ RecurDaily::RecurDaily( QWidget *parent, const char *name ) :
RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
//topLayout->addStretch( 1 );
- QBoxLayout *weeksLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *weeksLayout = new Q3HBoxLayout( topLayout );
QLabel *preLabel = new QLabel( i18n("Recur every"), this );
weeksLayout->addWidget( preLabel );
@@ -115,10 +123,10 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
QLabel *postLabel = new QLabel( i18n("week(s) on:"), this );
weeksLayout->addWidget( postLabel );
- QHBox *dayBox = new QHBox( this );
- topLayout->addWidget( dayBox, 1, AlignVCenter );
+ Q3HBox *dayBox = new Q3HBox( this );
+ topLayout->addWidget( dayBox, 1, Qt::AlignVCenter );
// TODO: Respect start of week setting
for ( int i = 0; i < 7; ++i ) {
QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true );
int left = 1;
@@ -155,14 +163,14 @@ QBitArray RecurWeekly::days()
RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
- QBoxLayout *freqLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout );
QLabel *preLabel = new QLabel( i18n("every"), this );
freqLayout->addWidget( preLabel );
@@ -171,13 +179,13 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
QLabel *postLabel = new QLabel( i18n("month(s)"), this );
freqLayout->addWidget( postLabel );
- QButtonGroup *buttonGroup = new QButtonGroup( this );
- buttonGroup->setFrameStyle( QFrame::NoFrame );
- topLayout->addWidget( buttonGroup, 1, AlignVCenter );
+ Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this );
+ buttonGroup->setFrameStyle( Q3Frame::NoFrame );
+ topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter );
- QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 );
+ Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 3, 2 );
buttonLayout->setSpacing( KDialog::spacingHint() );
buttonLayout->setMargin( KDialog::marginHintSmall() );
@@ -188,9 +196,9 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
mByDayRadio = new QRadioButton( recurOnText, buttonGroup );
buttonLayout->addWidget( mByDayRadio, 0, 0 );
- mByDayCombo = new QComboBox( buttonGroup );
+ mByDayCombo = new Q3ComboBox( buttonGroup );
mByDayCombo->setSizeLimit( 7 );
mByDayCombo->insertItem( i18n("1st") );
mByDayCombo->insertItem( i18n("2nd") );
mByDayCombo->insertItem( i18n("3rd") );
@@ -292,14 +300,14 @@ int RecurMonthly::weekday()
RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
RecurBase( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
- QBoxLayout *freqLayout = new QHBoxLayout( topLayout );
+ Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout );
QLabel *preLabel = new QLabel( i18n("every"), this );
freqLayout->addWidget( preLabel );
@@ -308,20 +316,20 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
QLabel *postLabel = new QLabel( i18n("year(s)"), this );
freqLayout->addWidget( postLabel );
- QButtonGroup *buttonGroup = new QButtonGroup( this );
- buttonGroup->setFrameStyle( QFrame::NoFrame );
- topLayout->addWidget( buttonGroup, 1, AlignVCenter );
+ Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this );
+ buttonGroup->setFrameStyle( Q3Frame::NoFrame );
+ topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter );
- QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 2, 3 );
+ Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 2, 3 );
mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup);
buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight);
mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup );
buttonLayout->addWidget( mByDayLabel, 0, 1 );
- mByMonthCombo = new QComboBox( buttonGroup );
+ mByMonthCombo = new Q3ComboBox( buttonGroup );
mByMonthCombo->insertItem( i18n("January") );
mByMonthCombo->insertItem( i18n("February") );
mByMonthCombo->insertItem( i18n("March") );
mByMonthCombo->insertItem( i18n("April") );
@@ -382,17 +390,17 @@ int RecurYearly::day()
ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) :
QWidget( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
- QGroupBox *groupBox = new QGroupBox( 1, Horizontal, i18n("Exceptions"),
+ Q3GroupBox *groupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Exceptions"),
this );
topLayout->addWidget( groupBox );
QWidget *box = new QWidget( groupBox );
- QGridLayout *boxLayout = new QGridLayout( box );
+ Q3GridLayout *boxLayout = new Q3GridLayout( box );
mExceptionDateEdit = new KDateEdit( box );
boxLayout->addWidget( mExceptionDateEdit, 0, 0 );
@@ -402,9 +410,9 @@ ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) :
boxLayout->addWidget( changeExceptionButton, 2, 0 );
QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box );
boxLayout->addWidget( deleteExceptionButton, 3, 0 );
- mExceptionList = new QListBox( box );
+ mExceptionList = new Q3ListBox( box );
boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 );
boxLayout->setRowStretch( 4, 1 );
boxLayout->setColStretch( 1, 3 );
@@ -505,29 +513,29 @@ DateList ExceptionsDialog::dates()
RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
const char *name )
: QWidget( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
- mRangeGroupBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Range"),
+ mRangeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Range"),
this );
topLayout->addWidget( mRangeGroupBox );
QWidget *rangeBox = new QWidget( mRangeGroupBox );
- QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox );
+ Q3VBoxLayout *rangeLayout = new Q3VBoxLayout( rangeBox );
rangeLayout->setSpacing( KDialog::spacingHint() );
rangeLayout->setMargin( KDialog::marginHintSmall() );
mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox );
rangeLayout->addWidget( mStartDateLabel );
- mRangeButtonGroup = new QButtonGroup;
+ mRangeButtonGroup = new Q3ButtonGroup;
mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox );
mRangeButtonGroup->insert( mNoEndDateButton );
rangeLayout->addWidget( mNoEndDateButton );
- QBoxLayout *durationLayout = new QHBoxLayout( rangeLayout );
+ Q3BoxLayout *durationLayout = new Q3HBoxLayout( rangeLayout );
durationLayout->setSpacing( KDialog::spacingHint() );
mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox );
mRangeButtonGroup->insert( mEndDurationButton );
@@ -538,9 +546,9 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox );
durationLayout ->addWidget( endDurationLabel );
- QBoxLayout *endDateLayout = new QHBoxLayout( rangeLayout );
+ Q3BoxLayout *endDateLayout = new Q3HBoxLayout( rangeLayout );
endDateLayout->setSpacing( KDialog::spacingHint() );
mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox );
mRangeButtonGroup->insert( mEndDateButton );
@@ -665,9 +673,9 @@ void RecurrenceRangeDialog::setDateTimes( const QDateTime &start,
RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) :
QWidget( parent, name )
{
- QBoxLayout *topLayout = new QVBoxLayout( this );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( this );
mTypeCombo = new QComboBox( this );
mTypeCombo->insertItem( i18n("Daily") );
mTypeCombo->insertItem( i18n("Weekly") );
@@ -724,9 +732,9 @@ void RecurrenceChooser::emitChoice()
KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
QWidget( parent, name )
{
- QGridLayout *topLayout = new QGridLayout( this, 2,2 );
+ Q3GridLayout *topLayout = new Q3GridLayout( this, 2,2 );
topLayout->setSpacing( KDialog::spacingHint() );
topLayout->setMargin( KDialog::marginHintSmall() );
mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this );
@@ -734,9 +742,9 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
SLOT( setEnabled( bool ) ) );
topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 );
- mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"),
+ mTimeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Time"),
this );
topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 );
if ( QApplication::desktop()->width() <= 640 ) {
@@ -751,16 +759,16 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
// mDateTimeLabel = new QLabel( timeFrame );
// layoutTimeFrame->addWidget( mDateTimeLabel );
//mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) );
//mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) );
- mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this );
+ mRuleBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Rule"), this );
topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 );
mRecurrenceChooser = new RecurrenceChooser( mRuleBox );
connect( mRecurrenceChooser, SIGNAL( chosen( int ) ),
SLOT( showCurrentRule( int ) ) );
- mRuleStack = new QWidgetStack( mRuleBox );
+ mRuleStack = new Q3WidgetStack( mRuleBox );
mDaily = new RecurDaily( mRuleStack );
mRuleStack->addWidget( mDaily, 0 );
@@ -895,10 +903,10 @@ void KOEditorRecurrence::readEvent(Incidence *event)
dtEnd = ((Todo*)event)->dtDue();
setDefaults( event->dtStart(), dtEnd );
QBitArray rDays( 7 );
- QPtrList<Recurrence::rMonthPos> rmp;
- QPtrList<int> rmd;
+ Q3PtrList<Recurrence::rMonthPos> rmp;
+ Q3PtrList<int> rmd;
int day = 0;
int count = 0;
int month = 0;
setDateTimes( event->dtStart(), dtEnd );
@@ -967,9 +975,9 @@ void KOEditorRecurrence::readEvent(Incidence *event)
month = event->dtStart().date().month() ;
mYearly->setByMonth( month, day );
#if 0
//qDebug("2day = %d ",day );
- QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
+ Q3PtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
int month;
if ( !monthlist.isEmpty() ) {
month = monthlist.first()->rPos ;
} else {