newpilotdialog.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. *openPilot Log - A FOSS Pilot Logbook Application
  3. *Copyright (C) 2020 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 NEWPILOT_H
  19. #define NEWPILOT_H
  20. #include <QDialog>
  21. #include <QMessageBox>
  22. #include <QRegularExpression>
  23. #include <QRegularExpressionValidator>
  24. #include <QCompleter>
  25. #include "src/classes/pilot.h"
  26. #include "src/classes/completionlist.h"
  27. #include "src/experimental/DataBase.h"
  28. #include "src/experimental/Entry.h"
  29. #include "src/experimental/Decl.h"
  30. namespace Ui {
  31. class NewPilot;
  32. }
  33. class NewPilotDialog : public QDialog
  34. {
  35. Q_OBJECT
  36. public:
  37. explicit NewPilotDialog(QWidget *parent = nullptr);
  38. explicit NewPilotDialog(int rowId, QWidget *parent = nullptr);
  39. ~NewPilotDialog();
  40. private slots:
  41. void on_buttonBox_accepted();
  42. //public slots:
  43. void onCommitSuccessful();
  44. void onCommitUnsuccessful(const QSqlError &sqlError, const QString &);
  45. private:
  46. Ui::NewPilot *ui;
  47. experimental::PilotEntry pilotEntry;
  48. inline void setup();
  49. void formFiller();
  50. void submitForm();
  51. };
  52. #endif // NEWPILOT_H