Diffstat (limited to 'core/pim/datebook/datebookweeklst.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index 8e88377..58a9c53 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp | |||
@@ -20,14 +20,14 @@ | |||
20 | #include <qstyle.h> | 20 | #include <qstyle.h> |
21 | #include <qtoolbutton.h> | 21 | #include <qtoolbutton.h> |
22 | #include <qvbox.h> | 22 | #include <qvbox.h> |
23 | #include <qsizepolicy.h> | 23 | #include <qsizepolicy.h> |
24 | #include <qabstractlayout.h> | 24 | #include <qabstractlayout.h> |
25 | #include <qtl.h> | 25 | #include <qtl.h> |
26 | 26 | ||
27 | bool calcWeek(const QDate &d, int &week, int &year, | 27 | bool calcWeek(const QDate &d, int &week, int &year, |
28 | bool startOnMonday = false); | 28 | bool startOnMonday = false); |
29 | 29 | ||
30 | DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, | 30 | DateBookWeekLstHeader::DateBookWeekLstHeader(bool /*onM*/, QWidget* parent, |
31 | const char* name, WFlags fl) | 31 | const char* name, WFlags fl) |
32 | : DateBookWeekLstHeaderBase(parent, name, fl) | 32 | : DateBookWeekLstHeaderBase(parent, name, fl) |
33 | { | 33 | { |
@@ -54,12 +54,12 @@ void DateBookWeekLstHeader::setDate(const QDate &d) { | |||
54 | int year,week; | 54 | int year,week; |
55 | calcWeek(d,week,year,onMonday); | 55 | calcWeek(d,week,year,onMonday); |
56 | labelWeek->setText("W: " + QString::number(week)); | 56 | labelWeek->setText("W: " + QString::number(week)); |
57 | 57 | ||
58 | QDate start=date; | 58 | QDate start=date; |
59 | QDate stop=start.addDays(6); | 59 | QDate stop=start.addDays(6); |
60 | labelDate->setText( QString::number(start.day()) + " " + | 60 | labelDate->setText( QString::number(start.day()) + " " + |
61 | start.monthName(start.month()) + " - " + | 61 | start.monthName(start.month()) + " - " + |
62 | QString::number(stop.day()) + " " + | 62 | QString::number(stop.day()) + " " + |
63 | start.monthName(stop.month()) ); | 63 | start.monthName(stop.month()) ); |
64 | emit dateChanged(year,week); | 64 | emit dateChanged(year,week); |
65 | } | 65 | } |
@@ -92,9 +92,9 @@ void DateBookWeekLstHeader::prevWeek() { | |||
92 | } | 92 | } |
93 | 93 | ||
94 | DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, | 94 | DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, |
95 | QWidget* parent, | 95 | QWidget* parent, |
96 | const char* name, | 96 | const char* name, |
97 | WFlags fl ) | 97 | WFlags fl ) |
98 | : DateBookWeekLstDayHdrBase(parent, name, fl) { | 98 | : DateBookWeekLstDayHdrBase(parent, name, fl) { |
99 | 99 | ||
100 | date=d; | 100 | date=d; |
@@ -102,7 +102,7 @@ DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, | |||
102 | static const char *wdays="MTWTFSS"; | 102 | static const char *wdays="MTWTFSS"; |
103 | char day=wdays[d.dayOfWeek()-1]; | 103 | char day=wdays[d.dayOfWeek()-1]; |
104 | 104 | ||
105 | label->setText( QString(QChar(day)) + " " + | 105 | label->setText( QString(QChar(day)) + " " + |
106 | QString::number(d.day()) ); | 106 | QString::number(d.day()) ); |
107 | add->setText("+"); | 107 | add->setText("+"); |
108 | 108 | ||
@@ -110,7 +110,7 @@ DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, | |||
110 | QPalette pal=label->palette(); | 110 | QPalette pal=label->palette(); |
111 | pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); | 111 | pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); |
112 | label->setPalette(pal); | 112 | label->setPalette(pal); |
113 | 113 | ||
114 | /* | 114 | /* |
115 | QFont f=label->font(); | 115 | QFont f=label->font(); |
116 | f.setItalic(true); | 116 | f.setItalic(true); |
@@ -139,9 +139,9 @@ void DateBookWeekLstDayHdr::newEvent() { | |||
139 | 139 | ||
140 | emit addEvent(start,stop,""); | 140 | emit addEvent(start,stop,""); |
141 | } | 141 | } |
142 | DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, | 142 | DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, |
143 | QWidget* parent, | 143 | QWidget* parent, |
144 | const char* name, | 144 | const char* name, |
145 | WFlags fl) : | 145 | WFlags fl) : |
146 | OClickableLabel(parent,name,fl), | 146 | OClickableLabel(parent,name,fl), |
147 | event(ev) | 147 | event(ev) |
@@ -165,9 +165,9 @@ void DateBookWeekLstEvent::editMe() { | |||
165 | } | 165 | } |
166 | 166 | ||
167 | 167 | ||
168 | DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | 168 | DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, |
169 | const QDate &d, bool onM, | 169 | const QDate &d, bool onM, |
170 | QWidget* parent, | 170 | QWidget* parent, |
171 | const char* name, WFlags fl) | 171 | const char* name, WFlags fl) |
172 | : QWidget( parent, name, fl ) | 172 | : QWidget( parent, name, fl ) |
173 | { | 173 | { |
@@ -176,13 +176,13 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
176 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); | 176 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); |
177 | 177 | ||
178 | QVBoxLayout *layout = new QVBoxLayout( this ); | 178 | QVBoxLayout *layout = new QVBoxLayout( this ); |
179 | 179 | ||
180 | qBubbleSort(ev); | 180 | qBubbleSort(ev); |
181 | QValueListIterator<EffectiveEvent> it; | 181 | QValueListIterator<EffectiveEvent> it; |
182 | it=ev.begin(); | 182 | it=ev.begin(); |
183 | 183 | ||
184 | int dayOrder[7]; | 184 | int dayOrder[7]; |
185 | if (onMonday) | 185 | if (onMonday) |
186 | for (int d=0; d<7; d++) dayOrder[d]=d+1; | 186 | for (int d=0; d<7; d++) dayOrder[d]=d+1; |
187 | else { | 187 | else { |
188 | for (int d=0; d<7; d++) dayOrder[d]=d; | 188 | for (int d=0; d<7; d++) dayOrder[d]=d; |
@@ -193,16 +193,16 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
193 | // Header | 193 | // Header |
194 | DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), | 194 | DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), |
195 | onMonday,this); | 195 | onMonday,this); |
196 | connect(hdr, SIGNAL(showDate(int,int,int)), | 196 | connect(hdr, SIGNAL(showDate(int,int,int)), |
197 | this, SIGNAL(showDate(int,int,int))); | 197 | this, SIGNAL(showDate(int,int,int))); |
198 | connect(hdr, SIGNAL(addEvent(const QDateTime &, | 198 | connect(hdr, SIGNAL(addEvent(const QDateTime &, |
199 | const QDateTime &, | 199 | const QDateTime &, |
200 | const QString &)), | 200 | const QString &)), |
201 | this, SIGNAL(addEvent(const QDateTime &, | 201 | this, SIGNAL(addEvent(const QDateTime &, |
202 | const QDateTime &, | 202 | const QDateTime &, |
203 | const QString &))); | 203 | const QString &))); |
204 | layout->addWidget(hdr); | 204 | layout->addWidget(hdr); |
205 | 205 | ||
206 | // Events | 206 | // Events |
207 | while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { | 207 | while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { |
208 | DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); | 208 | DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); |
@@ -211,17 +211,17 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
211 | this, SIGNAL(editEvent(const Event &))); | 211 | this, SIGNAL(editEvent(const Event &))); |
212 | it++; | 212 | it++; |
213 | } | 213 | } |
214 | 214 | ||
215 | layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); | 215 | layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); |
216 | } | 216 | } |
217 | } | 217 | } |
218 | DateBookWeekLstView::~DateBookWeekLstView(){} | 218 | DateBookWeekLstView::~DateBookWeekLstView(){} |
219 | void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} | 219 | void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} |
220 | 220 | ||
221 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | 221 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, |
222 | QValueList<EffectiveEvent> &ev2, | 222 | QValueList<EffectiveEvent> &ev2, |
223 | QDate &d, bool onM, | 223 | QDate &d, bool onM, |
224 | QWidget* parent, | 224 | QWidget* parent, |
225 | const char* name, WFlags fl) | 225 | const char* name, WFlags fl) |
226 | : QWidget( parent, name, fl ) | 226 | : QWidget( parent, name, fl ) |
227 | { | 227 | { |
@@ -251,8 +251,8 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | |||
251 | const QString &))); | 251 | const QString &))); |
252 | } | 252 | } |
253 | 253 | ||
254 | DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, | 254 | DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, |
255 | QWidget *parent, | 255 | QWidget *parent, |
256 | const char *name ) | 256 | const char *name ) |
257 | : QWidget( parent, name ), | 257 | : QWidget( parent, name ), |
258 | db( newDB ), | 258 | db( newDB ), |
@@ -266,10 +266,10 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, | |||
266 | 266 | ||
267 | header=new DateBookWeekLstHeader(onM, this); | 267 | header=new DateBookWeekLstHeader(onM, this); |
268 | layout->addWidget( header ); | 268 | layout->addWidget( header ); |
269 | connect(header, SIGNAL(dateChanged(int,int)), | 269 | connect(header, SIGNAL(dateChanged(int,int)), |
270 | this, SLOT(dateChanged(int,int))); | 270 | this, SLOT(dateChanged(int,int))); |
271 | connect(header, SIGNAL(setDbl(bool)), | 271 | connect(header, SIGNAL(setDbl(bool)), |
272 | this, SLOT(setDbl(bool))); | 272 | this, SLOT(setDbl(bool))); |
273 | 273 | ||
274 | scroll=new QScrollView(this); | 274 | scroll=new QScrollView(this); |
275 | //scroll->setVScrollBarMode(QScrollView::AlwaysOn); | 275 | //scroll->setVScrollBarMode(QScrollView::AlwaysOn); |
@@ -310,7 +310,7 @@ QDate DateBookWeekLst::date() const { | |||
310 | if (!onMonday) | 310 | if (!onMonday) |
311 | if (dow==7) dow=1; | 311 | if (dow==7) dow=1; |
312 | else dow++; | 312 | else dow++; |
313 | 313 | ||
314 | d=d.addDays( (_week-1)*7 - dow + 1 ); | 314 | d=d.addDays( (_week-1)*7 - dow + 1 ); |
315 | return d; | 315 | return d; |
316 | } | 316 | } |