1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-29 13:32:26 -04:00

LimeRFE USB support: GUI: mark apply button in green when changes need configuration update

This commit is contained in:
f4exb 2020-01-21 08:36:09 +01:00
parent ff44eec40f
commit 839ce57209
3 changed files with 32 additions and 1 deletions

View File

@ -47,6 +47,7 @@ LimeRFEUSBDialog::LimeRFEUSBDialog(LimeRFEUSBCalib& limeRFEUSBCalib, QWidget* pa
updateDeviceSetList();
displaySettings(); // default values
highlightApplyButton(false);
m_timer.setInterval(500);
}
@ -474,6 +475,7 @@ void LimeRFEUSBDialog::on_deviceToGUI_clicked()
m_controller.stateToSettings(m_settings);
displaySettings();
highlightApplyButton(false);
}
void LimeRFEUSBDialog::on_rxChannelGroup_currentIndexChanged(int index)
@ -486,6 +488,8 @@ void LimeRFEUSBDialog::on_rxChannelGroup_currentIndexChanged(int index)
m_settings.m_txChannels = m_settings.m_rxChannels;
ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels);
}
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_rxChannel_currentIndexChanged(int index)
@ -507,11 +511,14 @@ void LimeRFEUSBDialog::on_rxChannel_currentIndexChanged(int index)
m_settings.m_txCellularChannel = m_settings.m_rxCellularChannel;
setTxChannels();
}
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_rxPort_currentIndexChanged(int index)
{
m_settings.m_rxPort = (LimeRFEController::RxPort) index;
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_txFollowsRx_clicked()
@ -525,12 +532,17 @@ void LimeRFEUSBDialog::on_txFollowsRx_clicked()
m_settings.m_txHAMChannel = m_settings.m_rxHAMChannel;
m_settings.m_txCellularChannel = m_settings.m_rxCellularChannel;
ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels);
if (checked) {
highlightApplyButton(true);
}
}
void LimeRFEUSBDialog::on_txChannelGroup_currentIndexChanged(int index)
{
m_settings.m_txChannels = (LimeRFEController::ChannelGroups) index;
setTxChannels();
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_txChannel_currentIndexChanged(int index)
@ -544,21 +556,25 @@ void LimeRFEUSBDialog::on_txChannel_currentIndexChanged(int index)
}
setTxChannels();
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_txPort_currentIndexChanged(int index)
{
m_settings.m_txPort = (LimeRFEController::TxPort) index;
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_powerEnable_clicked()
{
m_settings.m_swrEnable = ui->powerEnable->isChecked();
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_powerSource_currentIndexChanged(int index)
{
m_settings.m_swrSource = (LimeRFEController::SWRSource) index;
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_powerRefresh_clicked()
@ -713,6 +729,15 @@ void LimeRFEUSBDialog::updateDeviceSetList()
}
}
void LimeRFEUSBDialog::highlightApplyButton(bool highlight)
{
if (highlight) {
ui->apply->setStyleSheet("QPushButton { background-color : green; }");
} else {
ui->apply->setStyleSheet("QPushButton { background:rgb(79,79,79); }");
}
}
void LimeRFEUSBDialog::on_modeRx_toggled(bool checked)
{
int rc;
@ -800,6 +825,8 @@ void LimeRFEUSBDialog::on_rxTxToggle_clicked()
ui->statusText->setText(m_controller.getError(rc).c_str());
displayMode();
}
highlightApplyButton(true);
}
void LimeRFEUSBDialog::on_apply_clicked()
@ -808,6 +835,7 @@ void LimeRFEUSBDialog::on_apply_clicked()
m_controller.settingsToState(m_settings);
int rc = m_controller.configure();
ui->statusText->setText(m_controller.getError(rc).c_str());
highlightApplyButton(false);
}
void LimeRFEUSBDialog::tick()

View File

@ -58,6 +58,7 @@ private:
void stopStartRx(bool start);
void stopStartTx(bool start);
void syncRxTx();
void highlightApplyButton(bool highlight);
Ui::LimeRFEUSBDialog* ui;
LimeRFEController m_controller;

View File

@ -6,6 +6,8 @@ To open the LimeRFE USB dialog open the Preferences sub-menu from the top bar an
The dialog is non-modal so that it can be left open and keep the control on LimeRFE while other functions can be used.
Whenever a change requires the LimeRFE configuration to be changed to become effective the "Apply" button (6) becomes green to suggest it should be activated.
⚠ Disclaimer: please use this interface and the LimeRFE sensibly by making sure you are licensed to operate it on the selected frequencies. If you are a licensed amateur radio you should make sure you operate on the bands allocated in your region as some bands are exclusive to a specific region or country.
![LimeRFE USB dialog](../doc/img/LimeRFEUSB_dialog.png)
@ -201,7 +203,7 @@ This is where status messages are displayed.
<h2>6. Apply changes</h2>
Use this button to apply configuration changes. You must press this button to make any of your changes active.
Use this button to apply configuration changes. You must press this button to make any of your changes active. Whenever a change requires the LimeRFE configuration to be changed to become effective this button becomes green to suggest it should be activated.
<h2>7. Close dialog</h2>