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.
11 #include <QPushButton>
14 #include <QVBoxLayout>
15 #include <QItemSelectionModel>
18 #include <QXmlDefaultHandler>
21 #include "table-model.h"
23 class MainWindow : public QMainWindow
28 MainWindow(QMainWindow *parent = 0);
29 void createLayout(QWidget *parent = 0);
30 void createStatusBar();
31 void createTableView(QList<Score *> &, QList <Club *> &);
32 void updateStatusBar();
33 void loadScoreFile(QString &fileName, QList<Score *> &scoreList);
34 void loadClubFile(QString &fileName, QList<Club *> &clubList);
35 void saveScoreFile(QString &fileName, QList<Score *> &scoreList);
36 void saveClubFile(QString &fileName, QList<Club *> &clubList);
42 void firstButtonClicked();
43 void lastButtonClicked();
44 void nextButtonClicked();
45 void prevButtonClicked();
51 void viewStatistics();
55 void loadSettings(void);
56 Club *findClub(QString &name);
57 void getStat(QTextEdit *);
59 QList<Score *> scoreList;
60 QList<Club *> clubList;
62 ScoreTableModel *scoreTableModel;
64 QAbstractItemModel *tableModel;
65 QItemSelectionModel *selectionModel;
70 QVBoxLayout *tableLayout;
71 QVBoxLayout *buttonLayout;
72 QWidget *centralWidget;
78 QPushButton *nextButton;
79 QPushButton *prevButton;
80 QPushButton *firstButton;
81 QPushButton *lastButton;
88 QAction *editScoreAct;
89 QAction *newCourseAct;
90 QAction *editCourseAct;
97 QAction *viewScoreAct;
98 QAction *viewCourseAct;
101 void createActions();