summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/clickablelabel.cpp6
-rw-r--r--core/pim/datebook/datebookday.cpp8
-rw-r--r--core/pim/datebook/datebookweek.cpp2
-rw-r--r--core/pim/datebook/datebookweeklst.cpp12
-rw-r--r--core/pim/datebook/timepicker.cpp4
5 files changed, 16 insertions, 16 deletions
diff --git a/core/pim/datebook/clickablelabel.cpp b/core/pim/datebook/clickablelabel.cpp
index 1dd0d15..128bebb 100644
--- a/core/pim/datebook/clickablelabel.cpp
+++ b/core/pim/datebook/clickablelabel.cpp
@@ -1,30 +1,30 @@
#include "clickablelabel.h"
#include <stdio.h>
-ClickableLabel::ClickableLabel(QWidget* parent = 0,
- const char* name = 0,
- WFlags fl = 0) :
+ClickableLabel::ClickableLabel(QWidget* parent,
+ const char* name,
+ WFlags fl) :
QLabel(parent,name,fl)
{
textInverted=false;
isToggle=false;
isDown=false;
showState(false);
setFrameShadow(Sunken);
}
void ClickableLabel::setToggleButton(bool t) {
isToggle=t;
}
void ClickableLabel::mousePressEvent( QMouseEvent *e ) {
if (isToggle && isDown) {
showState(false);
} else {
showState(true);
}
}
void ClickableLabel::mouseReleaseEvent( QMouseEvent *e ) {
if (rect().contains(e->pos()) && isToggle) isDown=!isDown;
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp
index d5daab2..67a88e9 100644
--- a/core/pim/datebook/datebookday.cpp
+++ b/core/pim/datebook/datebookday.cpp
@@ -464,52 +464,52 @@ DateBookDayWidget::DateBookDayWidget( const EffectiveEvent &e,
text = "<b>" + strDesc + "</b><br>" + "<i>"
+ strCat + "</i>"
+ "<br><b>" + tr("Start") + "</b>: ";
if ( e.startDate() != ev.date() ) {
// multi-day event. Show start date
text += TimeString::longDateString( e.startDate() );
} else {
// Show start time.
text += TimeString::timeString( ev.start(), whichClock, FALSE );
}
text += "<br><b>" + tr("End") + "</b>: ";
if ( e.endDate() != ev.date() ) {
// multi-day event. Show end date
text += TimeString::longDateString( e.endDate() );
} else {
// Show end time.
text += TimeString::timeString( ev.end(), whichClock, FALSE );
}
text += "<br><br>" + strNote;
setBackgroundMode( PaletteBase );
- QTime s = ev.start();
- QTime e = ev.end();
- int y = s.hour()*60+s.minute();
- int h = e.hour()*60+e.minute()-y;
+ QTime start = ev.start();
+ QTime end = ev.end();
+ int y = start.hour()*60+start.minute();
+ int h = end.hour()*60+end.minute()-y;
int rh = dateBook->dayView()->rowHeight(0);
y = y*rh/60;
h = h*rh/60;
if ( h < 3 )
h = 3;
geom.setY( y );
geom.setHeight( h );
}
DateBookDayWidget::~DateBookDayWidget()
{
}
void DateBookDayWidget::paintEvent( QPaintEvent *e )
{
QPainter p( this );
p.setPen( QColor(100, 100, 100) );
p.setBrush( QColor( 255, 240, 230 ) ); // based on priority?
p.drawRect(rect());
int y = 0;
int d = 0;
if ( ev.event().hasAlarm() ) {
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp
index e9fcc39..6532ba4 100644
--- a/core/pim/datebook/datebookweek.cpp
+++ b/core/pim/datebook/datebookweek.cpp
@@ -591,49 +591,49 @@ QDate DateBookWeek::weekDate() const
// this used to only be needed by datebook.cpp, but now we need it inside
// week view since
// we need to be able to figure out our total number of weeks on the fly...
// this is probably the best place to put it..
// For Weeks that start on Monday... (EASY!)
// At the moment we will use ISO 8601 method for computing
// the week. Granted, other countries use other methods,
// bet we aren't doing any Locale stuff at the moment. So,
// this should pass. This Algorithim is public domain and
// available at:
// http://personal.ecu.edu/mccartyr/ISOwdALG.txt
// the week number is return, and the year number is returned in year
// for Instance 2001/12/31 is actually the first week in 2002.
// There is a more mathematical definition, but I will implement it when
// we are pass our deadline.
// For Weeks that start on Sunday... (ahh... home rolled)
// okay, if Jan 1 is on Friday or Saturday,
// it will go to the pervious
// week...
bool calcWeek( const QDate &d, int &week, int &year,
- bool startOnMonday = false )
+ bool startOnMonday )
{
int weekNumber;
int yearNumber;
// remove a pesky warning, (Optimizations on g++)
weekNumber = -1;
int jan1WeekDay = QDate(d.year(), 1, 1).dayOfWeek();
int dayOfWeek = d.dayOfWeek();
if ( !d.isValid() )
return false;
if ( startOnMonday ) {
// find the Jan1Weekday;
if ( d.dayOfYear() <= ( 8 - jan1WeekDay) && jan1WeekDay > 4 ) {
yearNumber = d.year() - 1;
if ( jan1WeekDay == 5 || ( jan1WeekDay == 6 && QDate::leapYear(yearNumber) ) )
weekNumber = 53;
else
weekNumber = 52;
} else
yearNumber = d.year();
if ( yearNumber == d.year() ) {
int totalDays = 365;
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 7083bc5..85c745a 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -71,99 +71,99 @@ void DateBookWeekLstHeader::pickDate() {
picker = new DateBookMonth( m1, 0, TRUE );
m1->insertItem( picker );
connect( picker, SIGNAL( dateClicked( int, int, int ) ),
this, SLOT( setDate( int, int, int ) ) );
//connect( m1, SIGNAL( aboutToHide() ),
//this, SLOT( gotHide() ) );
}
picker->setDate( date.year(), date.month(), date.day() );
m1->popup(mapToGlobal(labelWeek->pos()+QPoint(0,labelWeek->height())));
picker->setFocus();
}
void DateBookWeekLstHeader::setDate(int y, int m, int d) {
QDate new_date(y,m,d);
setDate(new_date);
}
void DateBookWeekLstHeader::nextWeek() {
setDate(date.addDays(7));
}
void DateBookWeekLstHeader::prevWeek() {
setDate(date.addDays(-7));
}
DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM,
- QWidget* parent = 0,
- const char* name = 0,
- WFlags fl = 0 )
+ 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)) + " " +
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);
label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor()));
*/
} else if (d.dayOfWeek() == 7) { // FIXME: Match any holiday
QPalette pal=label->palette();
pal.setColor(QColorGroup::Foreground, QColor(255,0,0));
label->setPalette(pal);
}
connect (label, SIGNAL(clicked()), this, SLOT(showDay()));
connect (add, SIGNAL(clicked()), this, SLOT(newEvent()));
}
void DateBookWeekLstDayHdr::showDay() {
emit showDate(date.year(), date.month(), date.day());
}
void DateBookWeekLstDayHdr::newEvent() {
QDateTime start, stop;
start=stop=date;
start.setTime(QTime(10,0));
stop.setTime(QTime(12,0));
emit addEvent(start,stop,"");
}
DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
- QWidget* parent = 0,
- const char* name = 0,
- WFlags fl = 0) :
+ QWidget* parent,
+ const char* name,
+ WFlags fl) :
ClickableLabel(parent,name,fl),
event(ev)
{
char s[10];
if ( ev.startDate() != ev.date() ) { // multiday event (not first day)
if ( ev.endDate() == ev.date() ) { // last day
strcpy(s, "__|__");
} else {
strcpy(s, " |---");
}
} else {
sprintf(s,"%.2d:%.2d",ev.start().hour(),ev.start().minute());
}
setText(QString(s) + " " + ev.description());
connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
}
void DateBookWeekLstEvent::editMe() {
emit editEvent(event.event());
}
DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
const QDate &d, bool onM,
diff --git a/core/pim/datebook/timepicker.cpp b/core/pim/datebook/timepicker.cpp
index 9097e1b..43e05ad 100644
--- a/core/pim/datebook/timepicker.cpp
+++ b/core/pim/datebook/timepicker.cpp
@@ -1,35 +1,35 @@
#include "timepicker.h"
#include <qbuttongroup.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include "clickablelabel.h"
#include <qstring.h>
#include <stdio.h>
-TimePicker::TimePicker(QWidget* parent = 0, const char* name = 0,
- WFlags fl = 0) :
+TimePicker::TimePicker(QWidget* parent, const char* name,
+ WFlags fl) :
QWidget(parent,name,fl)
{
QVBoxLayout *vbox=new QVBoxLayout(this);
ClickableLabel *r;
QString s;
// Hour Row
QWidget *row=new QWidget(this);
QHBoxLayout *l=new QHBoxLayout(row);
vbox->addWidget(row);
for (int i=0; i<24; i++) {
r=new ClickableLabel(row);
hourLst.append(r);
s.sprintf("%.2d",i);
r->setText(s);
r->setToggleButton(true);
r->setAlignment(AlignHCenter | AlignVCenter);
l->addWidget(r);
connect(r, SIGNAL(toggled(bool)),
this, SLOT(slotHour(bool)));