summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-08-06 09:54:42 (UTC)
committer zautrix <zautrix>2005-08-06 09:54:42 (UTC)
commitb841f4f2d54ac531c1f9ec88852d31307b9145f2 (patch) (side-by-side diff)
treec334106e75e73bbc3fc33cd3c0d6480314a42774
parentcd215c243d0636cabbc73006652b9b6783319de1 (diff)
downloadkdepimpi-b841f4f2d54ac531c1f9ec88852d31307b9145f2.zip
kdepimpi-b841f4f2d54ac531c1f9ec88852d31307b9145f2.tar.gz
kdepimpi-b841f4f2d54ac531c1f9ec88852d31307b9145f2.tar.bz2
fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--korganizer/kotodoview.cpp30
-rw-r--r--korganizer/kotodoview.h2
3 files changed, 26 insertions, 10 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index f4b3ddb..201f863 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,54 +1,56 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.1.19 ************
-Fixed a crash in journal view and a crash in setting a todo to stopped when KO/Pi saved the file when "stop todo" dialog was shown.
+Fixed a crash in journal view.
+Fixed a crash at setting a todo to stopped if KO/Pi saved the file while "stop todo" dialog was shown.
Fixed a minor problem with the marcus bains line (whatever that is).
+Fixed a crash when setting a todo to complete from the show dialog which was called from the What's Next View.
********** VERSION 2.1.18 ************
Pi-Sync mode:
The "Write back file" status dialog was updated too often such that writing back the file on the Z was very slow. Fixed.
KO/Pi:
Fixed a layout problem on the Z 5500 with the calender box right of the location box in the event/todo editor. Thanks to Andrew, who found, reported and fixed this problem ( I did not get that problem - it was working on my 5500 ).
Fixed a problem when (imported or added from other applications) events or todos did have attachments.
Fixed a really ugly and hidden problem in the management of the parent/child relationchip of todos.
********** VERSION 2.1.17 ************
KO/Pi:
Added option to display times in What's Next View on two lines.
(Useful for display on the Zaurus with 240x320 screen)
Removed "Allday" for allday events of one day duration in What's Next View.
Added date range for allday events of more than one day duration in What's Next View.
Fixed two problems in the data importing from Outlook:
Fixed the duplicated import if the summary, location or description had whitespaces at the end.
Fixed a problem importing certain recurrence rules.
A journal in an ics file may have no dtStart value (as files from KNotes, which stores its notes in an ics journal file).
If now a journal has no dtStart value the dtStart value is set to the created value of the journal when loading the file. That makes it possible to view and edit "notes" from KNotes. Simply add another Resource in KO/Pi which is a copy of the ics file from KNotes. You will find the "notes" in KO/Pi as a journal entry on the date you created it.
And some minor fixes in KO/Pi.
Fixed a crash on the desktop when closing KO/Pi after accessing adressbook data (Linux + Windows ).
********** VERSION 2.1.16 ************
Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus.
Added columns for datetime in todo view: Last modified, created and last modified subtodo
Fixed a bug in agenda view displaying recurring multiday events which are longer than two days.
Made conflict detection up to 4 times faster.
********** VERSION 2.1.15 ************
Fixed two layout problems on the Z:
Made the with of the newly added buttons on the Quick-Todo smaller.
Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible.
********** VERSION 2.1.14 ************
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 00c2d97..27d755e 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -458,96 +458,97 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e )
e->ignore();
}
void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
QListView::contentsMouseReleaseEvent(e);
mMousePressed = false;
}
void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
if (!e) return;
QPoint vp = contentsToViewport(e->pos());
QListViewItem *item = itemAt(vp);
emit double_Clicked(item);
if (!item) return;
emit doubleClicked(item,vp,0);
}
/////////////////////////////////////////////////////////////////////////////
KOQuickTodo::KOQuickTodo(QWidget *parent) :
QLineEdit(parent)
{
setText(i18n("Click to add new Todo"));
}
void KOQuickTodo::focusInEvent(QFocusEvent *ev)
{
if ( text()==i18n("Click to add new Todo") )
setText("");
QLineEdit::focusInEvent(ev);
}
void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
{
setText(i18n("Click to add new Todo"));
QLineEdit::focusOutEvent(ev);
}
/////////////////////////////////////////////////////////////////////////////
KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
KOrg::BaseView(calendar,parent,name)
{
+ mActiveItem = 0;
mCategoryPopupMenu = 0;
mPendingUpdateBeforeRepaint = false;
isFlatDisplay = false;
mNavigator = 0;
QBoxLayout *topLayout = new QVBoxLayout(this);
mName = QString ( name );
mBlockUpdate = false;
mQuickBar = new QWidget( this );
topLayout->addWidget(mQuickBar);
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 = mQuickAdd->sizeHint().height();
int fixhei = fixwid;
if ( QApplication::desktop()->width() > 800 )
fixwid = (fixwid*3)/2;
connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
s_done->setPixmap( SmallIcon("greenhook16"));
connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
s_run->setPixmap( SmallIcon("ko16old"));
connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() );
mNewSubBut->setEnabled( false );
flat->setFixedWidth( fixwid );
s_done->setFixedWidth( fixwid );
allopen->setFixedWidth( fixwid );
allclose->setFixedWidth( fixwid );
s_run->setFixedWidth( fixwid );
flat->setFixedHeight(fixhei );
s_done->setFixedHeight(fixhei );
allopen->setFixedHeight(fixhei );
allclose->setFixedHeight(fixhei );
s_run->setFixedHeight(fixhei );
mNewSubBut->setFixedHeight(fixhei );
@@ -762,154 +763,163 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
}
KOTodoView::~KOTodoView()
{
#if QT_VERSION >= 0x030000
#else
delete mKOTodoViewWhatsThis;
#endif
delete mDocPrefs;
}
QString KOTodoView::getWhatsThisText(QPoint p)
{
KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
if ( item )
return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
KOPrefs::instance()->mWTshowDetails,
KOPrefs::instance()->mWTshowCreated,
KOPrefs::instance()->mWTshowChanged);
return i18n("That is the todo view" );
}
void KOTodoView::jumpToDate ()
{
// if (mActiveItem) {
// mActiveItem->todo());
// if ( mActiveItem->todo()->hasDueDate() )
// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
}
void KOTodoView::paintNeeded()
{
if ( mPendingUpdateBeforeRepaint ) {
updateView();
mPendingUpdateBeforeRepaint = false;
}
}
void KOTodoView::paintEvent(QPaintEvent * pevent)
{
if ( mPendingUpdateBeforeRepaint ) {
updateView();
mPendingUpdateBeforeRepaint = false;
}
KOrg::BaseView::paintEvent( pevent);
}
+void KOTodoView::clearList( bool saveCurrentItem ) // default true
+{
+ if ( mTodoListView->childCount() ) {
+ if ( saveCurrentItem )
+ storeCurrentItem();
+ mTodoListView->clear();
+ mTodoMap.clear();
+ }
+}
void KOTodoView::updateView()
{
+ mActiveItem = 0;
pendingSubtodo = 0;
if ( mBlockUpdate ) {
return;
}
if ( !isVisible() ) {
+ clearList ();
mPendingUpdateBeforeRepaint = true;
return;
}
//qDebug("KOTodoView::updateView() %x", this);
if ( isFlatDisplay ) {
displayAllFlat();
return;
}
- storeCurrentItem();
//qDebug("update ");
// kdDebug() << "KOTodoView::updateView()" << endl;
QFont fo = KOPrefs::instance()->mTodoViewFont;
+ clearList ();
- mTodoListView->clear();
if ( mName == "todolistsmall" ) {
if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
int ps = fo.pointSize() -2;
if ( ps > 12 )
ps -= 2;
fo.setPointSize( ps );
}
}
mTodoListView->setFont( fo );
// QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
//mTodoListView->header()->setMaximumHeight(fm.height());
QPtrList<Todo> todoList = calendar()->todos();
/*
kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
Event *t;
for(t = todoList.first(); t; t = todoList.next()) {
kdDebug() << " " << t->getSummary() << endl;
if (t->getRelatedTo()) {
kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
}
QPtrList<Event> l = t->getRelations();
Event *c;
for(c=l.first();c;c=l.next()) {
kdDebug() << " - relation: " << c->getSummary() << endl;
}
}
*/
// Put for each Event a KOTodoViewItem in the list view. Don't rely on a
// specific order of events. That means that we have to generate parent items
// recursively for proper hierarchical display of Todos.
- mTodoMap.clear();
Todo *todo;
todo = todoList.first();// todo; todo = todoList.next()) {
while ( todo ) {
bool next = true;
// qDebug("todo %s ", todo->summary().latin1());
Incidence *incidence = todo->relatedTo();
while ( incidence ) {
if ( incidence->typeID() == todoID ) {
//qDebug("related %s ",incidence->summary().latin1() );
if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) {
//qDebug("related not found ");
todoList.remove( );
todo = todoList.current();
next = false;
incidence = 0;
} else {
//qDebug("related found ");
incidence = incidence->relatedTo();
}
} else
incidence = 0;
}
if ( next )
todo = todoList.next();
}
for(todo = todoList.first(); todo; todo = todoList.next()) {
if (!mTodoMap.contains(todo) && checkTodo( todo ) )
{
insertTodoItem(todo);
}
}
// Restore opened/closed state
mTodoListView->blockSignals( true );
if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
mTodoListView->blockSignals( false );
resetCurrentItem();
}
void KOTodoView::storeCurrentItem()
{
mCurItem = 0;
mCurItemRootParent = 0;
mCurItemParent = 0;
mCurItemAbove = 0;
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
if (mActiveItem) {
@@ -929,96 +939,97 @@ void KOTodoView::resetCurrentItem()
{
//mTodoListView->setFocus();
KOTodoViewItem* foundItem = 0;
KOTodoViewItem* foundItemRoot = 0;
KOTodoViewItem* foundItemParent = 0;
KOTodoViewItem* foundItemAbove = 0;
if ( mTodoListView->firstChild () ) {
if ( mCurItem ) {
KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild ();
while ( item ) {
if ( item->todo() == mCurItem ) {
foundItem = item;
break;
} else if ( item->todo() == mCurItemAbove ) {
foundItemAbove = item;
}
if ( item->todo() == mCurItemRootParent ) {
foundItemRoot = item;
}
if ( item->todo() == mCurItemParent ) {
foundItemParent = item;
}
item = (KOTodoViewItem*)item->itemBelow();
}
if ( ! foundItem ) {
if ( foundItemParent ) {
foundItem = foundItemParent;
} else {
if ( foundItemRoot )
foundItem = foundItemRoot;
else
foundItem = foundItemAbove;
}
}
}
if ( foundItem ) {
mTodoListView->setSelected ( foundItem, true );
mTodoListView->setCurrentItem( foundItem );
mTodoListView->ensureItemVisible( foundItem );
} else {
if ( mTodoListView->firstChild () ) {
mTodoListView->setSelected ( mTodoListView->firstChild (), true );
mTodoListView->setCurrentItem( mTodoListView->firstChild () );
}
}
}
processSelectionChange();
+ if ( mName != "todolistsmall" )
QTimer::singleShot( 100, this, SLOT ( resetFocusToList() ));
}
void KOTodoView::resetFocusToList()
{
topLevelWidget()->setActiveWindow();
mTodoListView->setFocus();
}
//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
bool KOTodoView::checkTodo( Todo * todo )
{
if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
return false;
if ( !todo->isCompleted() ) {
if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() )
return true;
}
if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
if ( todo->hasStartDate() )
if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
return false;
if ( todo->hasDueDate() )
if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
return false;
}
return true;
}
void KOTodoView::restoreItemState( QListViewItem *item )
{
pendingSubtodo = 0;
while( item ) {
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
item = item->nextSibling();
}
}
QMap<Todo *,KOTodoViewItem *>::ConstIterator
KOTodoView::insertTodoItem(Todo *todo)
{
// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
// TODO: Check, if dynmaic cast is necessary
pendingSubtodo = 0;
@@ -1055,101 +1066,103 @@ void KOTodoView::updateConfig()
}
QPtrList<Incidence> KOTodoView::selectedIncidences()
{
QPtrList<Incidence> selected;
KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
// if (!item) item = mActiveItem;
if (item) selected.append(item->todo());
return selected;
}
QPtrList<Todo> KOTodoView::selectedTodos()
{
QPtrList<Todo> selected;
KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
// if (!item) item = mActiveItem;
if (item) selected.append(item->todo());
return selected;
}
void KOTodoView::changeEventDisplay(Event *, int)
{
updateView();
}
void KOTodoView::showDates(const QDate &, const QDate &)
{
}
void KOTodoView::showEvents(QPtrList<Event>)
{
kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
}
void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
const QDate &td)
{
#ifndef KORG_NOPRINTER
calPrinter->preview(CalPrinter::Todolist, fd, td);
#endif
}
void KOTodoView::editItem(QListViewItem *item )
{
+ if ( item )
emit editTodoSignal(((KOTodoViewItem *)item)->todo());
}
void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
{
+ if ( item )
emit showTodoSignal(((KOTodoViewItem *)item)->todo());
}
void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
{
pendingSubtodo = 0;
mActiveItem = (KOTodoViewItem *)item;
if (item) {
switch (column){
case 1:
mPriorityPopupMenu->popup(QCursor::pos ()); break;
case 2:
mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
case 3:
moveTodo();
break;
case 7:
mCategoryPopupMenu->popup(QCursor::pos ()); break;
case 8:
mCalPopupMenu->popup(QCursor::pos ()); break;
default:
mItemPopupMenu->popup(QCursor::pos());
}
} else mPopupMenu->popup(QCursor::pos());
}
void KOTodoView::newTodo()
{
emit newTodoSignal();
}
void KOTodoView::newSubTodo()
{
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
if (mActiveItem) {
if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) {
addQuickTodoPar( mActiveItem->todo());
} else
emit newSubTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::unparentTodo()
{
if (mActiveItem) {
emit unparentTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::reparentTodo()
@@ -1312,114 +1325,114 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
} else {
if ( row == 1 ) {
mActiveItem = (KOTodoViewItem *) item;
newSubTodo();
return;
}
if ( row == 5 || row == 6 || row == 2) {
mActiveItem = (KOTodoViewItem *) item;
Todo * t = mActiveItem->todo();
if ( t->isRunning() ) {
if ( t->runTime() < 15) {
t->stopRunning();
mActiveItem->construct();
topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!"));
return;
}
else
toggleRunningItem();
return;
} else {
t->setRunning( true );
mActiveItem->construct();
topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
return;
}
}
}
if ( KOPrefs::instance()->mEditOnDoubleClick )
editItem( item );
else
showItem( item , QPoint(), 0 );
}
void KOTodoView::toggleRunningItem()
{
// qDebug("KOTodoView::toggleRunning() ");
if ( ! mActiveItem )
return;
Todo * t = mActiveItem->todo();
if ( t->isRunning() ) {
KOStopTodoPrefs tp ( t, this );
if (QApplication::desktop()->width() <= 800 ){
int wid = tp.width();
int hei = tp.height();
int xx = (QApplication::desktop()->width()-wid)/2;
int yy = (QApplication::desktop()->height()-hei)/2;
tp.setGeometry( xx,yy,wid,hei );
}
tp.exec();
- updateTodo ( t, 0 );
+ updateTodo ( t, KOGlobals::EVENTEDITED );
} else {
KOStartTodoPrefs tp ( t->summary(), this );
if (QApplication::desktop()->width() <= 800 ){
int wid = tp.width();
int hei = tp.height();
int xx = (QApplication::desktop()->width()-wid)/2;
int yy = (QApplication::desktop()->height()-hei)/2;
tp.setGeometry( xx,yy,wid,hei );
}
if ( !tp.exec() ) return;
if ( tp.stopAll() ) {
mCalendar->stopAllTodos();
t->setRunning( true );
updateView();
} else {
t->setRunning( true );
- updateTodo ( t, 0 );
+ updateTodo ( t, KOGlobals::EVENTEDITED );
}
}
}
void KOTodoView::itemClicked(QListViewItem *item)
{
//qDebug("KOTodoView::itemClicked %d", item);
if (!item) {
if ( pendingSubtodo != 0 ) {
topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
}
pendingSubtodo = 0;
return;
}
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
if ( pendingSubtodo != 0 ) {
bool allowReparent = true;
QListViewItem *par = item;
while ( par ) {
if ( par == pendingSubtodo ) {
allowReparent = false;
break;
}
par = par->parent();
}
if ( !allowReparent ) {
topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
pendingSubtodo = 0;
} else {
Todo* newParent = todoItem->todo();
Todo* newSub = pendingSubtodo->todo();
pendingSubtodo = 0;
emit reparentTodoSignal( newParent,newSub );
return;
}
}
}
void KOTodoView::setDocumentId( const QString &id )
{
mDocPrefs->setDoc( id );
}
void KOTodoView::itemStateChanged( QListViewItem *item )
{
if (!item) return;
@@ -1460,106 +1473,106 @@ void KOTodoView::processSelectionChange()
void KOTodoView::modified(bool b)
{
emit isModified(b);
}
void KOTodoView::setTodoModified( Todo* todo )
{
todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
}
void KOTodoView::clearSelection()
{
mTodoListView->selectAll( false );
}
void KOTodoView::setAllOpen()
{
if ( isFlatDisplay ) {
isFlatDisplay = false;
mPopupMenu->setItemChecked( 8,false );
updateView();
} else {
storeCurrentItem();
}
setOpen(mTodoListView->firstChild(), true);
resetCurrentItem();
}
void KOTodoView::setAllClose()
{
if ( isFlatDisplay ) {
isFlatDisplay = false;
mPopupMenu->setItemChecked( 8,false );
updateView();
} else {
storeCurrentItem();
}
setOpen(mTodoListView->firstChild(), false);
resetCurrentItem();
}
void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
{
while ( item ) {
setOpen( item->firstChild(), setOpenI );
item->setOpen( setOpenI );
item = item->nextSibling();
}
}
void KOTodoView::displayAllFlat()
{
- storeCurrentItem();
+
+ mActiveItem = 0;
pendingSubtodo = 0;
if ( mBlockUpdate ) {
return;
}
+ clearList ();
mPopupMenu->setItemChecked( 8,true );
isFlatDisplay = true;
QPtrList<Todo> todoList = calendar()->todos();
- mTodoMap.clear();
- mTodoListView->clear();
Todo *todo;
for(todo = todoList.first(); todo; todo = todoList.next()) {
if ( checkTodo( todo ) ) {
KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
mTodoMap.insert(todo,todoItem);
}
}
resetCurrentItem();
}
void KOTodoView::setAllFlat()
{
if ( isFlatDisplay ) {
isFlatDisplay = false;
mPopupMenu->setItemChecked( 8,false );
updateView();
return;
}
displayAllFlat();
}
void KOTodoView::purgeCompleted()
{
emit purgeCompletedSignal();
}
void KOTodoView::toggleQuickTodo()
{
if ( mQuickBar->isVisible() ) {
mQuickBar->hide();
KOPrefs::instance()->mEnableQuickTodo = false;
}
else {
mQuickBar->show();
KOPrefs::instance()->mEnableQuickTodo = true;
}
mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
}
void KOTodoView::toggleRunning()
{
KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
updateView();
if ( KOPrefs::instance()->mHideNonStartedTodos )
topLevelWidget()->setCaption(i18n("Hide not Running"));
@@ -1651,71 +1664,72 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e )
}
if ( e->state() == Qt::ShiftButton ) {
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
reparentTodo();
e->accept();
} else
e->ignore();
break;
case Qt::Key_P:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
if ( pendingSubtodo )
itemClicked(mActiveItem);
e->accept();
} else
e->ignore();
break;
case Qt::Key_Escape:
if ( pendingSubtodo ) {
itemClicked(0);
e->accept();
} else
e->ignore();
break;
default:
e->ignore();
}
if ( true ) {
if ( e->key() == Qt::Key_I ) {
KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
if ( cn ) {
mActiveItem = cn;
KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
if ( ci ){
showTodo();
cn = (KOTodoViewItem*)cn->itemBelow();
if ( cn ) {
mTodoListView->setCurrentItem ( cn );
mTodoListView->ensureItemVisible ( cn );
}
}
}
e->accept();
}
}
}
+
void KOTodoView::updateTodo( Todo * t, int type )
{
if ( mBlockUpdate)
return;
QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
itemIterator = mTodoMap.find(t);
if (itemIterator != mTodoMap.end()) {
(*itemIterator)->construct();
} else {
if ( type == KOGlobals::EVENTADDED ) {
insertTodoItem( t );
}
}
}
void KOTodoView::todoModified(Todo * t , int p )
{
mBlockUpdate = true;
emit todoModifiedSignal ( t, p );
mBlockUpdate = false;
}
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index a8e90e2..9180015 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -129,97 +129,97 @@ class KOTodoListView : public KListView
void keyReleaseEvent ( QKeyEvent * ) ;
};
/**
This is the line-edit on top of the todoview for fast addition of new todos
*/
class KOQuickTodo : public QLineEdit
{
public:
KOQuickTodo(QWidget *parent=0);
protected:
void focusInEvent(QFocusEvent *ev);
void focusOutEvent(QFocusEvent *ev);
};
/**
This class provides a multi-column list view of todo events.
@short multi-column list view of todo events.
@author Cornelius Schumacher <schumacher@kde.org>
*/
class KOTodoView : public KOrg::BaseView
{
Q_OBJECT
public:
KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
~KOTodoView();
QPtrList<Incidence> selectedIncidences();
QPtrList<Todo> selectedTodos();
DateList selectedDates()
{DateList q;
return q;}
/** Return number of shown dates. TodoView does not show dates, */
int currentDateCount() { return 0; }
void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
void setDocumentId( const QString & );
void saveLayout(KConfig *config, const QString &group) const;
void restoreLayout(KConfig *config, const QString &group);
void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
QString getWhatsThisText(QPoint p);
- void clearList() {mTodoListView->clear(); }
+ void clearList( bool saveCurrentItem = true );
public slots:
void updateView();
void updateConfig();
void changeEventDisplay(Event *, int);
void showDates(const QDate &start, const QDate &end);
void showEvents(QPtrList<Event> eventList);
void clearSelection();
void jumpToDate ();
void editItem(QListViewItem *item);
void showItem(QListViewItem *item,const QPoint &,int);
void popupMenu(QListViewItem *item,const QPoint &,int);
void newTodo();
void newSubTodo();
void unparentTodo();
void reparentTodo();
void showTodo();
void editTodo();
void cloneTodo();
void cancelTodo();
void moveTodo();
void beamTodo();
void deleteTodo();
void setNewPriority(int);
void setNewPercentage(int);
void changedCategories(int);
void setAllOpen();
void setAllClose();
void setAllFlat();
void displayAllFlat();
void purgeCompleted();
void toggleCompleted();
void toggleRunning();
void toggleQuickTodo();
void updateTodo( Todo *, int );
void itemClicked(QListViewItem *);
void itemStateChanged(QListViewItem *);
void modified(bool);
void itemDoubleClicked(QListViewItem *item);
void resetFocusToList();