mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +01:00
Fixed needless config saves
This commit is contained in:
parent
a53dc1a6ae
commit
bad8ecba49
@ -548,16 +548,20 @@ void MainWindow::draw() {
|
||||
if (!lockWaterfallControls) {
|
||||
// Handle arrow keys
|
||||
if (vfo != NULL && (gui::waterfall.mouseInFFT || gui::waterfall.mouseInWaterfall)) {
|
||||
bool freqChanged = false;
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_LeftArrow) && !gui::freqSelect.digitHovered) {
|
||||
double nfreq = gui::waterfall.getCenterFrequency() + vfo->generalOffset - vfo->snapInterval;
|
||||
nfreq = roundl(nfreq / vfo->snapInterval) * vfo->snapInterval;
|
||||
tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq);
|
||||
freqChanged = true;
|
||||
}
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_RightArrow) && !gui::freqSelect.digitHovered) {
|
||||
double nfreq = gui::waterfall.getCenterFrequency() + vfo->generalOffset + vfo->snapInterval;
|
||||
nfreq = roundl(nfreq / vfo->snapInterval) * vfo->snapInterval;
|
||||
tuner::tune(tuningMode, gui::waterfall.selectedVFO, nfreq);
|
||||
freqChanged = true;
|
||||
}
|
||||
if (freqChanged) {
|
||||
core::configManager.acquire();
|
||||
core::configManager.conf["frequency"] = gui::waterfall.getCenterFrequency();
|
||||
if (vfo != NULL) {
|
||||
@ -565,6 +569,7 @@ void MainWindow::draw() {
|
||||
}
|
||||
core::configManager.release(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle scrollwheel
|
||||
int wheel = ImGui::GetIO().MouseWheel;
|
||||
|
@ -145,13 +145,13 @@ private:
|
||||
std::lock_guard lck(_this->vfoMtx);
|
||||
if (ImGui::Combo(CONCAT("##_rigctl_srv_rec_", _this->name), &_this->recorderId, _this->recorderNamesTxt.c_str())) {
|
||||
_this->selectRecorderByName(_this->recorderNames[_this->recorderId], false);
|
||||
}
|
||||
if (!_this->selectedRecorder.empty()) {
|
||||
config.acquire();
|
||||
config.conf[_this->name]["recorder"] = _this->selectedRecorder;
|
||||
config.release(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::BeginTable(CONCAT("Stop##_rigctl_srv_tbl_", _this->name), 2);
|
||||
ImGui::TableNextRow();
|
||||
|
Loading…
Reference in New Issue
Block a user