Make "Save As" the default save mode
ClosedPublic

Authored by ngraham on Jan 31 2018, 4:26 AM.

Details

Summary

BUG: 389614

Yet more anecdotal evidence from bug triaging suggests that many would prefer "Save As" to be the default save mode in Spectacle. This patch accomplishes that.

I am planning a larger rewrite of the buttons sometime in the coming weeks that should hopefully end squabbles over button settings, but until then, I believe this will be a welcome improvement.

Test Plan

Tested in KDE Neon

  • Removed ~/.config/spectaclerc; "Save As" is now the default save mode
  • Clicked "Save As" button: correct save operation is performed; button stays in "Save As" mode
  • Changed the button to other save modes; same thing
  • Quit Spectacle and re-opened when the button was in each save mode; it opened in the correct mode

Diff Detail

Repository
R166 Spectacle
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham requested review of this revision.Jan 31 2018, 4:26 AM
ngraham created this revision.
ngraham edited the summary of this revision. (Show Details)Jan 31 2018, 4:26 AM
ngraham edited the test plan for this revision. (Show Details)
rkron accepted this revision.Jan 31 2018, 1:35 PM

Looks good.

This revision is now accepted and ready to land.Jan 31 2018, 1:35 PM
ngraham closed this revision.Jan 31 2018, 2:00 PM
rkflx added a comment.Jan 31 2018, 2:04 PM

Good job. Extensive smartphone users used to not being prompted for a filename might be a bit annoyed by this, but unless autosave is rolled out for all of our software I'd value consistency higher.

Code LGTM.

Did you check whether we'd need any docbook alterations? I think we'll do because the default behaviour is explained quite prominently. (Sadly this would need to be changed again with a bigger rewrite, but IMO half-finished patches are to be avoided if we want to keep the quality up. You could also wait whether the bigger rewrite makes it in time for 18.04, but please don't leave it hanging in the end.)

src/Gui/KSMainWindow.cpp
204

By renumbering you'll switch around modes even for users who explicitly chose something else and made it stick. Unfortunately, Spectacle saves the last mode even if it is the default (other apps don't do that), so changing defaults means either users losing their changes or users who started Spectacle at least once not getting the new default. I guess your approach is the lesser evil, but it's not ideal indeed.

326

@rkron Looking at how ints are used here instead of enums hurts so much. It's an opportunity for some refactoring, getting to know Spectacle's codebase a bit… ;)

rkflx added a comment.Jan 31 2018, 2:10 PM

Regarding my comment in D10153#197608 and your bigger rewrite plans, let's discuss this in T7841.