author | zautrix <zautrix> | 2005-02-02 21:31:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-02 21:31:25 (UTC) |
commit | 279354f19275e5e654636acb87c465edf652eeae (patch) (unidiff) | |
tree | 1721c6201fa28392cb02a80510c47a12ae4e0d4c | |
parent | f79d089ec5c44a27f9005da76e452b4574eae27f (diff) | |
download | kdepimpi-279354f19275e5e654636acb87c465edf652eeae.zip kdepimpi-279354f19275e5e654636acb87c465edf652eeae.tar.gz kdepimpi-279354f19275e5e654636acb87c465edf652eeae.tar.bz2 |
fifix
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 27 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 22 |
3 files changed, 35 insertions, 18 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 00f5c28..ec08321 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1144,69 +1144,69 @@ | |||
1144 | { "Type of View","Typ der Ansicht" }, | 1144 | { "Type of View","Typ der Ansicht" }, |
1145 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1145 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1146 | { "Alt+F","Alt+F" }, | 1146 | { "Alt+F","Alt+F" }, |
1147 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1147 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1148 | { "Alt+T","Alt+T" }, | 1148 | { "Alt+T","Alt+T" }, |
1149 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1149 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1150 | { "Print month","Drucke Monat" }, | 1150 | { "Print month","Drucke Monat" }, |
1151 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1151 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1152 | { "&Start month:","&Startmonat:" }, | 1152 | { "&Start month:","&Startmonat:" }, |
1153 | { "&End month:","&Endmonat:" }, | 1153 | { "&End month:","&Endmonat:" }, |
1154 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1154 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1155 | { "Print todos","Drucke Todos" }, | 1155 | { "Print todos","Drucke Todos" }, |
1156 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1156 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1157 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1157 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1158 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1158 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1159 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1159 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1160 | { "Items to Print","Zu druckende Items" }, | 1160 | { "Items to Print","Zu druckende Items" }, |
1161 | { "&From:","Von:" }, | 1161 | { "&From:","Von:" }, |
1162 | { "&To:","Bis:" }, | 1162 | { "&To:","Bis:" }, |
1163 | { "Print &all todo items","Drucke alle Todo Items" }, | 1163 | { "Print &all todo items","Drucke alle Todo Items" }, |
1164 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1164 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1165 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1165 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1166 | { "Todo List","Todo Liste" }, | 1166 | { "Todo List","Todo Liste" }, |
1167 | { "&Title:","&Titel:" }, | 1167 | { "&Title:","&Titel:" }, |
1168 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1168 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1169 | { "Todo list","Todo Liste" }, | 1169 | { "Todo list","Todo Liste" }, |
1170 | { "&Print...","Drucke..." }, | 1170 | { "&Print...","Drucke..." }, |
1171 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1171 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1172 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1172 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1173 | { "OK","OK" }, | 1173 | { "OK","OK" }, |
1174 | { "FilterEditor","FilterEditor" }, | 1174 | { "FilterEditor","FilterEditor" }, |
1175 | { "Include","Inclusive" }, | 1175 | { "Include","Inclusive" }, |
1176 | { "Exclude","Exclusive" }, | 1176 | { "Exclude","Exclusive" }, |
1177 | { "Edit Selection...","Editiere Auswahl" }, | 1177 | { "Edit Selection...","Editiere Auswahl" }, |
1178 | { "recurring events","wiederholende Termine" }, | 1178 | { "recurring events","wiederholende Termine" }, |
1179 | { "recurr. events","wiederh.Termine" }, | 1179 | { "recurr. events","wiederh.Termine" }, |
1180 | { "completed to-dos","erledigte Todos" }, | 1180 | { "completed to-dos","erledigte Todos" }, |
1181 | { "events","Termine" }, | 1181 | { "events","Termine" }, |
1182 | { "todos","Todos" }, | 1182 | { "todos","Todos" }, |
1183 | { "journals","Journale" }, | 1183 | { "journals","Journale" }, |
1184 | { "public","öffentl." }, | 1184 | { "public","öffentl." }, |
1185 | { "private","privat" }, | 1185 | { "private","privat" }, |
1186 | { "confidential","vertraul." }, | 1186 | { "confidential","vertraul." }, |
1187 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1187 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1188 | { "Yesterday","Gestern" }, | 1188 | { "Yesterday","Gestern" }, |
1189 | { "Day after tomorrow","Übermorgen" }, | 1189 | { "Day after tomorrow","Übermorgen" }, |
1190 | { "Tomorrow","Morgen" }, | 1190 | { "Tomorrow","Morgen" }, |
1191 | { "Day before yesterday","Vorgestern" }, | 1191 | { "Day before yesterday","Vorgestern" }, |
1192 | { "Size %1","Größe %1" }, | 1192 | { "Size %1","Größe %1" }, |
1193 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1193 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1194 | { " (%1 y.)"," (%1 J.)" }, | 1194 | { " (%1 y.)"," (%1 J.)" }, |
1195 | { "Allday:","Ganztägig:" }, | 1195 | { "Allday:","Ganztägig:" }, |
1196 | { "compl.todos","erled.Todos" }, | 1196 | { "compl.todos","erled.Todos" }, |
1197 | { "Day view","Tagesansicht" }, | 1197 | { "Day view","Tagesansicht" }, |
1198 | { "Next days","Nächste Tage" }, | 1198 | { "Next days","Nächste Tage" }, |
1199 | { "Next week","Nächste Woche" }, | 1199 | { "Next week","Nächste Woche" }, |
1200 | { "Next two weeks","Nächste zwei Wochen" }, | 1200 | { "Next two weeks","Nächste zwei Wochen" }, |
1201 | { "Next month","Nächster Monat" }, | 1201 | { "Next month","Nächster Monat" }, |
1202 | { "Journal view","Journal" }, | 1202 | { "Journal view","Journal" }, |
1203 | { "Display all opened","Zeige alle geöffnet" }, | 1203 | { "Display all opened","Zeige alle geöffnet" }, |
1204 | { "Display all closed","Zeige alle geschlossen" }, | 1204 | { "Display all closed","Zeige alle geschlossen" }, |
1205 | { "Display all flat","Zeige alle flach" }, | 1205 | { "Display all flat","Zeige alle flach" }, |
1206 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1206 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1207 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1207 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1208 | { "","" }, | 1208 | { "Select week %1-%2","Selektiere Woche %1-%2" }, |
1209 | { "","" }, | 1209 | { "Select Week","Selektiere Woche" }, |
1210 | { "","" }, | 1210 | { "","" }, |
1211 | { "","" }, | 1211 | { "","" }, |
1212 | { "","" }, | 1212 | { "","" }, |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 918931a..1908b1c 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -372,139 +372,148 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
372 | // Create day name labels for agenda columns | 372 | // Create day name labels for agenda columns |
373 | mDayLabelsFrame = new QHBox(this); | 373 | mDayLabelsFrame = new QHBox(this); |
374 | topLayout->addWidget(mDayLabelsFrame); | 374 | topLayout->addWidget(mDayLabelsFrame); |
375 | mDayLabels = new QFrame (mDayLabelsFrame); | 375 | mDayLabels = new QFrame (mDayLabelsFrame); |
376 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); | 376 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); |
377 | // Create agenda splitter | 377 | // Create agenda splitter |
378 | #ifndef KORG_NOSPLITTER | 378 | #ifndef KORG_NOSPLITTER |
379 | mSplitterAgenda = new QSplitter(Vertical,this); | 379 | mSplitterAgenda = new QSplitter(Vertical,this); |
380 | topLayout->addWidget(mSplitterAgenda); | 380 | topLayout->addWidget(mSplitterAgenda); |
381 | mSplitterAgenda->setOpaqueResize(); | 381 | mSplitterAgenda->setOpaqueResize(); |
382 | 382 | ||
383 | mAllDayFrame = new QHBox(mSplitterAgenda); | 383 | mAllDayFrame = new QHBox(mSplitterAgenda); |
384 | 384 | ||
385 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 385 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
386 | #else | 386 | #else |
387 | #if 0 | 387 | #if 0 |
388 | QWidget *mainBox = new QWidget( this ); | 388 | QWidget *mainBox = new QWidget( this ); |
389 | topLayout->addWidget( mainBox ); | 389 | topLayout->addWidget( mainBox ); |
390 | QBoxLayout *mainLayout = new QVBoxLayout(mainBox); | 390 | QBoxLayout *mainLayout = new QVBoxLayout(mainBox); |
391 | mAllDayFrame = new QHBox(mainBox); | 391 | mAllDayFrame = new QHBox(mainBox); |
392 | mainLayout->addWidget(mAllDayFrame); | 392 | mainLayout->addWidget(mAllDayFrame); |
393 | mainLayout->setStretchFactor( mAllDayFrame, 0 ); | 393 | mainLayout->setStretchFactor( mAllDayFrame, 0 ); |
394 | mAllDayFrame->setFocusPolicy(NoFocus); | 394 | mAllDayFrame->setFocusPolicy(NoFocus); |
395 | QWidget *agendaFrame = new QWidget(mainBox); | 395 | QWidget *agendaFrame = new QWidget(mainBox); |
396 | mainLayout->addWidget(agendaFrame); | 396 | mainLayout->addWidget(agendaFrame); |
397 | mainLayout->setStretchFactor( agendaFrame, 10 ); | 397 | mainLayout->setStretchFactor( agendaFrame, 10 ); |
398 | 398 | ||
399 | agendaFrame->setFocusPolicy(NoFocus); | 399 | agendaFrame->setFocusPolicy(NoFocus); |
400 | #endif | 400 | #endif |
401 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 401 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
402 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 402 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
403 | topLayout->addWidget( mSplitterAgenda ); | 403 | topLayout->addWidget( mSplitterAgenda ); |
404 | mAllDayFrame = new QHBox(mSplitterAgenda); | 404 | mAllDayFrame = new QHBox(mSplitterAgenda); |
405 | mAllDayFrame->setFocusPolicy(NoFocus); | 405 | mAllDayFrame->setFocusPolicy(NoFocus); |
406 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 406 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
407 | agendaFrame->setFocusPolicy(NoFocus); | 407 | agendaFrame->setFocusPolicy(NoFocus); |
408 | 408 | ||
409 | #endif | 409 | #endif |
410 | 410 | ||
411 | // Create all-day agenda widget | 411 | // Create all-day agenda widget |
412 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); | 412 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); |
413 | 413 | ||
414 | mExpandButton = new QPushButton(mDummyAllDayLeft); | 414 | mExpandButton = new QPushButton(mDummyAllDayLeft); |
415 | mExpandButton->setPixmap( mNotExpandedPixmap ); | 415 | mExpandButton->setPixmap( mNotExpandedPixmap ); |
416 | int widebut = mExpandButton->sizeHint().width(); | 416 | int widebut = mExpandButton->sizeHint().width(); |
417 | if ( QApplication::desktop()->width() < 480 ) | 417 | if ( QApplication::desktop()->width() < 480 ) |
418 | widebut = widebut*2; | 418 | widebut = widebut*2; |
419 | else | 419 | else |
420 | widebut = (widebut*3) / 2; | 420 | widebut = (widebut*3) / 2; |
421 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, | 421 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, |
422 | // QSizePolicy::Fixed ) ); | 422 | // QSizePolicy::Fixed ) ); |
423 | mExpandButton->setFixedSize( widebut, widebut); | 423 | mExpandButton->setFixedSize( widebut, widebut); |
424 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); | 424 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); |
425 | mExpandButton->setFocusPolicy(NoFocus); | 425 | mExpandButton->setFocusPolicy(NoFocus); |
426 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); | 426 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); |
427 | mAllDayAgenda->setFocusPolicy(NoFocus); | 427 | mAllDayAgenda->setFocusPolicy(NoFocus); |
428 | QVBox *dummyAllDayRight = new QVBox(mAllDayFrame); | 428 | QVBox *dummyAllDayRight = new QVBox(mAllDayFrame); |
429 | 429 | ||
430 | QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); | 430 | QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); |
431 | mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); | 431 | mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); |
432 | 432 | ||
433 | dummyAllDayRightB->setFlat( true ); | 433 | dummyAllDayRightB->setFlat( true ); |
434 | dummyAllDayRightB->setFocusPolicy(NoFocus); | 434 | dummyAllDayRightB->setFocusPolicy(NoFocus); |
435 | dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); | 435 | dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); |
436 | |||
436 | QPopupMenu * wpo = new QPopupMenu (this); | 437 | QPopupMenu * wpo = new QPopupMenu (this); |
437 | wpo->insertItem( i18n("W#"), 0 ); | 438 | QPopupMenu * all = new QPopupMenu (this); |
439 | //wpo->insertItem( i18n("W#"), 0 ); | ||
440 | int first = 1; | ||
438 | int i; | 441 | int i; |
439 | for ( i = 1; i < 53; i++ ) | 442 | for ( i = 1; i < 50; ++i ) { |
440 | wpo->insertItem( QString::number( i ),i ); | 443 | if ( !(i%10) ) { |
441 | //Qt bug - we must add some empty fields... | 444 | all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); |
442 | for ( i = 53; i < 54; ++i ) { | 445 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); |
443 | wpo->insertItem( "", 52 ); | 446 | first = i; |
447 | wpo = new QPopupMenu (this); | ||
448 | } | ||
449 | wpo->insertItem( QString::number(i), i ); | ||
450 | } | ||
451 | for ( i = 50; i < 53; ++i ) { | ||
452 | wpo->insertItem( QString::number(i), i); | ||
444 | } | 453 | } |
445 | dummyAllDayRightB->setPopup( wpo ); | 454 | all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); |
446 | 455 | dummyAllDayRightB->setPopup( all ); | |
447 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); | 456 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); |
448 | 457 | ||
449 | // Create event context menu for all day agenda | 458 | // Create event context menu for all day agenda |
450 | mAllDayAgendaPopup = eventPopup(); | 459 | mAllDayAgendaPopup = eventPopup(); |
451 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 460 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
452 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 461 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
453 | 462 | ||
454 | // Create agenda frame | 463 | // Create agenda frame |
455 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); | 464 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); |
456 | // QHBox *agendaFrame = new QHBox(splitterAgenda); | 465 | // QHBox *agendaFrame = new QHBox(splitterAgenda); |
457 | 466 | ||
458 | // create event indicator bars | 467 | // create event indicator bars |
459 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); | 468 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); |
460 | agendaLayout->addWidget(mEventIndicatorTop,0,1); | 469 | agendaLayout->addWidget(mEventIndicatorTop,0,1); |
461 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); | 470 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); |
462 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, | 471 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, |
463 | agendaFrame); | 472 | agendaFrame); |
464 | agendaLayout->addWidget(mEventIndicatorBottom,2,1); | 473 | agendaLayout->addWidget(mEventIndicatorBottom,2,1); |
465 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); | 474 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); |
466 | agendaLayout->addWidget(dummyAgendaRight,0,2); | 475 | agendaLayout->addWidget(dummyAgendaRight,0,2); |
467 | 476 | ||
468 | // Create time labels | 477 | // Create time labels |
469 | mTimeLabels = new TimeLabels(24,agendaFrame); | 478 | mTimeLabels = new TimeLabels(24,agendaFrame); |
470 | agendaLayout->addWidget(mTimeLabels,1,0); | 479 | agendaLayout->addWidget(mTimeLabels,1,0); |
471 | connect(mTimeLabels,SIGNAL( scaleChanged()), | 480 | connect(mTimeLabels,SIGNAL( scaleChanged()), |
472 | this,SLOT(updateConfig())); | 481 | this,SLOT(updateConfig())); |
473 | 482 | ||
474 | // Create agenda | 483 | // Create agenda |
475 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); | 484 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); |
476 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); | 485 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); |
477 | agendaLayout->setColStretch(1,1); | 486 | agendaLayout->setColStretch(1,1); |
478 | mAgenda->setFocusPolicy(NoFocus); | 487 | mAgenda->setFocusPolicy(NoFocus); |
479 | // Create event context menu for agenda | 488 | // Create event context menu for agenda |
480 | mAgendaPopup = eventPopup(); | 489 | mAgendaPopup = eventPopup(); |
481 | 490 | ||
482 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), | 491 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), |
483 | i18n("Toggle Alarm"),mAgenda, | 492 | i18n("Toggle Alarm"),mAgenda, |
484 | SLOT(popupAlarm()),true); | 493 | SLOT(popupAlarm()),true); |
485 | 494 | ||
486 | 495 | ||
487 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 496 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
488 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 497 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
489 | 498 | ||
490 | // make connections between dependent widgets | 499 | // make connections between dependent widgets |
491 | mTimeLabels->setAgenda(mAgenda); | 500 | mTimeLabels->setAgenda(mAgenda); |
492 | 501 | ||
493 | // Update widgets to reflect user preferences | 502 | // Update widgets to reflect user preferences |
494 | // updateConfig(); | 503 | // updateConfig(); |
495 | 504 | ||
496 | // createDayLabels(); | 505 | // createDayLabels(); |
497 | 506 | ||
498 | // these blank widgets make the All Day Event box line up with the agenda | 507 | // these blank widgets make the All Day Event box line up with the agenda |
499 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 508 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
500 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 509 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
501 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 510 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
502 | 511 | ||
503 | // Scrolling | 512 | // Scrolling |
504 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), | 513 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), |
505 | mTimeLabels, SLOT(positionChanged())); | 514 | mTimeLabels, SLOT(positionChanged())); |
506 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), | 515 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), |
507 | SLOT(setContentsPos(int))); | 516 | SLOT(setContentsPos(int))); |
508 | 517 | ||
509 | connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); | 518 | connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); |
510 | connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); | 519 | connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); |
@@ -520,129 +529,129 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
520 | SLOT(newEventAllDay(int,int))); | 529 | SLOT(newEventAllDay(int,int))); |
521 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), | 530 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), |
522 | SLOT(newTodoAllDay(int,int))); | 531 | SLOT(newTodoAllDay(int,int))); |
523 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 532 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
524 | SLOT(newEventAllDay(int,int))); | 533 | SLOT(newEventAllDay(int,int))); |
525 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 534 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
526 | SLOT(newTimeSpanSelected(int,int,int,int))); | 535 | SLOT(newTimeSpanSelected(int,int,int,int))); |
527 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 536 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
528 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); | 537 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); |
529 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 538 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
530 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 539 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
531 | 540 | ||
532 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 541 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
533 | SIGNAL(editIncidenceSignal(Incidence *))); | 542 | SIGNAL(editIncidenceSignal(Incidence *))); |
534 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 543 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
535 | SIGNAL(editIncidenceSignal(Incidence *))); | 544 | SIGNAL(editIncidenceSignal(Incidence *))); |
536 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 545 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
537 | SIGNAL(showIncidenceSignal(Incidence *))); | 546 | SIGNAL(showIncidenceSignal(Incidence *))); |
538 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 547 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
539 | SIGNAL(showIncidenceSignal(Incidence *))); | 548 | SIGNAL(showIncidenceSignal(Incidence *))); |
540 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 549 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
541 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 550 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
542 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 551 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
543 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 552 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
544 | 553 | ||
545 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 554 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
546 | SLOT(updateEventDates(KOAgendaItem *, int ))); | 555 | SLOT(updateEventDates(KOAgendaItem *, int ))); |
547 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 556 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
548 | SLOT(updateEventDates(KOAgendaItem *, int))); | 557 | SLOT(updateEventDates(KOAgendaItem *, int))); |
549 | 558 | ||
550 | // event indicator update | 559 | // event indicator update |
551 | connect(mAgenda,SIGNAL(lowerYChanged(int)), | 560 | connect(mAgenda,SIGNAL(lowerYChanged(int)), |
552 | SLOT(updateEventIndicatorTop(int))); | 561 | SLOT(updateEventIndicatorTop(int))); |
553 | connect(mAgenda,SIGNAL(upperYChanged(int)), | 562 | connect(mAgenda,SIGNAL(upperYChanged(int)), |
554 | SLOT(updateEventIndicatorBottom(int))); | 563 | SLOT(updateEventIndicatorBottom(int))); |
555 | // drag signals | 564 | // drag signals |
556 | /* | 565 | /* |
557 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), | 566 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), |
558 | SLOT(startDrag(Event *))); | 567 | SLOT(startDrag(Event *))); |
559 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), | 568 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), |
560 | SLOT(startDrag(Event *))); | 569 | SLOT(startDrag(Event *))); |
561 | */ | 570 | */ |
562 | // synchronize selections | 571 | // synchronize selections |
563 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 572 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
564 | mAllDayAgenda, SLOT( deselectItem() ) ); | 573 | mAllDayAgenda, SLOT( deselectItem() ) ); |
565 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 574 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
566 | mAgenda, SLOT( deselectItem() ) ); | 575 | mAgenda, SLOT( deselectItem() ) ); |
567 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 576 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
568 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 577 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
569 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 578 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
570 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 579 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
571 | connect( mAgenda, SIGNAL( resizedSignal() ), | 580 | connect( mAgenda, SIGNAL( resizedSignal() ), |
572 | SLOT( updateConfig( ) ) ); | 581 | SLOT( updateConfig( ) ) ); |
573 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), | 582 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), |
574 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); | 583 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); |
575 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), | 584 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), |
576 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); | 585 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); |
577 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 586 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
578 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 587 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
579 | 588 | ||
580 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 589 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
581 | QFontMetrics fm ( dlf ); | 590 | QFontMetrics fm ( dlf ); |
582 | QString dayTest = "30"; | 591 | QString dayTest = "30"; |
583 | int wid = fm.width( dayTest ); | 592 | int wid = fm.width( dayTest ); |
584 | int maxWid = dummyAllDayRight->width(); | 593 | int maxWid = dummyAllDayRight->width()-2; |
585 | int fontPoint = dlf.pointSize(); | 594 | int fontPoint = dlf.pointSize(); |
586 | while ( wid > maxWid ) { | 595 | while ( wid > maxWid ) { |
587 | --fontPoint; | 596 | --fontPoint; |
588 | dlf.setPointSize( fontPoint ); | 597 | dlf.setPointSize( fontPoint ); |
589 | QFontMetrics f( dlf ); | 598 | QFontMetrics f( dlf ); |
590 | wid = f.width( dayTest ); | 599 | wid = f.width( dayTest ); |
591 | } | 600 | } |
592 | mDummyAllDayRightL->setFont( dlf ); | 601 | mDummyAllDayRightL->setFont( dlf ); |
593 | mDummyAllDayRightL->setAlignment( AlignHCenter ); | 602 | mDummyAllDayRightL->setAlignment( AlignHCenter ); |
594 | } | 603 | } |
595 | 604 | ||
596 | void KOAgendaView::toggleAllDay() | 605 | void KOAgendaView::toggleAllDay() |
597 | { | 606 | { |
598 | if ( mSplitterAgenda->firstHandle() ) | 607 | if ( mSplitterAgenda->firstHandle() ) |
599 | mSplitterAgenda->firstHandle()->toggle(); | 608 | mSplitterAgenda->firstHandle()->toggle(); |
600 | } | 609 | } |
601 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) | 610 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) |
602 | { | 611 | { |
603 | calendar()->addIncidence( inc ); | 612 | calendar()->addIncidence( inc ); |
604 | 613 | ||
605 | if ( incOld ) { | 614 | if ( incOld ) { |
606 | if ( incOld->type() == "Todo" ) | 615 | if ( incOld->type() == "Todo" ) |
607 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); | 616 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); |
608 | else | 617 | else |
609 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); | 618 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); |
610 | } | 619 | } |
611 | 620 | ||
612 | } | 621 | } |
613 | 622 | ||
614 | KOAgendaView::~KOAgendaView() | 623 | KOAgendaView::~KOAgendaView() |
615 | { | 624 | { |
616 | delete mAgendaPopup; | 625 | delete mAgendaPopup; |
617 | delete mAllDayAgendaPopup; | 626 | delete mAllDayAgendaPopup; |
618 | delete KOAgendaItem::paintPix(); | 627 | delete KOAgendaItem::paintPix(); |
619 | delete KOAgendaItem::paintPixSel(); | 628 | delete KOAgendaItem::paintPixSel(); |
620 | } | 629 | } |
621 | void KOAgendaView::resizeEvent( QResizeEvent* e ) | 630 | void KOAgendaView::resizeEvent( QResizeEvent* e ) |
622 | { | 631 | { |
623 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); | 632 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); |
624 | bool uc = false; | 633 | bool uc = false; |
625 | int ow = e->oldSize().width(); | 634 | int ow = e->oldSize().width(); |
626 | int oh = e->oldSize().height(); | 635 | int oh = e->oldSize().height(); |
627 | int w = e->size().width(); | 636 | int w = e->size().width(); |
628 | int h = e->size().height(); | 637 | int h = e->size().height(); |
629 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { | 638 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { |
630 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) | 639 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) |
631 | uc = true; | 640 | uc = true; |
632 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); | 641 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); |
633 | } | 642 | } |
634 | mUpcomingWidth = e->size().width() ; | 643 | mUpcomingWidth = e->size().width() ; |
635 | if ( mBlockUpdating || uc ) { | 644 | if ( mBlockUpdating || uc ) { |
636 | mBlockUpdating = false; | 645 | mBlockUpdating = false; |
637 | //mAgenda->setMinimumSize(800 , 600 ); | 646 | //mAgenda->setMinimumSize(800 , 600 ); |
638 | //qDebug("mAgenda->resize+++++++++++++++ "); | 647 | //qDebug("mAgenda->resize+++++++++++++++ "); |
639 | updateConfig(); | 648 | updateConfig(); |
640 | //qDebug("KOAgendaView::Updating now possible "); | 649 | //qDebug("KOAgendaView::Updating now possible "); |
641 | } else | 650 | } else |
642 | createDayLabels(); | 651 | createDayLabels(); |
643 | //qDebug("resizeEvent end "); | 652 | //qDebug("resizeEvent end "); |
644 | 653 | ||
645 | } | 654 | } |
646 | void KOAgendaView::slotDaylabelClicked( int num ) | 655 | void KOAgendaView::slotDaylabelClicked( int num ) |
647 | { | 656 | { |
648 | 657 | ||
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 2406bb5..24de01f 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -75,139 +75,147 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
75 | bool insertWeek = (QString ( name ) == QString("useBigPixmaps")) ; | 75 | bool insertWeek = (QString ( name ) == QString("useBigPixmaps")) ; |
76 | if ( insertWeek && QApplication::desktop()->width() > 320 ) | 76 | if ( insertWeek && QApplication::desktop()->width() > 320 ) |
77 | isDesktop = true; | 77 | isDesktop = true; |
78 | // Create backward navigation buttons | 78 | // Create backward navigation buttons |
79 | mPrevYear = new QPushButton( mCtrlFrame ); | 79 | mPrevYear = new QPushButton( mCtrlFrame ); |
80 | mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); | 80 | mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) ); |
81 | QToolTip::add( mPrevYear, i18n("Previous Year") ); | 81 | QToolTip::add( mPrevYear, i18n("Previous Year") ); |
82 | 82 | ||
83 | mPrevMonth = new QPushButton( mCtrlFrame ); | 83 | mPrevMonth = new QPushButton( mCtrlFrame ); |
84 | mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); | 84 | mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") ); |
85 | QToolTip::add( mPrevMonth, i18n("Previous Month") ); | 85 | QToolTip::add( mPrevMonth, i18n("Previous Month") ); |
86 | 86 | ||
87 | // Create forward navigation buttons | 87 | // Create forward navigation buttons |
88 | mNextMonth = new QPushButton( mCtrlFrame ); | 88 | mNextMonth = new QPushButton( mCtrlFrame ); |
89 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); | 89 | mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") ); |
90 | QToolTip::add( mNextMonth, i18n("Next Month") ); | 90 | QToolTip::add( mNextMonth, i18n("Next Month") ); |
91 | 91 | ||
92 | QPushButton * selWeek = 0; | 92 | QPushButton * selWeek = 0; |
93 | if ( insertWeek ) { | 93 | if ( insertWeek ) { |
94 | selWeek = new QPushButton( mCtrlFrame ); | 94 | selWeek = new QPushButton( mCtrlFrame ); |
95 | QToolTip::add( selWeek, i18n("Select Week") ); | 95 | QToolTip::add( selWeek, i18n("Select Week") ); |
96 | selWeek->setFocusPolicy(NoFocus); | 96 | selWeek->setFocusPolicy(NoFocus); |
97 | } | 97 | } |
98 | 98 | ||
99 | mNextYear = new QPushButton( mCtrlFrame ); | 99 | mNextYear = new QPushButton( mCtrlFrame ); |
100 | mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); | 100 | mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") ); |
101 | QToolTip::add( mNextYear, i18n("Next Year") ); | 101 | QToolTip::add( mNextYear, i18n("Next Year") ); |
102 | mSelectMonth = new QPushButton( mCtrlFrame ); | 102 | mSelectMonth = new QPushButton( mCtrlFrame ); |
103 | // Create month name label | 103 | // Create month name label |
104 | //selectMonth->setFont( tfont ); | 104 | //selectMonth->setFont( tfont ); |
105 | // selectMonth->setAlignment( AlignCenter ); | 105 | // selectMonth->setAlignment( AlignCenter ); |
106 | //mDateLabel = new QLabel( selectMonth ); | 106 | //mDateLabel = new QLabel( selectMonth ); |
107 | //mDateLabel->setFont( tfont ); | 107 | //mDateLabel->setFont( tfont ); |
108 | //mDateLabel->setAlignment( AlignCenter ); | 108 | //mDateLabel->setAlignment( AlignCenter ); |
109 | if ( QString ( name ) == QString("useBigPixmaps") ) { | 109 | if ( QString ( name ) == QString("useBigPixmaps") ) { |
110 | mNextMonth->setFlat( true); | 110 | mNextMonth->setFlat( true); |
111 | mNextYear->setFlat( true); | 111 | mNextYear->setFlat( true); |
112 | mSelectMonth->setFlat( true); | 112 | mSelectMonth->setFlat( true); |
113 | mPrevYear->setFlat( true); | 113 | mPrevYear->setFlat( true); |
114 | mPrevMonth->setFlat( true); | 114 | mPrevMonth->setFlat( true); |
115 | if ( insertWeek ) | 115 | if ( insertWeek ) |
116 | selWeek->setFlat( true); | 116 | selWeek->setFlat( true); |
117 | } | 117 | } |
118 | mSelectMonth->setFont( tfont ); | 118 | mSelectMonth->setFont( tfont ); |
119 | // Set minimum width to width of widest month name label | 119 | // Set minimum width to width of widest month name label |
120 | int i; | 120 | int i; |
121 | int maxwidth = 0; | 121 | int maxwidth = 0; |
122 | QFontMetrics fm ( mSelectMonth->font() ); | 122 | QFontMetrics fm ( mSelectMonth->font() ); |
123 | int width = fm.width("September '00" ); | 123 | int width = fm.width("September '00" ); |
124 | // for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date); | 124 | // for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date); |
125 | // ++i ) { | 125 | // ++i ) { |
126 | // //int width = fm.width( KOGlobals::self()->calendarSystem()->monthName(i, | 126 | // //int width = fm.width( KOGlobals::self()->calendarSystem()->monthName(i, |
127 | // // KOGlobals::self()->calendarSystem()->year(date) ) + " 2000" ); | 127 | // // KOGlobals::self()->calendarSystem()->year(date) ) + " 2000" ); |
128 | // int width = fm.width("September 2000" ); | 128 | // int width = fm.width("September 2000" ); |
129 | // if ( width > maxwidth ) maxwidth = width; | 129 | // if ( width > maxwidth ) maxwidth = width; |
130 | // } | 130 | // } |
131 | maxwidth = width+2; | 131 | maxwidth = width+2; |
132 | int size = fm.height()+2; | 132 | int size = fm.height()+2; |
133 | if ( QApplication::desktop()->width() >= 480 ) { | 133 | if ( QApplication::desktop()->width() >= 480 ) { |
134 | size += 6; | 134 | size += 6; |
135 | maxwidth+= 6; | 135 | maxwidth+= 6; |
136 | } | 136 | } |
137 | 137 | ||
138 | if ( insertWeek ) { | 138 | if ( insertWeek ) { |
139 | //shit : bug in Qt. after inserting 53 item, only 51 are shown... | ||
140 | QPopupMenu * wpo = new QPopupMenu (this); | 139 | QPopupMenu * wpo = new QPopupMenu (this); |
141 | wpo->insertItem( i18n("W#"), 0 ); | 140 | QPopupMenu * all = new QPopupMenu (this); |
142 | for ( i = 1; i < 53; ++i ) { | 141 | //wpo->insertItem( i18n("W#"), 0 ); |
142 | int first = 1; | ||
143 | for ( i = 1; i < 50; ++i ) { | ||
144 | if ( !(i%10) ) { | ||
145 | all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); | ||
146 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); | ||
147 | first = i; | ||
148 | wpo = new QPopupMenu (this); | ||
149 | } | ||
143 | wpo->insertItem( QString::number(i), i ); | 150 | wpo->insertItem( QString::number(i), i ); |
144 | } | 151 | } |
145 | for ( i = 53; i < 54; ++i ) { | 152 | for ( i = 50; i < 53; ++i ) { |
146 | wpo->insertItem( "", 52 ); | 153 | wpo->insertItem( QString::number(i), i); |
147 | } | 154 | } |
148 | selWeek->setPopup( wpo ); | 155 | all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); |
149 | selWeek->setFixedWidth( (size/4)*3 ); | 156 | selWeek->setPopup( all ); |
157 | selWeek->setFixedWidth( (size/5)*4 ); | ||
150 | selWeek->setFixedHeight( size ); | 158 | selWeek->setFixedHeight( size ); |
151 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); | 159 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeek ( int ) ) ); |
152 | } | 160 | } |
153 | mSelectMonth->setFixedWidth( maxwidth ); | 161 | mSelectMonth->setFixedWidth( maxwidth ); |
154 | mSelectMonth->setFixedHeight( size ); | 162 | mSelectMonth->setFixedHeight( size ); |
155 | mPrevYear->setFixedHeight( size ); | 163 | mPrevYear->setFixedHeight( size ); |
156 | mPrevMonth->setFixedHeight( size ); | 164 | mPrevMonth->setFixedHeight( size ); |
157 | mNextMonth->setFixedHeight( size ); | 165 | mNextMonth->setFixedHeight( size ); |
158 | mNextYear->setFixedHeight ( size ); | 166 | mNextYear->setFixedHeight ( size ); |
159 | // set up control frame layout | 167 | // set up control frame layout |
160 | QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); | 168 | QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); |
161 | ctrlLayout->addWidget( mPrevYear, 3 ); | 169 | ctrlLayout->addWidget( mPrevYear, 3 ); |
162 | ctrlLayout->addWidget( mPrevMonth, 3 ); | 170 | ctrlLayout->addWidget( mPrevMonth, 3 ); |
163 | //ctrlLayout->addStretch( 1 ); | 171 | //ctrlLayout->addStretch( 1 ); |
164 | // ctrlLayout->addSpacing( 1 ); | 172 | // ctrlLayout->addSpacing( 1 ); |
165 | // ctrlLayout->addWidget( mDateLabel ); | 173 | // ctrlLayout->addWidget( mDateLabel ); |
166 | ctrlLayout->addWidget( mSelectMonth ); | 174 | ctrlLayout->addWidget( mSelectMonth ); |
167 | // ctrlLayout->addSpacing( 1 ); | 175 | // ctrlLayout->addSpacing( 1 ); |
168 | // ctrlLayout->addStretch( 1 ); | 176 | // ctrlLayout->addStretch( 1 ); |
169 | ctrlLayout->addWidget( mNextMonth, 3 ); | 177 | ctrlLayout->addWidget( mNextMonth, 3 ); |
170 | ctrlLayout->addWidget( mNextYear, 3 ); | 178 | ctrlLayout->addWidget( mNextYear, 3 ); |
171 | if ( insertWeek ) | 179 | if ( insertWeek ) |
172 | ctrlLayout->addWidget( selWeek ); | 180 | ctrlLayout->addWidget( selWeek ); |
173 | 181 | ||
174 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); | 182 | connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); |
175 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); | 183 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); |
176 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); | 184 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); |
177 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); | 185 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); |
178 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); | 186 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); |
179 | mPrevYear->setFocusPolicy(NoFocus); | 187 | mPrevYear->setFocusPolicy(NoFocus); |
180 | mPrevMonth->setFocusPolicy(NoFocus); | 188 | mPrevMonth->setFocusPolicy(NoFocus); |
181 | mNextMonth->setFocusPolicy(NoFocus); | 189 | mNextMonth->setFocusPolicy(NoFocus); |
182 | mNextYear->setFocusPolicy(NoFocus); | 190 | mNextYear->setFocusPolicy(NoFocus); |
183 | mSelectMonth->setFocusPolicy(NoFocus); | 191 | mSelectMonth->setFocusPolicy(NoFocus); |
184 | 192 | ||
185 | } | 193 | } |
186 | 194 | ||
187 | NavigatorBar::~NavigatorBar() | 195 | NavigatorBar::~NavigatorBar() |
188 | { | 196 | { |
189 | } | 197 | } |
190 | 198 | ||
191 | void NavigatorBar::selectMonth() | 199 | void NavigatorBar::selectMonth() |
192 | { | 200 | { |
193 | 201 | ||
194 | int month; | 202 | int month; |
195 | KPopupFrame* popup = new KPopupFrame(this); | 203 | KPopupFrame* popup = new KPopupFrame(this); |
196 | int size = 12; | 204 | int size = 12; |
197 | if ( QApplication::desktop()->width() >= 480 ) | 205 | if ( QApplication::desktop()->width() >= 480 ) |
198 | size = 18; | 206 | size = 18; |
199 | KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(size, popup); | 207 | KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(size, popup); |
200 | // ----- | 208 | // ----- |
201 | picker->resize(picker->sizeHint()); | 209 | picker->resize(picker->sizeHint()); |
202 | popup->setMainWidget(picker); | 210 | popup->setMainWidget(picker); |
203 | picker->setFocus(); | 211 | picker->setFocus(); |
204 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 212 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
205 | if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) | 213 | if(popup->exec(mSelectMonth->mapToGlobal(QPoint(0, mSelectMonth->height())))) |
206 | { | 214 | { |
207 | month = picker->getResult(); | 215 | month = picker->getResult(); |
208 | emit monthSelected ( month ); | 216 | emit monthSelected ( month ); |
209 | } else { | 217 | } else { |
210 | KNotifyClient::beep(); | 218 | KNotifyClient::beep(); |
211 | } | 219 | } |
212 | delete popup; | 220 | delete popup; |
213 | } | 221 | } |