newtaildialog.h
/*
*openPilotLog - A FOSS Pilot Logbook Application
*Copyright (C) 2020-2022 Felix Turowsky
*
*This program is free software: you can redistribute it and/or modify
*it under the terms of the GNU General Public License as published by
*the Free Software Foundation, either version 3 of the License, or
*(at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef NEWTAIL_H
#define NEWTAIL_H
#include <QDialog>
#include <QCompleter>
#include <QMessageBox>
#include <QRegularExpression>
#include <QComboBox>
#include "src/classes/settings.h"
#include "src/functions/calc.h"
#include "src/database/database.h"
#include "src/database/row.h"
namespace Ui {
class NewTail;
}
class NewTailDialog : public QDialog
{
Q_OBJECT
public:
explicit NewTailDialog(const QString& new_registration, QWidget *parent = nullptr);
explicit NewTailDialog(int row_id, QWidget *parent = nullptr);
~NewTailDialog();
signals:
void tailDataChanged();
private:
Ui::NewTail *ui;
//ATailEntry entry;
OPL::TailEntry entry;
QStringList aircraftList;
QHash<int, QString> idMap;
void setupCompleter();
void setupValidators();
void fillForm(OPL::Row entry, bool is_template);
bool verify();
void submitForm();
private slots:
void on_operationComboBox_currentIndexChanged(int index);
void on_ppTypeComboBox_currentIndexChanged(int index);
void on_ppNumberComboBox_currentIndexChanged(int index);
void on_weightComboBox_currentIndexChanged(int index);
void on_registrationLineEdit_textChanged(const QString &arg1);
void on_buttonBox_accepted();
void onSearchCompleterActivated();
};
#endif // NEWTAIL_H
NewTailDialog
The NewTailDialog enables adding new Tail entries to the database or editing existing ones.
Definition: newtaildialog.h:61
NewTailDialog::NewTailDialog
NewTailDialog(const QString &new_registration, QWidget *parent=nullptr)
NewTailDialog - create a new ATailEntry and submit it to the database.
Definition: newtaildialog.cpp:23
OPL::Row
The Row class provides an interface for retreiving and submitting entries from the database.
Definition: row.h:46
OPL::TailEntry
A Row representing a Tail (Registration) entry. See Row class for details.
Definition: row.h:96