X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmain-window.h;h=aac1845f57ff0e1797a1e60520b163b525427c4c;hb=f8bf44d8af1bcc0c641ff2261fbf235a5bad2107;hp=ca39136c91be23b8cee6e9f5b9f504b894d9c7c9;hpb=f322e3807769eb7bf63e9a3edf2431bc13b6a742;p=scorecard diff --git a/src/main-window.h b/src/main-window.h index ca39136..aac1845 100644 --- a/src/main-window.h +++ b/src/main-window.h @@ -1,15 +1,26 @@ +/* + * 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. + */ + #include #include +#include #include +#include #include #include #include #include +#include #include #include "data.h" #include "table-model.h" -#include "tree-model.h" +#include "list-model.h" class MainWindow : public QMainWindow { @@ -17,13 +28,12 @@ class MainWindow : public QMainWindow public: MainWindow(QMainWindow *parent = 0); - void createLayout(QWidget *parent = 0); - void createStatusBar(); - void createTableView(QList &scoreList, QList &clubList); - void createTreeView(QList &scoreList, QObject *parent); - void updateStatusBar(); + void createLayoutTable(QWidget *parent = 0); + void createLayoutList(QWidget *parent = 0); + void createListView(QList &, QList &); + void updateTitleBar(QString & msg); void loadScoreFile(QString &fileName, QList &scoreList); - void loadClubFile(QString &fileName, QList &clubList); + void loadClubFile(QString &fileName, QList &clubList, bool readOnly = false); void saveScoreFile(QString &fileName, QList &scoreList); void saveClubFile(QString &fileName, QList &clubList); @@ -31,53 +41,64 @@ signals: void dataChanged(); private slots: - void firstButtonClicked(); - void lastButtonClicked(); - void nextButtonClicked(); - void prevButtonClicked(); + void clickedList(const QModelIndex &index); - void updateTreeView(const QModelIndex & index); void newScore(); + void deleteScore(); + void editScore(); void newCourse(); + void deleteCourse(); + void editCourse(); + void viewStatistics(); + void listScores(); + void listCourses(); private: - Club *findClub(QString &name); + void loadSettings(void); + Club * findClub(QString &name); + Course * findCourse(const QString &clubName, const QString &courseName); + Course * findCourse(); + Score * findScore(QString & clubName, QString & courseName); + + void showNote(QString msg); + void getStat(QTextEdit *); + + void viewScore(Score * score, Course * course); + void viewCourse(Course * course); QList scoreList; QList clubList; ScoreTableModel *scoreTableModel; - ScoreTreeModel *scoreTreeModel; + ScoreListModel *scoreListModel; + CourseListModel *courseListModel; QAbstractItemModel *tableModel; QItemSelectionModel *selectionModel; - QTableView *tableViewFront; - QTableView *tableViewBack; + QTableView *table; + QListView *list; // Layouts - QVBoxLayout *tableLayout; - QVBoxLayout *buttonLayout; + QWidget *centralWidget; // Menus QMenu *menu; - // Buttons - QPushButton *nextButton; - QPushButton *prevButton; - QPushButton *firstButton; - QPushButton *lastButton; - // Actions - QAction *newScoreAct; - QAction *newCourseAct; - QAction *viewScoreAct; - QAction *viewCourseAct; - QAction *viewStatisticAct; + QAction *newScoreAction; + QAction *newCourseAction; + QAction *statAction; + + QActionGroup *filterGroup; + QAction *listScoreAction; + QAction *listCourseAction; void createMenus(); void createActions(); - + // Windows + QMainWindow *scoreWin; + QMainWindow *courseWin; };