Merge pull request #1852 from Trial97/war_ning

This commit is contained in:
Sefa Eyeoglu 2023-11-23 11:01:53 +01:00 committed by GitHub
commit a966289944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 12 deletions

View File

@ -461,9 +461,9 @@ bool ResourceFolderModel::setData(const QModelIndex& index, [[maybe_unused]] con
if (role == Qt::CheckStateRole) {
if (m_instance != nullptr && m_instance->isRunning()) {
auto response =
CustomMessageBox::selectable(nullptr, "Confirm toggle",
"If you enable/disable this resource while the game is running it may crash your game.\n"
"Are you sure you want to do this?",
CustomMessageBox::selectable(nullptr, tr("Confirm toggle"),
tr("If you enable/disable this resource while the game is running it may crash your game.\n"
"Are you sure you want to do this?"),
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();

View File

@ -254,9 +254,9 @@ void ExternalResourcesPage::removeItem()
void ExternalResourcesPage::removeItems(const QItemSelection& selection)
{
if (m_instance != nullptr && m_instance->isRunning()) {
auto response = CustomMessageBox::selectable(this, "Confirm Delete",
"If you remove this resource while the game is running it may crash your game.\n"
"Are you sure you want to do this?",
auto response = CustomMessageBox::selectable(this, tr("Confirm Delete"),
tr("If you remove this resource while the game is running it may crash your game.\n"
"Are you sure you want to do this?"),
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();
@ -275,9 +275,9 @@ void ExternalResourcesPage::enableItem()
void ExternalResourcesPage::disableItem()
{
if (m_instance != nullptr && m_instance->isRunning()) {
auto response = CustomMessageBox::selectable(this, "Confirm disable",
"If you disable this resource while the game is running it may crash your game.\n"
"Are you sure you want to do this?",
auto response = CustomMessageBox::selectable(this, tr("Confirm disable"),
tr("If you disable this resource while the game is running it may crash your game.\n"
"Are you sure you want to do this?"),
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();

View File

@ -171,9 +171,9 @@ bool ModFolderPage::onSelectionChanged(const QModelIndex& current, [[maybe_unuse
void ModFolderPage::removeItems(const QItemSelection& selection)
{
if (m_instance != nullptr && m_instance->isRunning()) {
auto response = CustomMessageBox::selectable(this, "Confirm Delete",
"If you remove mods while the game is running it may crash your game.\n"
"Are you sure you want to do this?",
auto response = CustomMessageBox::selectable(this, tr("Confirm Delete"),
tr("If you remove mods while the game is running it may crash your game.\n"
"Are you sure you want to do this?"),
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();
@ -239,6 +239,18 @@ void ModFolderPage::updateMods(bool includeDeps)
QMessageBox::critical(this, tr("Error"), tr("Mod updates are unavailable when metadata is disabled!"));
return;
}
if (m_instance != nullptr && m_instance->isRunning()) {
auto response =
CustomMessageBox::selectable(this, tr("Confirm Update"),
tr("If you update mods while the game is running may cause mod duplication and game crashes.\n"
"The old files may not be deleted as they are in use.\n"
"Are you sure you want to do this?"),
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();
if (response != QMessageBox::Yes)
return;
}
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
auto mods_list = m_model->selectedMods(selection);