This overhauls the kill prompt UI to make it more modern and more
easily to grasp.
* Reduce the amount of text and redundancy.
Give the window a title and drop the "app is not responding" heading.
Try to remove the application name from the displayed window title.
Also use the bold emphasis used in other places like deleting files.
* Use the application icon if available with a warning overlay.
This makes it easier to grasp which application it's talking about.
* Move technical information (like PID and hostname) into an
expandable "Details" section.
KGuiAddons has been implicitly pulled in by KConfigWidgets already.
wilder/Plasma/6.2
Kai Uwe Broulik2 years agocommitted byVlad Zahorodnii
// Drop redundant application name, cf. QXcbWindow::setWindowTitle.
constQStringtitleSeparator=QString::fromUtf8("\xe2\x80\x94");// // U+2014, EM DASH
caption.remove(titleSeparator+appname);
caption.remove(QStringLiteral(" – ")+appname);// EN dash (Firefox)
caption.remove(QStringLiteral(" - ")+appname);// classic minus :-)
caption=caption.toHtmlEscaped();
caption=caption.toHtmlEscaped();
appname=appname.toHtmlEscaped();
appname=appname.toHtmlEscaped();
hostname=hostname.toHtmlEscaped();
hostname=hostname.toHtmlEscaped();
QStringpidString=QString::number(pid);// format pid ourself as it does not make sense to format an ID according to locale settings
QStringpidString=QString::number(pid);// format pid ourself as it does not make sense to format an ID according to locale settings
QStringquestion=i18nc("@info","<b>Application \"%1\" is not responding</b>",appname);
QStringquestion=(caption==appname)?xi18nc("@info","<para><application>%1</application> is not responding. Do you want to terminate this application?</para>",
question+=isLocal
appname)
?xi18nc("@info","<para>You tried to close window \"%1\" from application \"%2\" (Process ID: %3) but the application is not responding.</para>",
:xi18nc("@info \"window title\" of application name is not responding.","<para>\"%1\" of <application>%2</application> is not responding. Do you want to terminate this application?</para>",
caption,appname,pidString)
caption,appname);
:xi18nc("@info","<para>You tried to close window \"%1\" from application \"%2\" (Process ID: %3), running on host \"%4\", but the application is not responding.</para>",
caption,appname,pidString,hostname);
question+=xi18nc("@info",
question+=xi18nc("@info",
"<para>Do you want to terminate this application?</para>"
"<para><emphasis strong='true'>Terminating this application will close all of its windows. Any unsaved data will be lost.</emphasis></para>");
"<para><warning>Terminating the application will close all of its child windows. Any unsaved data will be lost.</warning></para>");