Added warning on mods update while running
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
a3445cbbdd
commit
890965746f
@ -460,9 +460,9 @@ bool ResourceFolderModel::setData(const QModelIndex& index, [[maybe_unused]] con
|
|||||||
if (role == Qt::CheckStateRole) {
|
if (role == Qt::CheckStateRole) {
|
||||||
if (m_instance != nullptr && m_instance->isRunning()) {
|
if (m_instance != nullptr && m_instance->isRunning()) {
|
||||||
auto response =
|
auto response =
|
||||||
CustomMessageBox::selectable(nullptr, "Confirm toggle",
|
CustomMessageBox::selectable(nullptr, tr("Confirm toggle"),
|
||||||
"If you enable/disable this resource while the game is running it may crash your game.\n"
|
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?",
|
"Are you sure you want to do this?"),
|
||||||
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
||||||
->exec();
|
->exec();
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ enum class ResourceProvider;
|
|||||||
|
|
||||||
class Mod;
|
class Mod;
|
||||||
class NetJob;
|
class NetJob;
|
||||||
class ModUpdateDialog;
|
|
||||||
|
|
||||||
class ChooseProviderDialog : public QDialog {
|
class ChooseProviderDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -252,9 +252,9 @@ void ExternalResourcesPage::removeItem()
|
|||||||
void ExternalResourcesPage::removeItems(const QItemSelection& selection)
|
void ExternalResourcesPage::removeItems(const QItemSelection& selection)
|
||||||
{
|
{
|
||||||
if (m_instance != nullptr && m_instance->isRunning()) {
|
if (m_instance != nullptr && m_instance->isRunning()) {
|
||||||
auto response = CustomMessageBox::selectable(this, "Confirm Delete",
|
auto response = CustomMessageBox::selectable(this, tr("Confirm Delete"),
|
||||||
"If you remove this resource while the game is running it may crash your game.\n"
|
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?",
|
"Are you sure you want to do this?"),
|
||||||
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
||||||
->exec();
|
->exec();
|
||||||
|
|
||||||
@ -273,9 +273,9 @@ void ExternalResourcesPage::enableItem()
|
|||||||
void ExternalResourcesPage::disableItem()
|
void ExternalResourcesPage::disableItem()
|
||||||
{
|
{
|
||||||
if (m_instance != nullptr && m_instance->isRunning()) {
|
if (m_instance != nullptr && m_instance->isRunning()) {
|
||||||
auto response = CustomMessageBox::selectable(this, "Confirm disable",
|
auto response = CustomMessageBox::selectable(this, tr("Confirm disable"),
|
||||||
"If you disable this resource while the game is running it may crash your game.\n"
|
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?",
|
"Are you sure you want to do this?"),
|
||||||
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
||||||
->exec();
|
->exec();
|
||||||
|
|
||||||
|
@ -150,9 +150,9 @@ bool ModFolderPage::onSelectionChanged(const QModelIndex& current, [[maybe_unuse
|
|||||||
void ModFolderPage::removeItems(const QItemSelection& selection)
|
void ModFolderPage::removeItems(const QItemSelection& selection)
|
||||||
{
|
{
|
||||||
if (m_instance != nullptr && m_instance->isRunning()) {
|
if (m_instance != nullptr && m_instance->isRunning()) {
|
||||||
auto response = CustomMessageBox::selectable(this, "Confirm Delete",
|
auto response = CustomMessageBox::selectable(this, tr("Confirm Delete"),
|
||||||
"If you remove mods while the game is running it may crash your game.\n"
|
tr("If you remove mods while the game is running it may crash your game.\n"
|
||||||
"Are you sure you want to do this?",
|
"Are you sure you want to do this?"),
|
||||||
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
|
||||||
->exec();
|
->exec();
|
||||||
|
|
||||||
@ -218,6 +218,17 @@ void ModFolderPage::updateMods()
|
|||||||
QMessageBox::critical(this, tr("Error"), tr("Mod updates are unavailable when metadata is disabled!"));
|
QMessageBox::critical(this, tr("Error"), tr("Mod updates are unavailable when metadata is disabled!"));
|
||||||
return;
|
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.\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 selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
|
||||||
|
|
||||||
auto mods_list = m_model->selectedMods(selection);
|
auto mods_list = m_model->selectedMods(selection);
|
||||||
|
Loading…
Reference in New Issue
Block a user