mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-12 03:07:11 +01:00
Fixed bugs with the frequency manager
This commit is contained in:
parent
2f61b190ca
commit
0741f265d7
@ -1,3 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define VERSION_STR "1.0.0_rc1"
|
||||
#define VERSION_STR "1.0.0_rc2"
|
@ -198,19 +198,20 @@ private:
|
||||
|
||||
ImGui::EndTable();
|
||||
|
||||
if (strlen(nameBuf) == 0) { style::beginDisabled(); }
|
||||
bool applyDisabled = (strlen(nameBuf) == 0) || (bookmarks.find(editedBookmarkName) != bookmarks.end() && editedBookmarkName != firstEditedBookmarkName);
|
||||
if (applyDisabled) { style::beginDisabled(); }
|
||||
if (ImGui::Button("Apply")) {
|
||||
open = false;
|
||||
|
||||
// If editing, delete the original one
|
||||
if (editOpen) {
|
||||
bookmarks.erase(firstEeditedBookmarkName);
|
||||
bookmarks.erase(firstEditedBookmarkName);
|
||||
}
|
||||
bookmarks[nameBuf] = editedBookmark;
|
||||
bookmarks[editedBookmarkName] = editedBookmark;
|
||||
|
||||
saveByName(selectedListName);
|
||||
}
|
||||
if (strlen(nameBuf) == 0) { style::endDisabled(); }
|
||||
if (applyDisabled) { style::endDisabled(); }
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel")) {
|
||||
open = false;
|
||||
@ -463,7 +464,7 @@ private:
|
||||
|
||||
_this->editedBookmark.selected = false;
|
||||
|
||||
_this->editOpen = true;
|
||||
_this->createOpen = true;
|
||||
|
||||
// Find new unique default name
|
||||
if (_this->bookmarks.find("New Bookmark") == _this->bookmarks.end()) {
|
||||
@ -492,7 +493,7 @@ private:
|
||||
_this->editOpen = true;
|
||||
_this->editedBookmark = _this->bookmarks[selectedNames[0]];
|
||||
_this->editedBookmarkName = selectedNames[0];
|
||||
_this->firstEeditedBookmarkName = selectedNames[0];
|
||||
_this->firstEditedBookmarkName = selectedNames[0];
|
||||
}
|
||||
if (selectedNames.size() != 1 && _this->selectedListName != "") { style::endDisabled(); }
|
||||
|
||||
@ -808,7 +809,7 @@ private:
|
||||
std::map<std::string, FrequencyBookmark> bookmarks;
|
||||
|
||||
std::string editedBookmarkName = "";
|
||||
std::string firstEeditedBookmarkName = "";
|
||||
std::string firstEditedBookmarkName = "";
|
||||
FrequencyBookmark editedBookmark;
|
||||
|
||||
std::vector<std::string> listNames;
|
||||
|
Loading…
Reference in New Issue
Block a user