| 1 | // This file is part of Dust Racing 2D. |
| 2 | // Copyright (C) 2011 Jussi Lind <[email protected]> |
| 3 | // |
| 4 | // Dust Racing 2D 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, either version 3 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // Dust Racing 2D is distributed in the hope that it will be useful, |
| 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | // GNU General Public License for more details. |
| 12 | // |
| 13 | // You should have received a copy of the GNU General Public License |
| 14 | // along with Dust Racing 2D. If not, see <http://www.gnu.org/licenses/>. |
| 15 | |
| 16 | #ifndef NEWTRACKDIALOG_HPP |
| 17 | #define NEWTRACKDIALOG_HPP |
| 18 | |
| 19 | #include <QDialog> |
| 20 | |
| 21 | class QCheckBox; |
| 22 | class QGridLayout; |
| 23 | class QLabel; |
| 24 | class QLineEdit; |
| 25 | class QPushButton; |
| 26 | |
| 27 | //! Dialog displayed when user wants to create a new track. |
| 28 | class NewTrackDialog : public QDialog |
| 29 | { |
| 30 | Q_OBJECT |
| 31 | |
| 32 | public: |
| 33 | //! Constructor. |
| 34 | explicit NewTrackDialog(QWidget * parent = nullptr); |
| 35 | |
| 36 | //! Get column count. |
| 37 | unsigned int cols() const; |
| 38 | |
| 39 | //! Get row count. |
| 40 | unsigned int rows() const; |
| 41 | |
| 42 | //! Get name. |
| 43 | QString name() const; |
| 44 | |
| 45 | //! Return true if unlocked user track. |
| 46 | bool isUserTrack() const; |
| 47 | |
| 48 | private slots: |
| 49 | |
| 50 | void validateData(); |
| 51 | |
| 52 | private: |
| 53 | QGridLayout * m_layout; |
| 54 | QPushButton * m_okButton; |
| 55 | QPushButton * m_cancelButton; |
| 56 | QLineEdit * m_colsEdit; |
| 57 | QLineEdit * m_rowsEdit; |
| 58 | QLineEdit * m_nameEdit; |
| 59 | QLabel * m_colsLabel; |
| 60 | QLabel * m_rowsLabel; |
| 61 | QLabel * m_nameLabel; |
| 62 | QLabel * m_userLabel; |
| 63 | QCheckBox * m_userCheck; |
| 64 | }; |
| 65 | |
| 66 | #endif // NEWTRACKDIALOG_HPP |