firstrundialog.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. *openPilotLog - A FOSS Pilot Logbook Application
  3. *Copyright (C) 2020-2021 Felix Turowsky
  4. *
  5. *This program is free software: you can redistribute it and/or modify
  6. *it under the terms of the GNU General Public License as published by
  7. *the Free Software Foundation, either version 3 of the License, or
  8. *(at your option) any later version.
  9. *
  10. *This program is distributed in the hope that it will be useful,
  11. *but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. *GNU General Public License for more details.
  14. *
  15. *You should have received a copy of the GNU General Public License
  16. *along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #ifndef FIRSTRUNDIALOG_H
  19. #define FIRSTRUNDIALOG_H
  20. #include <QDialog>
  21. #include <QButtonGroup>
  22. #include <QMessageBox>
  23. #include <QStringBuilder>
  24. #include <QDateEdit>
  25. namespace Ui {
  26. class FirstRunDialog;
  27. }
  28. class FirstRunDialog : public QDialog
  29. {
  30. Q_OBJECT
  31. public:
  32. explicit FirstRunDialog(QWidget *parent = nullptr);
  33. ~FirstRunDialog();
  34. private slots:
  35. void on_previousPushButton_clicked();
  36. void on_nextPushButton_clicked();
  37. void on_styleComboBox_currentTextChanged(const QString &new_style_setting);
  38. void on_currWarningCheckBox_stateChanged(int arg1);
  39. void on_currWarningThresholdSpinBox_valueChanged(int arg1);
  40. void on_currCustom1LineEdit_editingFinished();
  41. void on_currCustom2LineEdit_editingFinished();
  42. void on_dateFormatComboBox_currentIndexChanged(int index);
  43. /*!
  44. * \brief Import an existing database instead of creating a new one
  45. */
  46. void on_importPushButton_clicked();
  47. private:
  48. Ui::FirstRunDialog *ui;
  49. bool useRessourceData;
  50. void writeSettings();
  51. bool setupDatabase();
  52. bool createUserEntry();
  53. bool writeCurrencies();
  54. bool finishSetup();
  55. QList<QDateEdit*> dateEdits;
  56. void reject() override;
  57. };
  58. #endif // FIRSTRUNDIALOG_H