2018-02-08 21:28:33 -05:00
|
|
|
// -*- Mode: C++ -*-
|
|
|
|
#ifndef LogQSO_H
|
|
|
|
#define LogQSO_H
|
|
|
|
|
|
|
|
#ifdef QT5
|
|
|
|
#include <QtWidgets>
|
|
|
|
#else
|
|
|
|
#include <QtGui>
|
|
|
|
#endif
|
|
|
|
|
2018-03-05 14:49:51 -05:00
|
|
|
#include <QString>
|
2018-02-08 21:28:33 -05:00
|
|
|
#include <QScopedPointer>
|
2018-03-05 14:49:51 -05:00
|
|
|
#include <QDateTime>
|
2018-02-08 21:28:33 -05:00
|
|
|
|
|
|
|
#include "Radio.hpp"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class LogQSO;
|
|
|
|
}
|
|
|
|
|
|
|
|
class QSettings;
|
|
|
|
class Configuration;
|
2018-03-05 14:49:51 -05:00
|
|
|
class QByteArray;
|
2018-02-08 21:28:33 -05:00
|
|
|
|
|
|
|
class LogQSO : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit LogQSO(QString const& programTitle, QSettings *, Configuration const *, QWidget *parent = 0);
|
|
|
|
~LogQSO();
|
|
|
|
void initLogQSO(QString const& hisCall, QString const& hisGrid, QString mode,
|
|
|
|
QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn,
|
|
|
|
QDateTime const& dateTimeOff,
|
|
|
|
Radio::Frequency dialFreq, QString const& myCall, QString const& myGrid,
|
2019-05-31 15:15:45 -04:00
|
|
|
bool toDATA, bool dBtoComments, bool bFox, QString const& opCall, const QString &comments);
|
2018-02-08 21:28:33 -05:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void accept();
|
2019-06-01 22:41:10 -04:00
|
|
|
bool acceptText(QString text);
|
2018-02-08 21:28:33 -05:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void acceptQSO (QDateTime const& QSO_date_off, QString const& call, QString const& grid
|
2018-11-30 17:02:14 -05:00
|
|
|
, Radio::Frequency dial_freq, QString const& mode, QString const& submode
|
2018-02-08 21:28:33 -05:00
|
|
|
, QString const& rpt_sent, QString const& rpt_received
|
2019-02-10 09:37:26 -05:00
|
|
|
, QString const& comments
|
2018-03-05 14:49:51 -05:00
|
|
|
, QString const& name, QDateTime const& QSO_date_on, QString const& operator_call
|
2019-06-05 11:33:21 -04:00
|
|
|
, QString const& my_call, QString const& my_grid, QByteArray const& ADIF, QMap<QString, QVariant> const &additionalFields);
|
2018-02-08 21:28:33 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void hideEvent (QHideEvent *);
|
|
|
|
|
2019-06-01 10:43:03 -04:00
|
|
|
private slots:
|
2019-06-04 17:05:33 -04:00
|
|
|
void createAdditionalField(QString key={}, QString value={});
|
|
|
|
void resetAdditionalFields();
|
2019-06-05 11:33:21 -04:00
|
|
|
QMap<QString, QVariant> collectAdditionalFields();
|
2019-06-04 17:05:33 -04:00
|
|
|
void on_add_new_field_button_pressed();
|
2019-06-01 10:43:03 -04:00
|
|
|
void on_start_now_button_pressed();
|
|
|
|
void on_end_now_button_pressed();
|
|
|
|
|
2018-02-08 21:28:33 -05:00
|
|
|
private:
|
|
|
|
void loadSettings ();
|
|
|
|
void storeSettings () const;
|
|
|
|
|
|
|
|
QScopedPointer<Ui::LogQSO> ui;
|
|
|
|
QSettings * m_settings;
|
|
|
|
Configuration const * m_config;
|
|
|
|
QString m_comments;
|
|
|
|
Radio::Frequency m_dialFreq;
|
|
|
|
QString m_myCall;
|
|
|
|
QString m_myGrid;
|
|
|
|
QDateTime m_dateTimeOn;
|
|
|
|
QDateTime m_dateTimeOff;
|
2019-06-04 17:05:33 -04:00
|
|
|
QList<QLineEdit*> m_additionalFieldsControls;
|
2018-02-08 21:28:33 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LogQSO_H
|