mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-24 02:12:37 -04:00
Option to display principal prefix instead of country name.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8287 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
ff7e127e53
commit
053a83dc52
@ -550,6 +550,7 @@ private:
|
|||||||
bool prompt_to_log_;
|
bool prompt_to_log_;
|
||||||
bool insert_blank_;
|
bool insert_blank_;
|
||||||
bool DXCC_;
|
bool DXCC_;
|
||||||
|
bool ppfx_;
|
||||||
bool clear_DX_;
|
bool clear_DX_;
|
||||||
bool miles_;
|
bool miles_;
|
||||||
bool quick_call_;
|
bool quick_call_;
|
||||||
@ -650,6 +651,7 @@ bool Configuration::report_in_comments () const {return m_->report_in_comments_;
|
|||||||
bool Configuration::prompt_to_log () const {return m_->prompt_to_log_;}
|
bool Configuration::prompt_to_log () const {return m_->prompt_to_log_;}
|
||||||
bool Configuration::insert_blank () const {return m_->insert_blank_;}
|
bool Configuration::insert_blank () const {return m_->insert_blank_;}
|
||||||
bool Configuration::DXCC () const {return m_->DXCC_;}
|
bool Configuration::DXCC () const {return m_->DXCC_;}
|
||||||
|
bool Configuration::ppfx() const {return m_->ppfx_;}
|
||||||
bool Configuration::clear_DX () const {return m_->clear_DX_;}
|
bool Configuration::clear_DX () const {return m_->clear_DX_;}
|
||||||
bool Configuration::miles () const {return m_->miles_;}
|
bool Configuration::miles () const {return m_->miles_;}
|
||||||
bool Configuration::quick_call () const {return m_->quick_call_;}
|
bool Configuration::quick_call () const {return m_->quick_call_;}
|
||||||
@ -1120,6 +1122,7 @@ void Configuration::impl::initialize_models ()
|
|||||||
ui_->prompt_to_log_check_box->setChecked (prompt_to_log_);
|
ui_->prompt_to_log_check_box->setChecked (prompt_to_log_);
|
||||||
ui_->insert_blank_check_box->setChecked (insert_blank_);
|
ui_->insert_blank_check_box->setChecked (insert_blank_);
|
||||||
ui_->DXCC_check_box->setChecked (DXCC_);
|
ui_->DXCC_check_box->setChecked (DXCC_);
|
||||||
|
ui_->ppfx_check_box->setChecked (ppfx_);
|
||||||
ui_->clear_DX_check_box->setChecked (clear_DX_);
|
ui_->clear_DX_check_box->setChecked (clear_DX_);
|
||||||
ui_->miles_check_box->setChecked (miles_);
|
ui_->miles_check_box->setChecked (miles_);
|
||||||
ui_->quick_call_check_box->setChecked (quick_call_);
|
ui_->quick_call_check_box->setChecked (quick_call_);
|
||||||
@ -1356,6 +1359,7 @@ void Configuration::impl::read_settings ()
|
|||||||
prompt_to_log_ = settings_->value ("PromptToLog", false).toBool ();
|
prompt_to_log_ = settings_->value ("PromptToLog", false).toBool ();
|
||||||
insert_blank_ = settings_->value ("InsertBlank", false).toBool ();
|
insert_blank_ = settings_->value ("InsertBlank", false).toBool ();
|
||||||
DXCC_ = settings_->value ("DXCCEntity", false).toBool ();
|
DXCC_ = settings_->value ("DXCCEntity", false).toBool ();
|
||||||
|
ppfx_ = settings_->value ("PrincipalPrefix", false).toBool ();
|
||||||
clear_DX_ = settings_->value ("ClearCallGrid", false).toBool ();
|
clear_DX_ = settings_->value ("ClearCallGrid", false).toBool ();
|
||||||
miles_ = settings_->value ("Miles", false).toBool ();
|
miles_ = settings_->value ("Miles", false).toBool ();
|
||||||
quick_call_ = settings_->value ("QuickCall", false).toBool ();
|
quick_call_ = settings_->value ("QuickCall", false).toBool ();
|
||||||
@ -1453,6 +1457,7 @@ void Configuration::impl::write_settings ()
|
|||||||
settings_->setValue ("PromptToLog", prompt_to_log_);
|
settings_->setValue ("PromptToLog", prompt_to_log_);
|
||||||
settings_->setValue ("InsertBlank", insert_blank_);
|
settings_->setValue ("InsertBlank", insert_blank_);
|
||||||
settings_->setValue ("DXCCEntity", DXCC_);
|
settings_->setValue ("DXCCEntity", DXCC_);
|
||||||
|
settings_->setValue ("PrincipalPrefix", ppfx_);
|
||||||
settings_->setValue ("ClearCallGrid", clear_DX_);
|
settings_->setValue ("ClearCallGrid", clear_DX_);
|
||||||
settings_->setValue ("Miles", miles_);
|
settings_->setValue ("Miles", miles_);
|
||||||
settings_->setValue ("QuickCall", quick_call_);
|
settings_->setValue ("QuickCall", quick_call_);
|
||||||
@ -1858,6 +1863,7 @@ void Configuration::impl::accept ()
|
|||||||
prompt_to_log_ = ui_->prompt_to_log_check_box->isChecked ();
|
prompt_to_log_ = ui_->prompt_to_log_check_box->isChecked ();
|
||||||
insert_blank_ = ui_->insert_blank_check_box->isChecked ();
|
insert_blank_ = ui_->insert_blank_check_box->isChecked ();
|
||||||
DXCC_ = ui_->DXCC_check_box->isChecked ();
|
DXCC_ = ui_->DXCC_check_box->isChecked ();
|
||||||
|
ppfx_ = ui_->ppfx_check_box->isChecked ();
|
||||||
clear_DX_ = ui_->clear_DX_check_box->isChecked ();
|
clear_DX_ = ui_->clear_DX_check_box->isChecked ();
|
||||||
miles_ = ui_->miles_check_box->isChecked ();
|
miles_ = ui_->miles_check_box->isChecked ();
|
||||||
quick_call_ = ui_->quick_call_check_box->isChecked ();
|
quick_call_ = ui_->quick_call_check_box->isChecked ();
|
||||||
|
@ -114,6 +114,7 @@ public:
|
|||||||
bool prompt_to_log () const;
|
bool prompt_to_log () const;
|
||||||
bool insert_blank () const;
|
bool insert_blank () const;
|
||||||
bool DXCC () const;
|
bool DXCC () const;
|
||||||
|
bool ppfx() const;
|
||||||
bool clear_DX () const;
|
bool clear_DX () const;
|
||||||
bool miles () const;
|
bool miles () const;
|
||||||
bool quick_call () const;
|
bool quick_call () const;
|
||||||
|
@ -253,6 +253,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="ppfx_check_box">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show principal prefix instead of country name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -2746,12 +2753,12 @@ soundcard changes</string>
|
|||||||
</connection>
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
<buttongroup name="TX_audio_source_button_group"/>
|
|
||||||
<buttongroup name="CAT_data_bits_button_group"/>
|
|
||||||
<buttongroup name="TX_mode_button_group"/>
|
|
||||||
<buttongroup name="PTT_method_button_group"/>
|
|
||||||
<buttongroup name="CAT_handshake_button_group"/>
|
|
||||||
<buttongroup name="split_mode_button_group"/>
|
<buttongroup name="split_mode_button_group"/>
|
||||||
|
<buttongroup name="PTT_method_button_group"/>
|
||||||
|
<buttongroup name="TX_audio_source_button_group"/>
|
||||||
|
<buttongroup name="CAT_handshake_button_group"/>
|
||||||
|
<buttongroup name="CAT_data_bits_button_group"/>
|
||||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||||
|
<buttongroup name="TX_mode_button_group"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -121,7 +121,6 @@ QString DisplayText::appendDXCCWorkedB4(QString message, QString const& callsign
|
|||||||
if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message;
|
if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message;
|
||||||
|
|
||||||
logBook.match(/*in*/call,/*out*/countryName,callWorkedBefore,countryWorkedBefore);
|
logBook.match(/*in*/call,/*out*/countryName,callWorkedBefore,countryWorkedBefore);
|
||||||
|
|
||||||
message = message.trimmed ();
|
message = message.trimmed ();
|
||||||
QString appendage;
|
QString appendage;
|
||||||
if (!countryWorkedBefore) // therefore not worked call either
|
if (!countryWorkedBefore) // therefore not worked call either
|
||||||
@ -143,6 +142,12 @@ QString DisplayText::appendDXCCWorkedB4(QString message, QString const& callsign
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int i1=countryName.indexOf(";");
|
||||||
|
if(m_bPrincipalPrefix) {
|
||||||
|
int i2=countryName.lastIndexOf(";");
|
||||||
|
if(i1>0) countryName=countryName.mid(i1+2,i2-i1-2);
|
||||||
|
} else {
|
||||||
|
if(i1>0) countryName=countryName.mid(0,i1-1);
|
||||||
// do some obvious abbreviations
|
// do some obvious abbreviations
|
||||||
countryName.replace ("Islands", "Is.");
|
countryName.replace ("Islands", "Is.");
|
||||||
countryName.replace ("Island", "Is.");
|
countryName.replace ("Island", "Is.");
|
||||||
@ -162,6 +167,7 @@ QString DisplayText::appendDXCCWorkedB4(QString message, QString const& callsign
|
|||||||
countryName.replace ("Asiatic", "AS");
|
countryName.replace ("Asiatic", "AS");
|
||||||
countryName.replace ("European", "EU");
|
countryName.replace ("European", "EU");
|
||||||
countryName.replace ("African", "AF");
|
countryName.replace ("African", "AF");
|
||||||
|
}
|
||||||
|
|
||||||
appendage += countryName;
|
appendage += countryName;
|
||||||
|
|
||||||
@ -181,8 +187,9 @@ QString DisplayText::appendDXCCWorkedB4(QString message, QString const& callsign
|
|||||||
void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall,
|
void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall,
|
||||||
bool displayDXCCEntity, LogBook const& logBook,
|
bool displayDXCCEntity, LogBook const& logBook,
|
||||||
QColor color_CQ, QColor color_MyCall,
|
QColor color_CQ, QColor color_MyCall,
|
||||||
QColor color_DXCC, QColor color_NewCall)
|
QColor color_DXCC, QColor color_NewCall,bool ppfx)
|
||||||
{
|
{
|
||||||
|
m_bPrincipalPrefix=ppfx;
|
||||||
QColor bg {Qt::white};
|
QColor bg {Qt::white};
|
||||||
bool CQcall = false;
|
bool CQcall = false;
|
||||||
if (decodedText.string ().contains (" CQ ")
|
if (decodedText.string ().contains (" CQ ")
|
||||||
|
@ -21,7 +21,7 @@ public:
|
|||||||
void insertLineSpacer(QString const&);
|
void insertLineSpacer(QString const&);
|
||||||
void displayDecodedText(DecodedText const& decodedText, QString const& myCall, bool displayDXCCEntity,
|
void displayDecodedText(DecodedText const& decodedText, QString const& myCall, bool displayDXCCEntity,
|
||||||
LogBook const& logBook, QColor color_CQ, QColor color_MyCall,
|
LogBook const& logBook, QColor color_CQ, QColor color_MyCall,
|
||||||
QColor color_DXCC, QColor color_NewCall);
|
QColor color_DXCC, QColor color_NewCall, bool ppfx);
|
||||||
void displayTransmittedText(QString text, QString modeTx, qint32 txFreq,
|
void displayTransmittedText(QString text, QString modeTx, qint32 txFreq,
|
||||||
QColor color_TxMsg, bool bFastMode);
|
QColor color_TxMsg, bool bFastMode);
|
||||||
void displayQSY(QString text);
|
void displayQSY(QString text);
|
||||||
@ -37,6 +37,7 @@ protected:
|
|||||||
void mouseDoubleClickEvent(QMouseEvent *e);
|
void mouseDoubleClickEvent(QMouseEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool m_bPrincipalPrefix;
|
||||||
QString appendDXCCWorkedB4(QString message, QString const& callsign, QColor * bg, LogBook const& logBook,
|
QString appendDXCCWorkedB4(QString message, QString const& callsign, QColor * bg, LogBook const& logBook,
|
||||||
QColor color_CQ, QColor color_DXCC, QColor color_NewCall);
|
QColor color_CQ, QColor color_DXCC, QColor color_NewCall);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "countrydat.h"
|
#include "countrydat.h"
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
void CountryDat::init(const QString filename)
|
void CountryDat::init(const QString filename)
|
||||||
{
|
{
|
||||||
@ -91,6 +91,11 @@ void CountryDat::load()
|
|||||||
QString name = _extractName(line1);
|
QString name = _extractName(line1);
|
||||||
if (name.length()>0)
|
if (name.length()>0)
|
||||||
{
|
{
|
||||||
|
QString continent=line1.mid(36,2);
|
||||||
|
QString principalPrefix=line1.mid(69,4);
|
||||||
|
int i1=principalPrefix.indexOf(":");
|
||||||
|
if(i1>0) principalPrefix=principalPrefix.mid(0,i1);
|
||||||
|
name += "; " + principalPrefix + "; " + continent;
|
||||||
_countryNames << name;
|
_countryNames << name;
|
||||||
bool more = true;
|
bool more = true;
|
||||||
QStringList prefixs;
|
QStringList prefixs;
|
||||||
|
@ -75,6 +75,7 @@ void LogBook::match(/*in*/const QString call,
|
|||||||
QString currentBand = ""; // match any band
|
QString currentBand = ""; // match any band
|
||||||
callWorkedBefore = _log.match(call,currentBand,currentMode);
|
callWorkedBefore = _log.match(call,currentBand,currentMode);
|
||||||
countryName = _countries.find(call);
|
countryName = _countries.find(call);
|
||||||
|
// qDebug() << "B" << countryName;
|
||||||
|
|
||||||
if (countryName.length() > 0) // country was found
|
if (countryName.length() > 0) // country was found
|
||||||
countryWorkedBefore = _worked.getHasWorked(countryName);
|
countryWorkedBefore = _worked.getHasWorked(countryName);
|
||||||
|
@ -1260,7 +1260,7 @@ void MainWindow::dataSink(qint64 frames)
|
|||||||
DecodedText decodedtext {t, false, m_config.my_grid ()};
|
DecodedText decodedtext {t, false, m_config.my_grid ()};
|
||||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
||||||
m_config.color_NewCall());
|
m_config.color_NewCall(),m_config.ppfx());
|
||||||
if (ui->measure_check_box->isChecked ()) {
|
if (ui->measure_check_box->isChecked ()) {
|
||||||
// Append results text to file "fmt.all".
|
// Append results text to file "fmt.all".
|
||||||
QFile f {m_config.writeable_data_dir ().absoluteFilePath ("fmt.all")};
|
QFile f {m_config.writeable_data_dir ().absoluteFilePath ("fmt.all")};
|
||||||
@ -1497,7 +1497,7 @@ void MainWindow::fastSink(qint64 frames)
|
|||||||
DecodedText decodedtext {message.replace (QChar::LineFeed, ""), bcontest, m_config.my_grid ()};
|
DecodedText decodedtext {message.replace (QChar::LineFeed, ""), bcontest, m_config.my_grid ()};
|
||||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
||||||
m_config.color_NewCall());
|
m_config.color_NewCall(),m_config.ppfx());
|
||||||
m_bDecoded=true;
|
m_bDecoded=true;
|
||||||
auto_sequence (decodedtext, ui->sbFtol->value (), std::numeric_limits<unsigned>::max ());
|
auto_sequence (decodedtext, ui->sbFtol->value (), std::numeric_limits<unsigned>::max ());
|
||||||
if (m_mode != "ISCAT") postDecode (true, decodedtext.string ());
|
if (m_mode != "ISCAT") postDecode (true, decodedtext.string ());
|
||||||
@ -2702,7 +2702,7 @@ void::MainWindow::fast_decode_done()
|
|||||||
if(!m_bFastDone) {
|
if(!m_bFastDone) {
|
||||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
||||||
m_config.color_NewCall());
|
m_config.color_NewCall(),m_config.ppfx());
|
||||||
}
|
}
|
||||||
|
|
||||||
t=message.mid(10,5).toFloat();
|
t=message.mid(10,5).toFloat();
|
||||||
@ -2777,6 +2777,10 @@ void MainWindow::decodeDone ()
|
|||||||
if(ui->textBrowser3->toPlainText().indexOf(c2) >= 0) b=true;
|
if(ui->textBrowser3->toPlainText().indexOf(c2) >= 0) b=true;
|
||||||
if(ui->textBrowser4->toPlainText().indexOf(c2) >= 0) b=true;
|
if(ui->textBrowser4->toPlainText().indexOf(c2) >= 0) b=true;
|
||||||
if(!b) {
|
if(!b) {
|
||||||
|
QString countryName;
|
||||||
|
bool callWorkedBefore,countryWorkedBefore;
|
||||||
|
m_logBook.match(/*in*/c2,/*out*/countryName,callWorkedBefore,countryWorkedBefore);
|
||||||
|
qDebug() << "D" << t0 << countryName;
|
||||||
t += (t0 + "\n"); //Don't list calls already in QSO or in the stack
|
t += (t0 + "\n"); //Don't list calls already in QSO or in the stack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2888,13 +2892,13 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
DecodedText dt{".",false," "};
|
DecodedText dt{".",false," "};
|
||||||
ui->decodedTextBrowser->displayDecodedText(dt,m_baseCall,m_config.DXCC(),
|
ui->decodedTextBrowser->displayDecodedText(dt,m_baseCall,m_config.DXCC(),
|
||||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
||||||
m_config.color_DXCC(), m_config.color_NewCall());
|
m_config.color_DXCC(), m_config.color_NewCall(),m_config.ppfx());
|
||||||
m_bDisplayedOnce=true;
|
m_bDisplayedOnce=true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ui->decodedTextBrowser->displayDecodedText(decodedtext,m_baseCall,m_config.DXCC(),
|
ui->decodedTextBrowser->displayDecodedText(decodedtext,m_baseCall,m_config.DXCC(),
|
||||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
||||||
m_config.color_DXCC(), m_config.color_NewCall());
|
m_config.color_DXCC(), m_config.color_NewCall(),m_config.ppfx());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2928,7 +2932,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
// or contains MyCall
|
// or contains MyCall
|
||||||
ui->decodedTextBrowser2->displayDecodedText(decodedtext,m_baseCall,false,
|
ui->decodedTextBrowser2->displayDecodedText(decodedtext,m_baseCall,false,
|
||||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),
|
||||||
m_config.color_DXCC(),m_config.color_NewCall());
|
m_config.color_DXCC(),m_config.color_NewCall(),m_config.ppfx());
|
||||||
|
|
||||||
if(m_mode!="JT4") {
|
if(m_mode!="JT4") {
|
||||||
bool b65=decodedtext.isJT65();
|
bool b65=decodedtext.isJT65();
|
||||||
@ -4239,7 +4243,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
|
|||||||
if (s1!=s2 and !message.isTX()) {
|
if (s1!=s2 and !message.isTX()) {
|
||||||
ui->decodedTextBrowser2->displayDecodedText(message, m_baseCall,
|
ui->decodedTextBrowser2->displayDecodedText(message, m_baseCall,
|
||||||
false, m_logBook,m_config.color_CQ(), m_config.color_MyCall(),
|
false, m_logBook,m_config.color_CQ(), m_config.color_MyCall(),
|
||||||
m_config.color_DXCC(),m_config.color_NewCall());
|
m_config.color_DXCC(),m_config.color_NewCall(),m_config.ppfx());
|
||||||
m_QSOText = s2;
|
m_QSOText = s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user