Added SPOT button to UI

This commit is contained in:
Jordan Sherer 2018-07-09 16:31:37 -04:00
parent 722f2f10ae
commit f44b1154b7
6 changed files with 107 additions and 13 deletions

View File

@ -650,6 +650,14 @@ bool Configuration::spot_to_psk_reporter () const
// rig must be open and working to spot externally
return is_transceiver_online () && m_->spot_to_psk_reporter_;
}
void Configuration::set_spot_to_psk_reporter (bool spot)
{
if(m_->spot_to_psk_reporter_ != spot){
m_->spot_to_psk_reporter_ = spot;
m_->write_settings();
}
}
bool Configuration::monitor_off_at_startup () const {return m_->monitor_off_at_startup_;}
bool Configuration::monitor_last_used () const {return m_->rig_is_dummy_ || m_->monitor_last_used_;}
bool Configuration::log_as_RTTY () const {return m_->log_as_RTTY_;}
@ -1390,7 +1398,7 @@ void Configuration::impl::read_settings ()
quick_call_ = settings_->value ("QuickCall", false).toBool ();
disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool ();
beacon_ = settings_->value ("TxBeacon", 5).toInt ();
watchdog_ = settings_->value ("TxWatchdog", 6).toInt ();
watchdog_ = settings_->value ("TxWatchdog", 0).toInt ();
TX_messages_ = settings_->value ("Tx2QSO", true).toBool ();
enable_VHF_features_ = settings_->value("VHFUHF",false).toBool ();
decode_at_52s_ = settings_->value("Decode52",false).toBool ();

View File

@ -107,6 +107,7 @@ public:
bool id_after_73 () const;
bool tx_QSY_allowed () const;
bool spot_to_psk_reporter () const;
void set_spot_to_psk_reporter (bool);
bool monitor_off_at_startup () const;
bool monitor_last_used () const;
bool log_as_RTTY () const;

View File

@ -389,7 +389,7 @@
<string/>
</property>
<property name="value">
<number>6</number>
<number>0</number>
</property>
</widget>
</item>
@ -1777,6 +1777,9 @@ QListView::item:hover {
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="report_in_comments_check_box">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Some logging programs will not accept the type of reports
saved by this program.
@ -1790,6 +1793,9 @@ comments field.</string>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="clear_DX_check_box">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Check this option to force the clearing of the DX Call
and DX Grid fields when a 73 or free text message is sent.</string>
@ -2863,12 +2869,12 @@ soundcard changes</string>
</connection>
</connections>
<buttongroups>
<buttongroup name="TX_audio_source_button_group"/>
<buttongroup name="CAT_stop_bits_button_group"/>
<buttongroup name="TX_mode_button_group"/>
<buttongroup name="PTT_method_button_group"/>
<buttongroup name="TX_mode_button_group"/>
<buttongroup name="CAT_data_bits_button_group"/>
<buttongroup name="split_mode_button_group"/>
<buttongroup name="CAT_handshake_button_group"/>
<buttongroup name="TX_audio_source_button_group"/>
</buttongroups>
</ui>

View File

@ -1010,7 +1010,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
ui->TxFreqSpinBox->setValue(1500);
ui->RxFreqSpinBox->setValue(1500);
//connect(ui->tableWidgetRXAll->horizontalHeader(), &QHeaderView::sectionResized, this, [this](){ });
ui->spotButton->setChecked(m_config.spot_to_psk_reporter());
// setup tablewidget context menus
auto clearAction1 = new QAction(QIcon::fromTheme("edit-clear"), QString("Clear"), ui->textEditRX);
@ -1746,7 +1746,7 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
on_dxGridEntry_textChanged (m_hisGrid); // recalculate distances in case of units change
enable_DXCC_entity (m_config.DXCC ()); // sets text window proportions and (re)inits the logbook
if(m_config.spot_to_psk_reporter ()) pskSetLocal ();
preparePSKReporter();
if(m_config.restart_audio_input ()) {
Q_EMIT startAudioInputStream (m_config.audio_input_device (),
@ -1806,6 +1806,23 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
}
}
void MainWindow::preparePSKReporter(){
if(m_config.spot_to_psk_reporter ()){
pskSetLocal ();
ui->spotButton->setChecked(true);
} else {
ui->spotButton->setChecked(false);
}
}
void MainWindow::on_spotButton_clicked(bool checked){
// 1. save setting
m_config.set_spot_to_psk_reporter(checked);
// 2. prepare
preparePSKReporter();
}
void MainWindow::on_monitorButton_clicked (bool checked)
{
if (!m_transmitting) {
@ -1882,8 +1899,8 @@ void MainWindow::on_autoButton_clicked (bool checked)
void MainWindow::auto_tx_mode (bool state)
{
ui->autoButton->setChecked (state);
on_autoButton_clicked (state);
ui->autoButton->setChecked (state);
on_autoButton_clicked (state);
}
void MainWindow::keyPressEvent (QKeyEvent * e)
@ -6796,6 +6813,10 @@ void MainWindow::stopTuneATU()
m_bTxTime=false;
}
void MainWindow::on_monitorTxButton_clicked(){
on_stopTxButton_clicked();
}
void MainWindow::on_stopTxButton_clicked() //Stop Tx
{
if (m_tune) stop_tuning ();
@ -7302,6 +7323,10 @@ void MainWindow::transmitDisplay (bool transmitting)
ui->pbTxMode->setEnabled (false);
}
}
// TODO: jsherer - encapsulate this in a function?
ui->monitorButton->setVisible(!transmitting);
ui->monitorTxButton->setVisible(transmitting);
}
void MainWindow::on_sbFtol_valueChanged(int value)

View File

@ -143,10 +143,13 @@ private slots:
void on_tx5_currentTextChanged (QString const&);
void on_tx6_editingFinished();
void on_actionSettings_triggered();
void preparePSKReporter();
void on_spotButton_clicked(bool checked);
void on_monitorButton_clicked (bool);
void on_actionAbout_triggered();
void on_autoButton_clicked (bool);
void on_labDialFreq_clicked();
void on_monitorTxButton_clicked();
void on_stopTxButton_clicked();
void on_stopButton_clicked();
void on_actionRelease_Notes_triggered ();

View File

@ -532,9 +532,9 @@ background-color: #6699ff;
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="autoButton">
<widget class="QPushButton" name="spotButton">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -583,7 +583,7 @@ background-color: #00ff00;
}</string>
</property>
<property name="text">
<string>TX</string>
<string>SPOT</string>
</property>
<property name="checkable">
<bool>true</bool>
@ -591,6 +591,7 @@ background-color: #00ff00;
</widget>
</item>
<item row="1" column="2">
<widget class="QWidget" name="monitorContainer" native="true">
<widget class="QPushButton" name="monitorButton">
<property name="enabled">
<bool>true</bool>
@ -632,7 +633,7 @@ QPushButton[state=&quot;error&quot;] {
background-color: red;
}
QPushButton[state=&quot;warning&quot;] {
background-color: orange;
background-color: yellow;
}
QPushButton[state=&quot;ok&quot;] {
background-color: #00ff00;
@ -648,6 +649,56 @@ background-color: #00ff00;
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="monitorTxButton">
<property name="visible">
<bool>false</bool>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>40</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
font-family: helvetica;
font-size: 9pt;
font-weight: bold;
color: black;
border-style: solid;
border-width:0px;
border-color: gray;
max-height:30px;
min-width:40px;
min-height:30px;
max-width:40px;;
background-color: yellow;
}
</string>
</property>
<property name="text">
<string>TX</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="tuneButton">
@ -3747,7 +3798,7 @@ list. The list can be maintained in Settings (F2).</string>
</widget>
</item>
<item>
<widget class="QPushButton" name="autoButton_old">
<widget class="QPushButton" name="autoButton">
<property name="minimumSize">
<size>
<width>50</width>