summaryrefslogtreecommitdiff
path: root/core/pim/datebook/modules/weeklst/datebookweeklst.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/modules/weeklst/datebookweeklst.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/modules/weeklst/datebookweeklst.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/pim/datebook/modules/weeklst/datebookweeklst.cpp b/core/pim/datebook/modules/weeklst/datebookweeklst.cpp
index b36bf6d..59f937f 100644
--- a/core/pim/datebook/modules/weeklst/datebookweeklst.cpp
+++ b/core/pim/datebook/modules/weeklst/datebookweeklst.cpp
@@ -1,24 +1,25 @@
#include "namespace_hack.h"
#include "datebookweeklst.h"
#include "datebookweeklstheader.h"
#include "datebookweeklstview.h"
#include "datebookweeklstdblview.h"
#include "datebook.h"
#include <opie2/odebug.h>
#include <qpe/datebookmonth.h>
#include <qpe/config.h>
+#include <qpe/qpeapplication.h>
#include <qlayout.h>
#include <qtoolbutton.h>
using namespace Opie::Ui;
DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDBHoliday *newDB,
QWidget *parent,
const char *name )
: QWidget( parent, name ),
db( newDB ),
startTime( 0 ),
@@ -59,25 +60,27 @@ void DateBookWeekLst::setDate(const QDate &d) {
void DateBookWeekLst::setDbl(bool on) {
dbl=on;
bool displayed = false;
if (m_CurrentView) {
displayed = m_CurrentView->toggleDoubleView(on);
}
if (!displayed||dbl) {
getEvents();
}
}
-void DateBookWeekLst::redraw() {getEvents();}
+void DateBookWeekLst::redraw() {
+ getEvents();
+}
QDate DateBookWeekLst::date() {
return bdate;
}
// return the date at the beginning of the week...
// copied from DateBookWeek
QDate DateBookWeekLst::weekDate() const
{
QDate d=bdate;
// Calculate offset to first day of week.
@@ -97,48 +100,54 @@ void DateBookWeekLst::getEvents() {
QValueList<EffectiveEvent> el = db->getEffectiveEvents(start, stop);
QValueList<EffectiveEvent> el2;
if (dbl) {
start2 = start.addDays(7);
stop = start2.addDays(6);
el2 = db->getEffectiveEvents(start2, stop);
}
if (!m_CurrentView) {
if (dbl) {
- m_CurrentView=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,scroll);
+ m_CurrentView=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,ampm,scroll);
} else {
- m_CurrentView=new DateBookWeekLstDblView(el,start,bStartOnMonday,scroll);
+ m_CurrentView=new DateBookWeekLstDblView(el,start,bStartOnMonday,ampm,scroll);
}
m_CurrentView->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed));
connect (m_CurrentView, SIGNAL(editEvent(const Event&)), this, SIGNAL(editEvent(const Event&)));
connect (m_CurrentView, SIGNAL(duplicateEvent(const Event &)), this, SIGNAL(duplicateEvent(const Event &)));
connect (m_CurrentView, SIGNAL(removeEvent(const Event &)), this, SIGNAL(removeEvent(const Event &)));
connect (m_CurrentView, SIGNAL(beamEvent(const Event &)), this, SIGNAL(beamEvent(const Event &)));
connect (m_CurrentView, SIGNAL(redraw()), this, SLOT(redraw()));
connect (m_CurrentView, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
connect (m_CurrentView, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)),
this, SIGNAL(addEvent(const QDateTime&,const QDateTime&,const QString&,const QString&)));
+ connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(slotClockChanged(bool)));
scroll->addChild(m_CurrentView);
} else {
if (dbl) {
m_CurrentView->setEvents(el,el2,start,bStartOnMonday);
} else {
m_CurrentView->setEvents(el,start,bStartOnMonday);
}
}
scroll->updateScrollBars();
}
+void DateBookWeekLst::slotClockChanged( bool ap ) {
+ ampm = ap;
+ getEvents();
+}
+
void DateBookWeekLst::dateChanged(QDate &newdate) {
dateset = true;
bdate=newdate;
odebug << "Date changed " << oendl;
getEvents();
}
void DateBookWeekLst::keyPressEvent(QKeyEvent *e)
{
switch(e->key()) {
case Key_Up:
scroll->scrollBy(0, -20);