Merge pull request #2560 from okrc/main

fixed issue with the display about cmbDefault
This commit is contained in:
DavidXanatos 2022-12-23 18:00:01 +01:00 committed by GitHub
commit dfc74b2114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1267,7 +1267,11 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB
SB_STATUS Status = SandBoxes.first()->RenameBox(Value.replace(" ", "_"));
if (!Status.IsError())
{
RenameItem(OldValue.replace(" ", "_"), Value.replace(" ", "_"));
if (theAPI->GetGlobalSettings()->GetText("DefaultBox", "DefaultBox").compare(OldValue.replace(" ", "_"), Qt::CaseInsensitive) == 0)
theAPI->GetGlobalSettings()->SetText("DefaultBox", Value.replace(" ", "_"));
}
Results.append(Status);
}
else if (Action == m_pMenuRecover)

View File

@ -635,9 +635,10 @@ void CSettingsWindow::LoadSettings()
QTreeWidgetItem* pItem = new QTreeWidgetItem();
AddRunItem(NameCmd.first, NameCmd.second);
}
ui.cmbDefault->clear();
foreach(const CSandBoxPtr & pBox, theAPI->GetAllBoxes())
ui.cmbDefault->addItem(pBox->GetName().replace("_", ""), pBox->GetName());
ui.cmbDefault->addItem(pBox->GetName().replace("_", " "), pBox->GetName());
int pos = ui.cmbDefault->findData(theAPI->GetGlobalSettings()->GetText("DefaultBox", "DefaultBox"));
if(pos == -1)
pos = ui.cmbDefault->findData("DefaultBox");