From 2aabde6c21d6dc4f9de8cf3ac17b98053961cc6b Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 09 Jul 2005 23:58:28 +0000 Subject: fixxx --- (limited to 'korganizer') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7044e90..f9685e9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -367,7 +367,7 @@ CalendarView::CalendarView( Calendar *calendar, void CalendarView::init() { mNextAlarmDateTime = QDateTime::currentDateTime(); - setFocusPolicy ( NoFocus ); + //setFocusPolicy ( NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; @@ -4687,8 +4687,8 @@ 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 @@ -432,6 +432,7 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) } } + e->accept(); return; } @@ -440,6 +441,7 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) case Qt::Key_Down: case Qt::Key_Up: QListView::keyPressEvent ( e ); + e->accept(); break; case Qt::Key_Left: case Qt::Key_Right: @@ -514,30 +516,31 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mQuickAdd = new KOQuickTodo(mQuickBar); 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 ) fixwid *= 2; 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 ); s_run->setFixedHeight( flat->sizeHint().height() ); connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); - mNewSubBut = new QPushButton( "sub",mQuickBar ); mNewSubBut->setFixedWidth( fixwid*3/2 ); connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); mNewSubBut->setEnabled( false ); @@ -575,9 +578,12 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->addColumn(i18n("Start Time")); 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")); mTodoListView->setColumnAlignment(4,AlignHCenter); @@ -588,7 +594,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->setRenameable( 0 ); mTodoListView->setColumnWidth( 0, 120 ); int iii = 0; - for ( iii = 0; iii< 10 ; ++iii ) + for ( iii = 0; iii< 12 ; ++iii ) mTodoListView->setColumnWidthMode( iii, QListView::Manual ); @@ -1603,7 +1609,6 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) { // e->ignore(); //return; - //qDebug("KOTodoView::keyPressEvent "); if ( !isVisible() ) { e->ignore(); return; @@ -1611,7 +1616,8 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: - QWidget::keyPressEvent ( e ); + // KOrg::BaseView::keyPressEvent ( e ); + e->ignore(); break; case Qt::Key_Q: diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 0cf6e4c..bdef94c 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -153,10 +153,26 @@ void KOTodoViewItem::construct() setSortKey(5,skeyd); 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 // found in the description. White spaces are removed from beginning and end @@ -317,12 +333,44 @@ void KOTodoViewItem::stateChange(bool state) bool KOTodoViewItem::isAlternate() { - +#if 0 + //if ( m_known ) return m_odd; + //qDebug("test "); + KOTodoViewItem *item = static_cast(itemAbove()); + if ( item ) { + m_known = item->m_known; + if ( m_known ) { + m_odd = !item->m_odd ; + return m_odd; + } + } else { + item = static_cast(itemBelow()); + if ( item ) { + m_known = item->m_known; + if ( m_known ) { + m_odd = !item->m_odd ; + return m_odd; + } + } + } KOTodoListView *lv = static_cast(listView()); - if (lv && lv->alternateBackground().isValid()) + item = static_cast(lv->firstChild()); + bool previous = true; + qDebug("WHILE "); + while ( item ) { + item->m_odd = !previous; + item->m_known = true; + previous = !previous; + item = static_cast(item->itemBelow()); + } + return m_odd; + +#else + + //KOTodoListView *lv = static_cast(listView()); + //if (lv && lv->alternateBackground().isValid()) { - KOTodoViewItem *above = 0; - above = static_cast(itemAbove()); + KOTodoViewItem *above = static_cast(itemAbove()); m_known = above ? above->m_known : true; if (m_known) { @@ -341,6 +389,7 @@ bool KOTodoViewItem::isAlternate() } else { + KOTodoListView *lv = static_cast(listView()); item = static_cast(lv->firstChild()); } @@ -354,6 +403,7 @@ bool KOTodoViewItem::isAlternate() return m_odd; } return false; +#endif } void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) -- cgit v0.9.0.2