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
+26 -12
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] () {