author | zautrix <zautrix> | 2005-07-03 08:42:34 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-03 08:42:34 (UTC) |
commit | 971bfd3cf502fbbafc96bef70e21beb545e450b5 (patch) (unidiff) | |
tree | 2d4b2d0d291c5a23bb39e3f448403acbe86cc071 /korganizer/kolistview.cpp | |
parent | 914c795a77d8bb28fc8c2155cfc9524f3effdde1 (diff) | |
download | kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.zip kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.gz kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.bz2 |
fixes
-rw-r--r-- | korganizer/kolistview.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index cec0476..25e599d 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -299,77 +299,77 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
299 | 299 | ||
300 | int iii = 0; | 300 | int iii = 0; |
301 | for ( iii = 0; iii< 13 ; ++iii ) | 301 | for ( iii = 0; iii< 13 ; ++iii ) |
302 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 302 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
303 | 303 | ||
304 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 304 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
305 | layoutTop->addWidget(mListView); | 305 | layoutTop->addWidget(mListView); |
306 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 306 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
307 | mPopupMenu = eventPopup(); | 307 | mPopupMenu = eventPopup(); |
308 | QPopupMenu* selPopup = new QPopupMenu ( this ); | 308 | QPopupMenu* selPopup = new QPopupMenu ( this ); |
309 | mPopupMenu->insertSeparator(); | 309 | mPopupMenu->insertSeparator(); |
310 | 310 | ||
311 | selPopup->insertItem(i18n("All"),this, | 311 | selPopup->insertItem(i18n("All"),this, |
312 | SLOT(allSelection())); | 312 | SLOT(allSelection())); |
313 | selPopup->insertItem(i18n("None"),this, | 313 | selPopup->insertItem(i18n("None"),this, |
314 | SLOT(clearSelection())); | 314 | SLOT(clearSelection())); |
315 | selPopup->insertItem(i18n("Delete selected..."),this, | 315 | selPopup->insertItem(i18n("Delete selected..."),this, |
316 | SLOT(deleteAll())); | 316 | SLOT(deleteAll())); |
317 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); | 317 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); |
318 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 318 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
319 | i18n("Hide all selected"),this, | 319 | i18n("Hide all selected"),this, |
320 | SLOT(hideAll()),true); | 320 | SLOT(hideAll()),true); |
321 | 321 | ||
322 | selPopup->insertSeparator(); | 322 | selPopup->insertSeparator(); |
323 | QPopupMenu * exportPO = new QPopupMenu ( this ); | ||
324 | selPopup->insertItem( i18n("Export"), exportPO ); | ||
323 | #ifdef DESKTOP_VERSION | 325 | #ifdef DESKTOP_VERSION |
324 | mPopupMenu->insertSeparator(); | 326 | mPopupMenu->insertSeparator(); |
325 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 327 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
326 | i18n("Print complete list"),this, | 328 | i18n("Print complete list..."),this, |
327 | SLOT(printList()),true); | 329 | SLOT(printList()),true); |
328 | #endif | 330 | #endif |
329 | mCalPopup = new QPopupMenu ( this ); | 331 | mCalPopup = new QPopupMenu ( this ); |
330 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); | 332 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); |
331 | 333 | ||
332 | selPopup->insertItem(i18n("Set categories")+"...",this, | 334 | selPopup->insertItem(i18n("Set categories")+"...",this, |
333 | SLOT(setCat()) ); | 335 | SLOT(setCat()) ); |
334 | selPopup->insertItem( i18n("Set alarm..."),this, | 336 | selPopup->insertItem( i18n("Set alarm..."),this, |
335 | SLOT(setAlarm())); | 337 | SLOT(setAlarm())); |
336 | #if 0 | 338 | #if 0 |
337 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 339 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
338 | i18n("Set categories")+"...",this, | 340 | i18n("Set categories")+"...",this, |
339 | SLOT(setCat()),true); | 341 | SLOT(setCat()),true); |
340 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 342 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
341 | i18n("Set alarm..."),this, | 343 | i18n("Set alarm..."),this, |
342 | SLOT(setAlarm()),true); | 344 | SLOT(setAlarm()),true); |
343 | #endif | 345 | #endif |
344 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, | 346 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, |
345 | SLOT( populateCalPopup() )); | 347 | SLOT( populateCalPopup() )); |
346 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, | 348 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, |
347 | SLOT( setCalendar( int ) )); | 349 | SLOT( setCalendar( int ) )); |
348 | QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, | 350 | QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, |
349 | SLOT( catChanged( Incidence * ) )); | 351 | SLOT( catChanged( Incidence * ) )); |
350 | QPopupMenu * exportPO = new QPopupMenu ( this ); | ||
351 | selPopup->insertItem( i18n("Export"), exportPO ); | ||
352 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, | 352 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, |
353 | SLOT(saveToFile())); | 353 | SLOT(saveToFile())); |
354 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, | 354 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, |
355 | SLOT(saveToFileVCS())); | 355 | SLOT(saveToFileVCS())); |
356 | exportPO->insertItem( i18n("Journal/Details..."),this, | 356 | exportPO->insertItem( i18n("Journal/Details..."),this, |
357 | SLOT(saveDescriptionToFile())); | 357 | SLOT(saveDescriptionToFile())); |
358 | // mPopupMenu->insertSeparator(); | 358 | // mPopupMenu->insertSeparator(); |
359 | // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 359 | // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
360 | // i18n("Add Categ. to selected..."),this, | 360 | // i18n("Add Categ. to selected..."),this, |
361 | // SLOT(addCat()),true); | 361 | // SLOT(addCat()),true); |
362 | //mPopupMenu->insertSeparator(); | 362 | //mPopupMenu->insertSeparator(); |
363 | #ifndef DESKTOP_VERSION | 363 | #ifndef DESKTOP_VERSION |
364 | selPopup->insertSeparator(); | 364 | selPopup->insertSeparator(); |
365 | selPopup->insertItem( i18n("Beam via IR..."),this, | 365 | selPopup->insertItem( i18n("Beam via IR..."),this, |
366 | SLOT(beamSelected())); | 366 | SLOT(beamSelected())); |
367 | #if 0 | 367 | #if 0 |
368 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 368 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
369 | i18n("Beam via IR"),this, | 369 | i18n("Beam via IR"),this, |
370 | SLOT(beamSelected()),true); | 370 | SLOT(beamSelected()),true); |
371 | #endif | 371 | #endif |
372 | #endif | 372 | #endif |
373 | /* | 373 | /* |
374 | mPopupMenu = new QPopupMenu; | 374 | mPopupMenu = new QPopupMenu; |
375 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 375 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
@@ -1291,49 +1291,48 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1291 | } | 1291 | } |
1292 | } | 1292 | } |
1293 | } | 1293 | } |
1294 | e->accept(); | 1294 | e->accept(); |
1295 | } | 1295 | } |
1296 | break; | 1296 | break; |
1297 | default: | 1297 | default: |
1298 | e->ignore(); | 1298 | e->ignore(); |
1299 | } | 1299 | } |
1300 | } | 1300 | } |
1301 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1301 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1302 | : KListView( lv, "kolistlistview", false ) | 1302 | : KListView( lv, "kolistlistview", false ) |
1303 | { | 1303 | { |
1304 | mYMousePos = 0; | 1304 | mYMousePos = 0; |
1305 | mPopupTimer = new QTimer(this); | 1305 | mPopupTimer = new QTimer(this); |
1306 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 1306 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
1307 | #ifndef DESKTOP_VERSION | 1307 | #ifndef DESKTOP_VERSION |
1308 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1308 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1309 | #endif | 1309 | #endif |
1310 | setSelectionMode( QListView::Multi ); | 1310 | setSelectionMode( QListView::Multi ); |
1311 | setMultiSelection( true); | 1311 | setMultiSelection( true); |
1312 | } | 1312 | } |
1313 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) | 1313 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) |
1314 | { | 1314 | { |
1315 | int selCount = 0; | ||
1316 | QListViewItem *qitem = firstChild (); | 1315 | QListViewItem *qitem = firstChild (); |
1317 | while ( qitem ) { | 1316 | while ( qitem ) { |
1318 | if ( qitem->isSelected() && item != qitem ) | 1317 | if ( qitem->isSelected() && item != qitem ) |
1319 | return true; | 1318 | return true; |
1320 | qitem = qitem->nextSibling(); | 1319 | qitem = qitem->nextSibling(); |
1321 | } | 1320 | } |
1322 | return false; | 1321 | return false; |
1323 | } | 1322 | } |
1324 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1323 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1325 | { | 1324 | { |
1326 | if (!e) return; | 1325 | if (!e) return; |
1327 | QPoint vp = contentsToViewport(e->pos()); | 1326 | QPoint vp = contentsToViewport(e->pos()); |
1328 | QListViewItem *item = itemAt(vp); | 1327 | QListViewItem *item = itemAt(vp); |
1329 | if (!item) { | 1328 | if (!item) { |
1330 | emit newEvent(); | 1329 | emit newEvent(); |
1331 | return; | 1330 | return; |
1332 | } | 1331 | } |
1333 | KListView::contentsMouseDoubleClickEvent(e); | 1332 | KListView::contentsMouseDoubleClickEvent(e); |
1334 | } | 1333 | } |
1335 | #if 0 | 1334 | #if 0 |
1336 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1335 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1337 | { | 1336 | { |
1338 | //qDebug("contentsMousePressEvent++++ "); | 1337 | //qDebug("contentsMousePressEvent++++ "); |
1339 | KListView::contentsMousePressEvent( e ); | 1338 | KListView::contentsMousePressEvent( e ); |