From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'korganizer/koagendaview.cpp') diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 6e65a03..87993ae 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -21,21 +21,33 @@ without including the source code for Qt in the source distribution. */ -#include -#include +#include +#include #include -#include +#include #include #ifndef KORG_NOSPLITTER #include #endif #include #include -#include +#include #include #include #include #include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -78,8 +90,8 @@ using namespace KOrg; #define IDLETIMEOUT 45 -TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : - QScrollView(parent,name,f) +TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,Qt::WFlags f) : + Q3ScrollView(parent,name,f) { myPix.resize( 1, 1 ); mRows = rows; @@ -95,7 +107,7 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : resizeContents(50,mRows * mCellHeight); - viewport()->setBackgroundMode( PaletteBackground ); + viewport()->setBackgroundMode( Qt::PaletteBackground ); } void TimeLabels::setCellHeight(int height) @@ -283,7 +295,7 @@ void TimeLabels::paintEvent(QPaintEvent*) //////////////////////////////////////////////////////////////////////////// EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) - : QFrame(parent,name) + : Q3Frame(parent,name) { mColumns = 1; mTopBox = 0; @@ -393,7 +405,7 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : expandPix = SmallIcon("1leftrightarrow" ); } - QBoxLayout *topLayout = new QVBoxLayout(this); + Q3BoxLayout *topLayout = new Q3VBoxLayout(this); // Create day name labels for agenda columns // Create agenda splitter @@ -401,13 +413,13 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); topLayout->addWidget( mSplitterAgenda ); - mAllDayFrame = new QHBox(mSplitterAgenda); - mAllDayFrame->setFocusPolicy(NoFocus); + mAllDayFrame = new Q3HBox(mSplitterAgenda); + mAllDayFrame->setFocusPolicy(Qt::NoFocus); QWidget *agendaFrame = new QWidget(mSplitterAgenda); - agendaFrame->setFocusPolicy(NoFocus); + agendaFrame->setFocusPolicy(Qt::NoFocus); // Create all-day agenda widget - mDummyAllDayLeft = new QVBox( mAllDayFrame ); + mDummyAllDayLeft = new Q3VBox( mAllDayFrame ); mExpandButton = new QPushButton(mDummyAllDayLeft); mExpandButton->setPixmap( expandPix ); @@ -420,16 +432,16 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : // QSizePolicy::Fixed ) ); mExpandButton->setFixedSize( widebut, widebut); connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); - mExpandButton->setFocusPolicy(NoFocus); + mExpandButton->setFocusPolicy(Qt::NoFocus); mAllDayAgenda = new KOAgenda(1,mAllDayFrame); - mAllDayAgenda->setFocusPolicy(NoFocus); + mAllDayAgenda->setFocusPolicy(Qt::NoFocus); QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); // Create event context menu for all day agenda //mAllDayAgendaPopup = eventPopup(); // Create agenda frame - QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); + Q3GridLayout *agendaLayout = new Q3GridLayout(agendaFrame,4,3); // QHBox *agendaFrame = new QHBox(splitterAgenda); // create event indicator bars @@ -437,10 +449,10 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : #ifndef DESKTOP_VERSION mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); #endif - mDayLabelsFrame = new QHBox(agendaFrame); + mDayLabelsFrame = new Q3HBox(agendaFrame); //topLayout->addWidget(mDayLabelsFrame); - mDayLabels = new QFrame (mDayLabelsFrame); - mLayoutDayLabels = new QHBoxLayout(mDayLabels); + mDayLabels = new Q3Frame (mDayLabelsFrame); + mLayoutDayLabels = new Q3HBoxLayout(mDayLabels); agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); agendaLayout->addWidget(mEventIndicatorTop,1,1); @@ -460,12 +472,12 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); agendaLayout->setColStretch(1,1); - mAgenda->setFocusPolicy(NoFocus); + mAgenda->setFocusPolicy(Qt::NoFocus); // Create event context menu for agenda mAllAgendaPopup = eventPopup(); #if 0 - mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), + mAllAgendaPopup->addAdditionalItem(QIcon(SmallIcon("bell")), i18n("Toggle Alarm"),mAgenda, SLOT(popupAlarm()),true); @@ -918,9 +930,9 @@ int KOAgendaView::currentDateCount() return mSelectedDates.count(); } -QPtrList KOAgendaView::selectedIncidences() +Q3PtrList KOAgendaView::selectedIncidences() { - QPtrList selected; + Q3PtrList selected; Incidence *incidence; incidence = mAgenda->selectedIncidence(); @@ -987,8 +999,8 @@ void KOAgendaView::updateConfig() mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); // ToolTips displaying summary of events - KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() - ->mEnableToolTips); + /* TODO:hacker: KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() + ->mEnableToolTips); */ //setHolidayMasks(); @@ -1117,7 +1129,7 @@ void KOAgendaView::showDates( const QDate &start, const QDate &end ) } -void KOAgendaView::showEvents(QPtrList) +void KOAgendaView::showEvents(Q3PtrList) { kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; } @@ -1165,11 +1177,11 @@ void KOAgendaView::fillAgenda() mMinY.resize(mSelectedDates.count()); mMaxY.resize(mSelectedDates.count()); - QPtrList dayEvents; + Q3PtrList dayEvents; // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. // Therefore, gtodoset all of them. - QPtrList todos = calendar()->todos(); + Q3PtrList todos = calendar()->todos(); mAgenda->setDateList(mSelectedDates); @@ -1300,7 +1312,7 @@ void KOAgendaView::fillAgenda() // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. // Already completed items can be displayed on their original due date //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda - bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; + bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)today) && KOPrefs::instance()->mShowTodoInAgenda; bool fillIn = false; if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) fillIn = true; @@ -1503,7 +1515,7 @@ void KOAgendaView::readSettings(KConfig *config) config->setGroup("Views"); //#ifndef KORG_NOSPLITTER - QValueList sizes = config->readIntListEntry("Separator AgendaView"); + Q3ValueList sizes = config->readIntListEntry("Separator AgendaView"); if (sizes.count() == 2) { if ( sizes[0] < 20 ) { sizes[1] = sizes[1] +20 - sizes[0]; @@ -1524,7 +1536,7 @@ void KOAgendaView::writeSettings(KConfig *config) config->setGroup("Views"); //#ifndef KORG_NOSPLITTER - QValueList list = mSplitterAgenda->sizes(); + Q3ValueList list = mSplitterAgenda->sizes(); config->writeEntry("Separator AgendaView",list); //qDebug("write %d %d ", list[0],list[1] ); //#endif @@ -1541,7 +1553,7 @@ void KOAgendaView::setHolidayMasks() bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); bool showHoliday = false; if ( KOPrefs::instance()->mExcludeHolidays ) { - QPtrList events = calendar()->events( date, true ); + Q3PtrList events = calendar()->events( date, true ); Event *event; for( event = events.first(); event; event = events.next() ) { if ( event->isHoliday()) { @@ -1663,7 +1675,7 @@ void KOAgendaView::updateTodo( Todo * t, int ) removeAD = true; } else { - bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; + bool overdue = (!t->isCompleted()) && (t->dtDue() < (QDateTime)QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; if ( overdue && QDate::currentDate() >= mSelectedDates.first() && QDate::currentDate() <= mSelectedDates.last()) { -- cgit v0.9.0.2