Commit a8cc81b9 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use action texts for buttons of decision/confirmation dialogs

parent 01a94088
Pipeline #94385 passed with stage
in 13 minutes and 13 seconds
......@@ -133,13 +133,14 @@ void ShowArchiveStructureDialog::slotExtractFile()
if (!dir.isEmpty()) {
if (QFile(dir + QLatin1Char('/') + currentFile->name())
.exists()) {
if (KMessageBox::questionYesNo(
this,
i18n("Do you want to override %1?",
currentFile->name()),
i18n("File Already Exist")) == KMessageBox::No) {
return;
}
if (KMessageBox::questionYesNo(this,
i18n("Do you want to overwrite %1?", currentFile->name()),
i18n("File Already Exist"),
KStandardGuiItem::overwrite(),
KStandardGuiItem::cancel())
== KMessageBox::No) {
return;
}
}
if (!currentFile->copyTo(dir)) {
KMessageBox::error(this, i18n("Impossible to copy %1 in %2.",
......
......@@ -71,7 +71,12 @@ bool ImportExportProgressIndicatorGui::overwriteConfigMessageBox(const QString &
if (PimDataExportGlobalConfig::self()->alwaysOverrideFile()) {
return true;
}
return KMessageBox::warningYesNo(mParentWidget, i18n("\"%1\" already exists. Do you want to overwrite it?", configName), i18n("Restore")) == KMessageBox::Yes;
const int answer = KMessageBox::warningYesNo(mParentWidget,
i18n("\"%1\" already exists. Do you want to overwrite it?", configName),
i18n("Restore"),
KStandardGuiItem::overwrite(),
KStandardGuiItem::cancel());
return (answer == KMessageBox::Yes);
}
bool ImportExportProgressIndicatorGui::overwriteDirectoryMessageBox(const QString &directory) const
......@@ -79,7 +84,12 @@ bool ImportExportProgressIndicatorGui::overwriteDirectoryMessageBox(const QStrin
if (PimDataExportGlobalConfig::self()->alwaysOverrideDirectory()) {
return true;
}
return KMessageBox::warningYesNo(mParentWidget, i18n("Directory \"%1\" already exists. Do you want to overwrite it?", directory), i18n("Restore")) == KMessageBox::Yes;
const int answer = KMessageBox::warningYesNo(mParentWidget,
i18n("Directory \"%1\" already exists. Do you want to overwrite it?", directory),
i18n("Restore"),
KStandardGuiItem::overwrite(),
KStandardGuiItem::cancel());
return (answer == KMessageBox::Yes);
}
void ImportExportProgressIndicatorGui::showErrorMessage(const QString &message, const QString &title)
......
......@@ -22,10 +22,13 @@ PimDataBackupRestoreUI::~PimDataBackupRestoreUI()
bool PimDataBackupRestoreUI::continueToRestore()
{
if (KMessageBox::No
== KMessageBox::questionYesNo(mParentWidget,
i18n("The archive was created by a newer version of this program. It might contain additional data which will be skipped during import. Do you want to import it?"),
i18n("Not correct version"))) {
const int answer = KMessageBox::questionYesNo(mParentWidget,
i18n("The archive was created by a newer version of this program. It might contain additional data which "
"will be skipped during import. Do you want to import it?"),
i18n("Not correct version"),
KGuiItem(i18nc("@action:button", "Import"), QStringLiteral("document-import")),
KStandardGuiItem::cancel());
if (answer == KMessageBox::No) {
return false;
}
return true;
......
......@@ -351,11 +351,12 @@ void PimDataExporterWindow::slotRestoreData()
void PimDataExporterWindow::loadData(const QString &filename, const QString &templateFile)
{
if (KMessageBox::warningYesNo(
this,
i18n("Before restoring data you must close all kdepim applications. "
"Do you want to continue?"),
i18n("Backup")) == KMessageBox::No) {
const int answer = KMessageBox::warningYesNo(this,
i18n("Before restoring data you must close all kdepim applications. Do you want to continue?"),
i18n("Backup"),
KStandardGuiItem::cont(),
KStandardGuiItem::cancel());
if (answer == KMessageBox::No) {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment