mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-05 08:51:19 -05:00
Merge branch 'release-2.3.0' into develop
This commit is contained in:
commit
6efdf28489
@ -70,7 +70,7 @@ message (STATUS "******************************************************")
|
||||
|
||||
include (set_build_type)
|
||||
# RC 0 or omitted is a development build, GA is a General Availability release build
|
||||
set_build_type (RC 2)
|
||||
set_build_type (RC 3)
|
||||
set (wsjtx_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}")
|
||||
|
||||
#
|
||||
@ -1573,6 +1573,13 @@ install (FILES
|
||||
#COMPONENT runtime
|
||||
)
|
||||
|
||||
install (DIRECTORY
|
||||
example_log_configurations
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
FILES_MATCHING REGEX "^.*[^~]$"
|
||||
#COMPONENT runtime
|
||||
)
|
||||
|
||||
#
|
||||
# Mac installer files
|
||||
#
|
||||
|
@ -812,7 +812,7 @@ bool Configuration::is_dummy_rig () const
|
||||
|
||||
bool Configuration::transceiver_online ()
|
||||
{
|
||||
LOG_TRACE ("transceiver_online: " << m_->cached_rig_state_);
|
||||
LOG_TRACE (m_->cached_rig_state_);
|
||||
return m_->have_rig ();
|
||||
}
|
||||
|
||||
@ -823,37 +823,37 @@ int Configuration::transceiver_resolution () const
|
||||
|
||||
void Configuration::transceiver_offline ()
|
||||
{
|
||||
LOG_TRACE ("transceiver_offline: " << m_->cached_rig_state_);
|
||||
LOG_TRACE (m_->cached_rig_state_);
|
||||
m_->close_rig ();
|
||||
}
|
||||
|
||||
void Configuration::transceiver_frequency (Frequency f)
|
||||
{
|
||||
LOG_TRACE ("transceiver_frequency: " << f << m_->cached_rig_state_);
|
||||
LOG_TRACE (f << ' ' << m_->cached_rig_state_);
|
||||
m_->transceiver_frequency (f);
|
||||
}
|
||||
|
||||
void Configuration::transceiver_tx_frequency (Frequency f)
|
||||
{
|
||||
LOG_TRACE ("transceiver_tx_frequency: " << f << m_->cached_rig_state_);
|
||||
LOG_TRACE (f << ' ' << m_->cached_rig_state_);
|
||||
m_->transceiver_tx_frequency (f);
|
||||
}
|
||||
|
||||
void Configuration::transceiver_mode (MODE mode)
|
||||
{
|
||||
LOG_TRACE ("transceiver_mode: " << mode << " " << m_->cached_rig_state_);
|
||||
LOG_TRACE (mode << ' ' << m_->cached_rig_state_);
|
||||
m_->transceiver_mode (mode);
|
||||
}
|
||||
|
||||
void Configuration::transceiver_ptt (bool on)
|
||||
{
|
||||
LOG_TRACE ("transceiver_ptt: " << on << " " << m_->cached_rig_state_);
|
||||
LOG_TRACE (on << ' ' << m_->cached_rig_state_);
|
||||
m_->transceiver_ptt (on);
|
||||
}
|
||||
|
||||
void Configuration::sync_transceiver (bool force_signal, bool enforce_mode_and_split)
|
||||
{
|
||||
LOG_TRACE ("sync_transceiver: force signal: " << force_signal << " enforce_mode_and_split: " << enforce_mode_and_split << " " << m_->cached_rig_state_);
|
||||
LOG_TRACE ("force signal: " << force_signal << " enforce_mode_and_split: " << enforce_mode_and_split << ' ' << m_->cached_rig_state_);
|
||||
m_->sync_transceiver (force_signal);
|
||||
if (!enforce_mode_and_split)
|
||||
{
|
||||
@ -2838,7 +2838,7 @@ void Configuration::impl::sync_transceiver (bool /*force_signal*/)
|
||||
void Configuration::impl::handle_transceiver_update (TransceiverState const& state,
|
||||
unsigned sequence_number)
|
||||
{
|
||||
LOG_TRACE ("handle_transceiver_update: Transceiver State #: " << sequence_number << " " << state);
|
||||
LOG_TRACE ("#: " << sequence_number << ' ' << state);
|
||||
|
||||
// only follow rig on some information, ignore other stuff
|
||||
cached_rig_state_.online (state.online ());
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <boost/log/utility/setup/settings.hpp>
|
||||
#include <boost/log/sinks/sync_frontend.hpp>
|
||||
#include <boost/log/sinks/text_ostream_backend.hpp>
|
||||
#include <boost/log/sinks/debug_output_backend.hpp>
|
||||
#include <boost/log/support/date_time.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <QColor>
|
||||
#include <QtWidgets>
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
|
||||
#include "validators/MaidenheadLocatorValidator.hpp"
|
||||
|
||||
@ -73,7 +72,7 @@ bool ClientWidget::IdFilterModel::filterAcceptsRow (int source_row
|
||||
, QModelIndex const& source_parent) const
|
||||
{
|
||||
auto source_index_col0 = sourceModel ()->index (source_row, 0, source_parent);
|
||||
return sourceModel ()->data (source_index_col0).value<ClientKey> () == key_;
|
||||
return sourceModel ()->data (source_index_col0, Qt::UserRole + 1).value<ClientKey> () == key_;
|
||||
}
|
||||
|
||||
void ClientWidget::IdFilterModel::de_call (QString const& call)
|
||||
|
118
WSJTXLogging.cpp
118
WSJTXLogging.cpp
@ -10,7 +10,6 @@
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/log/sinks/text_file_backend.hpp>
|
||||
#include <boost/log/sinks/async_frontend.hpp>
|
||||
#include <boost/log/sinks/debug_output_backend.hpp>
|
||||
#include <boost/log/expressions.hpp>
|
||||
#include <boost/log/expressions/formatters/date_time.hpp>
|
||||
#include <boost/log/expressions/predicates/channel_severity_filter.hpp>
|
||||
@ -19,6 +18,7 @@
|
||||
#include <boost/date_time/gregorian/greg_day.hpp>
|
||||
#include <boost/container/flat_map.hpp>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
@ -60,12 +60,62 @@ namespace
|
||||
//throw;
|
||||
}
|
||||
};
|
||||
|
||||
// Reroute Qt messages to the system logger
|
||||
void qt_log_handler (QtMsgType type, QMessageLogContext const& context, QString const& msg)
|
||||
{
|
||||
// Convert Qt message types to logger severities
|
||||
auto severity = trivial::trace;
|
||||
switch (type)
|
||||
{
|
||||
case QtDebugMsg: severity = trivial::debug; break;
|
||||
case QtInfoMsg: severity = trivial::info; break;
|
||||
case QtWarningMsg: severity = trivial::warning; break;
|
||||
case QtCriticalMsg: severity = trivial::error; break;
|
||||
case QtFatalMsg: severity = trivial::fatal; break;
|
||||
}
|
||||
// Map non-default Qt categories to logger channels, Qt logger
|
||||
// context is mapped to the appropriate logger attributes.
|
||||
auto log = sys::get ();
|
||||
std::string file;
|
||||
std::string function;
|
||||
if (context.file)
|
||||
{
|
||||
file = context.file;
|
||||
}
|
||||
if (context.function)
|
||||
{
|
||||
function = context.function;
|
||||
}
|
||||
if (!context.category || !qstrcmp (context.category, "default"))
|
||||
{
|
||||
BOOST_LOG_SEV (log, severity)
|
||||
<< boost::log::add_value ("Line", context.line)
|
||||
<< boost::log::add_value ("File", file)
|
||||
<< boost::log::add_value ("Function", function)
|
||||
<< msg.toStdString ();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LOG_CHANNEL_SEV (log, std::string {context.category}, severity)
|
||||
<< boost::log::add_value ("Line", context.line)
|
||||
<< boost::log::add_value ("File", file)
|
||||
<< boost::log::add_value ("Function", function)
|
||||
<< msg.toStdString ();
|
||||
}
|
||||
if (QtFatalMsg == type)
|
||||
{
|
||||
// bail out
|
||||
throw std::runtime_error {"Fatal Qt Error"};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WSJTXLogging::WSJTXLogging ()
|
||||
{
|
||||
auto core = logging::core::get ();
|
||||
// Catch relevant exceptions from logging.
|
||||
logging::core::get ()->set_exception_handler
|
||||
core->set_exception_handler
|
||||
(
|
||||
logging::make_exception_handler<std::runtime_error, std::logic_error> (exception_handler {})
|
||||
);
|
||||
@ -120,7 +170,6 @@ WSJTXLogging::WSJTXLogging ()
|
||||
// Default log file location.
|
||||
QDir app_data {QStandardPaths::writableLocation (QStandardPaths::AppLocalDataLocation)};
|
||||
Logger::init (); // Basic setup of attributes
|
||||
auto core = logging::core::get ();
|
||||
|
||||
//
|
||||
// Sink intended for general use that passes everything above
|
||||
@ -175,70 +224,17 @@ WSJTXLogging::WSJTXLogging ()
|
||||
);
|
||||
|
||||
core->add_sink (sys_sink);
|
||||
|
||||
#if !defined (NDEBUG) && defined (Q_OS_WIN)
|
||||
// auto windbg_sink = boost::make_shared<sinks::synchronous_sink<sinks::debug_output_backend>> ();
|
||||
// windbg_sink->set_filter (trivial::severity >= trivial::trace && expr::is_debugger_present ());
|
||||
// core->add_sink (windbg_sink);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Indicate start of logging
|
||||
LOG_INFO ("Log Start");
|
||||
::qInstallMessageHandler (&qt_log_handler);
|
||||
}
|
||||
|
||||
WSJTXLogging::~WSJTXLogging ()
|
||||
{
|
||||
LOG_INFO ("Log Finish");
|
||||
auto lg = logging::core::get ();
|
||||
lg->flush ();
|
||||
lg->remove_all_sinks ();
|
||||
}
|
||||
|
||||
// Reroute Qt messages to the system logger
|
||||
void WSJTXLogging::qt_log_handler (QtMsgType type, QMessageLogContext const& context, QString const& msg)
|
||||
{
|
||||
// Convert Qt message types to logger severities
|
||||
auto severity = trivial::trace;
|
||||
switch (type)
|
||||
{
|
||||
case QtDebugMsg: severity = trivial::debug; break;
|
||||
case QtInfoMsg: severity = trivial::info; break;
|
||||
case QtWarningMsg: severity = trivial::warning; break;
|
||||
case QtCriticalMsg: severity = trivial::error; break;
|
||||
case QtFatalMsg: severity = trivial::fatal; break;
|
||||
}
|
||||
// Map non-default Qt categories to logger channels, Qt logger
|
||||
// context is mapped to the appropriate logger attributes.
|
||||
auto log = sys::get ();
|
||||
std::string file;
|
||||
std::string function;
|
||||
if (context.file)
|
||||
{
|
||||
file = context.file;
|
||||
}
|
||||
if (context.function)
|
||||
{
|
||||
function = context.function;
|
||||
}
|
||||
if (!context.category || !qstrcmp (context.category, "default"))
|
||||
{
|
||||
BOOST_LOG_SEV (log, severity)
|
||||
<< boost::log::add_value ("Line", context.line)
|
||||
<< boost::log::add_value ("File", file)
|
||||
<< boost::log::add_value ("Function", function)
|
||||
<< msg.toStdString ();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LOG_CHANNEL_SEV (log, std::string {context.category}, severity)
|
||||
<< boost::log::add_value ("Line", context.line)
|
||||
<< boost::log::add_value ("File", file)
|
||||
<< boost::log::add_value ("Function", function)
|
||||
<< msg.toStdString ();
|
||||
}
|
||||
if (QtFatalMsg == type)
|
||||
{
|
||||
// bail out
|
||||
throw std::runtime_error {"Fatal Qt Error"};
|
||||
}
|
||||
auto core = logging::core::get ();
|
||||
core->flush ();
|
||||
core->remove_all_sinks ();
|
||||
}
|
||||
|
@ -1,10 +1,6 @@
|
||||
#ifndef WSJTX_LOGGING_HPP__
|
||||
#define WSJTX_LOGGING_HPP__
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
class QString;
|
||||
|
||||
//
|
||||
// Class WSJTXLogging - wraps application specific logging
|
||||
//
|
||||
@ -13,14 +9,6 @@ class WSJTXLogging final
|
||||
public:
|
||||
explicit WSJTXLogging ();
|
||||
~WSJTXLogging ();
|
||||
|
||||
//
|
||||
// Install this as the Qt message handler (qInstallMessageHandler)
|
||||
// to integrate Qt messages. This handler can be installed at any
|
||||
// time, it does not rely on an instance of WSJTXLogging existing,
|
||||
// so logging occurring before the logging sinks, filters, and
|
||||
// formatters, etc, are established can take place.
|
||||
static void qt_log_handler (QtMsgType type, QMessageLogContext const& context, QString const&);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
5
example_log_configurations/README
Normal file
5
example_log_configurations/README
Normal file
@ -0,0 +1,5 @@
|
||||
Example WSJT-X Logging Configuration Files
|
||||
==========================================
|
||||
|
||||
Here you will find some typical loggin configuration files. Pick a
|
||||
suitable one and copy it to the WSJT-X log files directory.
|
14
example_log_configurations/wsjtx_log_config.ini.console
Normal file
14
example_log_configurations/wsjtx_log_config.ini.console
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Example logging confguration file to send records to the console terminal
|
||||
#
|
||||
|
||||
[Core]
|
||||
# Set DisableLogging to true to disable all logging.
|
||||
DisableLogging="false"
|
||||
|
||||
[Sinks.Console]
|
||||
Destination="Console"
|
||||
Asynchronous="false"
|
||||
AutoFlush="true"
|
||||
Format="[%TimeStamp(format=\"%H:%M:%S.%f\")%][%Channel%:%Severity%] %Message%"
|
||||
Filter="(%Channel% matches \"SYSLOG\" & %Severity% >= trace) | (%Channel% matches \"RIGCTRL\" & %Severity% >= info)"
|
15
example_log_configurations/wsjtx_log_config.ini.debugger
Normal file
15
example_log_configurations/wsjtx_log_config.ini.debugger
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# Example WSJT-X logging configuration for sending records to the
|
||||
# attached Windows debugger (e.g. gdb)
|
||||
#
|
||||
|
||||
[Core]
|
||||
# Set DisableLogging to true to disable all logging.
|
||||
DisableLogging="false"
|
||||
|
||||
[Sinks.Debugger]
|
||||
Destination="Debugger"
|
||||
Asynchronous="false"
|
||||
AutoFlush="true"
|
||||
Format="[%TimeStamp(format=\"%H:%M:%S.%f\")%][%Channel%][%Severity%] %File%(%Line%) %Function%: %Message%"
|
||||
Filter="(%Channel% matches \"SYSLOG\" & %Severity% >= debug) | (%Channel% matches \"RIGCTRL\" & %Severity% >= info)"
|
@ -0,0 +1,14 @@
|
||||
[Sinks.SYSLOG]
|
||||
Destination="TextFile"
|
||||
Asynchronous="true"
|
||||
AutoFlush="true"
|
||||
Format="[%TimeStamp(format=\"%Y-%m-%d %H:%M:%S.%f\")%][%Uptime(format=\"%O:%M:%S.%f\")%][%Channel%][%Severity%] %File%(%Line%) %Function%: %Message%"
|
||||
RotationTimePoint="11:42:00"
|
||||
Target="${AppLocalDataLocation}/logs"
|
||||
FileName="${AppLocalDataLocation}/wsjtx_syslog.log"
|
||||
TargetFileName="${AppLocalDataLocation}/logs/wsjtx_syslog_%Y-%m_%3N.log"
|
||||
Append="true"
|
||||
EnableFinalRotation="false"
|
||||
ScanForFiles="Matching"
|
||||
MaxSize=1073741824
|
||||
MaxFiles="10"
|
8
main.cpp
8
main.cpp
@ -104,7 +104,6 @@ namespace
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
::qInstallMessageHandler (&WSJTXLogging::qt_log_handler);
|
||||
init_random_seed ();
|
||||
|
||||
// make the Qt type magic happen
|
||||
@ -211,7 +210,9 @@ int main(int argc, char *argv[])
|
||||
multiple = true;
|
||||
}
|
||||
|
||||
// now we have the application name we can open the settings
|
||||
// now we have the application name we can open the logging and settings
|
||||
WSJTXLogging lg;
|
||||
LOG_INFO (program_title (revision ()) << " - Program startup");
|
||||
MultiSettings multi_settings {parser.value (cfg_option)};
|
||||
|
||||
// find the temporary files path
|
||||
@ -247,9 +248,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
WSJTXLogging lg;
|
||||
LOG_INFO (program_title (revision ()) << " - Program startup");
|
||||
|
||||
// load UI translations
|
||||
L10nLoader l10n {&a, locale, parser.value (lang_option)};
|
||||
|
||||
|
@ -580,6 +580,7 @@ auto FrequencyList_v2::impl::frequency_list (FrequencyItems frequency_list) -> F
|
||||
return frequency_list;
|
||||
}
|
||||
|
||||
// add a frequency returning the new model index
|
||||
QModelIndex FrequencyList_v2::impl::add (Item f)
|
||||
{
|
||||
// Any Frequency that isn't in the list may be added
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "Configuration.hpp"
|
||||
#include "Decoder/decodedtext.h"
|
||||
#include "Network/LotWUsers.hpp"
|
||||
#include "models/DecodeHighlightingModel.hpp"
|
||||
#include "logbook/logbook.h"
|
||||
|
@ -8,11 +8,10 @@
|
||||
#include <QPair>
|
||||
#include <QString>
|
||||
|
||||
#include "Decoder/decodedtext.h"
|
||||
|
||||
class QAction;
|
||||
class Configuration;
|
||||
class LogBook;
|
||||
class DecodedText;
|
||||
|
||||
class DisplayText
|
||||
: public QTextEdit
|
||||
|
@ -3441,19 +3441,21 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(),
|
||||
haveFSpread, fSpread);
|
||||
|
||||
if(m_bBestSPArmed and m_mode=="FT4") {
|
||||
if(m_bBestSPArmed && m_mode=="FT4" && CALLING == m_QSOProgress) {
|
||||
QString messagePriority=ui->decodedTextBrowser->CQPriority();
|
||||
if(messagePriority!="") {
|
||||
if(messagePriority=="New Call on Band"
|
||||
and m_BestCQpriority!="New Call on Band"
|
||||
and m_BestCQpriority!="New Multiplier") {
|
||||
m_BestCQpriority="New Call on Band";
|
||||
m_bDoubleClicked = true;
|
||||
processMessage(decodedtext0);
|
||||
}
|
||||
if(messagePriority=="New DXCC"
|
||||
and m_BestCQpriority!="New DXCC"
|
||||
and m_BestCQpriority!="New Multiplier") {
|
||||
m_BestCQpriority="New DXCC";
|
||||
m_bDoubleClicked = true;
|
||||
processMessage(decodedtext0);
|
||||
}
|
||||
}
|
||||
@ -7607,10 +7609,6 @@ void MainWindow::on_sbTR_valueChanged(int value)
|
||||
progressBar.setMaximum (value);
|
||||
}
|
||||
if(m_mode=="FST4") chk_FST4_freq_range();
|
||||
if(m_monitoring) {
|
||||
on_stopButton_clicked();
|
||||
on_monitorButton_clicked(true);
|
||||
}
|
||||
if(m_transmitting) {
|
||||
on_stopTxButton_clicked();
|
||||
}
|
||||
|
@ -1185,6 +1185,9 @@ Not available to nonstandard callsign holders.</string>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbBestSP">
|
||||
<property name="toolTip">
|
||||
<string>Enable auto response to the first decode from a new DXCC or new call on the current band.</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton:checked {
|
||||
color: rgb(0, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user