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>
23 #include "score-common.h"
24 #include "table-model.h"
25 #include "list-model.h"
27 class MainWindow : public QMainWindow
32 MainWindow(QMainWindow *parent = 0);
33 void createLayoutTable(QWidget *parent = 0);
34 void createLayoutList(QWidget *parent = 0);
35 void createListView(QList<Score *> &, QList <Club *> &);
36 void updateTitleBar(QString & msg);
37 void loadScoreFile(QString &fileName, QList<Score *> &scoreList);
38 void loadClubFile(QString &fileName, QList<Club *> &clubList, bool readOnly = false);
39 void saveScoreFile(QString &fileName, QList<Score *> &scoreList);
40 void saveClubFile(QString &fileName, QList<Club *> &clubList);
46 void clickedList(const QModelIndex &index);
54 void viewStatistics();
61 void loadSettings(void);
62 void saveSettings(void);
63 Club * findClub(QString &name);
64 Course * findCourse(const QString &clubName, const QString &courseName);
65 Course * findCourse();
66 Score * findScore(QString & clubName, QString & courseName);
67 void flushReadOnlyItems();
69 void showNote(QString msg);
70 void getStat(QTextEdit *);
72 void viewScore(Score * score, Course * course);
73 void viewCourse(Course * course);
75 QList<Score *> scoreList;
76 QList<Club *> clubList;
78 ScoreTableModel *scoreTableModel;
79 ScoreListModel *scoreListModel;
80 CourseListModel *courseListModel;
82 QItemSelectionModel *selectionModel;
87 QWidget *centralWidget;
97 QAction *newScoreAction;
98 QAction *newCourseAction;
100 QAction *settingsAction;
102 QActionGroup *filterGroup;
103 QAction *listScoreAction;
104 QAction *listCourseAction;
107 void createActions();
110 QMainWindow *scoreWin;
111 QMainWindow *courseWin;