mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Calendar move defaults to constructor
This commit is contained in:
committed by
Sean Rhea
parent
255f57b5f7
commit
d4ee3fe8cd
@@ -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);
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user