summaryrefslogtreecommitdiff
path: root/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/modules/weeklst/datebookweeklstview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/modules/weeklst/datebookweeklstview.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
index 82b9c6d..469a60a 100644
--- a/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
+++ b/core/pim/datebook/modules/weeklst/datebookweeklstview.cpp
@@ -7,15 +7,16 @@
7#include <opie2/odebug.h> 7#include <opie2/odebug.h>
8 8
9#include <qpe/config.h> 9#include <qpe/config.h>
10#include <qpe/qpeapplication.h>
10 11
11#include <qlayout.h> 12#include <qlayout.h>
12#include <qtl.h> 13#include <qtl.h>
13 14
14DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, 15DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
15 const QDate &d, bool onM, 16 const QDate &d, bool onM, bool showAmPm,
16 QWidget* parent, 17 QWidget* parent,
17 const char* name, WFlags fl) 18 const char* name, WFlags fl)
18 : QWidget( parent, name, fl ) 19 : QWidget( parent, name, fl ), ampm(showAmPm)
19{ 20{
20 childs.clear(); 21 childs.clear();
21 m_MainLayout = new QVBoxLayout( this ); 22 m_MainLayout = new QVBoxLayout( this );
@@ -65,17 +66,18 @@ void DateBookWeekLstView::setEvents(QValueList<EffectiveEvent> &ev, const QDate
65 w->setPalette(white); 66 w->setPalette(white);
66 QVBoxLayout * tlayout = new QVBoxLayout(w); 67 QVBoxLayout * tlayout = new QVBoxLayout(w);
67 childs.append(w); 68 childs.append(w);
68 // Header 69 // Header
69 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,w); 70 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i-dayoffset), bStartOnMonday,w);
70 connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 71 connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
71 connect(hdr, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)), 72 connect(hdr, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
72 this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&))); 73 this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
73 tlayout->addWidget(hdr); 74 tlayout->addWidget(hdr);
75 connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(slotClockChanged(bool)));
74 76
75 // Events 77 // Events
76 while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { 78 while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) {
77 if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day. 79 if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) { // Skip events ending at 00:00 starting at another day.
78 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,w); 80 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(ampm,*it,weeklistviewconfig,w);
79 tlayout->addWidget(l); 81 tlayout->addWidget(l);
80 connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&))); 82 connect (l, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
81 connect (l, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &))); 83 connect (l, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
@@ -87,14 +89,14 @@ void DateBookWeekLstView::setEvents(QValueList<EffectiveEvent> &ev, const QDate
87 } 89 }
88 tlayout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); 90 tlayout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
89 m_MainLayout->addWidget(w); 91 m_MainLayout->addWidget(w);
90/*
91 QSpacerItem * tmp = new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding);
92 m_MainLayout->addItem(tmp);
93*/
94 } 92 }
95 setUpdatesEnabled(true); 93 setUpdatesEnabled(true);
96} 94}
97 95
96void DateBookWeekLstView::slotClockChanged( bool ap ) {
97 ampm = ap;
98}
99
98DateBookWeekLstView::~DateBookWeekLstView() 100DateBookWeekLstView::~DateBookWeekLstView()
99{} 101{}
100 102