Remove "Remember last used Save mode" checkbox
ClosedPublic

Authored by rominf on Feb 21 2018, 1:03 PM.

Details

Summary

Per Nate Graham: "This UI control is a relic from a prior version of spectacle when the "Save" split button's menu was full of items. Now, it only has two, and this setting is checked by default. The use case for turning it off is pretty difficult to envision now. Therefore, in the interest of de-cluttering, let's remove it."

BUG: 390809

Before:

After:

Test Plan
  1. Select Save button.
  2. Close Spectacle.
  3. Open Spectacle.
  4. Save is active.
  5. Select Save As.
  6. Close Spectacle.
  7. Open Spectacle.
  8. Save As is active.

Diff Detail

Repository
R166 Spectacle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rominf requested review of this revision.Feb 21 2018, 1:03 PM
rominf created this revision.
rominf added a project: Spectacle.
rominf added a subscriber: rkflx.
rkflx added a comment.Feb 21 2018, 2:04 PM

Thanks for the patch (again!) ;)

As you've picked a junior job item, the actual code change is not that difficult, but let's first work on the commit message a bit. Please read https://community.kde.org/Infrastructure/Phabricator#Formatting_your_patch, and adapt your summary accordingly. https://bugs.kde.org/show_bug.cgi?id=390793#c1 and https://bugs.kde.org/show_bug.cgi?id=390809#c0 contain a bit of a rationale which would be good to have in the commit message too.

Let us know if you have any questions…

Also, try to look at Spectacle's help and see if you'd need to adapt doc/index.docbook too.

rominf edited the summary of this revision. (Show Details)Feb 21 2018, 3:28 PM
rominf added a reviewer: ngraham.
rominf added a subscriber: ngraham.
ngraham requested changes to this revision.EditedFeb 21 2018, 3:31 PM

Migrating my comment from D10718, since I saw that one before this one. We'll use your patch, since you got in first. :)

Thanks! Great second patch. There's even more code clean-up we can do here, though. For example:

$ grep -ri UseDynamicSaveButton .
./src/SpectacleConfig.cpp:bool SpectacleConfig::useDynamicSaveButton() const
./src/SpectacleConfig.cpp:void SpectacleConfig::setUseDynamicSaveButton(bool enabled)
./src/SpectacleConfig.h:    bool useDynamicSaveButton() const;
./src/SpectacleConfig.h:    void setUseDynamicSaveButton(bool enabled);
Binary file ./src/spectacle matches
./src/Gui/KSMainWindow.cpp:    return cfgManager->useDynamicSaveButton() ? cfgManager->lastUsedSaveMode() : SaveMode::SaveAs;

You can also get rid of QCheckBox *mUseLastSaveAction; on generalOptionsPage.h

In the end, KSMainWindow::saveButtonMode() will be simplified, and always return the last used save mode.

Also, make sure you test the upgrade test case:

  • Use Spectacle 17.12.x
  • Build and deploy Spectacle from git master
  • Make sure the save button behaves as expected
This revision now requires changes to proceed.Feb 21 2018, 3:31 PM
rominf updated this revision to Diff 27696.Feb 21 2018, 3:31 PM

Remove "Remember last used Save mode" checkbox

Feel free to use my screenshots in D10718 if you'd like. :)

Also, please mention your testing process in the Test Plan section, and be sure to add the Spectacle group in the future.

rominf edited the summary of this revision. (Show Details)Feb 21 2018, 3:53 PM
rominf edited the test plan for this revision. (Show Details)

Is it OK now?

Much better! Still needs a few things:

  • Actual testing steps listed in the Test Plan section, not just a listing of your test config
  • We can still remove more code. See D10711#210888. We can get rid of every usage of UseDynamicSaveButton and a checkbox in generalOptionsPage.h, and finally simplify KSMainWindow::saveButtonMode()
rominf updated this revision to Diff 27755.Feb 22 2018, 7:56 AM

Updating D10711: Remove "Remember last used Save mode" checkbox

rominf edited the test plan for this revision. (Show Details)Feb 22 2018, 8:01 AM
rkflx requested changes to this revision.Feb 22 2018, 1:36 PM

You are making progress ;)

doc/index.docbook
116

Remove mention here too, please.

src/Gui/KSMainWindow.cpp
113–114

Could be simplified even more:

SpectacleConfig::instance()->lastUsedSaveMode()

At this point the whole function is kinda pointless, so let's just remove it and add a direct call to the two switches.

This revision now requires changes to proceed.Feb 22 2018, 1:36 PM
rominf updated this revision to Diff 27784.Feb 22 2018, 1:45 PM
rominf edited the test plan for this revision. (Show Details)
  • Remove saveButtonMode
rominf marked 2 inline comments as done.Feb 22 2018, 1:46 PM
rkflx accepted this revision.Feb 22 2018, 4:51 PM
rkflx edited the test plan for this revision. (Show Details)

Yay, that's it!

rkflx added a comment.Feb 22 2018, 4:53 PM

@ngraham Green light? (You are still blocking Phab.)

ngraham accepted this revision.Feb 22 2018, 5:05 PM

Looks perfect now! Landing it on master.

This revision is now accepted and ready to land.Feb 22 2018, 5:05 PM
This revision was automatically updated to reflect the committed changes.