-rw-r--r-- | korganizer/kolistview.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index db3f802..cdcbbf0 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -275,105 +275,115 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
275 | mListView->setColumnAlignment(4,AlignHCenter); | 275 | mListView->setColumnAlignment(4,AlignHCenter); |
276 | mListView->setColumnAlignment(5,AlignLeft); | 276 | mListView->setColumnAlignment(5,AlignLeft); |
277 | mListView->setColumnAlignment(6,AlignLeft); | 277 | mListView->setColumnAlignment(6,AlignLeft); |
278 | mListView->setColumnAlignment(7,AlignLeft); | 278 | mListView->setColumnAlignment(7,AlignLeft); |
279 | mListView->setColumnAlignment(8,AlignLeft); | 279 | mListView->setColumnAlignment(8,AlignLeft); |
280 | mListView->setColumnAlignment(9,AlignLeft); | 280 | mListView->setColumnAlignment(9,AlignLeft); |
281 | mListView->setColumnAlignment(10,AlignLeft); | 281 | mListView->setColumnAlignment(10,AlignLeft); |
282 | mListView->setColumnAlignment(11,AlignLeft); | 282 | mListView->setColumnAlignment(11,AlignLeft); |
283 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); | 283 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); |
284 | 284 | ||
285 | int iii = 0; | 285 | int iii = 0; |
286 | for ( iii = 0; iii< 12 ; ++iii ) | 286 | for ( iii = 0; iii< 12 ; ++iii ) |
287 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 287 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
288 | 288 | ||
289 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 289 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
290 | layoutTop->addWidget(mListView); | 290 | layoutTop->addWidget(mListView); |
291 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 291 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
292 | mPopupMenu = eventPopup(); | 292 | mPopupMenu = eventPopup(); |
293 | QPopupMenu* selPopup = new QPopupMenu ( this ); | 293 | QPopupMenu* selPopup = new QPopupMenu ( this ); |
294 | mPopupMenu->insertSeparator(); | 294 | mPopupMenu->insertSeparator(); |
295 | 295 | ||
296 | selPopup->insertItem(i18n("All"),this, | 296 | selPopup->insertItem(i18n("All"),this, |
297 | SLOT(allSelection())); | 297 | SLOT(allSelection())); |
298 | selPopup->insertItem(i18n("None"),this, | 298 | selPopup->insertItem(i18n("None"),this, |
299 | SLOT(clearSelection())); | 299 | SLOT(clearSelection())); |
300 | selPopup->insertItem(i18n("Delete selected..."),this, | 300 | selPopup->insertItem(i18n("Delete selected..."),this, |
301 | SLOT(deleteAll())); | 301 | SLOT(deleteAll())); |
302 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); | 302 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); |
303 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 303 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
304 | i18n("Hide all selected"),this, | 304 | i18n("Hide all selected"),this, |
305 | SLOT(hideAll()),true); | 305 | SLOT(hideAll()),true); |
306 | 306 | ||
307 | mPopupMenu->insertSeparator(); | 307 | selPopup->insertSeparator(); |
308 | #ifdef DESKTOP_VERSION | 308 | #ifdef DESKTOP_VERSION |
309 | mPopupMenu->insertSeparator(); | ||
309 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 310 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
310 | i18n("Print complete list"),this, | 311 | i18n("Print complete list"),this, |
311 | SLOT(printList()),true); | 312 | SLOT(printList()),true); |
312 | mPopupMenu->insertSeparator(); | ||
313 | #endif | 313 | #endif |
314 | mCalPopup = new QPopupMenu ( this ); | 314 | mCalPopup = new QPopupMenu ( this ); |
315 | mPopupMenu->insertItem( i18n("Set Calendar"), mCalPopup ); | 315 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); |
316 | 316 | ||
317 | selPopup->insertItem(i18n("Set categories")+"...",this, | ||
318 | SLOT(setCat()) ); | ||
319 | selPopup->insertItem( i18n("Set alarm..."),this, | ||
320 | SLOT(setAlarm())); | ||
321 | #if 0 | ||
317 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 322 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
318 | i18n("Set categories")+"...",this, | 323 | i18n("Set categories")+"...",this, |
319 | SLOT(setCat()),true); | 324 | SLOT(setCat()),true); |
320 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 325 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
321 | i18n("Set alarm..."),this, | 326 | i18n("Set alarm..."),this, |
322 | SLOT(setAlarm()),true); | 327 | SLOT(setAlarm()),true); |
328 | #endif | ||
323 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, | 329 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, |
324 | SLOT( populateCalPopup() )); | 330 | SLOT( populateCalPopup() )); |
325 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, | 331 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, |
326 | SLOT( setCalendar( int ) )); | 332 | SLOT( setCalendar( int ) )); |
327 | QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, | 333 | QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, |
328 | SLOT( catChanged( Incidence * ) )); | 334 | SLOT( catChanged( Incidence * ) )); |
329 | QPopupMenu * exportPO = new QPopupMenu ( this ); | 335 | QPopupMenu * exportPO = new QPopupMenu ( this ); |
330 | mPopupMenu->insertItem( i18n("Export"), exportPO ); | 336 | selPopup->insertItem( i18n("Export"), exportPO ); |
331 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, | 337 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, |
332 | SLOT(saveToFile())); | 338 | SLOT(saveToFile())); |
333 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, | 339 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, |
334 | SLOT(saveToFileVCS())); | 340 | SLOT(saveToFileVCS())); |
335 | exportPO->insertItem( i18n("Journal/Details..."),this, | 341 | exportPO->insertItem( i18n("Journal/Details..."),this, |
336 | SLOT(saveDescriptionToFile())); | 342 | SLOT(saveDescriptionToFile())); |
337 | // mPopupMenu->insertSeparator(); | 343 | // mPopupMenu->insertSeparator(); |
338 | // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 344 | // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
339 | // i18n("Add Categ. to selected..."),this, | 345 | // i18n("Add Categ. to selected..."),this, |
340 | // SLOT(addCat()),true); | 346 | // SLOT(addCat()),true); |
341 | //mPopupMenu->insertSeparator(); | 347 | //mPopupMenu->insertSeparator(); |
342 | #ifndef DESKTOP_VERSION | 348 | #ifndef DESKTOP_VERSION |
343 | mPopupMenu->insertSeparator(); | 349 | selPopup->insertSeparator(); |
350 | selPopup->insertItem( i18n("Beam via IR"),this, | ||
351 | SLOT(beamSelected())); | ||
352 | #if 0 | ||
344 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 353 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
345 | i18n("Beam via IR"),this, | 354 | i18n("Beam via IR"),this, |
346 | SLOT(beamSelected()),true); | 355 | SLOT(beamSelected()),true); |
347 | #endif | 356 | #endif |
357 | #endif | ||
348 | /* | 358 | /* |
349 | mPopupMenu = new QPopupMenu; | 359 | mPopupMenu = new QPopupMenu; |
350 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 360 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
351 | SLOT (editEvent())); | 361 | SLOT (editEvent())); |
352 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 362 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
353 | SLOT (deleteEvent())); | 363 | SLOT (deleteEvent())); |
354 | mPopupMenu->insertSeparator(); | 364 | mPopupMenu->insertSeparator(); |
355 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 365 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
356 | SLOT(showDates())); | 366 | SLOT(showDates())); |
357 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 367 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
358 | SLOT(hideDates())); | 368 | SLOT(hideDates())); |
359 | */ | 369 | */ |
360 | QObject::connect(mListView,SIGNAL( newEvent()), | 370 | QObject::connect(mListView,SIGNAL( newEvent()), |
361 | this,SIGNAL(signalNewEvent())); | 371 | this,SIGNAL(signalNewEvent())); |
362 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 372 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
363 | this,SLOT(defaultItemAction(QListViewItem *))); | 373 | this,SLOT(defaultItemAction(QListViewItem *))); |
364 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, | 374 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, |
365 | const QPoint &, int )), | 375 | const QPoint &, int )), |
366 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 376 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
367 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 377 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
368 | SLOT(processSelectionChange(QListViewItem *))); | 378 | SLOT(processSelectionChange(QListViewItem *))); |
369 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 379 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
370 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 380 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
371 | 381 | ||
372 | readSettings(KOGlobals::config(),"KOListView Layout"); | 382 | readSettings(KOGlobals::config(),"KOListView Layout"); |
373 | } | 383 | } |
374 | 384 | ||
375 | KOListView::~KOListView() | 385 | KOListView::~KOListView() |
376 | { | 386 | { |
377 | delete mPopupMenu; | 387 | delete mPopupMenu; |
378 | #if QT_VERSION >= 0x030000 | 388 | #if QT_VERSION >= 0x030000 |
379 | 389 | ||