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