korgac: Save size and position on dialog hide/close and improve restore
ClosedPublic

Authored by dfries on Oct 16 2018, 4:10 AM.

Details

Summary

Instead of saving position sometimes (application close, suspend
reminder), save at each point the dialog hides, dismiss reminder,
dismiss all, escape or window close, etc.

In addition to saving the position, save the geometry to get the size
as well, that way if the user wants it bigger (or smaller) the only
have to do it once.

The logic was show, move, which would run in that order, the window
shows, then it moves to the correct location which looks bad, restore
the position & size, then show, so it appears in the final location.

BUG: 347486

Test Plan

A quicker way to test this is with a previous patch "Show Reminders" dock menu item option, as opposed to setting a bunch of reminders and waiting for them to go off.

before patch is applied/after patch is applied behaviors

  • move the Reminder window to a corner of the screen, show the Reminder window [ before/after it will appear at the same location]
  • move the Reminder window to a different corner, press escape, show the Reminder window [ before the escape position didn't save and it appears in the previous location, after it appears in the escape position]
  • make the Reminders window large, show Reminders window [ before/after it is the large size]
  • exit korgac, run korgac, show Reminders window [ before it is back to the previous normal size, after it is the larger size]

Diff Detail

Repository
R210 KOrganizer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfries created this revision.Oct 16 2018, 4:10 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptOct 16 2018, 4:10 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dfries requested review of this revision.Oct 16 2018, 4:10 AM
dfries edited the summary of this revision. (Show Details)
mlaurent requested changes to this revision.Oct 16 2018, 4:57 AM
mlaurent added inline comments.
korgac/alarmdialog.cpp
856

indent

This revision now requires changes to proceed.Oct 16 2018, 4:57 AM
dvratil requested changes to this revision.Oct 16 2018, 8:34 AM
dvratil added a subscriber: dvratil.
dvratil added inline comments.
korgac/alarmdialog.cpp
147

This is not compatible with the previous settings (because it was a QPoint) - you should probably continue reading Position as QPoint and add a new config entry instead called "Size" to read as QSize. You can then construct a QRect from QPoint and QSize. Remember to adjust saving the same way.

dfries marked 2 inline comments as done.Oct 17 2018, 4:15 AM

redoing patch

dfries updated this revision to Diff 43779.Oct 17 2018, 4:17 AM
dfries edited the summary of this revision. (Show Details)

Moved the resize() argument up to be the rectangle default size if the configuration file doesn't have one, in addition to the requested changes.

dvratil requested changes to this revision.Oct 17 2018, 8:19 AM

Minor nitpicks, otherwise looks good.

korgac/alarmdialog.cpp
148

const

152

Coding style: space after if

This revision now requires changes to proceed.Oct 17 2018, 8:19 AM
dfries updated this revision to Diff 43833.Oct 18 2018, 3:57 AM
dfries marked 2 inline comments as done.

added const, if<space>(

Seems ok for me now.

dvratil accepted this revision.Oct 19 2018, 11:45 AM
mlaurent accepted this revision.Oct 24 2018, 5:01 AM
This revision is now accepted and ready to land.Oct 24 2018, 5:01 AM

I'm seeing D16242, D16243, D16244, and this one D16245 are ready to land, can one of you two land these for me?

This revision was automatically updated to reflect the committed changes.