From d4ee3fe8cd32981a8e65270d914ccf56388d189b Mon Sep 17 00:00:00 2001 From: Berend De Schouwer Date: Thu, 31 Dec 2009 10:58:21 +0200 Subject: [PATCH] Calendar move defaults to constructor --- src/MainWindow.cpp | 5 ----- src/RideCalendar.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 437130368..b5b876ea2 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -130,12 +130,7 @@ MainWindow::MainWindow(const QDir &home) : // Analysis toolbox contents calendar = new RideCalendar; - calendar->setFirstDayOfWeek(Qt::Monday); calendar->setHome(home); - calendar->addWorkoutCode(QString("race"), QColor(Qt::red)); - calendar->addWorkoutCode(QString("sick"), QColor(Qt::yellow)); - calendar->addWorkoutCode(QString("swim"), QColor(Qt::blue)); - calendar->addWorkoutCode(QString("gym"), QColor(Qt::gray)); treeWidget = new QTreeWidget; treeWidget->setColumnCount(3); diff --git a/src/RideCalendar.cpp b/src/RideCalendar.cpp index 4648e5d0f..17f1cb78a 100644 --- a/src/RideCalendar.cpp +++ b/src/RideCalendar.cpp @@ -14,6 +14,11 @@ RideCalendar::RideCalendar(QWidget *parent) : QCalendarWidget(parent) { + this->setFirstDayOfWeek(Qt::Monday); + this->addWorkoutCode(QString("race"), QColor(255,128,128)); + this->addWorkoutCode(QString("sick"), QColor(255,255,128)); + this->addWorkoutCode(QString("swim"), QColor(128,128,255)); + this->addWorkoutCode(QString("gym"), QColor(Qt::lightGray)); }; void RideCalendar::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const @@ -60,7 +65,7 @@ void RideCalendar::paintCell(QPainter *painter, const QRect &rect, const QDate & QString notesPath = home.absolutePath() + "/" + ride->notesFileName; QFile notesFile(notesPath); - QColor color(Qt::green); + QColor color(128, 255, 128); QString line("Ride"); QString code; if (notesFile.exists()) {