Updated decode highlighting and LotW user's data file management

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.
This commit is contained in:
Bill Somerville
2018-10-17 00:26:04 +01:00
parent 851c0e3bc6
commit 873b1d1c43
32 changed files with 1232 additions and 1117 deletions
+2 -38
View File
@@ -6,18 +6,9 @@
#include <QString>
#include <QFile>
#include <QTextStream>
#include <QMessageLogContext>
#include <QDateTime>
#include <QMutex>
#include <QMutexLocker>
#include "pimpl_impl.hpp"
namespace
{
QMutex lock;
}
class TraceFile::impl
{
public:
@@ -81,35 +72,8 @@ TraceFile::impl::~impl ()
// write Qt messages to the diagnostic log file
void TraceFile::impl::message_handler (QtMsgType type, QMessageLogContext const& context, QString const& msg)
{
char const * severity;
switch (type)
{
case QtDebugMsg:
severity = "Debug";
break;
case QtWarningMsg:
severity = "Warning";
break;
case QtFatalMsg:
severity = "Fatal";
break;
default:
severity = "Critical";
break;
}
{
// guard against multiple threads with overlapping messages
QMutexLocker guard (&lock);
Q_ASSERT_X (current_stream_, "TraceFile:message_handler", "no stream to write to");
*current_stream_
<< QDateTime::currentDateTimeUtc ().toString ("yyyy-MM-ddTHH:mm:ss.zzzZ")
<< '(' << context.file << ':' << context.line /* << ", " << context.function */ << ')'
<< severity << ": " << msg.trimmed () << endl;
}
Q_ASSERT_X (current_stream_, "TraceFile:message_handler", "no stream to write to");
*current_stream_ << qFormatLogMessage (type, context, msg) << endl;
if (QtFatalMsg == type)
{