author | zautrix <zautrix> | 2004-10-10 20:52:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-10 20:52:35 (UTC) |
commit | ad409bf71ce6c3733f9e5ae4e4aa38765329d7d8 (patch) (unidiff) | |
tree | 1e8b4286ed0d30499bfdb048fc4163caf05f69ce | |
parent | ee6e29a5092d32165b7bf6b39069bd8a1dcd5b0a (diff) | |
download | kdepimpi-ad409bf71ce6c3733f9e5ae4e4aa38765329d7d8.zip kdepimpi-ad409bf71ce6c3733f9e5ae4e4aa38765329d7d8.tar.gz kdepimpi-ad409bf71ce6c3733f9e5ae4e4aa38765329d7d8.tar.bz2 |
todo list fixes
-rw-r--r-- | korganizer/calendarview.cpp | 2 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 19 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 |
3 files changed, 13 insertions, 9 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 0c35bb3..1f2c6da 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -281,65 +281,65 @@ void CalendarView::init() | |||
281 | } | 281 | } |
282 | #endif | 282 | #endif |
283 | QWidget *rightBox = new QWidget( mPanner ); | 283 | QWidget *rightBox = new QWidget( mPanner ); |
284 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 284 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
285 | 285 | ||
286 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | 286 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); |
287 | rightLayout->addWidget( mNavigatorBar ); | 287 | rightLayout->addWidget( mNavigatorBar ); |
288 | 288 | ||
289 | mRightFrame = new QWidgetStack( rightBox ); | 289 | mRightFrame = new QWidgetStack( rightBox ); |
290 | rightLayout->addWidget( mRightFrame, 1 ); | 290 | rightLayout->addWidget( mRightFrame, 1 ); |
291 | 291 | ||
292 | mLeftFrame = mLeftSplitter; | 292 | mLeftFrame = mLeftSplitter; |
293 | #else | 293 | #else |
294 | QWidget *mainBox = new QWidget( this ); | 294 | QWidget *mainBox = new QWidget( this ); |
295 | QWidget *leftFrame = new QWidget( mainBox ); | 295 | QWidget *leftFrame = new QWidget( mainBox ); |
296 | 296 | ||
297 | QBoxLayout * mainBoxLayout; | 297 | QBoxLayout * mainBoxLayout; |
298 | QBoxLayout * leftFrameLayout; | 298 | QBoxLayout * leftFrameLayout; |
299 | if ( KOPrefs::instance()->mVerticalScreen ) { | 299 | if ( KOPrefs::instance()->mVerticalScreen ) { |
300 | mainBoxLayout = new QVBoxLayout(mainBox); | 300 | mainBoxLayout = new QVBoxLayout(mainBox); |
301 | leftFrameLayout = new QHBoxLayout(leftFrame ); | 301 | leftFrameLayout = new QHBoxLayout(leftFrame ); |
302 | } else { | 302 | } else { |
303 | mainBoxLayout = new QHBoxLayout(mainBox); | 303 | mainBoxLayout = new QHBoxLayout(mainBox); |
304 | leftFrameLayout = new QVBoxLayout(leftFrame ); | 304 | leftFrameLayout = new QVBoxLayout(leftFrame ); |
305 | } | 305 | } |
306 | topLayout->addWidget( mainBox ); | 306 | topLayout->addWidget( mainBox ); |
307 | mainBoxLayout->addWidget (leftFrame); | 307 | mainBoxLayout->addWidget (leftFrame); |
308 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, | 308 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, |
309 | "CalendarView::DateNavigator", QDate::currentDate()); | 309 | "CalendarView::DateNavigator", QDate::currentDate()); |
310 | // mDateNavigator->blockSignals( true ); | 310 | // mDateNavigator->blockSignals( true ); |
311 | leftFrameLayout->addWidget( mDateNavigator ); | 311 | leftFrameLayout->addWidget( mDateNavigator ); |
312 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); | 312 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); |
313 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolist"); | 313 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); |
314 | 314 | ||
315 | if ( QApplication::desktop()->width() < 480 ) { | 315 | if ( QApplication::desktop()->width() < 480 ) { |
316 | leftFrameLayout->addWidget(mFilterView); | 316 | leftFrameLayout->addWidget(mFilterView); |
317 | leftFrameLayout->addWidget(mTodoList, 2 ); | 317 | leftFrameLayout->addWidget(mTodoList, 2 ); |
318 | 318 | ||
319 | } else { | 319 | } else { |
320 | leftFrameLayout->addWidget(mTodoList,2 ); | 320 | leftFrameLayout->addWidget(mTodoList,2 ); |
321 | leftFrameLayout->addWidget(mFilterView ); | 321 | leftFrameLayout->addWidget(mFilterView ); |
322 | } | 322 | } |
323 | mFilterView->hide(); | 323 | mFilterView->hide(); |
324 | QWidget *rightBox = new QWidget( mainBox ); | 324 | QWidget *rightBox = new QWidget( mainBox ); |
325 | mainBoxLayout->addWidget ( rightBox, 10 ); | 325 | mainBoxLayout->addWidget ( rightBox, 10 ); |
326 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 326 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
327 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | 327 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); |
328 | mRightFrame = new QWidgetStack( rightBox ); | 328 | mRightFrame = new QWidgetStack( rightBox ); |
329 | rightLayout->addWidget( mNavigatorBar ); | 329 | rightLayout->addWidget( mNavigatorBar ); |
330 | rightLayout->addWidget( mRightFrame, 10 ); | 330 | rightLayout->addWidget( mRightFrame, 10 ); |
331 | 331 | ||
332 | mLeftFrame = leftFrame; | 332 | mLeftFrame = leftFrame; |
333 | if ( KOPrefs::instance()->mVerticalScreen ) { | 333 | if ( KOPrefs::instance()->mVerticalScreen ) { |
334 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 334 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
335 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 335 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
336 | } else { | 336 | } else { |
337 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 337 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
338 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 338 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
339 | } | 339 | } |
340 | 340 | ||
341 | //qDebug("Calendarview Size %d %d ", width(), height()); | 341 | //qDebug("Calendarview Size %d %d ", width(), height()); |
342 | #endif | 342 | #endif |
343 | 343 | ||
344 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 344 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
345 | SLOT( showDates( const KCal::DateList & ) ) ); | 345 | SLOT( showDates( const KCal::DateList & ) ) ); |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index da46eca..ca5eadd 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -28,64 +28,65 @@ | |||
28 | #include <qvbox.h> | 28 | #include <qvbox.h> |
29 | #include <kdebug.h> | 29 | #include <kdebug.h> |
30 | #include "koprefs.h" | 30 | #include "koprefs.h" |
31 | #include <klocale.h> | 31 | #include <klocale.h> |
32 | #include <kglobal.h> | 32 | #include <kglobal.h> |
33 | #include <kiconloader.h> | 33 | #include <kiconloader.h> |
34 | #include <kmessagebox.h> | 34 | #include <kmessagebox.h> |
35 | 35 | ||
36 | #include <libkcal/icaldrag.h> | 36 | #include <libkcal/icaldrag.h> |
37 | #include <libkcal/vcaldrag.h> | 37 | #include <libkcal/vcaldrag.h> |
38 | #include <libkcal/calfilter.h> | 38 | #include <libkcal/calfilter.h> |
39 | #include <libkcal/dndfactory.h> | 39 | #include <libkcal/dndfactory.h> |
40 | #include <libkcal/calendarresources.h> | 40 | #include <libkcal/calendarresources.h> |
41 | #include <libkcal/resourcecalendar.h> | 41 | #include <libkcal/resourcecalendar.h> |
42 | #include <kresources/resourceselectdialog.h> | 42 | #include <kresources/resourceselectdialog.h> |
43 | #ifndef DESKTOP_VERSION | 43 | #ifndef DESKTOP_VERSION |
44 | #include <qpe/qpeapplication.h> | 44 | #include <qpe/qpeapplication.h> |
45 | #else | 45 | #else |
46 | #include <qapplication.h> | 46 | #include <qapplication.h> |
47 | #endif | 47 | #endif |
48 | #ifndef KORG_NOPRINTER | 48 | #ifndef KORG_NOPRINTER |
49 | #include "calprinter.h" | 49 | #include "calprinter.h" |
50 | #endif | 50 | #endif |
51 | #include "docprefs.h" | 51 | #include "docprefs.h" |
52 | 52 | ||
53 | #include "kotodoview.h" | 53 | #include "kotodoview.h" |
54 | using namespace KOrg; | 54 | using namespace KOrg; |
55 | 55 | ||
56 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, | 56 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, |
57 | const char *name) : | 57 | const char *name) : |
58 | KListView(parent,name) | 58 | KListView(parent,name) |
59 | { | 59 | { |
60 | mName = QString ( name ); | ||
60 | mCalendar = calendar; | 61 | mCalendar = calendar; |
61 | #ifndef DESKTOP_VERSION | 62 | #ifndef DESKTOP_VERSION |
62 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 63 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
63 | #endif | 64 | #endif |
64 | mOldCurrent = 0; | 65 | mOldCurrent = 0; |
65 | mMousePressed = false; | 66 | mMousePressed = false; |
66 | 67 | ||
67 | setAcceptDrops(true); | 68 | setAcceptDrops(true); |
68 | viewport()->setAcceptDrops(true); | 69 | viewport()->setAcceptDrops(true); |
69 | int size = 16; | 70 | int size = 16; |
70 | if (qApp->desktop()->width() < 300 ) | 71 | if (qApp->desktop()->width() < 300 ) |
71 | size = 12; | 72 | size = 12; |
72 | setTreeStepSize( size + 6 ); | 73 | setTreeStepSize( size + 6 ); |
73 | 74 | ||
74 | } | 75 | } |
75 | 76 | ||
76 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) | 77 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) |
77 | { | 78 | { |
78 | #ifndef KORG_NODND | 79 | #ifndef KORG_NODND |
79 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; | 80 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; |
80 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 81 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
81 | !QTextDrag::canDecode( e ) ) { | 82 | !QTextDrag::canDecode( e ) ) { |
82 | e->ignore(); | 83 | e->ignore(); |
83 | return; | 84 | return; |
84 | } | 85 | } |
85 | 86 | ||
86 | mOldCurrent = currentItem(); | 87 | mOldCurrent = currentItem(); |
87 | #endif | 88 | #endif |
88 | } | 89 | } |
89 | 90 | ||
90 | 91 | ||
91 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) | 92 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) |
@@ -235,133 +236,137 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) | |||
235 | QString("Delete ")+source, "Not implemented" ); | 236 | QString("Delete ")+source, "Not implemented" ); |
236 | */ | 237 | */ |
237 | } | 238 | } |
238 | } | 239 | } |
239 | #endif | 240 | #endif |
240 | } | 241 | } |
241 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | 242 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) |
242 | { | 243 | { |
243 | 244 | ||
244 | QListViewItem* cn; | 245 | QListViewItem* cn; |
245 | if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { | 246 | if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { |
246 | cn = currentItem(); | 247 | cn = currentItem(); |
247 | if ( cn ) { | 248 | if ( cn ) { |
248 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 249 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
249 | if ( ci ){ | 250 | if ( ci ){ |
250 | if ( e->state() == ShiftButton ) | 251 | if ( e->state() == ShiftButton ) |
251 | ci->setOn( false ); | 252 | ci->setOn( false ); |
252 | else | 253 | else |
253 | ci->setOn( true ); | 254 | ci->setOn( true ); |
254 | cn = cn->nextSibling(); | 255 | cn = cn->nextSibling(); |
255 | if ( cn ) { | 256 | if ( cn ) { |
256 | setCurrentItem ( cn ); | 257 | setCurrentItem ( cn ); |
257 | ensureItemVisible ( cn ); | 258 | ensureItemVisible ( cn ); |
258 | } | 259 | } |
259 | 260 | ||
260 | } | 261 | } |
261 | } | 262 | } |
262 | 263 | ||
263 | return; | 264 | return; |
264 | } | 265 | } |
265 | 266 | ||
266 | // qDebug("KOTodoListView::keyPressEvent "); | 267 | // qDebug("KOTodoListView::keyPressEvent "); |
267 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || ( height() > 150 && width() > 200 ) ) { | 268 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { |
268 | switch ( e->key() ) { | 269 | switch ( e->key() ) { |
269 | case Qt::Key_Down: | 270 | case Qt::Key_Down: |
270 | case Qt::Key_Up: | 271 | case Qt::Key_Up: |
271 | QListView::keyPressEvent ( e ); | 272 | QListView::keyPressEvent ( e ); |
272 | break; | 273 | break; |
274 | case Qt::Key_Left: | ||
275 | case Qt::Key_Right: | ||
276 | QListView::keyPressEvent ( e ); | ||
277 | break; | ||
273 | default: | 278 | default: |
274 | e->ignore(); | 279 | e->ignore(); |
275 | break; | 280 | break; |
276 | } | 281 | } |
277 | return; | 282 | return; |
278 | } | 283 | } |
279 | e->ignore(); | 284 | e->ignore(); |
280 | } | 285 | } |
281 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) | 286 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) |
282 | { | 287 | { |
283 | QListView::contentsMouseReleaseEvent(e); | 288 | QListView::contentsMouseReleaseEvent(e); |
284 | mMousePressed = false; | 289 | mMousePressed = false; |
285 | } | 290 | } |
286 | 291 | ||
287 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 292 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
288 | { | 293 | { |
289 | if (!e) return; | 294 | if (!e) return; |
290 | 295 | ||
291 | QPoint vp = contentsToViewport(e->pos()); | 296 | QPoint vp = contentsToViewport(e->pos()); |
292 | 297 | ||
293 | QListViewItem *item = itemAt(vp); | 298 | QListViewItem *item = itemAt(vp); |
294 | 299 | ||
295 | emit double_Clicked(item); | 300 | emit double_Clicked(item); |
296 | if (!item) return; | 301 | if (!item) return; |
297 | 302 | ||
298 | emit doubleClicked(item,vp,0); | 303 | emit doubleClicked(item,vp,0); |
299 | } | 304 | } |
300 | 305 | ||
301 | ///////////////////////////////////////////////////////////////////////////// | 306 | ///////////////////////////////////////////////////////////////////////////// |
302 | 307 | ||
303 | KOQuickTodo::KOQuickTodo(QWidget *parent) : | 308 | KOQuickTodo::KOQuickTodo(QWidget *parent) : |
304 | QLineEdit(parent) | 309 | QLineEdit(parent) |
305 | { | 310 | { |
306 | setText(i18n("Click to add a new Todo")); | 311 | setText(i18n("Click to add a new Todo")); |
307 | } | 312 | } |
308 | 313 | ||
309 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) | 314 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) |
310 | { | 315 | { |
311 | if ( text()==i18n("Click to add a new Todo") ) | 316 | if ( text()==i18n("Click to add a new Todo") ) |
312 | setText(""); | 317 | setText(""); |
313 | QLineEdit::focusInEvent(ev); | 318 | QLineEdit::focusInEvent(ev); |
314 | } | 319 | } |
315 | 320 | ||
316 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | 321 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) |
317 | { | 322 | { |
318 | setText(i18n("Click to add a new Todo")); | 323 | setText(i18n("Click to add a new Todo")); |
319 | QLineEdit::focusOutEvent(ev); | 324 | QLineEdit::focusOutEvent(ev); |
320 | } | 325 | } |
321 | 326 | ||
322 | ///////////////////////////////////////////////////////////////////////////// | 327 | ///////////////////////////////////////////////////////////////////////////// |
323 | 328 | ||
324 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 329 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
325 | KOrg::BaseView(calendar,parent,name) | 330 | KOrg::BaseView(calendar,parent,name) |
326 | { | 331 | { |
327 | QBoxLayout *topLayout = new QVBoxLayout(this); | 332 | QBoxLayout *topLayout = new QVBoxLayout(this); |
328 | mName = QString ( name ); | 333 | mName = QString ( name ); |
329 | mBlockUpdate = false; | 334 | mBlockUpdate = false; |
330 | mQuickAdd = new KOQuickTodo(this); | 335 | mQuickAdd = new KOQuickTodo(this); |
331 | topLayout->addWidget(mQuickAdd); | 336 | topLayout->addWidget(mQuickAdd); |
332 | 337 | ||
333 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); | 338 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); |
334 | 339 | ||
335 | mTodoListView = new KOTodoListView(calendar,this); | 340 | mTodoListView = new KOTodoListView(calendar,this, name ); |
336 | topLayout->addWidget(mTodoListView); | 341 | topLayout->addWidget(mTodoListView); |
337 | //mTodoListView->header()->setMaximumHeight(30); | 342 | //mTodoListView->header()->setMaximumHeight(30); |
338 | mTodoListView->setRootIsDecorated(true); | 343 | mTodoListView->setRootIsDecorated(true); |
339 | mTodoListView->setAllColumnsShowFocus(true); | 344 | mTodoListView->setAllColumnsShowFocus(true); |
340 | 345 | ||
341 | mTodoListView->setShowSortIndicator(true); | 346 | mTodoListView->setShowSortIndicator(true); |
342 | 347 | ||
343 | mTodoListView->addColumn(i18n("Todo")); | 348 | mTodoListView->addColumn(i18n("Todo")); |
344 | mTodoListView->addColumn(i18n("Prio")); | 349 | mTodoListView->addColumn(i18n("Prio")); |
345 | mTodoListView->setColumnAlignment(1,AlignHCenter); | 350 | mTodoListView->setColumnAlignment(1,AlignHCenter); |
346 | mTodoListView->addColumn(i18n("Complete")); | 351 | mTodoListView->addColumn(i18n("Complete")); |
347 | mTodoListView->setColumnAlignment(2,AlignHCenter); | 352 | mTodoListView->setColumnAlignment(2,AlignHCenter); |
348 | mTodoListView->addColumn(i18n("Due Date")); | 353 | mTodoListView->addColumn(i18n("Due Date")); |
349 | mTodoListView->setColumnAlignment(3,AlignLeft); | 354 | mTodoListView->setColumnAlignment(3,AlignLeft); |
350 | mTodoListView->addColumn(i18n("Due Time")); | 355 | mTodoListView->addColumn(i18n("Due Time")); |
351 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 356 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
352 | mTodoListView->addColumn(i18n("Cancelled")); | 357 | mTodoListView->addColumn(i18n("Cancelled")); |
353 | mTodoListView->addColumn(i18n("Categories")); | 358 | mTodoListView->addColumn(i18n("Categories")); |
354 | #if 0 | 359 | #if 0 |
355 | mTodoListView->addColumn(i18n("Sort Id")); | 360 | mTodoListView->addColumn(i18n("Sort Id")); |
356 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 361 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
357 | #endif | 362 | #endif |
358 | 363 | ||
359 | mTodoListView->setMinimumHeight( 60 ); | 364 | mTodoListView->setMinimumHeight( 60 ); |
360 | mTodoListView->setItemsRenameable( true ); | 365 | mTodoListView->setItemsRenameable( true ); |
361 | mTodoListView->setRenameable( 0 ); | 366 | mTodoListView->setRenameable( 0 ); |
362 | mTodoListView->setColumnWidth( 0, 120 ); | 367 | mTodoListView->setColumnWidth( 0, 120 ); |
363 | mTodoListView->setColumnWidthMode(0, QListView::Manual); | 368 | mTodoListView->setColumnWidthMode(0, QListView::Manual); |
364 | mTodoListView->setColumnWidthMode(1, QListView::Manual); | 369 | mTodoListView->setColumnWidthMode(1, QListView::Manual); |
365 | mTodoListView->setColumnWidthMode(2, QListView::Manual); | 370 | mTodoListView->setColumnWidthMode(2, QListView::Manual); |
366 | mTodoListView->setColumnWidthMode(3, QListView::Manual); | 371 | mTodoListView->setColumnWidthMode(3, QListView::Manual); |
367 | mTodoListView->setColumnWidthMode(4, QListView::Manual); | 372 | mTodoListView->setColumnWidthMode(4, QListView::Manual); |
@@ -942,92 +947,90 @@ void KOTodoView::toggleQuickTodo() | |||
942 | void KOTodoView::toggleCompleted() | 947 | void KOTodoView::toggleCompleted() |
943 | { | 948 | { |
944 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 949 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
945 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 950 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
946 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 951 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
947 | updateView(); | 952 | updateView(); |
948 | } | 953 | } |
949 | 954 | ||
950 | void KOTodoView::addQuickTodo() | 955 | void KOTodoView::addQuickTodo() |
951 | { | 956 | { |
952 | Todo *todo = new Todo(); | 957 | Todo *todo = new Todo(); |
953 | todo->setSummary(mQuickAdd->text()); | 958 | todo->setSummary(mQuickAdd->text()); |
954 | todo->setOrganizer(KOPrefs::instance()->email()); | 959 | todo->setOrganizer(KOPrefs::instance()->email()); |
955 | CalFilter * cf = mCalendar->filter(); | 960 | CalFilter * cf = mCalendar->filter(); |
956 | if ( cf ) { | 961 | if ( cf ) { |
957 | if ( cf->isEnabled()&& cf->showCategories()) { | 962 | if ( cf->isEnabled()&& cf->showCategories()) { |
958 | todo->setCategories(cf->categoryList()); | 963 | todo->setCategories(cf->categoryList()); |
959 | } | 964 | } |
960 | if ( cf->isEnabled() ) | 965 | if ( cf->isEnabled() ) |
961 | todo->setSecrecy( cf->getSecrecy()); | 966 | todo->setSecrecy( cf->getSecrecy()); |
962 | } | 967 | } |
963 | mCalendar->addTodo(todo); | 968 | mCalendar->addTodo(todo); |
964 | mQuickAdd->setText(""); | 969 | mQuickAdd->setText(""); |
965 | todoModified (todo, KOGlobals::EVENTADDED ); | 970 | todoModified (todo, KOGlobals::EVENTADDED ); |
966 | updateView(); | 971 | updateView(); |
967 | } | 972 | } |
968 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 973 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
969 | { | 974 | { |
970 | // e->ignore(); | 975 | // e->ignore(); |
971 | //return; | 976 | //return; |
972 | switch ( e->key() ) { | 977 | switch ( e->key() ) { |
973 | case Qt::Key_Down: | 978 | case Qt::Key_Down: |
974 | QWidget::keyPressEvent ( e ); | ||
975 | break; | ||
976 | |||
977 | case Qt::Key_Up: | 979 | case Qt::Key_Up: |
978 | QWidget::keyPressEvent ( e ); | 980 | QWidget::keyPressEvent ( e ); |
979 | break; | 981 | break; |
982 | |||
980 | case Qt::Key_Q: | 983 | case Qt::Key_Q: |
981 | toggleQuickTodo(); | 984 | toggleQuickTodo(); |
982 | break; | 985 | break; |
983 | 986 | ||
984 | default: | 987 | default: |
985 | e->ignore(); | 988 | e->ignore(); |
986 | } | 989 | } |
987 | 990 | ||
988 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || ( height() > 150 && width() > 200 ) ) { | 991 | if ( true ) { |
989 | if ( e->key() == Qt::Key_I ) { | 992 | if ( e->key() == Qt::Key_I ) { |
990 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); | 993 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); |
991 | if ( cn ) { | 994 | if ( cn ) { |
992 | mActiveItem = cn; | 995 | mActiveItem = cn; |
993 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 996 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
994 | if ( ci ){ | 997 | if ( ci ){ |
995 | showTodo(); | 998 | showTodo(); |
996 | cn = (KOTodoViewItem*)cn->itemBelow(); | 999 | cn = (KOTodoViewItem*)cn->itemBelow(); |
997 | if ( cn ) { | 1000 | if ( cn ) { |
998 | mTodoListView->setCurrentItem ( cn ); | 1001 | mTodoListView->setCurrentItem ( cn ); |
999 | mTodoListView->ensureItemVisible ( cn ); | 1002 | mTodoListView->ensureItemVisible ( cn ); |
1000 | } | 1003 | } |
1001 | 1004 | ||
1002 | } | 1005 | } |
1003 | } | 1006 | } |
1004 | e->accept(); | 1007 | e->accept(); |
1005 | 1008 | ||
1006 | } | 1009 | } |
1007 | 1010 | ||
1008 | } | 1011 | } |
1009 | 1012 | ||
1010 | } | 1013 | } |
1011 | void KOTodoView::updateTodo( Todo * t, int type ) | 1014 | void KOTodoView::updateTodo( Todo * t, int type ) |
1012 | { | 1015 | { |
1013 | if ( mBlockUpdate) | 1016 | if ( mBlockUpdate) |
1014 | return; | 1017 | return; |
1015 | 1018 | ||
1016 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 1019 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
1017 | itemIterator = mTodoMap.find(t); | 1020 | itemIterator = mTodoMap.find(t); |
1018 | if (itemIterator != mTodoMap.end()) { | 1021 | if (itemIterator != mTodoMap.end()) { |
1019 | (*itemIterator)->construct(); | 1022 | (*itemIterator)->construct(); |
1020 | } else { | 1023 | } else { |
1021 | if ( type == KOGlobals::EVENTADDED ) { | 1024 | if ( type == KOGlobals::EVENTADDED ) { |
1022 | insertTodoItem( t ); | 1025 | insertTodoItem( t ); |
1023 | } | 1026 | } |
1024 | } | 1027 | } |
1025 | 1028 | ||
1026 | } | 1029 | } |
1027 | 1030 | ||
1028 | void KOTodoView::todoModified(Todo * t , int p ) | 1031 | void KOTodoView::todoModified(Todo * t , int p ) |
1029 | { | 1032 | { |
1030 | mBlockUpdate = true; | 1033 | mBlockUpdate = true; |
1031 | emit todoModifiedSignal ( t, p ); | 1034 | emit todoModifiedSignal ( t, p ); |
1032 | mBlockUpdate = false; | 1035 | mBlockUpdate = false; |
1033 | } | 1036 | } |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 4495702..6bf0203 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -45,64 +45,65 @@ | |||
45 | #include "koglobals.h" | 45 | #include "koglobals.h" |
46 | 46 | ||
47 | class QDragEnterEvent; | 47 | class QDragEnterEvent; |
48 | class QDragMoveEvent; | 48 | class QDragMoveEvent; |
49 | class QDragLeaveEvent; | 49 | class QDragLeaveEvent; |
50 | class QDropEvent; | 50 | class QDropEvent; |
51 | 51 | ||
52 | class DocPrefs; | 52 | class DocPrefs; |
53 | 53 | ||
54 | class KOTodoListView : public KListView | 54 | class KOTodoListView : public KListView |
55 | { | 55 | { |
56 | Q_OBJECT | 56 | Q_OBJECT |
57 | public: | 57 | public: |
58 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); | 58 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); |
59 | virtual ~KOTodoListView() {} | 59 | virtual ~KOTodoListView() {} |
60 | 60 | ||
61 | signals: | 61 | signals: |
62 | void todoDropped(Todo *); | 62 | void todoDropped(Todo *); |
63 | void double_Clicked(QListViewItem *item); | 63 | void double_Clicked(QListViewItem *item); |
64 | 64 | ||
65 | protected: | 65 | protected: |
66 | void contentsDragEnterEvent(QDragEnterEvent *); | 66 | void contentsDragEnterEvent(QDragEnterEvent *); |
67 | void contentsDragMoveEvent(QDragMoveEvent *); | 67 | void contentsDragMoveEvent(QDragMoveEvent *); |
68 | void contentsDragLeaveEvent(QDragLeaveEvent *); | 68 | void contentsDragLeaveEvent(QDragLeaveEvent *); |
69 | void contentsDropEvent(QDropEvent *); | 69 | void contentsDropEvent(QDropEvent *); |
70 | 70 | ||
71 | void contentsMousePressEvent(QMouseEvent *); | 71 | void contentsMousePressEvent(QMouseEvent *); |
72 | void contentsMouseMoveEvent(QMouseEvent *); | 72 | void contentsMouseMoveEvent(QMouseEvent *); |
73 | void contentsMouseReleaseEvent(QMouseEvent *); | 73 | void contentsMouseReleaseEvent(QMouseEvent *); |
74 | void contentsMouseDoubleClickEvent(QMouseEvent *); | 74 | void contentsMouseDoubleClickEvent(QMouseEvent *); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | QString mName; | ||
77 | Calendar *mCalendar; | 78 | Calendar *mCalendar; |
78 | QPoint mPressPos; | 79 | QPoint mPressPos; |
79 | bool mMousePressed; | 80 | bool mMousePressed; |
80 | QListViewItem *mOldCurrent; | 81 | QListViewItem *mOldCurrent; |
81 | void keyPressEvent ( QKeyEvent * ) ; | 82 | void keyPressEvent ( QKeyEvent * ) ; |
82 | }; | 83 | }; |
83 | 84 | ||
84 | 85 | ||
85 | /** | 86 | /** |
86 | This is the line-edit on top of the todoview for fast addition of new todos | 87 | This is the line-edit on top of the todoview for fast addition of new todos |
87 | */ | 88 | */ |
88 | class KOQuickTodo : public QLineEdit | 89 | class KOQuickTodo : public QLineEdit |
89 | { | 90 | { |
90 | public: | 91 | public: |
91 | KOQuickTodo(QWidget *parent=0); | 92 | KOQuickTodo(QWidget *parent=0); |
92 | protected: | 93 | protected: |
93 | void focusInEvent(QFocusEvent *ev); | 94 | void focusInEvent(QFocusEvent *ev); |
94 | void focusOutEvent(QFocusEvent *ev); | 95 | void focusOutEvent(QFocusEvent *ev); |
95 | }; | 96 | }; |
96 | 97 | ||
97 | 98 | ||
98 | /** | 99 | /** |
99 | This class provides a multi-column list view of todo events. | 100 | This class provides a multi-column list view of todo events. |
100 | 101 | ||
101 | @short multi-column list view of todo events. | 102 | @short multi-column list view of todo events. |
102 | @author Cornelius Schumacher <schumacher@kde.org> | 103 | @author Cornelius Schumacher <schumacher@kde.org> |
103 | */ | 104 | */ |
104 | class KOTodoView : public KOrg::BaseView | 105 | class KOTodoView : public KOrg::BaseView |
105 | { | 106 | { |
106 | Q_OBJECT | 107 | Q_OBJECT |
107 | public: | 108 | public: |
108 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); | 109 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); |