mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-24 11:40:31 -05:00
873b1d1c43
Includes a new settings facility with the highlighting being contrled by a new model class and a modified QListView to display the data for editing. Edits include enable and disable check boxes, a contextual pop-up menu to adjust backkground and foreground colours. Still to be implemented are priorities for highlighting categories. This will be adjustable by drag and drop in the Colors settings panel, it is already implemented by the priority order has no effect on highlighting of decodes yet. The LotW users data file fetch and time since user's last upload is now controled from the settings dialog. This change also drops support for Qt versions before 5.5 so that many workarounds for earlier versions can be removed. Debug trace is slightly modified to make better use of the Qt built in facilities to format and synchronize cross thread messaging.
80 lines
3.3 KiB
C++
80 lines
3.3 KiB
C++
#include "MetaDataRegistry.hpp"
|
|
|
|
#include <QMetaType>
|
|
#include <QItemEditorFactory>
|
|
#include <QStandardItemEditorCreator>
|
|
|
|
#include "Radio.hpp"
|
|
#include "FrequencyList.hpp"
|
|
#include "AudioDevice.hpp"
|
|
#include "Configuration.hpp"
|
|
#include "StationList.hpp"
|
|
#include "Transceiver.hpp"
|
|
#include "TransceiverFactory.hpp"
|
|
#include "WFPalette.hpp"
|
|
#include "IARURegions.hpp"
|
|
#include "DecodeHighlightingModel.hpp"
|
|
#include "FrequencyLineEdit.hpp"
|
|
|
|
QItemEditorFactory * item_editor_factory ()
|
|
{
|
|
static QItemEditorFactory * our_item_editor_factory = new QItemEditorFactory;
|
|
return our_item_editor_factory;
|
|
}
|
|
|
|
void register_types ()
|
|
{
|
|
// types in Radio.hpp are registered in their own translation unit
|
|
// as they are needed in the wsjtx_udp shared library too
|
|
|
|
// we still have to register the fully qualified names of enum types
|
|
// used as signal/slot connection arguments since the new Qt 5.5
|
|
// Q_ENUM macro only seems to register the unqualified name
|
|
|
|
item_editor_factory ()->registerEditor (qMetaTypeId<Radio::Frequency> (), new QStandardItemEditorCreator<FrequencyLineEdit> ());
|
|
//auto frequency_delta_type_id = qRegisterMetaType<Radio::FrequencyDelta> ("FrequencyDelta");
|
|
item_editor_factory ()->registerEditor (qMetaTypeId<Radio::FrequencyDelta> (), new QStandardItemEditorCreator<FrequencyDeltaLineEdit> ());
|
|
|
|
// Frequency list model
|
|
qRegisterMetaTypeStreamOperators<FrequencyList_v2::Item> ("Item_v2");
|
|
qRegisterMetaTypeStreamOperators<FrequencyList_v2::FrequencyItems> ("FrequencyItems_v2");
|
|
|
|
// defunct old versions
|
|
qRegisterMetaTypeStreamOperators<FrequencyList::Item> ("Item");
|
|
qRegisterMetaTypeStreamOperators<FrequencyList::FrequencyItems> ("FrequencyItems");
|
|
|
|
// Audio device
|
|
qRegisterMetaType<AudioDevice::Channel> ("AudioDevice::Channel");
|
|
|
|
// Configuration
|
|
qRegisterMetaTypeStreamOperators<Configuration::DataMode> ("Configuration::DataMode");
|
|
qRegisterMetaTypeStreamOperators<Configuration::Type2MsgGen> ("Configuration::Type2MsgGen");
|
|
|
|
// Station details
|
|
qRegisterMetaType<StationList::Station> ("Station");
|
|
qRegisterMetaType<StationList::Stations> ("Stations");
|
|
qRegisterMetaTypeStreamOperators<StationList::Station> ("Station");
|
|
qRegisterMetaTypeStreamOperators<StationList::Stations> ("Stations");
|
|
|
|
// Transceiver
|
|
qRegisterMetaType<Transceiver::TransceiverState> ("Transceiver::TransceiverState");
|
|
|
|
// Transceiver factory
|
|
qRegisterMetaTypeStreamOperators<TransceiverFactory::DataBits> ("TransceiverFactory::DataBits");
|
|
qRegisterMetaTypeStreamOperators<TransceiverFactory::StopBits> ("TransceiverFactory::StopBits");
|
|
qRegisterMetaTypeStreamOperators<TransceiverFactory::Handshake> ("TransceiverFactory::Handshake");
|
|
qRegisterMetaTypeStreamOperators<TransceiverFactory::PTTMethod> ("TransceiverFactory::PTTMethod");
|
|
qRegisterMetaTypeStreamOperators<TransceiverFactory::TXAudioSource> ("TransceiverFactory::TXAudioSource");
|
|
qRegisterMetaTypeStreamOperators<TransceiverFactory::SplitMode> ("TransceiverFactory::SplitMode");
|
|
|
|
// Waterfall palette
|
|
qRegisterMetaTypeStreamOperators<WFPalette::Colours> ("Colours");
|
|
|
|
// IARURegions
|
|
qRegisterMetaTypeStreamOperators<IARURegions::Region> ("IARURegions::Region");
|
|
|
|
// DecodeHighlightingModel
|
|
qRegisterMetaTypeStreamOperators<DecodeHighlightingModel::HighlightInfo> ("HighlightInfo");
|
|
qRegisterMetaTypeStreamOperators<DecodeHighlightingModel::HighlightItems> ("HighlightItems");
|
|
}
|