GPLv2 license
[scorecard] / src / course-dialog.h
index 343e34b..b6a54ef 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (C) 2009 Sakari Poussa
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 2.
+ */
+
 #ifndef COURSE_DIALOG_H
 #define COURSE_DIALOG_H
 
@@ -9,6 +17,8 @@
 #include <QLineEdit>
 #include <QDebug>
 
+#include "data.h"
+
 QT_BEGIN_NAMESPACE
 class QTableWidget;
 class QTableWidgetItem;
@@ -29,6 +39,7 @@ private slots:
  private:
 
   void createLayout(QWidget *parent);
+  bool validate(void);
 
   QLineEdit    *lineEditClub;
   QLineEdit    *lineEditCourse;
@@ -49,29 +60,31 @@ class CourseDialog: public QDialog
   CourseDialog(QWidget *w);
   void results(QVector<QString> &, QVector<QString> &, QVector<QString> &);
   bool validate();
+  void init(Course *course = 0);
 
- public slots:
-  void itemChanged(QTableWidgetItem *item);
-  void nextCell(QObject *);
-  void finnish(void);
+ private slots:
+  void up(void);
+  void down(void);
+  void next(void);
+  void finish(void);
 
  private:
   enum { ROW_HOLE = 0, ROW_PAR = 1, ROW_HCP = 2, ROW_LEN = 3, 
         ROW_HOLE_2 = 4, ROW_PAR_2 = 5, ROW_HCP_2 = 6, ROW_LEN_2 = 7};
-  enum { rows = 8, cols = 9, separator_row = 3 };
+  enum { ROWS = 8, COLS = 9, separator_row = 3 };
 
   void createTable(QWidget *parent = 0);
-  void createLabel(QWidget *parent = 0);
+  void createButton(QWidget *parent = 0);
   void createLayout(QWidget *parent = 0);
+  void moveToNextCell(QTableWidgetItem *item);
 
   // Widgets
-  //ScoreTable *table;
   QTableWidget *table;
-  QLabel *clubLabel;
-  QLabel *courseLabel;
-  QLineEdit *clubEdit;
-  QLineEdit *courseEdit;
-  QPushButton *pushButtonFinnish;
+
+  QPushButton *pushButtonUp;
+  QPushButton *pushButtonDown;
+  QPushButton *pushButtonNext;
+  QPushButton *pushButtonFinish;
 
   // Layouts
   QVBoxLayout *rightLayout;