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.
9 #ifndef COURSE_DIALOG_H
10 #define COURSE_DIALOG_H
16 #include <QDialogButtonBox>
21 #include "table-model.h"
25 class QTableWidgetItem;
28 class CourseWindow: public QMainWindow
33 CourseWindow(QWidget *parent = 0);
35 void setup(Course *course);
38 CourseTableModel *model;
41 class CourseSelectDialog: public QDialog
46 CourseSelectDialog(QWidget *parent = 0);
48 void results(QString &club, QString &course);
55 void createLayout(QWidget *parent);
58 QLineEdit *lineEditClub;
59 QLineEdit *lineEditCourse;
62 QPushButton *pushButtonNext;
65 QVBoxLayout *leftLayout;
66 QVBoxLayout *rightLayout;
69 class CourseDialog: public QDialog
74 CourseDialog(QWidget *w);
75 void results(QVector<QString> &, QVector<QString> &, QVector<QString> &);
77 void init(Course *course = 0);
86 enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_LEN = 3,
87 ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_LEN_2 = 7};
88 enum { ROWS = 8, COLS = 9, separator_row = 3 };
90 void createTable(QWidget *parent = 0);
91 void createButton(QWidget *parent = 0);
92 void createLayout(QWidget *parent = 0);
93 void moveToNextCell(QTableWidgetItem *item);
98 QPushButton *pushButtonUp;
99 QPushButton *pushButtonDown;
100 QPushButton *pushButtonNext;
101 QPushButton *pushButtonFinish;
104 QVBoxLayout *rightLayout;
105 QVBoxLayout *leftLayout;