Bug 389691 - Ambiguous shortcut warning when pressing Ctrl+Q, Ctrl+S or Ctrl+Shift+S
Summary: Ambiguous shortcut warning when pressing Ctrl+Q, Ctrl+S or Ctrl+Shift+S
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 17.12.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-31 14:07 UTC by null
Modified: 2018-02-14 22:39 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description null 2018-01-31 14:07:42 UTC
Ctrl+Q should quit Spectacle instead of presenting said warning and doing nothing, same thing for saving (as) with Ctrl+S (Ctrl+Shift+S).

I haven't looked too much into it, but it seems this also depends on whether you freshly started Spectacle or already saved something. Basically, Spectacle should always behave sane instead of only sometimes.

See also Bug 362061 and Bug 388592, but respecting the standard shortcuts would be fine for a start.
Comment 1 Kitsuna 2018-01-31 22:56:36 UTC
Confirmed using Plasma 5.11.5 Framework 5.42.0 Spectacle 17.12.1

Pressing Ctrl+Q without saving a file first results in expected outcome of the program closing. Saving an image first and then pressing Ctrl+Q results in the warning about ambiguous shortcuts and results in no action. I was not however able to reproduce this for Ctrl+S or Ctrl+Shift+S
Comment 2 null 2018-01-31 23:05:14 UTC
Thanks for testing. I guess you'd have to enable "Remember last used save mode" in the settings.

You are right: The first (or second, if the last used mode was different from save) Ctrl+S brings Spectacle in a bad state, after which a subsequent Ctrl+Q or Ctrl+S does not work anymore.

Same thing for pressing two/three times Ctrl+Shift+S.
Comment 3 Nate Graham 2018-02-10 15:39:26 UTC
I've submitted a patch that happens to fix this: https://phabricator.kde.org/D10301
Comment 4 null 2018-02-11 20:06:38 UTC
I have a patch which solves this for real ;) It's buried in a dependency chain, so bear with me…
Comment 5 null 2018-02-14 22:39:59 UTC
Git commit 3f9e76afb161d00880f4200d8059ec47375467ca by Henrik Fehlauer.
Committed on 14/02/2018 at 22:38.
Pushed by rkflx into branch 'master'.

Fix ambiguous shortcut warning when pressing save shortcuts

Summary:
When {nav Remember last used save mode} is enabled, pressing
{key Ctrl S} or {key Ctrl Shift S} repeatedly would result in a
ambiguous shortcut warning dialog.

This is because on every save the action was re-added to the dropdown
button, resulting in multiple shortcuts. It should be enough to set the
actions once, and then only swap the default action.

Depends on D10468
Ref T7841

Test Plan:
Press {key Ctrl S} twice, no warning dialog is shown anymore.
Both {nav Save} options still work as before and the last-used button is
set as the default.

Reviewers: #spectacle, ngraham

Reviewed By: #spectacle, ngraham

Subscribers: ngraham

Maniphest Tasks: T7841

Differential Revision: https://phabricator.kde.org/D10469

M  +14   -17   src/Gui/KSMainWindow.cpp
M  +3    -1    src/Gui/KSMainWindow.h

https://commits.kde.org/spectacle/3f9e76afb161d00880f4200d8059ec47375467ca