mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-21 06:13:41 +00:00
new feature: changing the name of modes
This commit is contained in:
parent
6b81b307b7
commit
0cdc4b138a
4 changed files with 33 additions and 4 deletions
|
|
@ -179,10 +179,14 @@ void ModeHandler::setStatusBarMessageChanged(const QString &msg)
|
|||
}
|
||||
}
|
||||
|
||||
bool ModeHandler::nameAllowed(const QString &name)
|
||||
bool ModeHandler::nameAllowed(const QString &name, unsigned int ignoreIndex)
|
||||
{
|
||||
for(auto m : modes) {
|
||||
if(m->getName() == name) {
|
||||
for(unsigned int i=0;i<modes.size();i++) {
|
||||
if(i == ignoreIndex) {
|
||||
// ignore possible collision at this index
|
||||
continue;
|
||||
}
|
||||
if(modes[i]->getName() == name) {
|
||||
/* name already taken, no duplicates allowed
|
||||
* when importing, name is used as value
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue