-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 96 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 3 |
5 files changed, 64 insertions, 45 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 4251283..e21bb44 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -5,6 +5,11 @@ Info about the changes in new versions of KDE-Pim/Pi | |||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. | 6 | Fixed problem loading translations for summary/location edit boxes in event/todo editor. |
7 | 7 | ||
8 | Added a general "select week number" to the toolbar. | ||
9 | |||
10 | Fixed some small problem of the new features introduced in version 2.0.3. | ||
11 | |||
12 | |||
8 | ********** VERSION 2.0.3 ************ | 13 | ********** VERSION 2.0.3 ************ |
9 | 14 | ||
10 | KO/Pi: | 15 | KO/Pi: |
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index ce66863..da5ef07 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -164,7 +164,7 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | |||
164 | if ( QApplication::desktop()->width() < 320 ) | 164 | if ( QApplication::desktop()->width() < 320 ) |
165 | mCompleteDateEdit->setMaximumWidth( 85 ); | 165 | mCompleteDateEdit->setMaximumWidth( 85 ); |
166 | else | 166 | else |
167 | mCompleteDateEdit->setMaximumWidth( 130 ); | 167 | mCompleteDateEdit->setMaximumWidth( 140 ); |
168 | topLayout->setSpacing( 0 ); | 168 | topLayout->setSpacing( 0 ); |
169 | } | 169 | } |
170 | } | 170 | } |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 5926abe..ffb2e1e 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -92,7 +92,7 @@ QString KNoScrollListBox::getWhatsThisText(QPoint p) | |||
92 | { | 92 | { |
93 | QListBoxItem* item = itemAt ( p ); | 93 | QListBoxItem* item = itemAt ( p ); |
94 | if ( ! item ) { | 94 | if ( ! item ) { |
95 | return i18n("Click in the cell\nto add an event!"); | 95 | return i18n("Click in the cell\nto add an event!"); |
96 | } | 96 | } |
97 | return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence()); | 97 | return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence()); |
98 | } | 98 | } |
@@ -319,7 +319,7 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | |||
319 | const QPoint &) ), | 319 | const QPoint &) ), |
320 | SLOT( contextMenu( QListBoxItem * ) ) ); | 320 | SLOT( contextMenu( QListBoxItem * ) ) ); |
321 | connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ), | 321 | connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ), |
322 | SLOT( selection( QListBoxItem * ) ) ); | 322 | SLOT( selection( QListBoxItem * ) ) ); |
323 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), | 323 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), |
324 | SLOT( cellClicked( QListBoxItem * ) ) ); | 324 | SLOT( cellClicked( QListBoxItem * ) ) ); |
325 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), | 325 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), |
@@ -552,43 +552,44 @@ void MonthViewCell::insertEvent(Event *event) | |||
552 | } | 552 | } |
553 | void MonthViewCell::insertTodo(Todo *todo) | 553 | void MonthViewCell::insertTodo(Todo *todo) |
554 | { | 554 | { |
555 | QString text; | 555 | QString text; |
556 | if (todo->hasDueDate()) { | 556 | mItemList->setFocusPolicy(WheelFocus); |
557 | if (!todo->doesFloat()) { | 557 | if (todo->hasDueDate()) { |
558 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 558 | if (!todo->doesFloat()) { |
559 | text += " "; | 559 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
560 | } | 560 | text += " "; |
561 | } | 561 | } |
562 | text += i18n("Td: %1").arg(todo->summary()); | 562 | } |
563 | 563 | text += i18n("T: %1").arg(todo->summary()); | |
564 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 564 | |
565 | //item->setPalette( mStandardPalette ); | 565 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
566 | QPalette pal; | 566 | //item->setPalette( mStandardPalette ); |
567 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 567 | QPalette pal; |
568 | QStringList categories = todo->categories(); | 568 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
569 | QString cat = categories.first(); | 569 | QStringList categories = todo->categories(); |
570 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 570 | QString cat = categories.first(); |
571 | pal = getPalette(); | 571 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
572 | if (cat.isEmpty()) { | 572 | pal = getPalette(); |
573 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 573 | if (cat.isEmpty()) { |
574 | } else { | 574 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
575 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | ||
576 | } | ||
577 | |||
578 | } else { | 575 | } else { |
579 | if (cat.isEmpty()) { | 576 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
580 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | ||
581 | } else { | ||
582 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | ||
583 | } | ||
584 | } | 577 | } |
585 | 578 | ||
586 | } else { | 579 | } else { |
587 | pal = mStandardPalette ; | 580 | if (cat.isEmpty()) { |
581 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | ||
582 | } else { | ||
583 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | ||
584 | } | ||
588 | } | 585 | } |
589 | item->setPalette( pal ); | 586 | |
590 | mItemList->insertItem( item ); | 587 | } else { |
591 | mToolTip += text+"\n"; | 588 | pal = mStandardPalette ; |
589 | } | ||
590 | item->setPalette( pal ); | ||
591 | mItemList->insertItem( item ); | ||
592 | mToolTip += text+"\n"; | ||
592 | } | 593 | } |
593 | void MonthViewCell::finishUpdateCell() | 594 | void MonthViewCell::finishUpdateCell() |
594 | { | 595 | { |
@@ -782,7 +783,6 @@ void MonthViewCell::contextMenu( QListBoxItem *item ) | |||
782 | void MonthViewCell::selection( QListBoxItem *item ) | 783 | void MonthViewCell::selection( QListBoxItem *item ) |
783 | { | 784 | { |
784 | if ( !item ) return; | 785 | if ( !item ) return; |
785 | |||
786 | mMonthView->setSelectedCell( this ); | 786 | mMonthView->setSelectedCell( this ); |
787 | } | 787 | } |
788 | 788 | ||
@@ -1265,9 +1265,15 @@ void KOMonthView::resizeEvent(QResizeEvent * e) | |||
1265 | { | 1265 | { |
1266 | qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); | 1266 | qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); |
1267 | if ( ignoreResizeEvent ) { | 1267 | if ( ignoreResizeEvent ) { |
1268 | qDebug("KOMonthView::resizeEvent ignored "); | 1268 | int diff = e->size().height() - e->oldSize().height(); |
1269 | --ignoreResizeEvent; | 1269 | if ( diff < 0 ) |
1270 | return; | 1270 | diff = diff * (-1); |
1271 | if ( diff == ignoreResizeEventHeight ) { | ||
1272 | qDebug("KOMonthView::resizeEvent ignored "); | ||
1273 | --ignoreResizeEvent; | ||
1274 | return; | ||
1275 | } | ||
1276 | ignoreResizeEvent = 0; | ||
1271 | } | 1277 | } |
1272 | if ( e->size().width()+ e->size().height() < 240 ) | 1278 | if ( e->size().width()+ e->size().height() < 240 ) |
1273 | return; | 1279 | return; |
@@ -1511,7 +1517,7 @@ MonthViewCell * KOMonthView::selectedCell( ) | |||
1511 | } | 1517 | } |
1512 | void KOMonthView::setSelectedCell( MonthViewCell *cell ) | 1518 | void KOMonthView::setSelectedCell( MonthViewCell *cell ) |
1513 | { | 1519 | { |
1514 | // qDebug("KOMonthView::setSelectedCell "); | 1520 | //qDebug("KOMonthView::setSelectedCell %x ", cell); |
1515 | if ( mSelectedCell && mSelectedCell != cell ) { | 1521 | if ( mSelectedCell && mSelectedCell != cell ) { |
1516 | MonthViewCell * mvc = mSelectedCell; | 1522 | MonthViewCell * mvc = mSelectedCell; |
1517 | mSelectedCell = cell; | 1523 | mSelectedCell = cell; |
@@ -1550,15 +1556,21 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) | |||
1550 | case Key_Up: | 1556 | case Key_Up: |
1551 | { | 1557 | { |
1552 | emit prevMonth(); | 1558 | emit prevMonth(); |
1553 | mCells[0]->setFocus(); | 1559 | if ( mShowWeekView ) |
1560 | mCellsW[0]->setFocus(); | ||
1561 | else | ||
1562 | mCells[0]->setFocus(); | ||
1554 | } | 1563 | } |
1555 | e->accept(); | 1564 | e->accept(); |
1556 | break; | 1565 | break; |
1557 | case Key_Down: | 1566 | case Key_Down: |
1558 | { | 1567 | { |
1559 | emit nextMonth(); | 1568 | emit nextMonth(); |
1560 | mCells[0]->setFocus(); | 1569 | if ( mShowWeekView ) |
1561 | 1570 | mCellsW[0]->setFocus(); | |
1571 | else | ||
1572 | mCells[0]->setFocus(); | ||
1573 | |||
1562 | } | 1574 | } |
1563 | e->accept(); | 1575 | e->accept(); |
1564 | break; | 1576 | break; |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 9dbe319..d70cda1 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -226,7 +226,7 @@ class KOMonthView: public KOEventView | |||
226 | const QDate &, const QDate &); | 226 | const QDate &, const QDate &); |
227 | bool isMonthView() { return true; } | 227 | bool isMonthView() { return true; } |
228 | bool isUpdatePossible() { return updatePossible; } | 228 | bool isUpdatePossible() { return updatePossible; } |
229 | void setIgnoreResizeEvent( int c ) { ignoreResizeEvent = c ;} | 229 | void setIgnoreResizeEvent( int c, int h ) { ignoreResizeEvent = c ;ignoreResizeEventHeight = h;} |
230 | 230 | ||
231 | MonthViewCell * selectedCell(); | 231 | MonthViewCell * selectedCell(); |
232 | public slots: | 232 | public slots: |
@@ -260,6 +260,7 @@ class KOMonthView: public KOEventView | |||
260 | 260 | ||
261 | private: | 261 | private: |
262 | int ignoreResizeEvent; | 262 | int ignoreResizeEvent; |
263 | int ignoreResizeEventHeight; | ||
263 | int currentWeek(); | 264 | int currentWeek(); |
264 | bool clPending; | 265 | bool clPending; |
265 | QWidgetStack * mWidStack; | 266 | QWidgetStack * mWidStack; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index dcb51dc..c35de0a 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -223,7 +223,8 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | |||
223 | int hei = mMainView->height(); | 223 | int hei = mMainView->height(); |
224 | if ( mCurrentView == mMonthView ) { | 224 | if ( mCurrentView == mMonthView ) { |
225 | if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { | 225 | if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) { |
226 | mMonthView->setIgnoreResizeEvent( 2 ); | 226 | |
227 | mMonthView->setIgnoreResizeEvent( 2 ,mMainView->navigatorBar()->height()); | ||
227 | mMainView->navigatorBar()->show(); | 228 | mMainView->navigatorBar()->show(); |
228 | hei -= mMainView->navigatorBar()->sizeHint().height(); | 229 | hei -= mMainView->navigatorBar()->sizeHint().height(); |
229 | } | 230 | } |