mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-24 13:18:38 -05:00
Restrict UDP SwitchConfiguration(14) to existing configurations
This commit is contained in:
parent
01dff71070
commit
63ef8412b9
@ -576,21 +576,29 @@ void MultiSettings::impl::select_configuration (QString const& target_name)
|
|||||||
{
|
{
|
||||||
if (main_window_ && target_name != current_)
|
if (main_window_ && target_name != current_)
|
||||||
{
|
{
|
||||||
|
bool changed {false};
|
||||||
{
|
{
|
||||||
auto const& current_group = settings_.group ();
|
auto const& current_group = settings_.group ();
|
||||||
if (current_group.size ()) settings_.endGroup ();
|
if (current_group.size ()) settings_.endGroup ();
|
||||||
// position to the alternative settings
|
// position to the alternative settings
|
||||||
SettingsGroup alternatives {&settings_, multi_settings_root_group};
|
SettingsGroup alternatives {&settings_, multi_settings_root_group};
|
||||||
|
if (settings_.childGroups ().contains (target_name))
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
// save the target settings
|
// save the target settings
|
||||||
SettingsGroup target_group {&settings_, target_name};
|
SettingsGroup target_group {&settings_, target_name};
|
||||||
new_settings_ = get_settings ();
|
new_settings_ = get_settings ();
|
||||||
|
}
|
||||||
if (current_group.size ()) settings_.beginGroup (current_group);
|
if (current_group.size ()) settings_.beginGroup (current_group);
|
||||||
}
|
}
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
// and set up the restart
|
// and set up the restart
|
||||||
current_ = target_name;
|
current_ = target_name;
|
||||||
Q_EMIT parent_->configurationNameChanged (unescape_ampersands (current_));
|
Q_EMIT parent_->configurationNameChanged (unescape_ampersands (current_));
|
||||||
restart (RepositionType::save_and_replace);
|
restart (RepositionType::save_and_replace);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiSettings::impl::clone_configuration (QMenu * parent_menu, QMenu const * menu)
|
void MultiSettings::impl::clone_configuration (QMenu * parent_menu, QMenu const * menu)
|
||||||
|
Loading…
Reference in New Issue
Block a user