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 @@ -19,16 +19,16 @@ #include <qtimer.h> #include <qstyle.h> #include <qtoolbutton.h> #include <qvbox.h> -#include <qsizepolicy.h> -#include <qabstractlayout.h> +#include <qsizepolicy.h> +#include <qabstractlayout.h> #include <qtl.h> bool calcWeek(const QDate &d, int &week, int &year, bool startOnMonday = false); -DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, +DateBookWeekLstHeader::DateBookWeekLstHeader(bool /*onM*/, QWidget* parent, const char* name, WFlags fl) : DateBookWeekLstHeaderBase(parent, name, fl) { setBackgroundMode( PaletteButton ); @@ -53,14 +53,14 @@ void DateBookWeekLstHeader::setDate(const QDate &d) { int year,week; calcWeek(d,week,year,onMonday); labelWeek->setText("W: " + QString::number(week)); - + QDate start=date; QDate stop=start.addDays(6); - labelDate->setText( QString::number(start.day()) + " " + + labelDate->setText( QString::number(start.day()) + " " + start.monthName(start.month()) + " - " + - QString::number(stop.day()) + " " + + QString::number(stop.day()) + " " + start.monthName(stop.month()) ); emit dateChanged(year,week); } void DateBookWeekLstHeader::pickDate() { @@ -91,27 +91,27 @@ void DateBookWeekLstHeader::prevWeek() { setDate(date.addDays(-7)); } DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, - QWidget* parent, - const char* name, - WFlags fl ) + QWidget* parent, + const char* name, + WFlags fl ) : DateBookWeekLstDayHdrBase(parent, name, fl) { date=d; static const char *wdays="MTWTFSS"; char day=wdays[d.dayOfWeek()-1]; - label->setText( QString(QChar(day)) + " " + + label->setText( QString(QChar(day)) + " " + QString::number(d.day()) ); add->setText("+"); if (d == QDate::currentDate()) { QPalette pal=label->palette(); pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); label->setPalette(pal); - + /* QFont f=label->font(); f.setItalic(true); label->setFont(f); @@ -138,11 +138,11 @@ void DateBookWeekLstDayHdr::newEvent() { stop.setTime(QTime(12,0)); emit addEvent(start,stop,""); } -DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, - QWidget* parent, - const char* name, +DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, + QWidget* parent, + const char* name, WFlags fl) : OClickableLabel(parent,name,fl), event(ev) { @@ -164,26 +164,26 @@ void DateBookWeekLstEvent::editMe() { emit editEvent(event.event()); } -DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, +DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM, - QWidget* parent, + QWidget* parent, const char* name, WFlags fl) : QWidget( parent, name, fl ) { onMonday=onM; setPalette(white); setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); QVBoxLayout *layout = new QVBoxLayout( this ); - + qBubbleSort(ev); QValueListIterator<EffectiveEvent> it; it=ev.begin(); int dayOrder[7]; - if (onMonday) + if (onMonday) for (int d=0; d<7; d++) dayOrder[d]=d+1; else { for (int d=0; d<7; d++) dayOrder[d]=d; dayOrder[0]=7; @@ -192,37 +192,37 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, for (int i=0; i<7; i++) { // Header DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), onMonday,this); - connect(hdr, SIGNAL(showDate(int,int,int)), + connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); - connect(hdr, SIGNAL(addEvent(const QDateTime &, + connect(hdr, SIGNAL(addEvent(const QDateTime &, const QDateTime &, - const QString &)), - this, SIGNAL(addEvent(const QDateTime &, + const QString &)), + this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &))); layout->addWidget(hdr); - + // Events while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); layout->addWidget(l); connect (l, SIGNAL(editEvent(const Event &)), this, SIGNAL(editEvent(const Event &))); it++; } - + layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); } } DateBookWeekLstView::~DateBookWeekLstView(){} void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} -DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, - QValueList<EffectiveEvent> &ev2, +DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, + QValueList<EffectiveEvent> &ev2, QDate &d, bool onM, - QWidget* parent, + QWidget* parent, const char* name, WFlags fl) : QWidget( parent, name, fl ) { QHBoxLayout *layout = new QHBoxLayout( this ); @@ -250,10 +250,10 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &))); } -DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, - QWidget *parent, +DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, + QWidget *parent, const char *name ) : QWidget( parent, name ), db( newDB ), startTime( 0 ), @@ -265,12 +265,12 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, layout->setMargin(0); header=new DateBookWeekLstHeader(onM, this); layout->addWidget( header ); - connect(header, SIGNAL(dateChanged(int,int)), + connect(header, SIGNAL(dateChanged(int,int)), this, SLOT(dateChanged(int,int))); connect(header, SIGNAL(setDbl(bool)), - this, SLOT(setDbl(bool))); + this, SLOT(setDbl(bool))); scroll=new QScrollView(this); //scroll->setVScrollBarMode(QScrollView::AlwaysOn); //scroll->setHScrollBarMode(QScrollView::AlwaysOff); @@ -309,9 +309,9 @@ QDate DateBookWeekLst::date() const { int dow= d.dayOfWeek(); if (!onMonday) if (dow==7) dow=1; else dow++; - + d=d.addDays( (_week-1)*7 - dow + 1 ); return d; } |