-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 24 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 66 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 28 | ||||
-rw-r--r-- | libkcal/incidence.h | 3 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 4 | ||||
-rw-r--r-- | libkcal/incidencebase.h | 1 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 1 |
9 files changed, 117 insertions, 24 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index ea7071d..6723dc5 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1527,4 +1527,12 @@ { "Sending back file ...","Sende Datei zurück..." }, { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, +{ "Created","Angelegt" }, +{ "Last Modified Sub","Zuletzt geändertes Sub" }, +{ "","" }, +{ "","" }, +{ "","" }, +{ "","" }, +{ "","" }, +{ "","" }, { "","" }, { "","" }, diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7044e90..f9685e9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -368,5 +368,5 @@ void CalendarView::init() { mNextAlarmDateTime = QDateTime::currentDateTime(); - setFocusPolicy ( NoFocus ); + //setFocusPolicy ( NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; @@ -4688,6 +4688,6 @@ void CalendarView::slotCalendarChanged() void CalendarView::keyPressEvent ( QKeyEvent *e) { - //qDebug(" alendarView::keyPressEvent "); - e->ignore(); + //qDebug("CalendarView::keyPressEvent "); + e->ignore(); } diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index add1819..94f35e6 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -433,4 +433,5 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) } + e->accept(); return; } @@ -441,4 +442,5 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) case Qt::Key_Up: QListView::keyPressEvent ( e ); + e->accept(); break; case Qt::Key_Left: @@ -515,5 +517,11 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); quickLayout->addWidget( mQuickAdd ); + mNewSubBut = new QPushButton( "sub",mQuickBar ); + QPushButton * s_done = new QPushButton( "D",mQuickBar ); + QPushButton * s_run = new QPushButton( "R",mQuickBar ); + QPushButton * allopen = new QPushButton( "O",mQuickBar ); + QPushButton * allclose = new QPushButton( "C",mQuickBar ); QPushButton * flat = new QPushButton( "F",mQuickBar ); + int fixwid = flat->sizeHint().height(); if ( QApplication::desktop()->width() >= 800 ) @@ -521,16 +529,12 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : flat->setFixedWidth( fixwid ); connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); - QPushButton * allopen = new QPushButton( "O",mQuickBar ); allopen->setFixedWidth( fixwid ); connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); - QPushButton * allclose = new QPushButton( "C",mQuickBar ); allclose->setFixedWidth( fixwid ); connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); - QPushButton * s_done = new QPushButton( "D",mQuickBar ); s_done->setPixmap( SmallIcon("greenhook16")); s_done->setFixedWidth( fixwid ); s_done->setFixedHeight( flat->sizeHint().height() ); connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); - QPushButton * s_run = new QPushButton( "R",mQuickBar ); s_run->setPixmap( SmallIcon("ko16old")); s_run->setFixedWidth( fixwid ); @@ -538,5 +542,4 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); - mNewSubBut = new QPushButton( "sub",mQuickBar ); mNewSubBut->setFixedWidth( fixwid*3/2 ); connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); @@ -576,7 +579,10 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->setColumnAlignment(6,AlignHCenter); - mTodoListView->addColumn(i18n("Cancelled")); + //mTodoListView->addColumn(i18n("Cancelled")); mTodoListView->addColumn(i18n("Categories")); mTodoListView->addColumn(i18n("Calendar")); + mTodoListView->addColumn(i18n("Last Modified")); + mTodoListView->addColumn(i18n("Created")); + mTodoListView->addColumn(i18n("Last Modified Sub")); #if 0 mTodoListView->addColumn(i18n("Sort Id")); @@ -589,5 +595,5 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->setColumnWidth( 0, 120 ); int iii = 0; - for ( iii = 0; iii< 10 ; ++iii ) + for ( iii = 0; iii< 12 ; ++iii ) mTodoListView->setColumnWidthMode( iii, QListView::Manual ); @@ -1604,5 +1610,4 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) // e->ignore(); //return; - //qDebug("KOTodoView::keyPressEvent "); if ( !isVisible() ) { e->ignore(); @@ -1612,5 +1617,6 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) case Qt::Key_Down: case Qt::Key_Up: - QWidget::keyPressEvent ( e ); + // KOrg::BaseView::keyPressEvent ( e ); + e->ignore(); break; diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 0cf6e4c..bdef94c 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -154,8 +154,24 @@ void KOTodoViewItem::construct() setSortKey(6,skeyt); - setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); - setText(8,mTodo->categoriesStr()); - setText(9,KOPrefs::instance()->calName( mTodo->calID())); - + //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); + setText(7,mTodo->categoriesStr()); + setText(8,KOPrefs::instance()->calName( mTodo->calID())); + setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true )); + setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true )); + setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true )); + QString key; + QDate d = mTodo->lastModified().date(); + QTime t = mTodo->lastModified().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); + setSortKey(9,key); + d = mTodo->created().date(); + t = mTodo->created().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); + setSortKey(10,key); + d = mTodo->lastModifiedSub().date(); + t = mTodo->lastModifiedSub().time(); + key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); + setSortKey(11,key); + #if 0 // Find sort id in description. It's the text behind the last '#' character @@ -318,10 +334,42 @@ void KOTodoViewItem::stateChange(bool state) bool KOTodoViewItem::isAlternate() { - +#if 0 + //if ( m_known ) return m_odd; + //qDebug("test "); + KOTodoViewItem *item = static_cast<KOTodoViewItem *>(itemAbove()); + if ( item ) { + m_known = item->m_known; + if ( m_known ) { + m_odd = !item->m_odd ; + return m_odd; + } + } else { + item = static_cast<KOTodoViewItem *>(itemBelow()); + if ( item ) { + m_known = item->m_known; + if ( m_known ) { + m_odd = !item->m_odd ; + return m_odd; + } + } + } KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); - if (lv && lv->alternateBackground().isValid()) + item = static_cast<KOTodoViewItem *>(lv->firstChild()); + bool previous = true; + qDebug("WHILE "); + while ( item ) { + item->m_odd = !previous; + item->m_known = true; + previous = !previous; + item = static_cast<KOTodoViewItem *>(item->itemBelow()); + } + return m_odd; + +#else + + //KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); + //if (lv && lv->alternateBackground().isValid()) { - KOTodoViewItem *above = 0; - above = static_cast<KOTodoViewItem *>(itemAbove()); + KOTodoViewItem *above = static_cast<KOTodoViewItem *>(itemAbove()); m_known = above ? above->m_known : true; if (m_known) @@ -342,4 +390,5 @@ bool KOTodoViewItem::isAlternate() else { + KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); item = static_cast<KOTodoViewItem *>(lv->firstChild()); } @@ -355,4 +404,5 @@ bool KOTodoViewItem::isAlternate() } return false; +#endif } diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 11f7ecc..e4bcc5e 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -282,5 +282,25 @@ void Incidence::setReadOnly( bool readOnly ) recurrence()->setRecurReadOnly( readOnly); } - +void Incidence::setLastModifiedSubInvalid() +{ + mLastModifiedSub = QDateTime(); + if ( mRelatedTo ) + mRelatedTo->setLastModifiedSubInvalid(); +} +QDateTime Incidence::lastModifiedSub() +{ + if ( !mRelations.count() ) + return lastModified(); + if ( mLastModifiedSub.isValid() ) + return mLastModifiedSub; + mLastModifiedSub = lastModified(); + Incidence * inc; + QPtrList<Incidence> Relations = relations(); + for (inc=Relations.first();inc;inc=Relations.next()) { + if ( inc->lastModifiedSub() > mLastModifiedSub ) + mLastModifiedSub = inc->lastModifiedSub(); + } + return mLastModifiedSub; +} void Incidence::setCreated(QDateTime created) { @@ -469,4 +489,5 @@ void Incidence::addRelationsToList(QPtrList<Incidence> *rel) void Incidence::addRelation(Incidence *event) { + setLastModifiedSubInvalid(); if( mRelations.findRef( event ) == -1 ) { mRelations.append(event); @@ -477,7 +498,6 @@ void Incidence::addRelation(Incidence *event) void Incidence::removeRelation(Incidence *event) { - - mRelations.removeRef(event); - + setLastModifiedSubInvalid(); + mRelations.removeRef(event); // if (event->getRelatedTo() == this) event->setRelatedTo(0); } diff --git a/libkcal/incidence.h b/libkcal/incidence.h index c88ba2f..d4af9f0 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -278,4 +278,6 @@ class Incidence : public IncidenceBase bool isBirthday() const; bool isAnniversary() const; + QDateTime lastModifiedSub(); + void setLastModifiedSubInvalid(); @@ -293,4 +295,5 @@ protected: // base components of jounal, event and todo QDateTime mCreated; + QDateTime mLastModifiedSub; QString mDescription; QString mSummary; diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 1a19f3e..022dead 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -192,5 +192,8 @@ QString IncidenceBase::uid() const return mUid; } +void IncidenceBase::setLastModifiedSubInvalid() +{ +} void IncidenceBase::setLastModified(const QDateTime &lm) { @@ -199,4 +202,5 @@ void IncidenceBase::setLastModified(const QDateTime &lm) // Calendar::updateEvent(). mLastModified = getEvenTime(lm); + setLastModifiedSubInvalid(); //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); } diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index bed73db..665c1f6 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h @@ -150,4 +150,5 @@ class IncidenceBase : public CustomProperties bool isTagged() const; void setTagged( bool ); + virtual void setLastModifiedSubInvalid(); protected: bool blockLastModified; diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index 5d83511..7f352d6 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp @@ -477,4 +477,5 @@ void KDatePicker::keyPressEvent ( QKeyEvent * e ) case Qt::Key_Return: + case Qt::Key_Enter: tableClickedSlot(); break; |