Bug 424658

Summary: KStandardGuiItem::yes() and KStandardGuiItem::no() display pointless tooltips that mirror the buttons' visible text
Product: [Frameworks and Libraries] frameworks-kwidgetsaddons Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: Christoph Feck <cfeck>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs, nate
Priority: NOR    
Version: 5.80.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.82
Sentry Crash Report:
Attachments: screen recording

Description Patrick Silva 2020-07-25 15:37:03 UTC
Created attachment 130395 [details]
screen recording

SUMMARY
The labels and tooltips of the buttons are the same.
Watch the attached screen recording please.

EXPECTED RESULT
no tooltip

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.73.0
Qt Version: 5.14.2
Comment 1 Christoph Feck 2020-08-17 18:27:16 UTC
The buttons should also use verbs instead of yes/no.
Comment 2 Nate Graham 2021-04-01 19:03:17 UTC
This is a standard KMessageBox::questionYesNo() with no fancy additions; moving to kwidgetsaddons.

Code is:

void Klipper::slotAskClearHistory()
{
    int clearHist = KMessageBox::questionYesNo(nullptr,
                                               i18n("Really delete entire clipboard history?"),
                                               i18n("Delete clipboard history?"),
                                               KStandardGuiItem::yes(),
                                               KStandardGuiItem::no(),
                                               QStringLiteral("really_clear_history"),
                                               KMessageBox::Dangerous);
    if (clearHist == KMessageBox::Yes) {
        history()->slotClear();
        saveHistory();
    }
}
Comment 3 Bug Janitor Service 2021-04-01 19:08:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/63
Comment 4 Nate Graham 2021-04-05 13:25:21 UTC
Git commit eeadf4513d30b35484728de15e878a8f96d1c7f1 by Nate Graham.
Committed on 05/04/2021 at 13:25.
Pushed by ngraham into branch 'master'.

Remove pointless tooltip for yes and no KStandardGuiItems

These buttons have tooltips with the exact same text that is shown on
them, which is pointless.

If this is not a mistake, I suspect that logic is that the application
might override the text in a way that's unclear to the user, so the
tooltip could provide clarity. However this too is false: in such a
situation, the words "yes" and "no" cannot be guaranteed to map to
clearly identifiable actions, so showing these tooltips would only muddy
the situation even further.

Let's trust application developers to write good text if they override
the default text, and remove these tooltips.
FIXED-IN: 5.81

M  +2    -2    src/kstandardguiitem.cpp

https://invent.kde.org/frameworks/kwidgetsaddons/commit/eeadf4513d30b35484728de15e878a8f96d1c7f1