2 * Copyright (C) 2009 Sakari Poussa
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, version 2.
10 #define SCORE_DIALOG_H
13 #include <QMainWindow>
14 #include <QTableWidget>
15 #include <QListWidget>
18 #include <QPushButton>
22 #include <QtMaemo5/QMaemo5ValueButton>
23 #include <QtMaemo5/QMaemo5DatePickSelector>
27 #include "table-model.h"
29 class ScoreWindow: public QMainWindow
34 ScoreWindow(QWidget *parent = 0);
37 void setup(Score * score, Course * course);
40 ScoreTableModel *model;
44 class SelectDialog: public QDialog
49 SelectDialog(QWidget *parent = 0);
51 void results(QString &club, QString &course, QString &date);
52 void init(QList<Club *> &list);
62 void comboBoxCourseUpdate(void);
63 void createLayout(QWidget *parent = 0);
66 QListWidget *listWidgetClub;
68 QMaemo5ValueButton *dateButton;
70 QLineEdit *lineEditDate;
75 QPushButton *pushButtonNext;
78 QVBoxLayout *leftLayout;
79 QVBoxLayout *rightLayout;
81 QList<Club *> clubList;
84 class ScoreDialog: public QDialog
89 ScoreDialog(QWidget *parent = 0);
91 void init(Course *course, Score *score = 0);
92 void results(QVector<QString> &scores);
103 void createTable(QWidget *parent = 0);
104 void createButton(QWidget *parent = 0);
105 void createLayout(QWidget *parent = 0);
106 void setDefaultScore(QTableWidget *table);
107 void moveToNextCell(QTableWidgetItem *item);
108 void showNote(QString msg);
110 enum { ROWS = 8, COLS = 9 };
111 enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_SCORE = 3,
112 ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_SCORE_2 = 7};
119 QPushButton *pushButtonFinish;
120 QPushButton *pushButtonUp;
121 QPushButton *pushButtonDown;
122 QPushButton *pushButtonNext;
125 QVBoxLayout *leftLayout;
126 QVBoxLayout *rightLayout;