Start implememntation of database based Fox log model and a new Fox log window widget

This change incorporates a reorganization of the GUI code with
widgets, validators, models, and item delegates being moved to
sub-directories.

Relax  the   requirements  of   the  ForeignKeyDelegate   and  related
CandidateKeyFilter classes to  allow them to work  with constant model
pointers for both referenced and referencing models.
This commit is contained in:
Bill Somerville 2018-11-07 17:49:45 +00:00
parent 48017c5827
commit 947b429723
106 changed files with 1231 additions and 722 deletions

View File

@ -215,22 +215,22 @@ set (WSJT_QT_CONF_DESTINATION ${QT_CONF_DESTINATION} CACHE PATH "Path for the qt
#
set (wsjt_qt_CXXSRCS
qt_helpers.cpp
MessageBox.cpp
widgets/MessageBox.cpp
MetaDataRegistry.cpp
NetworkServerLookup.cpp
revision_utils.cpp
WFPalette.cpp
Radio.cpp
RadioMetaType.cpp
IARURegions.cpp
Bands.cpp
Modes.cpp
FrequencyList.cpp
StationList.cpp
FrequencyLineEdit.cpp
CandidateKeyFilter.cpp
ForeignKeyDelegate.cpp
LiveFrequencyValidator.cpp
models/IARURegions.cpp
models/Bands.cpp
models/Modes.cpp
models/FrequencyList.cpp
models/StationList.cpp
widgets/FrequencyLineEdit.cpp
item_delegates/CandidateKeyFilter.cpp
item_delegates/ForeignKeyDelegate.cpp
validators/LiveFrequencyValidator.cpp
GetUserId.cpp
TraceFile.cpp
AudioDevice.cpp
@ -244,10 +244,10 @@ set (wsjt_qt_CXXSRCS
DXLabSuiteCommanderTransceiver.cpp
NetworkMessage.cpp
MessageClient.cpp
LettersSpinBox.cpp
HintedSpinBox.cpp
RestrictedSpinBox.cpp
HelpTextWindow.cpp
widgets/LettersSpinBox.cpp
widgets/HintedSpinBox.cpp
widgets/RestrictedSpinBox.cpp
widgets/HelpTextWindow.cpp
SampleDownloader.cpp
SampleDownloader/DirectoryDelegate.cpp
SampleDownloader/Directory.cpp
@ -255,15 +255,17 @@ set (wsjt_qt_CXXSRCS
SampleDownloader/RemoteFile.cpp
DisplayManual.cpp
MultiSettings.cpp
MaidenheadLocatorValidator.cpp
CallsignValidator.cpp
SplashScreen.cpp
validators/MaidenheadLocatorValidator.cpp
validators/CallsignValidator.cpp
widgets/SplashScreen.cpp
EqualizationToolsDialog.cpp
DoubleClickablePushButton.cpp
DoubleClickableRadioButton.cpp
widgets/DoubleClickablePushButton.cpp
widgets/DoubleClickableRadioButton.cpp
LotWUsers.cpp
DecodeHighlightingModel.cpp
DecodeHighlightingListView.cpp
models/DecodeHighlightingModel.cpp
widgets/DecodeHighlightingListView.cpp
models/FoxLog.cpp
widgets/FoxLogWindow.cpp
)
set (wsjt_qtmm_CXXSRCS
@ -286,31 +288,31 @@ set (wsjtx_CXXSRCS
psk_reporter.cpp
Modulator.cpp
Detector.cpp
logqso.cpp
displaytext.cpp
widgets/logqso.cpp
widgets/displaytext.cpp
decodedtext.cpp
getfile.cpp
soundout.cpp
soundin.cpp
meterwidget.cpp
signalmeter.cpp
plotter.cpp
widegraph.cpp
echograph.cpp
echoplot.cpp
fastgraph.cpp
fastplot.cpp
about.cpp
astro.cpp
messageaveraging.cpp
colorhighlighting.cpp
widgets/meterwidget.cpp
widgets/signalmeter.cpp
widgets/plotter.cpp
widgets/widegraph.cpp
widgets/echograph.cpp
widgets/echoplot.cpp
widgets/fastgraph.cpp
widgets/fastplot.cpp
widgets/about.cpp
widgets/astro.cpp
widgets/messageaveraging.cpp
widgets/colorhighlighting.cpp
WsprTxScheduler.cpp
mainwindow.cpp
widgets/mainwindow.cpp
Configuration.cpp
main.cpp
wsprnet.cpp
WSPRBandHopping.cpp
ExportCabrillo.cpp
widgets/ExportCabrillo.cpp
)
set (wsjt_CXXSRCS
@ -612,6 +614,7 @@ set (wsjt_CSRCS
set (wsjt_qt_UISRCS
wf_palette_design_dialog.ui
widgets/FoxLogWindow.ui
)
set (wsprsim_CSRCS
@ -635,17 +638,17 @@ set (wsprd_CSRCS
)
set (wsjtx_UISRCS
mainwindow.ui
about.ui
astro.ui
colorhighlighting.ui
echograph.ui
fastgraph.ui
messageaveraging.ui
widegraph.ui
logqso.ui
widgets/mainwindow.ui
widgets/about.ui
widgets/astro.ui
widgets/colorhighlighting.ui
widgets/echograph.ui
widgets/fastgraph.ui
widgets/messageaveraging.ui
widgets/widegraph.ui
widgets/logqso.ui
Configuration.ui
ExportCabrillo.ui
widgets/ExportCabrillo.ui
)
set (UDP_library_CXXSRCS
@ -667,7 +670,7 @@ set (message_aggregator_CXXSRCS
UDPExamples/DecodesModel.cpp
UDPExamples/BeaconsModel.cpp
UDPExamples/ClientWidget.cpp
MaidenheadLocatorValidator.cpp
validators/MaidenheadLocatorValidator.cpp
)
set (message_aggregator_STYLESHEETS
@ -859,6 +862,7 @@ message (STATUS "hamlib_LIBRARY_DIRS: ${hamlib_LIBRARY_DIRS}")
find_package (Qt5Widgets 5 REQUIRED)
find_package (Qt5Multimedia 5 REQUIRED)
find_package (Qt5PrintSupport 5 REQUIRED)
find_package (Qt5Sql 5 REQUIRED)
if (WIN32)
add_definitions (-DQT_NEEDS_QTMAIN)
@ -1139,7 +1143,7 @@ target_link_libraries (qcp Qt5::Widgets Qt5::PrintSupport)
add_library (wsjt_qt STATIC ${wsjt_qt_CXXSRCS} ${wsjt_qt_GENUISRCS} ${GENAXSRCS})
# set wsjtx_udp exports to static variants
target_compile_definitions (wsjt_qt PUBLIC UDP_STATIC_DEFINE)
target_link_libraries (wsjt_qt qcp Qt5::Widgets Qt5::Network)
target_link_libraries (wsjt_qt qcp Qt5::Widgets Qt5::Network Qt5::Sql)
target_include_directories (wsjt_qt BEFORE PRIVATE ${hamlib_INCLUDE_DIRS})
if (WIN32)
target_link_libraries (wsjt_qt Qt5::AxContainer Qt5::AxBase)
@ -1547,6 +1551,13 @@ if (NOT is_debug_build)
PATTERN "*quick*${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE
PATTERN "*_debug${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE
)
install (
FILES
${QT_PLUGINS_DIR}/sqldrivers/libqsqlite${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${WSJT_PLUGIN_DESTINATION}/sqldrivers
CONFIGURATIONS Release MinSizeRel
#COMPONENT runtime
)
# install (
# DIRECTORY
# ${QT_PLUGINS_DIR}/platforms
@ -1595,6 +1606,13 @@ if (NOT is_debug_build)
PATTERN "*quick*${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE
PATTERN "*d${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE
)
install (
FILES
${QT_PLUGINS_DIR}/sqldrivers/qsqlite${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${WSJT_PLUGIN_DESTINATION}/sqldrivers
CONFIGURATIONS Release MinSizeRel
#COMPONENT runtime
)
# install (
# DIRECTORY
# ${QT_PLUGINS_DIR}/platforms

View File

@ -160,28 +160,30 @@
#include <QFontDialog>
#include <QSerialPortInfo>
#include <QScopedPointer>
#include <QSqlDatabase>
#include <QSqlError>
#include <QDebug>
#include "pimpl_impl.hpp"
#include "qt_helpers.hpp"
#include "MetaDataRegistry.hpp"
#include "SettingsGroup.hpp"
#include "FrequencyLineEdit.hpp"
#include "CandidateKeyFilter.hpp"
#include "ForeignKeyDelegate.hpp"
#include "widgets/FrequencyLineEdit.hpp"
#include "item_delegates/CandidateKeyFilter.hpp"
#include "item_delegates/ForeignKeyDelegate.hpp"
#include "TransceiverFactory.hpp"
#include "Transceiver.hpp"
#include "Bands.hpp"
#include "IARURegions.hpp"
#include "Modes.hpp"
#include "FrequencyList.hpp"
#include "StationList.hpp"
#include "models/Bands.hpp"
#include "models/IARURegions.hpp"
#include "models/Modes.hpp"
#include "models/FrequencyList.hpp"
#include "models/StationList.hpp"
#include "NetworkServerLookup.hpp"
#include "MessageBox.hpp"
#include "MaidenheadLocatorValidator.hpp"
#include "CallsignValidator.hpp"
#include "widgets/MessageBox.hpp"
#include "validators/MaidenheadLocatorValidator.hpp"
#include "validators/CallsignValidator.hpp"
#include "LotWUsers.hpp"
#include "DecodeHighlightingModel.hpp"
#include "models/DecodeHighlightingModel.hpp"
#include "ui_Configuration.h"
#include "moc_Configuration.cpp"
@ -1000,6 +1002,18 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network
// this must be done after the default paths above are set
read_settings ();
// set up SQLite database
if (!QSqlDatabase::drivers ().contains ("QSQLITE"))
{
throw std::runtime_error {"Failed to find SQLite Qt driver"};
}
auto db = QSqlDatabase::addDatabase ("QSQLITE");
db.setDatabaseName (writeable_data_dir_.absoluteFilePath ("db.sqlite"));
if (!db.open ())
{
throw std::runtime_error {("Database Error: " + db.lastError ().text ()).toStdString ()};
}
// conditionally load LotW users data
ui_->LotW_CSV_fetch_push_button->setEnabled (false);
connect (&lotw_users_, &LotWUsers::load_finished, [this] () {

View File

@ -5,7 +5,7 @@
#include <QFont>
#include "Radio.hpp"
#include "IARURegions.hpp"
#include "models/IARURegions.hpp"
#include "AudioDevice.hpp"
#include "Transceiver.hpp"

View File

@ -2,14 +2,6 @@
<ui version="4.0">
<class>configuration_dialog</class>
<widget class="QDialog" name="configuration_dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>679</width>
<height>619</height>
</rect>
</property>
<property name="windowTitle">
<string>Settings</string>
</property>
@ -2832,7 +2824,7 @@ Right click for insert and delete options.</string>
<customwidget>
<class>DecodeHighlightingListView</class>
<extends>QListView</extends>
<header>DecodeHighlightingListView.hpp</header>
<header>widgets/DecodeHighlightingListView.hpp</header>
</customwidget>
</customwidgets>
<tabstops>

View File

@ -5,16 +5,16 @@
#include <QStandardItemEditorCreator>
#include "Radio.hpp"
#include "FrequencyList.hpp"
#include "models/FrequencyList.hpp"
#include "AudioDevice.hpp"
#include "Configuration.hpp"
#include "StationList.hpp"
#include "models/StationList.hpp"
#include "Transceiver.hpp"
#include "TransceiverFactory.hpp"
#include "WFPalette.hpp"
#include "IARURegions.hpp"
#include "DecodeHighlightingModel.hpp"
#include "FrequencyLineEdit.hpp"
#include "models/IARURegions.hpp"
#include "models/DecodeHighlightingModel.hpp"
#include "widgets/FrequencyLineEdit.hpp"
QItemEditorFactory * item_editor_factory ()
{

View File

@ -3,7 +3,7 @@
#include <qmath.h>
#include <QDateTime>
#include <QDebug>
#include "mainwindow.h"
#include "widgets/mainwindow.h" // TODO: G4WJS - break this dependency
#include "soundout.h"
#include "commons.h"

View File

@ -30,7 +30,7 @@
#include "SettingsGroup.hpp"
#include "qt_helpers.hpp"
#include "SettingsGroup.hpp"
#include "MessageBox.hpp"
#include "widgets/MessageBox.hpp"
#include "pimpl_impl.hpp"

View File

@ -7,7 +7,7 @@
#include <QNetworkReply>
#include <QString>
#include "MessageBox.hpp"
#include "widgets/MessageBox.hpp"
class QNetworkRequest;
class QIODevice;

View File

@ -7,7 +7,7 @@
#include "pimpl_impl.hpp"
#include "SettingsGroup.hpp"
#include "SampleDownloader/Directory.hpp"
#include "MessageBox.hpp"
#include "widgets/MessageBox.hpp"
#include "moc_SampleDownloader.cpp"

View File

@ -21,7 +21,7 @@
#include "DirectoryNode.hpp"
#include "FileNode.hpp"
#include "revision_utils.hpp"
#include "MessageBox.hpp"
#include "widgets/MessageBox.hpp"
#include "moc_Directory.cpp"

View File

@ -6,7 +6,7 @@
#include <QFileInfo>
#include "Directory.hpp"
#include "MessageBox.hpp"
#include "widgets/MessageBox.hpp"
FileNode::FileNode (QTreeWidgetItem * parent
, QNetworkAccessManager * network_manager

View File

@ -3,7 +3,7 @@
#include <QRegExp>
#include <QColor>
#include "MaidenheadLocatorValidator.hpp"
#include "validators/MaidenheadLocatorValidator.hpp"
namespace
{

View File

@ -11,8 +11,8 @@
#include "SettingsGroup.hpp"
#include "Configuration.hpp"
#include "Bands.hpp"
#include "FrequencyList.hpp"
#include "models/Bands.hpp"
#include "models/FrequencyList.hpp"
#include "WsprTxScheduler.h"
#include "pimpl_impl.hpp"
#include "moc_WSPRBandHopping.cpp"

View File

@ -29,17 +29,17 @@ public:
QModelIndex active_key_;
};
CandidateKeyFilter::CandidateKeyFilter (QAbstractItemModel * referenced_model
CandidateKeyFilter::CandidateKeyFilter (QAbstractItemModel const * referenced_model
, int referenced_key_column
, QObject * parent
, int referenced_key_role)
: QSortFilterProxyModel {parent}
, m_ {referenced_key_column, referenced_key_role, nullptr, 0, Qt::EditRole}
{
setSourceModel (referenced_model);
setSourceModel (const_cast<QAbstractItemModel *> (referenced_model));
}
CandidateKeyFilter::CandidateKeyFilter (QAbstractItemModel * referenced_model
CandidateKeyFilter::CandidateKeyFilter (QAbstractItemModel const * referenced_model
, QAbstractItemModel const * referencing_model
, int referenced_key_column
, int referencing_key_column
@ -49,7 +49,7 @@ CandidateKeyFilter::CandidateKeyFilter (QAbstractItemModel * referenced_model
: QSortFilterProxyModel {parent}
, m_ {referenced_key_column, referenced_key_role, referencing_model, referencing_key_column, referencing_key_role}
{
setSourceModel (referenced_model);
setSourceModel (const_cast<QAbstractItemModel *> (referenced_model));
}
CandidateKeyFilter::~CandidateKeyFilter ()

View File

@ -12,11 +12,11 @@ class CandidateKeyFilter final
: public QSortFilterProxyModel
{
public:
explicit CandidateKeyFilter (QAbstractItemModel * referenced_model
explicit CandidateKeyFilter (QAbstractItemModel const * referenced_model
, int referenced_key_column
, QObject * parent = nullptr
, int referenced_key_role = Qt::EditRole);
explicit CandidateKeyFilter (QAbstractItemModel * referenced_model
explicit CandidateKeyFilter (QAbstractItemModel const * referenced_model
, QAbstractItemModel const * referencing_model
, int referenced_key_column
, int referencing_key_column

View File

@ -4,7 +4,7 @@
#include "CandidateKeyFilter.hpp"
ForeignKeyDelegate::ForeignKeyDelegate (QAbstractItemModel * referenced_model
ForeignKeyDelegate::ForeignKeyDelegate (QAbstractItemModel const * referenced_model
, int referenced_key_column
, QObject * parent
, int referenced_key_role)
@ -13,7 +13,7 @@ ForeignKeyDelegate::ForeignKeyDelegate (QAbstractItemModel * referenced_model
{
}
ForeignKeyDelegate::ForeignKeyDelegate (QAbstractItemModel * referenced_model
ForeignKeyDelegate::ForeignKeyDelegate (QAbstractItemModel const * referenced_model
, QAbstractItemModel const * referencing_model
, int referenced_key_column
, int referencing_key_column

View File

@ -18,13 +18,13 @@ class ForeignKeyDelegate final
{
public:
// many to many relationship
explicit ForeignKeyDelegate (QAbstractItemModel * referenced_model
explicit ForeignKeyDelegate (QAbstractItemModel const * referenced_model
, int referenced_key_column
, QObject * parent = nullptr
, int referenced_key_role = Qt::EditRole);
// one to many (referenced to referencing) relationship
explicit ForeignKeyDelegate (QAbstractItemModel * referenced_model
explicit ForeignKeyDelegate (QAbstractItemModel const * referenced_model
, QAbstractItemModel const * referencing_model
, int referenced_key_column
, int referencing_key_column

View File

@ -18,7 +18,6 @@
#include <QStringList>
#include <QLockFile>
#include <QSplashScreen>
#include <QCommandLineParser>
#include <QCommandLineOption>
@ -27,13 +26,13 @@
#include "SettingsGroup.hpp"
#include "TraceFile.hpp"
#include "MultiSettings.hpp"
#include "mainwindow.h"
#include "widgets/mainwindow.h"
#include "commons.h"
#include "lib/init_random_seed.h"
#include "Radio.hpp"
#include "FrequencyList.hpp"
#include "SplashScreen.hpp"
#include "MessageBox.hpp" // last to avoid nasty MS macro definitions
#include "models/FrequencyList.hpp"
#include "widgets/SplashScreen.hpp"
#include "widgets/MessageBox.hpp" // last to avoid nasty MS macro definitions
extern "C" {
// Fortran procedures we need

94
models/FoxLog.cpp Normal file
View File

@ -0,0 +1,94 @@
#include "FoxLog.hpp"
#include <String>
#include <QDateTime>
#include <QSqlDatabase>
#include <QSqlTableModel>
#include <QSqlRecord>
#include <QSqlError>
#include <QSqlQuery>
#include <QDebug>
#include "pimpl_impl.hpp"
class FoxLog::impl final
: public QSqlTableModel
{
public:
impl ();
QSqlQuery insert_;
};
FoxLog::impl::impl ()
{
if (!database ().tables ().contains ("fox_log"))
{
QSqlQuery query;
if (!query.exec ("CREATE TABLE fox_log ("
" id INTEGER PRIMARY KEY AUTOINCREMENT,"
" \"when\" DATETIME NOT NULL,"
" call VARCHAR(20) NOT NULL,"
" grid VARCHAR(4),"
" report_sent VARCHAR(3),"
" report_rcvd VARCHAR(3),"
" band VARCHAR(6) NOT NULL,"
" CONSTRAINT no_dupes UNIQUE (call, band)"
")"))
{
throw std::runtime_error {("SQL Error: " + query.lastError ().text ()).toStdString ()};
}
}
setEditStrategy (QSqlTableModel::OnRowChange);
setTable ("fox_log");
setHeaderData (fieldIndex ("when"), Qt::Horizontal, tr ("Date and Time"));
setHeaderData (fieldIndex ("call"), Qt::Horizontal, tr ("Call"));
setHeaderData (fieldIndex ("grid"), Qt::Horizontal, tr ("Grid"));
setHeaderData (fieldIndex ("report_sent"), Qt::Horizontal, tr ("Sent"));
setHeaderData (fieldIndex ("report_rcvd"), Qt::Horizontal, tr ("Rcvd"));
setHeaderData (fieldIndex ("band"), Qt::Horizontal, tr ("Band"));
if (!select ())
{
throw std::runtime_error {("SQL Error: " + lastError ().text ()).toStdString ()};
}
}
FoxLog::FoxLog ()
{
}
FoxLog::~FoxLog ()
{
}
QAbstractItemModel * FoxLog::model ()
{
return &*m_;
}
bool FoxLog::add_QSO (QDateTime const& when, QString const& call, QString const& grid
, QString const& report_received, QString const& report_sent
, QString const& band)
{
auto db = m_->database ();
auto record = m_->record ();
record.setValue ("when", when.toMSecsSinceEpoch () / 1000);
record.setValue ("call", call);
record.setValue ("grid", grid);
record.setValue ("report_sent", report_sent);
record.setValue ("report_rcvd", report_received);
record.setValue ("band", band);
if (!m_->insertRecord (-1, record))
{
throw std::runtime_error {("SQL Error: " + m_->lastError ().text ()).toStdString ()};
}
if (!m_->submitAll ())
{
qDebug () << "type:" << m_->lastError ().type ();
if (QSqlError::TransactionError == m_->lastError ().type ())
{
return false;
}
throw std::runtime_error {("SQL Error: " + m_->lastError ().text ()).toStdString ()};
}
return true;
}

30
models/FoxLog.hpp Normal file
View File

@ -0,0 +1,30 @@
#ifndef FOX_LOG_HPP_
#define FOX_LOG_HPP_
#include <boost/core/noncopyable.hpp>
#include "pimpl_h.hpp"
class QDateTime;
class QString;
class QAbstractItemModel;
class FoxLog final
: private boost::noncopyable
{
public:
explicit FoxLog ();
~FoxLog ();
// returns false if insert fails, dupe call+band
bool add_QSO (QDateTime const&, QString const& call, QString const& grid
, QString const& report_received, QString const& report_sent
, QString const& band);
QAbstractItemModel * model ();
private:
class impl;
pimpl<impl> m_;
};
#endif

View File

@ -1,4 +1,4 @@
#include "IARURegions.hpp"
#include "models/IARURegions.hpp"
#include <algorithm>

View File

@ -5,8 +5,8 @@
#include <QComboBox>
#include <QLineEdit>
#include "Bands.hpp"
#include "FrequencyList.hpp"
#include "models/Bands.hpp"
#include "models/FrequencyList.hpp"
#include "moc_LiveFrequencyValidator.cpp"

View File

@ -3,7 +3,7 @@
#include <QAction>
#include <QColorDialog>
#include "DecodeHighlightingModel.hpp"
#include "models/DecodeHighlightingModel.hpp"
#include "MessageBox.hpp"
#include "pimpl_impl.hpp"

148
widgets/FoxLogWindow.cpp Normal file
View File

@ -0,0 +1,148 @@
#include "FoxLogWindow.hpp"
#include <QSettings>
#include <QApplication>
#include <QDateTime>
#include <QDir>
#include <QStyledItemDelegate>
#include <QDateTimeEdit>
#include <QPainter>
#include "SettingsGroup.hpp"
#include "Configuration.hpp"
#include "models/Bands.hpp"
#include "item_delegates/ForeignKeyDelegate.hpp"
#include "widgets/MessageBox.hpp"
#include "qt_helpers.hpp"
#include "ui_FoxLogWindow.h"
namespace
{
class DateTimeAsSecsSinceEpochItemDelegate final
: public QStyledItemDelegate
{
public:
DateTimeAsSecsSinceEpochItemDelegate (QObject * parent = nullptr)
: QStyledItemDelegate {parent}
{
}
static QVariant to_secs_since_epoch (QDateTime const& date_time)
{
return date_time.toMSecsSinceEpoch () / 1000;
}
static QDateTime to_date_time (QModelIndex const& index, int role = Qt::DisplayRole)
{
return to_date_time (index.model ()->data (index, role));
}
static QDateTime to_date_time (QVariant const& value)
{
return QDateTime::fromMSecsSinceEpoch (value.toULongLong () * 1000);
}
QString displayText (QVariant const& value, QLocale const& locale) const override
{
return locale.toString (to_date_time (value), QLocale::ShortFormat);
}
QWidget * createEditor (QWidget * parent, QStyleOptionViewItem const& /*option*/, QModelIndex const& /*index*/) const override
{
return new QDateTimeEdit {parent};
}
void setEditorData (QWidget * editor, QModelIndex const& index) const override
{
static_cast<QDateTimeEdit *> (editor)->setDateTime (to_date_time (index, Qt::EditRole));
}
void setModelData (QWidget * editor, QAbstractItemModel * model, QModelIndex const& index) const override
{
model->setData (index, to_secs_since_epoch (static_cast<QDateTimeEdit *> (editor)->dateTime ()));
}
void updateEditorGeometry (QWidget * editor, QStyleOptionViewItem const& option, QModelIndex const& /*index*/) const override
{
editor->setGeometry (option.rect);
}
};
}
FoxLogWindow::FoxLogWindow (QSettings * settings, Configuration const * configuration
, QAbstractItemModel * fox_log_model, QWidget * parent)
: QWidget {parent}
, settings_ {settings}
, configuration_ {configuration}
, ui_ {new Ui::FoxLogWindow}
{
fox_log_model_.setSourceModel (fox_log_model);
setWindowTitle (QApplication::applicationName () + " - Fox Log");
ui_->setupUi (this);
read_settings ();
change_font (configuration_->decoded_text_font ());
ui_->log_table_view->setModel (&fox_log_model_);
ui_->log_table_view->setColumnHidden (0, true);
ui_->log_table_view->setItemDelegateForColumn (1, new DateTimeAsSecsSinceEpochItemDelegate {this});
ui_->log_table_view->setItemDelegateForColumn (6, new ForeignKeyDelegate {configuration_->bands (), &fox_log_model_, 0, 6, this});
ui_->log_table_view->setSelectionMode (QTableView::SingleSelection);
ui_->log_table_view->resizeColumnsToContents ();
ui_->rate_label->setNum (0);
ui_->queued_label->setNum (0);
ui_->callers_label->setNum (0);
connect (&fox_log_model_, &QAbstractItemModel::rowsInserted, [this] (QModelIndex const& parent, int first, int /*last*/) {
ui_->log_table_view->scrollTo (fox_log_model_.index (first, 0, parent));
ui_->log_table_view->resizeColumnsToContents ();
// ui_->log_table_view->scrollToBottom ();
});
}
FoxLogWindow::~FoxLogWindow ()
{
if (isVisible ())
{
write_settings ();
}
}
void FoxLogWindow::closeEvent (QCloseEvent * e)
{
write_settings ();
QWidget::closeEvent (e);
}
void FoxLogWindow::read_settings ()
{
SettingsGroup g {settings_, "Fox Log Window"};
restoreGeometry (settings_->value ("window/geometery").toByteArray ());
}
void FoxLogWindow::write_settings () const
{
SettingsGroup g {settings_, "Fox Log Window"};
settings_->setValue ("window/geometery", saveGeometry ());
}
void FoxLogWindow::change_font (QFont const& font)
{
// ui_->log_table_view->setFont (font);
// ui_->log_table_view->horizontalHeader ()->setFont (font);
// ui_->log_table_view->verticalHeader ()->setFont (font);
fox_log_model_.set_font (font);
}
void FoxLogWindow::callers (int n)
{
ui_->callers_label->setNum (n);
}
void FoxLogWindow::queued (int n)
{
ui_->queued_label->setNum (n);
}
void FoxLogWindow::rate (int n)
{
ui_->rate_label->setNum (n);
}

65
widgets/FoxLogWindow.hpp Normal file
View File

@ -0,0 +1,65 @@
#ifndef FOX_LOG_WINDOW_HPP_
#define FOX_LOG_WINDOW_HPP_
#include <QWidget>
#include <QScopedPointer>
#include <QIdentityProxyModel>
class QSettings;
class Configuration;
class QFont;
class QDateTime;
class QAbstractItemModel;
namespace Ui
{
class FoxLogWindow;
}
// fix up font display as header font changes don't currently work
// from views (I think fixed in Qt 5.11.1)
class FontOverrideModel final
: public QIdentityProxyModel
{
public:
FontOverrideModel (QObject * parent = nullptr) : QIdentityProxyModel {parent} {}
void set_font (QFont const& font) {font_ = font;}
QVariant data (QModelIndex const& index, int role) const override
{
if (Qt::FontRole == role) return font_;
return QIdentityProxyModel::data (index, role);
}
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
{
if (Qt::FontRole == role) return font_;
return QIdentityProxyModel::headerData (section, orientation, role);
}
private:
QFont font_;
};
class FoxLogWindow final
: public QWidget
{
public:
explicit FoxLogWindow (QSettings *, Configuration const *, QAbstractItemModel * fox_log_model
, QWidget * parent = nullptr);
~FoxLogWindow ();
void change_font (QFont const&);
void callers (int);
void queued (int);
void rate (int);
private:
void closeEvent (QCloseEvent *) override;
void read_settings ();
void write_settings () const;
QSettings * settings_;
Configuration const * configuration_;
FontOverrideModel fox_log_model_;
QScopedPointer<Ui::FoxLogWindow> ui_;
};
#endif

109
widgets/FoxLogWindow.ui Normal file
View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FoxLogWindow</class>
<widget class="QWidget" name="FoxLogWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Fox Log</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableView" name="log_table_view"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Callers:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="callers_label">
<property name="text">
<string>N</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>In progress:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="queued_label">
<property name="text">
<string>N</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Rate:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="rate_label">
<property name="text">
<string>N</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,45 +1,45 @@
#ifndef FREQUENCY_LINE_EDIT_HPP_
#define FREQUENCY_LINE_EDIT_HPP_
#include <QLineEdit>
#include "Radio.hpp"
class QWidget;
//
// MHz frequency line edits with validation
//
class FrequencyLineEdit final
: public QLineEdit
{
Q_OBJECT;
Q_PROPERTY (Frequency frequency READ frequency WRITE frequency USER true);
public:
using Frequency = Radio::Frequency;
explicit FrequencyLineEdit (QWidget * parent = nullptr);
// Property frequency implementation
Frequency frequency () const;
void frequency (Frequency);
};
class FrequencyDeltaLineEdit final
: public QLineEdit
{
Q_OBJECT;
Q_PROPERTY (FrequencyDelta frequency_delta READ frequency_delta WRITE frequency_delta USER true);
public:
using FrequencyDelta = Radio::FrequencyDelta;
explicit FrequencyDeltaLineEdit (QWidget * parent = nullptr);
// Property frequency_delta implementation
FrequencyDelta frequency_delta () const;
void frequency_delta (FrequencyDelta);
};
#endif
#ifndef FREQUENCY_LINE_EDIT_HPP_
#define FREQUENCY_LINE_EDIT_HPP_
#include <QLineEdit>
#include "Radio.hpp"
class QWidget;
//
// MHz frequency line edits with validation
//
class FrequencyLineEdit final
: public QLineEdit
{
Q_OBJECT;
Q_PROPERTY (Frequency frequency READ frequency WRITE frequency USER true);
public:
using Frequency = Radio::Frequency;
explicit FrequencyLineEdit (QWidget * parent = nullptr);
// Property frequency implementation
Frequency frequency () const;
void frequency (Frequency);
};
class FrequencyDeltaLineEdit final
: public QLineEdit
{
Q_OBJECT;
Q_PROPERTY (FrequencyDelta frequency_delta READ frequency_delta WRITE frequency_delta USER true);
public:
using FrequencyDelta = Radio::FrequencyDelta;
explicit FrequencyDeltaLineEdit (QWidget * parent = nullptr);
// Property frequency_delta implementation
FrequencyDelta frequency_delta () const;
void frequency_delta (FrequencyDelta);
};
#endif

View File

@ -7,7 +7,7 @@
#include <QTextStream>
#include "qt_helpers.hpp"
#include <MessageBox.hpp>
#include "widgets/MessageBox.hpp"
HelpTextWindow::HelpTextWindow (QString const& title, QString const& file_name, QFont const& font, QWidget * parent)
: QLabel {parent, Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint}

View File

@ -1,100 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CAboutDlg</class>
<widget class="QDialog" name="CAboutDlg">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="windowTitle">
<string>About WSJT-X</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="labelTxt">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>okButton</sender>
<signal>clicked()</signal>
<receiver>CAboutDlg</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>321</x>
<y>120</y>
</hint>
<hint type="destinationlabel">
<x>186</x>
<y>71</y>
</hint>
</hints>
</connection>
</connections>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CAboutDlg</class>
<widget class="QDialog" name="CAboutDlg">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="windowTitle">
<string>About WSJT-X</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="labelTxt">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>okButton</sender>
<signal>clicked()</signal>
<receiver>CAboutDlg</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>321</x>
<y>120</y>
</hint>
<hint type="destinationlabel">
<x>186</x>
<y>71</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -4,7 +4,7 @@
#include <QDebug>
#include "SettingsGroup.hpp"
#include "DecodeHighlightingModel.hpp"
#include "models/DecodeHighlightingModel.hpp"
#include "ui_colorhighlighting.h"
#include "moc_colorhighlighting.cpp"

View File

@ -15,7 +15,7 @@
#include "Configuration.hpp"
#include "LotWUsers.hpp"
#include "DecodeHighlightingModel.hpp"
#include "models/DecodeHighlightingModel.hpp"
#include "logbook/logbook.h"
#include "qt_helpers.hpp"

View File

@ -1,294 +1,294 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EchoGraph</class>
<widget class="QDialog" name="EchoGraph">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>625</width>
<height>336</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>570</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Echo Graph</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="EPlotter" name="echoPlot">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>273</width>
<height>200</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="binsPerPixelSpinBox">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Compression factor for frequency scale&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Bins/Pixel </string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Gain</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="gainSlider">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Echo spectrum gain&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>-30</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Zero</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="zeroSlider">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Echo spectrum zero&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>-150</number>
</property>
<property name="maximum">
<number>150</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="smoothSpinBox">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Smoothing of echo spectrum&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Smooth </string>
</property>
<property name="maximum">
<number>20</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="nsum_label">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of echo transmissions averaged&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>N: 0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbColors">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click to cycle through a sequence of colors and line widths.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Colors</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>EPlotter</class>
<extends>QFrame</extends>
<header>plotter.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EchoGraph</class>
<widget class="QDialog" name="EchoGraph">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>625</width>
<height>336</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>570</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Echo Graph</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="EPlotter" name="echoPlot">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>273</width>
<height>200</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="binsPerPixelSpinBox">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Compression factor for frequency scale&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Bins/Pixel </string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Gain</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="gainSlider">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Echo spectrum gain&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>-30</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Zero</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="zeroSlider">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Echo spectrum zero&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>-150</number>
</property>
<property name="maximum">
<number>150</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="smoothSpinBox">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Smoothing of echo spectrum&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="prefix">
<string>Smooth </string>
</property>
<property name="maximum">
<number>20</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="nsum_label">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Number of echo transmissions averaged&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>N: 0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbColors">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click to cycle through a sequence of colors and line widths.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Colors</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>EPlotter</class>
<extends>QFrame</extends>
<header>widgets/plotter.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -2,6 +2,14 @@
<ui version="4.0">
<class>FastGraph</class>
<widget class="QDialog" name="FastGraph">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>707</width>
<height>253</height>
</rect>
</property>
<property name="windowTitle">
<string>Fast Graph</string>
</property>
@ -229,7 +237,7 @@
<customwidget>
<class>FPlotter</class>
<extends>QFrame</extends>
<header>fastplot.h</header>
<header>widgets/fastplot.h</header>
<container>1</container>
</customwidget>
</customwidgets>

View File

@ -9,8 +9,8 @@
#include "logbook/logbook.h"
#include "MessageBox.hpp"
#include "Configuration.hpp"
#include "Bands.hpp"
#include "MaidenheadLocatorValidator.hpp"
#include "models/Bands.hpp"
#include "validators/MaidenheadLocatorValidator.hpp"
#include "ui_logqso.h"
#include "moc_logqso.cpp"

View File

@ -46,10 +46,10 @@
#include "logqso.h"
#include "decodedtext.h"
#include "Radio.hpp"
#include "Bands.hpp"
#include "models/Bands.hpp"
#include "TransceiverFactory.hpp"
#include "StationList.hpp"
#include "LiveFrequencyValidator.hpp"
#include "models/StationList.hpp"
#include "validators/LiveFrequencyValidator.hpp"
#include "MessageClient.hpp"
#include "wsprnet.h"
#include "signalmeter.h"
@ -57,12 +57,14 @@
#include "SampleDownloader.hpp"
#include "Audio/BWFFile.hpp"
#include "MultiSettings.hpp"
#include "MaidenheadLocatorValidator.hpp"
#include "CallsignValidator.hpp"
#include "ExchangeValidator.hpp"
#include "validators/MaidenheadLocatorValidator.hpp"
#include "validators/CallsignValidator.hpp"
#include "validators/ExchangeValidator.hpp"
#include "EqualizationToolsDialog.hpp"
#include "LotWUsers.hpp"
#include "logbook/AD1CCty.hpp"
#include "models/FoxLog.hpp"
#include "FoXLogWindow.hpp"
#include "ui_mainwindow.h"
#include "moc_mainwindow.cpp"
@ -1032,7 +1034,8 @@ void MainWindow::writeSettings()
m_settings->setValue("DXcall",ui->dxCallEntry->text());
m_settings->setValue("DXgrid",ui->dxGridEntry->text());
m_settings->setValue ("AstroDisplayed", m_astroWidget && m_astroWidget->isVisible());
m_settings->setValue ("MsgAvgDisplayed", m_msgAvgWidget && m_msgAvgWidget->isVisible());
m_settings->setValue ("MsgAvgDisplayed", m_msgAvgWidget && m_msgAvgWidget->isVisible ());
m_settings->setValue ("FoxLogDisplayed", m_foxLogWindow && m_foxLogWindow->isVisible ());
m_settings->setValue ("FreeText", ui->freeTextMsg->currentText ());
m_settings->setValue("ShowMenus",ui->cbMenus->isChecked());
m_settings->setValue("CallFirst",ui->cbFirst->isChecked());
@ -1107,6 +1110,7 @@ void MainWindow::readSettings()
m_txFirst = m_settings->value("TxFirst",false).toBool();
auto displayAstro = m_settings->value ("AstroDisplayed", false).toBool ();
auto displayMsgAvg = m_settings->value ("MsgAvgDisplayed", false).toBool ();
auto displayFoxLog = m_settings->value ("FoxLogDisplayed", false).toBool ();
if (m_settings->contains ("FreeText")) ui->freeTextMsg->setCurrentText (
m_settings->value ("FreeText").toString ());
ui->cbMenus->setChecked(m_settings->value("ShowMenus",true).toBool());
@ -1196,6 +1200,7 @@ void MainWindow::readSettings()
checkMSK144ContestType();
if(displayMsgAvg) on_actionMessage_averaging_triggered();
if (displayFoxLog) on_actionFox_Log_triggered ();
}
void MainWindow::checkMSK144ContestType()
@ -1236,6 +1241,9 @@ void MainWindow::setDecodedTextFont (QFont const& font)
if (m_msgAvgWidget) {
m_msgAvgWidget->changeFont (font);
}
if (m_foxLogWindow) {
m_foxLogWindow->change_font (font);
}
updateGeometry ();
}
@ -2416,8 +2424,20 @@ void MainWindow::on_actionAstronomical_data_toggled (bool checked)
void MainWindow::on_actionFox_Log_triggered()
{
on_actionMessage_averaging_triggered();
m_msgAvgWidget->foxLogSetup( static_cast<int> (m_config.special_op_id()) );
if (!m_foxLog)
{
m_foxLog.reset (new FoxLog);
}
if (!m_foxLogWindow)
{
m_foxLogWindow.reset (new FoxLogWindow {m_settings, &m_config, m_foxLog->model ()});
// Connect signals from fox log window
connect (this, &MainWindow::finished, m_foxLogWindow.data (), &FoxLogWindow::close);
}
m_foxLogWindow->showNormal ();
m_foxLogWindow->raise ();
m_foxLogWindow->activateWindow ();
}
void MainWindow::on_actionColors_triggered()
@ -3766,8 +3786,12 @@ void MainWindow::guiUpdate()
//Once per second:
if(nsec != m_sec0) {
if((!m_msgAvgWidget or (m_msgAvgWidget and !m_msgAvgWidget->isVisible()))
and (SpecOp::NONE < m_config.special_op_id()) and (SpecOp::HOUND > m_config.special_op_id())) on_actionFox_Log_triggered();
// if((!m_msgAvgWidget or (m_msgAvgWidget and !m_msgAvgWidget->isVisible()))
// and (SpecOp::NONE < m_config.special_op_id()) and (SpecOp::HOUND > m_config.special_op_id())) on_actionFox_Log_triggered();
if (SpecOp::FOX == m_config.special_op_id() && (!m_foxLogWindow || !m_foxLogWindow->isVisible ()))
{
on_actionFox_Log_triggered();
}
if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) {
if(!m_bVHFwarned) vhfWarning();
} else {
@ -8021,9 +8045,10 @@ void MainWindow::houndCallers()
m_nHoundsCalling++; // Number of accepted Hounds to be sorted
}
}
if(m_msgAvgWidget != NULL and m_msgAvgWidget->isVisible()) {
m_msgAvgWidget->foxLabCallers(nTotal);
}
if(m_foxLogWindow && m_foxLogWindow->isVisible ())
{
m_foxLogWindow->callers (nTotal);
}
// Sort and display accumulated list of Hound callers
if(t.length()>30) {
@ -8179,21 +8204,23 @@ list2Done:
if(hc1!="") {
// Log this QSO!
auto QSO_time = QDateTime::currentDateTimeUtc ();
m_hisCall=hc1;
m_hisGrid=m_foxQSO[hc1].grid;
m_rptSent=m_foxQSO[hc1].sent;
m_rptRcvd=m_foxQSO[hc1].rcvd;
QDateTime logTime {QDateTime::currentDateTimeUtc ()};
QString thc1=(m_hisCall + " ").mid(0,6);
if(m_hisCall.contains("/")) thc1=m_hisCall;
QString logLine=logTime.toString("yyyy-MM-dd hh:mm") + " " + thc1 + " " +
m_hisGrid + " " + m_rptSent + " " + m_rptRcvd + " " + m_lastBand;
if(m_msgAvgWidget != NULL and m_msgAvgWidget->isVisible()) {
m_msgAvgWidget->foxAddLog(logLine);
}
on_logQSOButton_clicked();
writeFoxQSO(" Log: " + logLine.mid(17));
m_foxRateQueue.enqueue(now); //Add present time in seconds to Rate queue.
if (!m_foxLogWindow)
{
on_actionFox_Log_triggered ();
}
if (m_foxLog->add_QSO (QSO_time, m_hisCall, m_hisGrid, m_rptSent, m_rptRcvd, m_lastBand))
{
writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid)
.arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand));
on_logQSOButton_clicked();
m_foxRateQueue.enqueue (now); //Add present time in seconds
//to Rate queue.
}
m_loggedByFox[hc1] += (m_lastBand + " ");
}
@ -8249,10 +8276,11 @@ Transmit:
if(age < 3600) break;
m_foxRateQueue.dequeue();
}
if(m_msgAvgWidget != NULL and m_msgAvgWidget->isVisible()) {
m_msgAvgWidget->foxLabRate(m_foxRateQueue.size());
m_msgAvgWidget->foxLabQueued(m_foxQSOinProgress.count());
}
if (m_foxLogWindow && m_foxLogWindow->isVisible ())
{
m_foxLogWindow->rate (m_foxRateQueue.size ());
m_foxLogWindow->queued (m_foxQSOinProgress.count ());
}
}
void MainWindow::rm_tb4(QString houndCall)
@ -8312,7 +8340,7 @@ void MainWindow::foxGenWaveform(int i,QString fm)
writeFoxQSO(t + fm.trimmed());
}
void MainWindow::writeFoxQSO(QString msg)
void MainWindow::writeFoxQSO(QString const& msg)
{
QString t;
t.sprintf("%3d%3d%3d",m_houndQueue.count(),m_foxQSOinProgress.count(),m_foxQSO.count());

View File

@ -25,8 +25,8 @@
#include "AudioDevice.hpp"
#include "commons.h"
#include "Radio.hpp"
#include "Modes.hpp"
#include "FrequencyList.hpp"
#include "models/Modes.hpp"
#include "models/FrequencyList.hpp"
#include "Configuration.hpp"
#include "WSPRBandHopping.hpp"
#include "Transceiver.hpp"
@ -69,6 +69,8 @@ class WideGraph;
class LogQSO;
class Transceiver;
class MessageAveraging;
class FoxLogWindow;
class FoxLog;
class ColorHighlighting;
class MessageClient;
class QTime;
@ -360,6 +362,8 @@ private:
QScopedPointer<HelpTextWindow> m_prefixes;
QScopedPointer<HelpTextWindow> m_mouseCmnds;
QScopedPointer<MessageAveraging> m_msgAvgWidget;
QScopedPointer<FoxLog> m_foxLog;
QScopedPointer<FoxLogWindow> m_foxLogWindow;
QScopedPointer<ColorHighlighting> m_colorHighlighting;
QScopedPointer<ExportCabrillo> m_exportCabrillo;
Transceiver::TransceiverState m_rigState;
@ -733,7 +737,7 @@ private:
void foxRxSequencer(QString msg, QString houndCall, QString rptRcvd);
void foxTxSequencer();
void foxGenWaveform(int i,QString fm);
void writeFoxQSO(QString msg);
void writeFoxQSO (QString const& msg);
};
extern int killbyname(const char* progName);

View File

@ -3353,38 +3353,38 @@ QPushButton[state=&quot;ok&quot;] {
<customwidget>
<class>DisplayText</class>
<extends>QTextEdit</extends>
<header>displaytext.h</header>
<header>widgets/displaytext.h</header>
</customwidget>
<customwidget>
<class>LettersSpinBox</class>
<extends>QSpinBox</extends>
<header>LettersSpinBox.hpp</header>
<header>widgets/LettersSpinBox.hpp</header>
</customwidget>
<customwidget>
<class>SignalMeter</class>
<extends>QFrame</extends>
<header>signalmeter.h</header>
<header>widgets/signalmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>HintedSpinBox</class>
<extends>QSpinBox</extends>
<header>HintedSpinBox.hpp</header>
<header>widgets/HintedSpinBox.hpp</header>
</customwidget>
<customwidget>
<class>RestrictedSpinBox</class>
<extends>QSpinBox</extends>
<header>RestrictedSpinBox.hpp</header>
<header>widgets/RestrictedSpinBox.hpp</header>
</customwidget>
<customwidget>
<class>DoubleClickableRadioButton</class>
<extends>QRadioButton</extends>
<header>DoubleClickableRadioButton.hpp</header>
<header>widgets/DoubleClickableRadioButton.hpp</header>
</customwidget>
<customwidget>
<class>DoubleClickablePushButton</class>
<extends>QPushButton</extends>
<header>DoubleClickablePushButton.hpp</header>
<header>widgets/DoubleClickablePushButton.hpp</header>
</customwidget>
</customwidgets>
<tabstops>

View File

@ -1,130 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MessageAveraging</class>
<widget class="QWidget" name="MessageAveraging">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>268</height>
</rect>
</property>
<property name="windowTitle">
<string>Message Averaging</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="header_label">
<property name="text">
<string> UTC Sync DT Freq </string>
</property>
<property name="margin">
<number>3</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPlainTextEdit" name="msgAvgPlainTextEdit">
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lab1">
<property name="minimumSize">
<size>
<width>77</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Callers: 0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lab2">
<property name="minimumSize">
<size>
<width>77</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>In progress: 0</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>25</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lab3">
<property name="minimumSize">
<size>
<width>77</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Logged: 0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lab4">
<property name="minimumSize">
<size>
<width>77</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Rate: 0</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MessageAveraging</class>
<widget class="QWidget" name="MessageAveraging">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>268</height>
</rect>
</property>
<property name="windowTitle">
<string>Message Averaging</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="header_label">
<property name="text">
<string> UTC Sync DT Freq </string>
</property>
<property name="margin">
<number>3</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPlainTextEdit" name="msgAvgPlainTextEdit">
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lab1">
<property name="minimumSize">
<size>
<width>77</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Callers: 0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lab2">
<property name="minimumSize">
<size>
<width>77</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>In progress: 0</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>25</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lab3">
<property name="minimumSize">
<size>
<width>77</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Logged: 0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lab4">
<property name="minimumSize">
<size>
<width>77</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Rate: 0</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

Some files were not shown because too many files have changed in this diff Show More