Make requested changes

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2022-12-17 09:26:06 +00:00
parent ee003cd9ee
commit cbe5af235c
8 changed files with 27 additions and 27 deletions

View File

@ -64,13 +64,12 @@ QString GuiUtil::uploadPaste(const QString &name, const QString &text, QWidget *
baseUrl = pasteCustomAPIBaseSetting; baseUrl = pasteCustomAPIBaseSetting;
if (baseUrl.isValid()) { if (baseUrl.isValid()) {
auto response = CustomMessageBox::selectable(parentWidget, "Confirm Upload", auto response = CustomMessageBox::selectable(parentWidget, QObject::tr("Confirm Upload"),
QObject::tr("About to upload: %1\n" QObject::tr("About to upload: %1\n"
"Uploading to: %2\n" "Uploading to: %2\n"
"You should double-check for personal information.\n\n" "You should double-check for personal information.\n\n"
"Are you sure?") "Are you sure?")
.arg(name) .arg(name, baseUrl.host()),
.arg(baseUrl.host()),
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec(); ->exec();

View File

@ -2094,7 +2094,7 @@ void MainWindow::on_actionDeleteInstance_triggered()
auto id = m_selectedInstance->id(); auto id = m_selectedInstance->id();
auto response = CustomMessageBox::selectable(this, tr("CAREFUL!"), auto response = CustomMessageBox::selectable(this, tr("Confirm Deletion"),
tr("About to delete: %1\n" tr("About to delete: %1\n"
"This may be permanent and will completely delete the instance.\n\n" "This may be permanent and will completely delete the instance.\n\n"
"Are you sure?") "Are you sure?")

View File

@ -162,7 +162,7 @@ void ExternalResourcesPage::removeItem()
int count = 0; int count = 0;
bool folder = false; bool folder = false;
for (auto i : selection.indexes()) { for (auto& i : selection.indexes()) {
if (i.column() == 0) { if (i.column() == 0) {
count++; count++;
@ -172,23 +172,24 @@ void ExternalResourcesPage::removeItem()
} }
} }
bool enough = count > 1; QString text;
bool multiple = count > 1;
if (enough || folder) { if (multiple) {
QString text; text = tr("About to remove: %1 items\n"
if (enough) "This may be permanent and they will be gone from the folder.\n\n"
text = tr("About to remove: %1 items\n" "Are you sure?")
"This may be permanent and they will be gone from the folder.\n\n" .arg(count);
"Are you sure?") } else if (folder) {
.arg(count); text = tr("About to remove: %1 (folder)\n"
else "This may be permanent and it will be gone from the parent folder.\n\n"
text = tr("About to remove: %1 (folder)\n" "Are you sure?")
"This may be permanent and it will be gone from the parent folder.\n\n" .arg(m_model->at(selection.indexes().at(0).row()).fileinfo().fileName());
"Are you sure?") }
.arg(m_model->at(selection.indexes().at(0).row()).fileinfo().fileName());
auto response = CustomMessageBox::selectable(this, tr("CAREFUL!"), text, QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, if (!text.isEmpty()) {
QMessageBox::No) auto response = CustomMessageBox::selectable(this, tr("Confirm Removal"), text, QMessageBox::Warning,
QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec(); ->exec();
if (response != QMessageBox::Yes) if (response != QMessageBox::Yes)

View File

@ -220,7 +220,7 @@ void OtherLogsPage::on_btnDelete_clicked()
setControlsEnabled(false); setControlsEnabled(false);
return; return;
} }
if (QMessageBox::question(this, tr("CAREFUL!"), if (QMessageBox::question(this, tr("Confirm Deletion"),
tr("About to delete: %1\n" tr("About to delete: %1\n"
"This may be permanent and it will be gone from the logs folder.\n\n" "This may be permanent and it will be gone from the logs folder.\n\n"
"Are you sure?") "Are you sure?")
@ -252,7 +252,7 @@ void OtherLogsPage::on_btnClean_clicked()
return; return;
} }
QMessageBox *messageBox = new QMessageBox(this); QMessageBox *messageBox = new QMessageBox(this);
messageBox->setWindowTitle(tr("CAREFUL!")); messageBox->setWindowTitle(tr("Confirm Cleanup"));
if(toDelete.size() > 5) if(toDelete.size() > 5)
{ {
messageBox->setText(tr("Are you sure you want to delete all log files?")); messageBox->setText(tr("Are you sure you want to delete all log files?"));

View File

@ -526,7 +526,7 @@ void ScreenshotsPage::on_actionDelete_triggered()
.arg(count); .arg(count);
auto response = auto response =
CustomMessageBox::selectable(this, tr("CAREFUL!"), text, QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No)->exec(); CustomMessageBox::selectable(this, tr("Confirm Deletion"), text, QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No)->exec();
if (response != QMessageBox::Yes) if (response != QMessageBox::Yes)
return; return;

View File

@ -801,7 +801,7 @@ void ServersPage::on_actionAdd_triggered()
void ServersPage::on_actionRemove_triggered() void ServersPage::on_actionRemove_triggered()
{ {
auto response = CustomMessageBox::selectable(this, tr("CAREFUL!"), auto response = CustomMessageBox::selectable(this, tr("Confirm Removal"),
tr("About to remove: %1\n" tr("About to remove: %1\n"
"This is permanent and the server will be gone from your list forever (A LONG TIME).\n\n" "This is permanent and the server will be gone from your list forever (A LONG TIME).\n\n"
"Are you sure?") "Are you sure?")

View File

@ -326,7 +326,7 @@ void VersionPage::on_actionRemove_triggered()
auto component = m_profile->getComponent(index); auto component = m_profile->getComponent(index);
if (component->isCustom()) if (component->isCustom())
{ {
auto response = CustomMessageBox::selectable(this, tr("CAREFUL!"), auto response = CustomMessageBox::selectable(this, tr("Confirm Removal"),
tr("About to remove: %1\n" tr("About to remove: %1\n"
"This is permanent and will completely remove the custom component.\n\n" "This is permanent and will completely remove the custom component.\n\n"
"Are you sure?") "Are you sure?")
@ -725,7 +725,7 @@ void VersionPage::on_actionRevert_triggered()
} }
auto component = m_profile->getComponent(version); auto component = m_profile->getComponent(version);
auto response = CustomMessageBox::selectable(this, tr("CAREFUL!"), auto response = CustomMessageBox::selectable(this, tr("Confirm Reversion"),
tr("About to revert: %1\n" tr("About to revert: %1\n"
"This is permanent and will completely revert your customizations.\n\n" "This is permanent and will completely revert your customizations.\n\n"
"Are you sure?") "Are you sure?")

View File

@ -194,7 +194,7 @@ void WorldListPage::on_actionRemove_triggered()
if(!proxiedIndex.isValid()) if(!proxiedIndex.isValid())
return; return;
auto result = CustomMessageBox::selectable(this, tr("CAREFUL!"), auto result = CustomMessageBox::selectable(this, tr("Confirm Deletion"),
tr("About to delete: %1\n" tr("About to delete: %1\n"
"The world may be gone forever (A LONG TIME).\n\n" "The world may be gone forever (A LONG TIME).\n\n"
"Are you sure?") "Are you sure?")