mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-10 17:59:04 -04:00
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:
+2
-38
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user