mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 12:23:37 -05:00
c65d832356
The Status(1) message acquires the new fields Frequency Tolerance, T/R Period, and Configuration Name. The Rx DF, Tx DF fields become unsigned (this should be a benign change which is just for correctness as -ve values have never been possible). The Close(6) message becomes bi-directional allowing external applications to gracefully close down WSJT-X instances. A new message SwitchConfiguration(14) is provided that allows an external application to switch the current configuration of a WSJT-X instance. Another new message Configure(15) is provided to allow external applications to adjust some key parameters like the mode and submode. See the NetworkMessages.hpp header commentary for full details. The UDPExamples/MessageAggregator reference application has been updated to be able to exercise all of the above changes. Note that this commit enforces stricter checking on the "Settings->Reporting->Allow UDP requests" option, which must be checked before any state changing incoming messages to a WSJT-X instance are processed.
34 lines
838 B
C++
34 lines
838 B
C++
#include "RestrictedSpinBox.hpp"
|
|
|
|
#include <algorithm>
|
|
#include <utility>
|
|
|
|
#include <QString>
|
|
|
|
QValidator::State RestrictedSpinBox::validate (QString& input, int& pos) const
|
|
{
|
|
// start by doing the standard QSpinBox validation
|
|
auto valid = HintedSpinBox::validate (input, pos);
|
|
// extra validation
|
|
if (QValidator::Acceptable
|
|
&& values ().end () == std::find (values ().begin (), values ().end (), valueFromText (input)))
|
|
{
|
|
valid = QValidator::Intermediate;
|
|
}
|
|
return valid;
|
|
}
|
|
|
|
void RestrictedSpinBox::fixup (QString& input) const
|
|
{
|
|
auto iter = std::lower_bound (values ().begin (), values ().end (), valueFromText (input));
|
|
HintedSpinBox::fixup (input);
|
|
if (iter != values ().end ())
|
|
{
|
|
input = textFromValue (*iter);
|
|
}
|
|
else
|
|
{
|
|
input = textFromValue (values ().back ());
|
|
}
|
|
}
|