Initial Commit
[uktrainplanner] / src / chooser.h
1 #ifndef CHOOSER_H
2 #define CHOOSER_H
3
4 #include <QMainWindow>
5 #include <QDesktopServices>
6 #include <QUrl>
7 #include <QPushButton>
8 #include "src/stationchooser.h"
9 #include "src/favouritestations.h"
10 #include "src/departureboard.h"
11
12 namespace Ui {
13     class Chooser;
14 }
15
16 class Chooser : public QMainWindow {
17     Q_OBJECT
18 public:
19     Chooser(QWidget *parent = 0);
20     ~Chooser();
21
22 public slots:
23     void launchPlanner(); //Launches the journey planner
24     void stationSelected(); //Handles when a station departure board button is clicked
25     void editFavouriteDepartures(); //Handles when the user chooses to edit their favourite station
26     void chooseStation();
27
28 protected:
29     void changeEvent(QEvent *e);
30
31 private:
32     Ui::Chooser *ui;
33
34     QPushButton * addStationButton(QString name, QString crs);
35     void updateStationButtons();
36
37     QSettings settings;
38
39     FavouriteStations favouriteStations;
40     QVector<QPushButton *> stationButtons;
41
42     DepartureBoard * departureBoard;
43 };
44
45 #endif // CHOOSER_H