author | zautrix <zautrix> | 2005-03-22 22:55:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-22 22:55:32 (UTC) |
commit | aa6d19015bc91ae3af021d766d37a473e125278f (patch) (unidiff) | |
tree | f7b1d6b45a3997013318107ca02fa63b4b76913e | |
parent | 53ac6d1f931c50d89a44d9d46daceb7ed9d4ddc6 (diff) | |
download | kdepimpi-aa6d19015bc91ae3af021d766d37a473e125278f.zip kdepimpi-aa6d19015bc91ae3af021d766d37a473e125278f.tar.gz kdepimpi-aa6d19015bc91ae3af021d766d37a473e125278f.tar.bz2 |
fixes
-rw-r--r-- | kmicromail/opiemail.cpp | 1 | ||||
-rw-r--r-- | kmicromail/viewmailbase.cpp | 9 | ||||
-rw-r--r-- | kmicromail/viewmailbase.h | 5 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 34 | ||||
-rw-r--r-- | korganizer/kodaymatrix.h | 4 |
5 files changed, 38 insertions, 15 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index b701446..4436ad6 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -50,12 +50,13 @@ OpieMail::OpieMail( QWidget *parent, const char *name ) | |||
50 | settings = new Settings(); | 50 | settings = new Settings(); |
51 | tb = 0; | 51 | tb = 0; |
52 | setIcon(SmallIcon( "kmicromail" ) ); | 52 | setIcon(SmallIcon( "kmicromail" ) ); |
53 | folderView->populate( settings->getAccounts() ); | 53 | folderView->populate( settings->getAccounts() ); |
54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
56 | folderView->setFocus(); | ||
56 | } | 57 | } |
57 | 58 | ||
58 | OpieMail::~OpieMail() | 59 | OpieMail::~OpieMail() |
59 | { | 60 | { |
60 | if (settings) delete settings; | 61 | if (settings) delete settings; |
61 | if ( tb ) | 62 | if ( tb ) |
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp index 3a41ba0..3bb964e 100644 --- a/kmicromail/viewmailbase.cpp +++ b/kmicromail/viewmailbase.cpp | |||
@@ -1,12 +1,13 @@ | |||
1 | // CHANGED 2004-08-06 Lutz Rogowski | 1 | // CHANGED 2004-08-06 Lutz Rogowski |
2 | #include <qtextbrowser.h> | 2 | #include <qtextbrowser.h> |
3 | #include <qlistview.h> | 3 | #include <qlistview.h> |
4 | #include <qaction.h> | 4 | #include <qaction.h> |
5 | #include <qlabel.h> | 5 | #include <qlabel.h> |
6 | #include <qvbox.h> | 6 | #include <qvbox.h> |
7 | #include <qapplication.h> | ||
7 | 8 | ||
8 | #include <qtoolbar.h> | 9 | #include <qtoolbar.h> |
9 | #include <qmenubar.h> | 10 | #include <qmenubar.h> |
10 | #include <kiconloader.h> | 11 | #include <kiconloader.h> |
11 | //#include <qpe/resource.h> | 12 | //#include <qpe/resource.h> |
12 | #include <klocale.h> | 13 | #include <klocale.h> |
@@ -69,16 +70,18 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) | |||
69 | closeMail->addTo(toolbar); | 70 | closeMail->addTo(toolbar); |
70 | closeMail->addTo(mailmenu); | 71 | closeMail->addTo(mailmenu); |
71 | QVBox *view = new QVBox(this); | 72 | QVBox *view = new QVBox(this); |
72 | setCentralWidget(view); | 73 | setCentralWidget(view); |
73 | 74 | ||
74 | attachments = new QListView(view); | 75 | attachments = new QListView(view); |
75 | attachments->setMinimumHeight(90); | 76 | int fixh = 100; |
76 | attachments->setMaximumHeight(90); | 77 | if ( QApplication::desktop()->width() > 320 ) |
78 | fixh = 200; | ||
79 | attachments->setFixedHeight(fixh); | ||
77 | attachments->setAllColumnsShowFocus(true); | 80 | attachments->setAllColumnsShowFocus(true); |
78 | attachments->addColumn("Mime Type", 60); | 81 | attachments->addColumn("Mime Type", fixh-30); |
79 | attachments->addColumn(i18n("Description"), 100); | 82 | attachments->addColumn(i18n("Description"), 100); |
80 | attachments->addColumn(i18n("Filename"), 80); | 83 | attachments->addColumn(i18n("Filename"), 80); |
81 | attachments->addColumn(i18n("Size"), 80); | 84 | attachments->addColumn(i18n("Size"), 80); |
82 | attachments->setSorting(-1); | 85 | attachments->setSorting(-1); |
83 | attachments->hide(); | 86 | attachments->hide(); |
84 | 87 | ||
diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h index 7ad1eec..7c075eb 100644 --- a/kmicromail/viewmailbase.h +++ b/kmicromail/viewmailbase.h | |||
@@ -1,12 +1,17 @@ | |||
1 | // CHANGED 2004-08-06 Lutz Rogowski | 1 | // CHANGED 2004-08-06 Lutz Rogowski |
2 | #ifndef VIEWMAILBASE_H | 2 | #ifndef VIEWMAILBASE_H |
3 | #define VIEWMAILBASE_H | 3 | #define VIEWMAILBASE_H |
4 | 4 | ||
5 | #include <qmainwindow.h> | 5 | #include <qmainwindow.h> |
6 | 6 | ||
7 | #ifndef DESKTOP_VERSION | ||
8 | #include <qpe/qpemenubar.h> | ||
9 | #define QMenuBar QPEMenuBar | ||
10 | #endif | ||
11 | |||
7 | class QAction; | 12 | class QAction; |
8 | class OpenDiag; | 13 | class OpenDiag; |
9 | class QListView; | 14 | class QListView; |
10 | class QToolBar; | 15 | class QToolBar; |
11 | class QTextBrowser; | 16 | class QTextBrowser; |
12 | class QMenuBar; | 17 | class QMenuBar; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 59618bf..d543aaf 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -112,15 +112,17 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const | |||
112 | { | 112 | { |
113 | mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this); | 113 | mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this); |
114 | mPendingUpdateBeforeRepaint = false; | 114 | mPendingUpdateBeforeRepaint = false; |
115 | mouseDown = false; | 115 | mouseDown = false; |
116 | // initialize dynamic arrays | 116 | // initialize dynamic arrays |
117 | bDays.resize ( NUMDAYS ); | 117 | bDays.resize ( NUMDAYS ); |
118 | hDays.resize ( NUMDAYS );; | ||
119 | eDays.resize ( NUMDAYS );; | ||
118 | days = new QDate[NUMDAYS]; | 120 | days = new QDate[NUMDAYS]; |
119 | daylbls = new QString[NUMDAYS]; | 121 | daylbls = new QString[NUMDAYS]; |
120 | events = new int[NUMDAYS]; | 122 | //events = new int[NUMDAYS]; |
121 | mToolTip = new DynamicTip(this); | 123 | mToolTip = new DynamicTip(this); |
122 | 124 | ||
123 | // set default values used for drawing the matrix | 125 | // set default values used for drawing the matrix |
124 | mDefaultBackColor = palette().active().base(); | 126 | mDefaultBackColor = palette().active().base(); |
125 | mDefaultTextColor = palette().active().foreground(); | 127 | mDefaultTextColor = palette().active().foreground(); |
126 | mDefaultTextColorShaded = getShadedColor(mDefaultTextColor); | 128 | mDefaultTextColorShaded = getShadedColor(mDefaultTextColor); |
@@ -237,13 +239,13 @@ QColor KODayMatrix::getShadedColor(QColor color) | |||
237 | 239 | ||
238 | KODayMatrix::~KODayMatrix() | 240 | KODayMatrix::~KODayMatrix() |
239 | { | 241 | { |
240 | // delete mKODaymatrixWhatsThis; | 242 | // delete mKODaymatrixWhatsThis; |
241 | delete [] days; | 243 | delete [] days; |
242 | delete [] daylbls; | 244 | delete [] daylbls; |
243 | delete [] events; | 245 | //delete [] events; |
244 | delete mToolTip; | 246 | delete mToolTip; |
245 | } | 247 | } |
246 | 248 | ||
247 | /* | 249 | /* |
248 | void KODayMatrix::setStartDate(QDate start) | 250 | void KODayMatrix::setStartDate(QDate start) |
249 | { | 251 | { |
@@ -308,13 +310,13 @@ void KODayMatrix::clearSelection() | |||
308 | 310 | ||
309 | 311 | ||
310 | void KODayMatrix::recalculateToday() | 312 | void KODayMatrix::recalculateToday() |
311 | { | 313 | { |
312 | today = -1; | 314 | today = -1; |
313 | for (int i=0; i<NUMDAYS; i++) { | 315 | for (int i=0; i<NUMDAYS; i++) { |
314 | events[i] = 0; | 316 | //events[i] = 0; |
315 | days[i] = startdate.addDays(i); | 317 | days[i] = startdate.addDays(i); |
316 | daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); | 318 | daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); |
317 | 319 | ||
318 | // if today is in the currently displayed month, hilight today | 320 | // if today is in the currently displayed month, hilight today |
319 | if (days[i].year() == QDate::currentDate().year() && | 321 | if (days[i].year() == QDate::currentDate().year() && |
320 | days[i].month() == QDate::currentDate().month() && | 322 | days[i].month() == QDate::currentDate().month() && |
@@ -346,19 +348,22 @@ void KODayMatrix::updateViewTimed() | |||
346 | // if events are set for the day then remember to draw it bold | 348 | // if events are set for the day then remember to draw it bold |
347 | QPtrList<Event> eventlist = mCalendar->events(days[i]); | 349 | QPtrList<Event> eventlist = mCalendar->events(days[i]); |
348 | Event *event; | 350 | Event *event; |
349 | int numEvents = eventlist.count(); | 351 | int numEvents = eventlist.count(); |
350 | QString holiStr = ""; | 352 | QString holiStr = ""; |
351 | bDays.clearBit(i); | 353 | bDays.clearBit(i); |
354 | hDays.clearBit(i); | ||
355 | eDays.clearBit(i); | ||
352 | for(event=eventlist.first();event != 0;event=eventlist.next()) { | 356 | for(event=eventlist.first();event != 0;event=eventlist.next()) { |
353 | ushort recurType = event->recurrence()->doesRecur(); | 357 | ushort recurType = event->recurrence()->doesRecur(); |
354 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || | 358 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || |
355 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { | 359 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { |
356 | numEvents--; | 360 | numEvents--; |
357 | } | 361 | } |
358 | if ( event->isHoliday()) { | 362 | if ( event->isHoliday()) { |
363 | hDays.setBit(i); | ||
359 | if ( !holiStr.isEmpty() ) | 364 | if ( !holiStr.isEmpty() ) |
360 | holiStr += "\n"; | 365 | holiStr += "\n"; |
361 | holiStr += event->summary(); | 366 | holiStr += event->summary(); |
362 | if ( !event->location().isEmpty() ) | 367 | if ( !event->location().isEmpty() ) |
363 | holiStr += " (" + event->location() + ")"; | 368 | holiStr += " (" + event->location() + ")"; |
364 | } | 369 | } |
@@ -368,13 +373,14 @@ void KODayMatrix::updateViewTimed() | |||
368 | holiStr += i18n("Birthday") + ": "+event->summary(); | 373 | holiStr += i18n("Birthday") + ": "+event->summary(); |
369 | if ( !event->location().isEmpty() ) | 374 | if ( !event->location().isEmpty() ) |
370 | holiStr += " (" + event->location() + ")"; | 375 | holiStr += " (" + event->location() + ")"; |
371 | bDays.setBit(i); | 376 | bDays.setBit(i); |
372 | } | 377 | } |
373 | } | 378 | } |
374 | events[i] = numEvents; | 379 | if ( numEvents ) |
380 | eDays.setBit(i); | ||
375 | //if it is a holy day then draw it red. Sundays are consider holidays, too | 381 | //if it is a holy day then draw it red. Sundays are consider holidays, too |
376 | if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || | 382 | if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || |
377 | !holiStr.isEmpty()) { | 383 | !holiStr.isEmpty()) { |
378 | mHolidays[i] = holiStr; | 384 | mHolidays[i] = holiStr; |
379 | } else { | 385 | } else { |
380 | mHolidays[i] = QString::null; | 386 | mHolidays[i] = QString::null; |
@@ -444,14 +450,17 @@ void KODayMatrix::updateEvents() | |||
444 | if ( ( recurType == Recurrence::rDaily && | 450 | if ( ( recurType == Recurrence::rDaily && |
445 | !KOPrefs::instance()->mDailyRecur ) || | 451 | !KOPrefs::instance()->mDailyRecur ) || |
446 | ( recurType == Recurrence::rWeekly && | 452 | ( recurType == Recurrence::rWeekly && |
447 | !KOPrefs::instance()->mWeeklyRecur ) ) { | 453 | !KOPrefs::instance()->mWeeklyRecur ) ) { |
448 | numEvents--; | 454 | numEvents--; |
449 | } | 455 | } |
450 | } | 456 | } |
451 | events[ i ] = numEvents; | 457 | if ( numEvents ) |
458 | eDays.setBit(i); | ||
459 | else | ||
460 | eDays.clearBit(i); | ||
452 | } | 461 | } |
453 | } | 462 | } |
454 | 463 | ||
455 | const QDate& KODayMatrix::getDate(int offset) | 464 | const QDate& KODayMatrix::getDate(int offset) |
456 | { | 465 | { |
457 | if (offset < 0 || offset > NUMDAYS-1) { | 466 | if (offset < 0 || offset > NUMDAYS-1) { |
@@ -859,24 +868,27 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
859 | addCol += 1; | 868 | addCol += 1; |
860 | p.drawRect(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight+1); | 869 | p.drawRect(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight+1); |
861 | p.setPen(tmppen); | 870 | p.setPen(tmppen); |
862 | } | 871 | } |
863 | 872 | ||
864 | // if any events are on that day then draw it using a bold font | 873 | // if any events are on that day then draw it using a bold font |
865 | if (events[i] > 0) { | 874 | if ( eDays.testBit(i) ) { |
866 | QFont myFont = font(); | 875 | QFont myFont = font(); |
867 | myFont.setBold(true); | 876 | myFont.setBold(true); |
868 | p.setFont(myFont); | 877 | p.setFont(myFont); |
869 | } | 878 | } |
870 | 879 | ||
871 | // if it is a holiday then use the default holiday color | 880 | // if it is a holiday then use the default holiday color |
872 | if (!mHolidays[i].isNull()) { | 881 | if ( !mHolidays[i].isNull()) { |
873 | if ( bDays.testBit(i) ) { | 882 | if ( bDays.testBit(i) ) { |
874 | p.setPen(Qt::green); | 883 | if ( hDays.testBit(i) ) |
884 | p.setPen(QColor(Qt::green)); | ||
885 | else | ||
886 | p.setPen(QColor(Qt::green).dark()); | ||
875 | } else { | 887 | } else { |
876 | if (actcol == mDefaultTextColor) { | 888 | if (actcol == mDefaultTextColor ) { |
877 | p.setPen(KOPrefs::instance()->mHolidayColor); | 889 | p.setPen(KOPrefs::instance()->mHolidayColor); |
878 | } else { | 890 | } else { |
879 | p.setPen(mHolidayColorShaded); | 891 | p.setPen(mHolidayColorShaded); |
880 | } | 892 | } |
881 | } | 893 | } |
882 | } | 894 | } |
@@ -906,13 +918,13 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
906 | 918 | ||
907 | // reset color to actual color | 919 | // reset color to actual color |
908 | if (!mHolidays[i].isNull()) { | 920 | if (!mHolidays[i].isNull()) { |
909 | p.setPen(actcol); | 921 | p.setPen(actcol); |
910 | } | 922 | } |
911 | // reset bold font to plain font | 923 | // reset bold font to plain font |
912 | if (events[i] > 0) { | 924 | if ( eDays.testBit(i)) { |
913 | QFont myFont = font(); | 925 | QFont myFont = font(); |
914 | myFont.setBold(false); | 926 | myFont.setBold(false); |
915 | p.setFont(myFont); | 927 | p.setFont(myFont); |
916 | } | 928 | } |
917 | } | 929 | } |
918 | int off = 0;//xyOff; | 930 | int off = 0;//xyOff; |
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index 2a1959c..38a7f92 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h | |||
@@ -227,12 +227,14 @@ protected: | |||
227 | void resizeEvent(QResizeEvent *); | 227 | void resizeEvent(QResizeEvent *); |
228 | 228 | ||
229 | private: | 229 | private: |
230 | KODaymatrixWhatsThis* mKODaymatrixWhatsThis; | 230 | KODaymatrixWhatsThis* mKODaymatrixWhatsThis; |
231 | bool mouseDown; | 231 | bool mouseDown; |
232 | QBitArray bDays; | 232 | QBitArray bDays; |
233 | QBitArray hDays; | ||
234 | QBitArray eDays; | ||
233 | QPixmap myPix; | 235 | QPixmap myPix; |
234 | QTimer* mUpdateTimer; | 236 | QTimer* mUpdateTimer; |
235 | QTimer* mRepaintTimer; | 237 | QTimer* mRepaintTimer; |
236 | bool mDayChanged; | 238 | bool mDayChanged; |
237 | bool mPendingUpdateBeforeRepaint; | 239 | bool mPendingUpdateBeforeRepaint; |
238 | 240 | ||
@@ -267,13 +269,13 @@ private: | |||
267 | subsequently calling QDate::addDays(). */ | 269 | subsequently calling QDate::addDays(). */ |
268 | QDate *days; | 270 | QDate *days; |
269 | 271 | ||
270 | /** array of storing the number of events on a given day. | 272 | /** array of storing the number of events on a given day. |
271 | * used for drawing a bold font if there is at least one event on that day. | 273 | * used for drawing a bold font if there is at least one event on that day. |
272 | */ | 274 | */ |
273 | int *events; | 275 | //int *events; |
274 | 276 | ||
275 | /** stores holiday names of the days shown in the matrix. */ | 277 | /** stores holiday names of the days shown in the matrix. */ |
276 | QMap<int,QString> mHolidays; | 278 | QMap<int,QString> mHolidays; |
277 | 279 | ||
278 | /** indey of today or -1 if today is not visible in the matrix. */ | 280 | /** indey of today or -1 if today is not visible in the matrix. */ |
279 | int today; | 281 | int today; |