Diffstat (limited to 'core/pim/datebook/datebookweeklst.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 65 |
1 files changed, 62 insertions, 3 deletions
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index dc141c0..7083bc5 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp | |||
@@ -10,2 +10,3 @@ | |||
10 | #include <qpe/datebookmonth.h> | 10 | #include <qpe/datebookmonth.h> |
11 | #include <qpe/config.h> | ||
11 | 12 | ||
@@ -45,2 +46,3 @@ DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, | |||
45 | connect(labelWeek, SIGNAL(clicked()), this, SLOT(pickDate())); | 46 | connect(labelWeek, SIGNAL(clicked()), this, SLOT(pickDate())); |
47 | connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); | ||
46 | onMonday=onM; | 48 | onMonday=onM; |
@@ -158,2 +160,3 @@ DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, | |||
158 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); | 160 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); |
161 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); | ||
159 | } | 162 | } |
@@ -165,3 +168,3 @@ void DateBookWeekLstEvent::editMe() { | |||
165 | DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | 168 | DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, |
166 | QDate &d, bool onM, | 169 | const QDate &d, bool onM, |
167 | QWidget* parent, | 170 | QWidget* parent, |
@@ -217,2 +220,35 @@ void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} | |||
217 | 220 | ||
221 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | ||
222 | QValueList<EffectiveEvent> &ev2, | ||
223 | QDate &d, bool onM, | ||
224 | QWidget* parent, | ||
225 | const char* name, WFlags fl) | ||
226 | : QWidget( parent, name, fl ) | ||
227 | { | ||
228 | QHBoxLayout *layout = new QHBoxLayout( this ); | ||
229 | |||
230 | DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this); | ||
231 | layout->addWidget(w); | ||
232 | connect (w, SIGNAL(editEvent(const Event &)), | ||
233 | this, SIGNAL(editEvent(const Event &))); | ||
234 | connect (w, SIGNAL(showDate(int,int,int)), | ||
235 | this, SIGNAL(showDate(int,int,int))); | ||
236 | connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &, | ||
237 | const QString &)), | ||
238 | this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, | ||
239 | const QString &))); | ||
240 | |||
241 | |||
242 | w=new DateBookWeekLstView(ev2,d.addDays(7),onM,this); | ||
243 | layout->addWidget(w); | ||
244 | connect (w, SIGNAL(editEvent(const Event &)), | ||
245 | this, SIGNAL(editEvent(const Event &))); | ||
246 | connect (w, SIGNAL(showDate(int,int,int)), | ||
247 | this, SIGNAL(showDate(int,int,int))); | ||
248 | connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &, | ||
249 | const QString &)), | ||
250 | this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, | ||
251 | const QString &))); | ||
252 | } | ||
253 | |||
218 | DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, | 254 | DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, |
@@ -232,3 +268,6 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, | |||
232 | layout->addWidget( header ); | 268 | layout->addWidget( header ); |
233 | connect(header, SIGNAL(dateChanged(int,int)), this, SLOT(dateChanged(int,int))); | 269 | connect(header, SIGNAL(dateChanged(int,int)), |
270 | this, SLOT(dateChanged(int,int))); | ||
271 | connect(header, SIGNAL(setDbl(bool)), | ||
272 | this, SLOT(setDbl(bool))); | ||
234 | 273 | ||
@@ -241,4 +280,12 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, | |||
241 | view=NULL; | 280 | view=NULL; |
281 | Config config("DateBook"); | ||
282 | config.setGroup("Main"); | ||
283 | dbl=config.readBoolEntry("weeklst_dbl", false); | ||
284 | header->dbl->setOn(dbl); | ||
285 | } | ||
286 | DateBookWeekLst::~DateBookWeekLst(){ | ||
287 | Config config("DateBook"); | ||
288 | config.setGroup("Main"); | ||
289 | config.writeEntry("weeklst_dbl", dbl); | ||
242 | } | 290 | } |
243 | |||
244 | 291 | ||
@@ -251,2 +298,6 @@ void DateBookWeekLst::setDate(const QDate &d) { | |||
251 | } | 298 | } |
299 | void DateBookWeekLst::setDbl(bool on) { | ||
300 | dbl=on; | ||
301 | redraw(); | ||
302 | } | ||
252 | void DateBookWeekLst::redraw() {getEvents();} | 303 | void DateBookWeekLst::redraw() {getEvents();} |
@@ -272,3 +323,11 @@ void DateBookWeekLst::getEvents() { | |||
272 | if (view) delete view; | 323 | if (view) delete view; |
324 | if (dbl) { | ||
325 | QDate start2=start.addDays(7); | ||
326 | stop=start2.addDays(6); | ||
327 | QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop); | ||
328 | |||
329 | view=new DateBookWeekLstDblView(el,el2,start,onMonday,scroll); | ||
330 | } else { | ||
273 | view=new DateBookWeekLstView(el,start,onMonday,scroll); | 331 | view=new DateBookWeekLstView(el,start,onMonday,scroll); |
332 | } | ||
274 | 333 | ||