Commit 16cf9a3b authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Make overwrite confirmation look more like the Qt one

* Use same wording for question and caption.
* Show the file name without the full path.
* Use Overwrite and Cancel buttons.
* Flag as dangerous to make the Cancel button the default button.

GnuPG-bug-id: 6121
parent 6a79624c
Pipeline #213447 passed with stage
in 2 minutes and 29 seconds
......@@ -116,10 +116,15 @@ void GenRevokeCommand::doStart()
if (!mOutputFileName.endsWith(QLatin1String(".rev"))) {
mOutputFileName += QLatin1String(".rev");
}
if (QFileInfo(mOutputFileName).exists()) {
auto sel = KMessageBox::questionYesNo(d->parentWidgetOrView(), i18n("The file <b>%1</b> already exists.\n"
"Overwrite?", mOutputFileName),
i18n("Overwrite Existing File?"));
const QFileInfo fi{mOutputFileName};
if (fi.exists()) {
auto sel = KMessageBox::questionYesNo(d->parentWidgetOrView(),
xi18n("The file <filename>%1</filename> already exists. Do you wish to overwrite it?", fi.fileName()),
i18nc("@title:window", "Overwrite File?"),
KStandardGuiItem::overwrite(),
KStandardGuiItem::cancel(),
{},
KMessageBox::Notify|KMessageBox::Dangerous);
if (sel == KMessageBox::No) {
proposedFileName = mOutputFileName;
mOutputFileName.clear();
......
Supports Markdown
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