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.
12 #include <QPushButton>
14 #include <QVBoxLayout>
15 #include <QItemSelectionModel>
18 #include <QActionGroup>
19 #include <QXmlDefaultHandler>
22 #include "table-model.h"
23 #include "list-model.h"
25 class MainWindow : public QMainWindow
30 MainWindow(QMainWindow *parent = 0);
31 void createLayoutTable(QWidget *parent = 0);
32 void createLayoutList(QWidget *parent = 0);
33 void createListView(QList<Score *> &, QList <Club *> &);
34 void updateTitleBar(QString & msg);
35 void loadScoreFile(QString &fileName, QList<Score *> &scoreList);
36 void loadClubFile(QString &fileName, QList<Club *> &clubList, bool readOnly = false);
37 void saveScoreFile(QString &fileName, QList<Score *> &scoreList);
38 void saveClubFile(QString &fileName, QList<Club *> &clubList);
44 void clickedList(const QModelIndex &index);
52 void viewStatistics();
58 void loadSettings(void);
59 Club * findClub(QString &name);
60 Course * findCourse(const QString &clubName, const QString &courseName);
61 Course * findCourse();
62 Score * findScore(QString & clubName, QString & courseName);
64 void showNote(QString msg);
65 void getStat(QTextEdit *);
67 void viewScore(Score * score, Course * course);
68 void viewCourse(Course * course);
70 QList<Score *> scoreList;
71 QList<Club *> clubList;
73 ScoreTableModel *scoreTableModel;
74 ScoreListModel *scoreListModel;
75 CourseListModel *courseListModel;
77 QAbstractItemModel *tableModel;
78 QItemSelectionModel *selectionModel;
84 QWidget *centralWidget;
90 QAction *newScoreAction;
91 QAction *newCourseAction;
94 QActionGroup *filterGroup;
95 QAction *listScoreAction;
96 QAction *listCourseAction;
102 QMainWindow *scoreWin;
103 QMainWindow *courseWin;