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);
56 void showNote(QString msg);
59 QLineEdit *lineEditClub;
60 QLineEdit *lineEditCourse;
63 QPushButton *pushButtonNext;
66 QVBoxLayout *leftLayout;
67 QVBoxLayout *rightLayout;
70 class CourseDialog: public QDialog
75 CourseDialog(QWidget *w);
76 void results(QVector<QString> &, QVector<QString> &, QVector<QString> &);
78 void init(Course *course = 0);
87 enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_LEN = 3,
88 ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_LEN_2 = 7};
89 enum { ROWS = 8, COLS = 9, separator_row = 3 };
91 void createTable(QWidget *parent = 0);
92 void createButton(QWidget *parent = 0);
93 void createLayout(QWidget *parent = 0);
94 void moveToNextCell(QTableWidgetItem *item);
99 QPushButton *pushButtonUp;
100 QPushButton *pushButtonDown;
101 QPushButton *pushButtonNext;
102 QPushButton *pushButtonFinish;
105 QVBoxLayout *rightLayout;
106 QVBoxLayout *leftLayout;