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 <QTableWidget>
14 #include <QListWidget>
17 #include <QPushButton>
23 class SelectDialog: public QDialog
28 SelectDialog(QWidget *parent = 0);
30 void results(QString &club, QString &course, QString &date);
31 void init(QList<Club *> &list);
41 void comboBoxCourseUpdate(void);
42 void createLayout(QWidget *parent = 0);
45 QListWidget *listClub;
46 QLineEdit *lineEditDate;
50 QPushButton *pushButtonNext;
53 QVBoxLayout *leftLayout;
54 QVBoxLayout *rightLayout;
56 QList<Club *> clubList;
59 class ScoreDialog: public QDialog
64 ScoreDialog(QWidget *parent = 0);
65 void init(Course *course, Score *score = 0);
66 void results(QVector<QString> &scores);
77 void createTable(QWidget *parent = 0);
78 void createButton(QWidget *parent = 0);
79 void createLayout(QWidget *parent = 0);
80 void setDefaultScore(QTableWidget *table);
81 void moveToNextCell(QTableWidgetItem *item);
83 enum { ROWS = 8, COLS = 9 };
84 enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_SCORE = 3,
85 ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_SCORE_2 = 7};
92 QPushButton *pushButtonFinish;
93 QPushButton *pushButtonUp;
94 QPushButton *pushButtonDown;
95 QPushButton *pushButtonNext;
98 QVBoxLayout *leftLayout;
99 QVBoxLayout *rightLayout;