Show menu bar, how to re-enable, common shortcut dialog
Needs ReviewPublic

Authored by lsartorelli on Nov 19 2018, 1:28 PM.

Details

Reviewers
ngraham
Group Reviewers
Frameworks
KDE Applications
Summary

Provide a common message ,encapsulated into the ShowMenuBarAction, with a reminder about how to re-enable the menu bar with a keyboard shortcut sequence.

The message dialog is optional by default and can be enabled if needed.

The message dialog pops up only after the menu bar become hided.

Diff Detail

Repository
R236 KWidgetsAddons
Lint
Lint Skipped
Unit
Unit Tests Skipped
lsartorelli created this revision.Nov 19 2018, 1:28 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 19 2018, 1:28 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
lsartorelli requested review of this revision.Nov 19 2018, 1:28 PM
broulik added inline comments.
src/ktoggleshowmenubaraction.cpp
27

What's this for?

src/ktoggleshowmenubaraction.h
50

I know we typically use window here for legacy reasons, but given there's QWindow in Qt 5, might be better to use widget for all of this now?
Just asking, you don't have to change this now, unless someone else comments :)

79

There's an extra empty line

lsartorelli marked 2 inline comments as done.Nov 19 2018, 1:51 PM
cfeck added a subscriber: cfeck.Nov 19 2018, 2:12 PM
cfeck added inline comments.
src/ktoggleshowmenubaraction.cpp
22

Do we still follow the rule "include own headers first"?

src/ktoggleshowmenubaraction.h
29

reminds

Additionally, "show back" does not sound like proper english, but I am not a native english speaker.

lsartorelli marked 2 inline comments as done.
lsartorelli added inline comments.Nov 19 2018, 2:36 PM
src/ktoggleshowmenubaraction.h
29

Unfortunately, me too, ... any suggestion is appreciated

ngraham added inline comments.Nov 19 2018, 3:29 PM
src/ktoggleshowmenubaraction.h
58

remainder -> reminder

65

show back the menu bar -> show the menu bar again

keyborad -> keyboard

lsartorelli marked 3 inline comments as done.
aacid added a subscriber: aacid.Nov 19 2018, 6:29 PM
aacid added inline comments.
src/ktoggleshowmenubaraction.cpp
78

If shortcut() returns a QKeySequence (i think it does), you want toString(NativeText)

Not a native speaker but i don't think "typing" is what you want, i'd say "pressing".

Also what if there's no shortcut?

lsartorelli marked an inline comment as done.Nov 20 2018, 11:15 AM
lsartorelli added inline comments.
src/ktoggleshowmenubaraction.cpp
78

Do you suggest to add a warning in case of no shortcut?
The only options I am thinking of are
to tell the user add the missing shortcut via system settings,
to tell the user to modify the config file for current app or
I don't know

aacid added inline comments.Nov 20 2018, 10:34 PM
src/ktoggleshowmenubaraction.cpp
22

This is marked as done, but it is not really done, is it? I still see KMessageBox as first include.

78

No strong opinion really, anyone else has an idea?

lsartorelli marked an inline comment as done.
lsartorelli marked an inline comment as done.

Even though a lot of inline comments have been marked as resolved, I don't actually see that the requested changes have been made.

Hi, you are right, I did not realize a bit of mess in between my revisions.

Now all the requests should have been fulfilled properly.

Thanks for this massive support and please, just let me know if I need to fix something else.

Looking better now. Do we really want to only optionally show the warning with a bool argument? In general bool arguments to functions are discouraged because they're not very readable. And if the whole point of this function is to always show a consistent message, don't we want it to always be shown when an app uses this function?

src/ktoggleshowmenubaraction.cpp
78

I would recommend telling the user how they can add one. Since a shortcut is set by default, only advanced users who change this would trigger that boundary condition anyway, and they'd read the warning and understand what's going on.

Usually the message should be always shown, but I think there there are some exceptions.

  • for Kate the message is supposed to be off till its code base is upgraded with the removal of ts own popup.
  • for dolphin the message should be shown only if the menu bar and the tool bar are hided at the same time. (in this case a better message could be shown)

the documentation is mising a @since 5.SOMETHING

Added @since and @author in the header documentation

Hi, I accidentally went by.
How about to add an icon to some (main) toolbar, if any is present?
That would the need to show such a message reduce to cases where no tool bar is available. If that icon was added, and not already there, could that pop up a small tool tip to get some attention.
A quick search here in my browser give no hit for "isVisible". There should be no need to show such message when the action is somewhere seen.

Sorry for the noise, if I should completely wrong :-)