diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /korganizer/kotimelineview.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/kotimelineview.cpp')
-rw-r--r-- | korganizer/kotimelineview.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/korganizer/kotimelineview.cpp b/korganizer/kotimelineview.cpp index 24f981a53..ac40e2a31 100644 --- a/korganizer/kotimelineview.cpp +++ b/korganizer/kotimelineview.cpp @@ -26,7 +26,7 @@ #include <libkcal/calendar.h> #include <libkcal/calendarresources.h> -#include <qlayout.h> +#include <tqlayout.h> #include <kdgantt/KDGanttViewTaskItem.h> #include <kdgantt/KDGanttViewSubwidgets.h> @@ -41,12 +41,12 @@ using namespace KOrg; using namespace KCal; -KOTimelineView::KOTimelineView(Calendar *calendar, QWidget *parent, +KOTimelineView::KOTimelineView(Calendar *calendar, TQWidget *parent, const char *name) : KOEventView(calendar, parent, name), mEventPopup( 0 ) { - QVBoxLayout* vbox = new QVBoxLayout(this); + TQVBoxLayout* vbox = new TQVBoxLayout(this); mGantt = new KDGanttView(this); mGantt->setCalendarMode( true ); mGantt->setShowLegendButton( false ); @@ -62,18 +62,18 @@ KOTimelineView::KOTimelineView(Calendar *calendar, QWidget *parent, vbox->addWidget( mGantt ); - connect( mGantt, SIGNAL(gvCurrentChanged(KDGanttViewItem*)), - SLOT(itemSelected(KDGanttViewItem*)) ); - connect( mGantt, SIGNAL(itemDoubleClicked(KDGanttViewItem*)), - SLOT(itemDoubleClicked(KDGanttViewItem*)) ); - connect( mGantt, SIGNAL(itemRightClicked(KDGanttViewItem*)), - SLOT(itemRightClicked(KDGanttViewItem*)) ); - connect( mGantt, SIGNAL(gvItemMoved(KDGanttViewItem*)), - SLOT(itemMoved(KDGanttViewItem*)) ); - connect( mGantt, SIGNAL(rescaling(KDGanttView::Scale)), - SLOT(overscale(KDGanttView::Scale)) ); - connect( mGantt, SIGNAL( dateTimeDoubleClicked( const QDateTime& ) ), - SLOT( newEventWithHint( const QDateTime& ) ) ); + connect( mGantt, TQT_SIGNAL(gvCurrentChanged(KDGanttViewItem*)), + TQT_SLOT(itemSelected(KDGanttViewItem*)) ); + connect( mGantt, TQT_SIGNAL(itemDoubleClicked(KDGanttViewItem*)), + TQT_SLOT(itemDoubleClicked(KDGanttViewItem*)) ); + connect( mGantt, TQT_SIGNAL(itemRightClicked(KDGanttViewItem*)), + TQT_SLOT(itemRightClicked(KDGanttViewItem*)) ); + connect( mGantt, TQT_SIGNAL(gvItemMoved(KDGanttViewItem*)), + TQT_SLOT(itemMoved(KDGanttViewItem*)) ); + connect( mGantt, TQT_SIGNAL(rescaling(KDGanttView::Scale)), + TQT_SLOT(overscale(KDGanttView::Scale)) ); + connect( mGantt, TQT_SIGNAL( dateTimeDoubleClicked( const TQDateTime& ) ), + TQT_SLOT( newEventWithHint( const TQDateTime& ) ) ); } KOTimelineView::~KOTimelineView() @@ -100,13 +100,13 @@ int KOTimelineView::currentDateCount() } /*virtual*/ -void KOTimelineView::showDates(const QDate& start, const QDate& end) +void KOTimelineView::showDates(const TQDate& start, const TQDate& end) { mStartDate = start; mEndDate = end; - mHintDate = QDateTime(); - mGantt->setHorizonStart( QDateTime(start) ); - mGantt->setHorizonEnd( QDateTime(end.addDays(1)) ); + mHintDate = TQDateTime(); + mGantt->setHorizonStart( TQDateTime(start) ); + mGantt->setHorizonEnd( TQDateTime(end.addDays(1)) ); mGantt->setMinorScaleCount( 1 ); mGantt->setScale( KDGanttView::Hour ); mGantt->setMinimumScale( KDGanttView::Hour ); @@ -121,20 +121,20 @@ void KOTimelineView::showDates(const QDate& start, const QDate& end) CalendarResources *calres = dynamic_cast<CalendarResources*>( calendar() ); if ( !calres ) { item = new TimelineItem( i18n("Calendar"), mGantt ); - mCalendarItemMap[0][QString()] = item; + mCalendarItemMap[0][TQString()] = item; } else { CalendarResourceManager *manager = calres->resourceManager(); for ( CalendarResourceManager::ActiveIterator it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { - QColor resourceColor = *KOPrefs::instance()->resourceColor( (*it)->identifier() ); + TQColor resourceColor = *KOPrefs::instance()->resourceColor( (*it)->identifier() ); if ( (*it)->canHaveSubresources() ) { - QStringList subResources = (*it)->subresources(); - for ( QStringList::ConstIterator subit = subResources.constBegin(); subit != subResources.constEnd(); ++subit ) { - QString type = (*it)->subresourceType( *subit ); + TQStringList subResources = (*it)->subresources(); + for ( TQStringList::ConstIterator subit = subResources.constBegin(); subit != subResources.constEnd(); ++subit ) { + TQString type = (*it)->subresourceType( *subit ); if ( !(*it)->subresourceActive( *subit ) || (!type.isEmpty() && type != "event") ) continue; item = new TimelineItem( (*it)->labelForSubresource( *subit ), mGantt ); resourceColor = *KOPrefs::instance()->resourceColor( (*it)->identifier() ); - QColor subrescol = *KOPrefs::instance()->resourceColor( *subit ); + TQColor subrescol = *KOPrefs::instance()->resourceColor( *subit ); if ( subrescol.isValid() ) resourceColor = subrescol; if ( resourceColor.isValid() ) @@ -145,14 +145,14 @@ void KOTimelineView::showDates(const QDate& start, const QDate& end) item = new TimelineItem( (*it)->resourceName(), mGantt ); if ( resourceColor.isValid() ) item->setColors( resourceColor, resourceColor, resourceColor ); - mCalendarItemMap[*it][QString()] = item; + mCalendarItemMap[*it][TQString()] = item; } } } // add incidences Event::List events; - for ( QDate day = start; day <= end; day = day.addDays( 1 ) ) { + for ( TQDate day = start; day <= end; day = day.addDays( 1 ) ) { events = calendar()->events( day, EventSortStartDate, SortDirectionAscending ); for ( Event::List::ConstIterator it = events.constBegin(); it != events.constEnd(); ++it ) { insertIncidence( *it, day ); @@ -210,7 +210,7 @@ void KOTimelineView::itemDoubleClicked( KDGanttViewItem *item ) void KOTimelineView::itemRightClicked( KDGanttViewItem *item ) { - mHintDate = mGantt->getDateTimeForCoordX( QCursor::pos().x(), true ); + mHintDate = mGantt->getDateTimeForCoordX( TQCursor::pos().x(), true ); TimelineSubItem *tlitem = dynamic_cast<TimelineSubItem*>( item ); if ( !tlitem ) { showNewEventPopup(); @@ -218,10 +218,10 @@ void KOTimelineView::itemRightClicked( KDGanttViewItem *item ) } if ( !mEventPopup ) mEventPopup = eventPopup(); - mEventPopup->showIncidencePopup( tlitem->incidence(), QDate() ); + mEventPopup->showIncidencePopup( tlitem->incidence(), TQDate() ); } -bool KOTimelineView::eventDurationHint(QDateTime & startDt, QDateTime & endDt, bool & allDay) +bool KOTimelineView::eventDurationHint(TQDateTime & startDt, TQDateTime & endDt, bool & allDay) { startDt = mHintDate; endDt = mHintDate.addSecs( 2 * 60 * 60 ); @@ -230,7 +230,7 @@ bool KOTimelineView::eventDurationHint(QDateTime & startDt, QDateTime & endDt, b } //slot -void KOTimelineView::newEventWithHint( const QDateTime& dt ) +void KOTimelineView::newEventWithHint( const TQDateTime& dt ) { mHintDate = dt; emit newEventSignal( dt ); @@ -241,22 +241,22 @@ TimelineItem * KOTimelineView::calendarItemForIncidence(KCal::Incidence * incide CalendarResources *calres = dynamic_cast<CalendarResources*>( calendar() ); TimelineItem *item = 0; if ( !calres ) { - item = mCalendarItemMap[0][QString()]; + item = mCalendarItemMap[0][TQString()]; } else { ResourceCalendar *res = calres->resource( incidence ); if ( !res ) return 0; if ( res->canHaveSubresources() ) { - QString subRes = res->subresourceIdentifier( incidence ); + TQString subRes = res->subresourceIdentifier( incidence ); item = mCalendarItemMap[res][subRes]; } else { - item = mCalendarItemMap[res][QString()]; + item = mCalendarItemMap[res][TQString()]; } } return item; } -void KOTimelineView::insertIncidence(KCal::Incidence * incidence, const QDate &day ) +void KOTimelineView::insertIncidence(KCal::Incidence * incidence, const TQDate &day ) { TimelineItem *item = calendarItemForIncidence( incidence ); if ( !item ) { @@ -265,13 +265,13 @@ void KOTimelineView::insertIncidence(KCal::Incidence * incidence, const QDate &d } if ( incidence->doesRecur() ) { - QValueList<QDateTime> l = incidence->startDateTimesForDate( day ); + TQValueList<TQDateTime> l = incidence->startDateTimesForDate( day ); if ( l.isEmpty() ) { // strange, but seems to happen for some recurring events... - item->insertIncidence( incidence, QDateTime( day, incidence->dtStart().time() ), - QDateTime( day, incidence->dtEnd().time() ) ); + item->insertIncidence( incidence, TQDateTime( day, incidence->dtStart().time() ), + TQDateTime( day, incidence->dtEnd().time() ) ); } else { - for ( QValueList<QDateTime>::ConstIterator it = l.constBegin(); + for ( TQValueList<TQDateTime>::ConstIterator it = l.constBegin(); it != l.constEnd(); ++it ) { item->insertIncidence( incidence, *it, incidence->endDateForStart( *it ) ); } @@ -288,8 +288,8 @@ void KOTimelineView::insertIncidence(KCal::Incidence * incidence) if ( !event ) return; if ( incidence->doesRecur() ) - insertIncidence( incidence, QDate() ); - for ( QDate day = mStartDate; day <= mEndDate; day = day.addDays( 1 ) ) { + insertIncidence( incidence, TQDate() ); + for ( TQDate day = mStartDate; day <= mEndDate; day = day.addDays( 1 ) ) { Event::List events = calendar()->events( day, EventSortStartDate, SortDirectionAscending ); for ( Event::List::ConstIterator it = events.constBegin(); it != events.constEnd(); ++it ) { if ( events.contains( event ) ) @@ -305,8 +305,8 @@ void KOTimelineView::removeIncidence(KCal::Incidence * incidence) item->removeIncidence( incidence ); } else { // try harder, the incidence might already be removed from the resource - typedef QMap<QString, KOrg::TimelineItem*> M2_t; - typedef QMap<KCal::ResourceCalendar*, M2_t> M1_t; + typedef TQMap<TQString, KOrg::TimelineItem*> M2_t; + typedef TQMap<KCal::ResourceCalendar*, M2_t> M1_t; for ( M1_t::ConstIterator it1 = mCalendarItemMap.constBegin(); it1 != mCalendarItemMap.constEnd(); ++it1 ) { for ( M2_t::ConstIterator it2 = it1.data().constBegin(); it2 != it1.data().constEnd(); ++it2 ) { if ( it2.data() ) { @@ -324,9 +324,9 @@ void KOTimelineView::itemMoved(KDGanttViewItem * item) return; Incidence *i = tlit->incidence(); mChanger->beginChange( i ); - QDateTime newStart = tlit->startTime(); + TQDateTime newStart = tlit->startTime(); if ( i->doesFloat() ) - newStart = QDateTime( newStart.date() ); + newStart = TQDateTime( newStart.date() ); int delta = tlit->originalStart().secsTo( newStart ); i->setDtStart( i->dtStart().addSecs( delta ) ); int duration = tlit->startTime().secsTo( tlit->endTime() ); |