author | alwin <alwin> | 2005-03-19 13:44:30 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-19 13:44:30 (UTC) |
commit | 34e42590a8ef21c1377f89c7b82f25bcf0aec3cb (patch) (unidiff) | |
tree | f5afdae31945ca2bac7339a339499fa87ece50d9 /core/pim/datebook/modules/weeklst/datebookweeklstdayhdr.cpp | |
parent | d9e8b9e797e3162ab564bb3b0f04663ef1167541 (diff) | |
download | opie-34e42590a8ef21c1377f89c7b82f25bcf0aec3cb.zip opie-34e42590a8ef21c1377f89c7b82f25bcf0aec3cb.tar.gz opie-34e42590a8ef21c1377f89c7b82f25bcf0aec3cb.tar.bz2 |
so....
I looked for a problem. could not found due the kind of code structure.
so I had reorganized the code into a more sensefull structure so every one
should be able to find some code sequences when searching for a bug.
yes - now I found the problem and can thinking about resolving it.
Diffstat (limited to 'core/pim/datebook/modules/weeklst/datebookweeklstdayhdr.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/modules/weeklst/datebookweeklstdayhdr.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstdayhdr.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstdayhdr.cpp new file mode 100644 index 0000000..d173444 --- a/dev/null +++ b/core/pim/datebook/modules/weeklst/datebookweeklstdayhdr.cpp | |||
@@ -0,0 +1,53 @@ | |||
1 | #include "datebookweeklstdayhdr.h" | ||
2 | |||
3 | #include "namespace_hack.h" | ||
4 | |||
5 | DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /* onM */, | ||
6 | QWidget* parent, | ||
7 | const char* name, | ||
8 | WFlags fl ) | ||
9 | : DateBookWeekLstDayHdrBase(parent, name, fl) { | ||
10 | |||
11 | date=d; | ||
12 | |||
13 | static const QString wdays=tr("MTWTFSSM", "Week days"); | ||
14 | char day=wdays[d.dayOfWeek()-1]; | ||
15 | |||
16 | //dont use dayOfWeek() to save space ! | ||
17 | label->setText( QString(QObject::tr(QString(QChar(day)))) + " " +QString::number(d.day()) ); | ||
18 | |||
19 | add->setText("+"); | ||
20 | |||
21 | if (d == QDate::currentDate()) { | ||
22 | QPalette pal=label->palette(); | ||
23 | pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); | ||
24 | label->setPalette(pal); | ||
25 | |||
26 | /* | ||
27 | QFont f=label->font(); | ||
28 | f.setItalic(true); | ||
29 | label->setFont(f); | ||
30 | label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor())); | ||
31 | */ | ||
32 | } else if (d.dayOfWeek() == 7) { // FIXME: Match any holiday | ||
33 | QPalette pal=label->palette(); | ||
34 | pal.setColor(QColorGroup::Foreground, QColor(255,0,0)); | ||
35 | label->setPalette(pal); | ||
36 | } | ||
37 | |||
38 | connect (label, SIGNAL(clicked()), this, SLOT(showDay())); | ||
39 | connect (add, SIGNAL(clicked()), this, SLOT(newEvent())); | ||
40 | } | ||
41 | |||
42 | void DateBookWeekLstDayHdr::showDay() { | ||
43 | emit showDate(date.year(), date.month(), date.day()); | ||
44 | } | ||
45 | |||
46 | void DateBookWeekLstDayHdr::newEvent() { | ||
47 | QDateTime start, stop; | ||
48 | start=stop=date; | ||
49 | start.setTime(QTime(10,0)); | ||
50 | stop.setTime(QTime(12,0)); | ||
51 | |||
52 | emit addEvent(start,stop,"",0); | ||
53 | } | ||