-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
88 lines (76 loc) · 2.2 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
// Application headers
class Settings;
// Qt headers
class QButtonGroup;
class QGroupBox;
class QLineEdit;
class QPushButton;
#include <QMainWindow>
#include <memory>
/*!
* \brief The MainWindow class is the main user interface of the application
*/
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
protected:
/*!
* \brief Close the application
* \param event QCloseEvent
*/
void closeEvent(QCloseEvent *event);
private:
// Attributes
bool generate_has_been_clicked_{false};
// Buttons
QPushButton *generate_button_{nullptr};
QPushButton *open_player_stats_button_{nullptr};
QPushButton *open_club_stats_button_{nullptr};
QPushButton *select_output_file_button_{nullptr};
// Button groups
QButtonGroup *time_format_button_group_{nullptr};
// Fields
QLineEdit *player_stats_path_{nullptr};
QLineEdit *club_stats_path_{nullptr};
QLineEdit *output_file_{nullptr};
// Settings
std::unique_ptr<Settings> settings_;
// Ui functions
/*!
* \brief Initialises the file paths group and returns as a group widget
* \return file paths QGroupWidget
*/
QGroupBox *initGroupFilePaths();
/*!
* \brief Initialises the settings group and returns as a group widget
* \return settings QGroupWidget
*/
QGroupBox *initGroupSettings();
/*!
* \brief Initialises the user interface
*/
void initUi();
/*!
* \brief Initialises path selection widgets
* \param title Path title
* \param path_widget Path text display
* \param path_selection_button Path selection button
* \param is_input_path True = input path widget / False = output path widget
* \return a constructed widget
*/
QWidget *addPathSelectionUi(const QString &title,
QLineEdit *path_widget,
QPushButton *path_selection_button,
const bool is_input_path);
private slots:
/*!
* \brief Generates and output the statistics xlsx spreadsheet
*/
void generate();
};
#endif // MAINWINDOW_H