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>
21 #include <QtMaemo5/QMaemo5ValueButton>
22 #include <QtMaemo5/QMaemo5DatePickSelector>
27 class SelectDialog: public QDialog
32 SelectDialog(QWidget *parent = 0);
34 void results(QString &club, QString &course, QString &date);
35 void init(QList<Club *> &list);
45 void comboBoxCourseUpdate(void);
46 void createLayout(QWidget *parent = 0);
49 QListWidget *listClub;
51 QMaemo5ValueButton *dateButton;
53 QLineEdit *lineEditDate;
58 QPushButton *pushButtonNext;
61 QVBoxLayout *leftLayout;
62 QVBoxLayout *rightLayout;
64 QList<Club *> clubList;
67 class ScoreDialog: public QDialog
72 ScoreDialog(QWidget *parent = 0);
73 void init(Course *course, Score *score = 0);
74 void results(QVector<QString> &scores);
85 void createTable(QWidget *parent = 0);
86 void createButton(QWidget *parent = 0);
87 void createLayout(QWidget *parent = 0);
88 void setDefaultScore(QTableWidget *table);
89 void moveToNextCell(QTableWidgetItem *item);
90 void showNote(QString msg);
92 enum { ROWS = 8, COLS = 9 };
93 enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_SCORE = 3,
94 ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_SCORE_2 = 7};
101 QPushButton *pushButtonFinish;
102 QPushButton *pushButtonUp;
103 QPushButton *pushButtonDown;
104 QPushButton *pushButtonNext;
107 QVBoxLayout *leftLayout;
108 QVBoxLayout *rightLayout;