TOP Items
TODO General:
+- Always: when enterin ultiple scores, course does not update on
+ mainwiew. Window title is correct, but par/hcp info is not from the
+ same course. Next/prev few times corrects the problem.
+- New score dialog should be the same as main view (f.ex showing
+ subtotals, totals, and score colors).
- edit course table is selectable (chk others)
- split club/course DB in master and user
- If course is in the score but not in course, navogating away from
- Seems to be bug in the Qt/Maemo
- Date picker button (widget is missing)
- Use syslog
+- Year filters and maybe more, must be easy to apply
+
TODO Hildon 2.2
- Replace LineEdit w/ HildonEntry
#include <QtGui/QTableWidget>
#include "course-dialog.h"
-#include "cell-delegate.h"
-
+#include "score-common.h"
CourseSelectDialog::CourseSelectDialog(QWidget *parent) : QDialog(parent)
{
table->horizontalHeader()->hide();
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
+ table->setStyleSheet(ScoreColor::styleSheet());
}
void CourseDialog::init(Course *course)
{
QTableWidgetItem *par, *hcp;
- QColor fgColor(Qt::white);
- QColor bgColor(Qt::darkGray);
for (int i=0; i<18; i++) {
if (course) {
QTableWidgetItem *len = new QTableWidgetItem("");
QTableWidgetItem *holeNum = new QTableWidgetItem(QString::number(i+1));
- holeNum->setTextColor(fgColor);
- holeNum->setBackgroundColor(bgColor);
+ holeNum->setBackgroundColor(ScoreColor::holeBg());
holeNum->setTextAlignment(Qt::AlignCenter);
par->setTextAlignment(Qt::AlignCenter);
#include <QtGui>
+#include "score-common.h"
#include "main-window.h"
#include "score-dialog.h"
#include "course-dialog.h"
table->showGrid();
+ table->setStyleSheet(ScoreColor::styleSheet());
+
table->setModel(scoreTableModel);
table->setSelectionMode(QAbstractItemView::NoSelection);
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
table->horizontalHeader()->hide();
- table->verticalHeader()->setStyleSheet("background-color: yellow; color : gray }");
+ //table->verticalHeader()->setStyleSheet("color : gray }");
}
void MainWindow::createActions()
#include <QInputContext>
#include "score-dialog.h"
+#include "score-common.h"
SelectDialog::SelectDialog(QWidget *parent) : QDialog(parent)
{
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
table->horizontalHeader()->hide();
+ table->setStyleSheet(ScoreColor::styleSheet());
+
QStringList headers;
headers << "" << "Par" << "HCP" << "Score" << "" << "Par" << "HCP" << "Score";
table->setVerticalHeaderLabels(headers);
void ScoreDialog::init(Course *course, Score *score)
{
QTableWidgetItem *par, *hcp, *scoreItem, *holeNum;
- QColor fgColor(Qt::white);
- QColor bgColor(Qt::darkGray);
for (int i = 0; i < 18; i++) {
par = new QTableWidgetItem(course->getPar(i));
scoreItem = new QTableWidgetItem("");
holeNum = new QTableWidgetItem(QString::number(i+1));
- holeNum->setTextColor(fgColor);
- holeNum->setBackgroundColor(bgColor);
+ holeNum->setBackgroundColor(ScoreColor::holeBg());
par->setTextAlignment(Qt::AlignCenter);
hcp->setTextAlignment(Qt::AlignCenter);
#include "table-model.h"
#include "score-common.h"
+QString empty("");
+
Qt::ItemFlags ScoreTableModel::flags (const QModelIndex &)
{
return 0;
// Hole numbers 1-18. All hole nums, in, out and tot cell but not
// the empty cell.
if ((row == ROW_HOLE && col != 10) || row == ROW_HOLE_2) {
- QBrush brush(colorHoleBg);
- return brush;
+ QBrush brush(ScoreColor::holeBg());
+ return brush;
}
if (score && course && (row == ROW_SCORE || row == ROW_SCORE_2)) {
int par;
if (col == (COLS+1) && row == ROW_SCORE_2) {
// Total score
- QBrush brush(colorTotal);
+ QBrush brush(ScoreColor::total());
return brush;
}
if (col == COLS) {
// In and Out scores
- QBrush brush(colorSubTotal);
+ QBrush brush(ScoreColor::subTotal());
return brush;
}
if (col < COLS) {
if (shots == par) {
// Par
- QBrush brush(colorPar);
+ QBrush brush(ScoreColor::par());
return brush;
}
if (shots == (par-1)) {
// Birdie
- QBrush brush(colorBirdie);
+ QBrush brush(ScoreColor::birdie());
return brush;
}
if (shots == (par+1)) {
// Bogey
- QBrush brush(colorBogey);
+ QBrush brush(ScoreColor::bogey());
return brush;
}
if (shots == (par+2)) {
// Double Bogey
- QBrush brush(colorDoubleBogey);
+ QBrush brush(ScoreColor::doubleBogey());
return brush;
}
if (shots > (par+2)) {
// Very bad
- QBrush brush(colorBad);
+ QBrush brush(ScoreColor::bad());
return brush;
}
}