Correctly set i18n suffix in mousemark spinbox.
ClosedPublic

Authored by davidedmundson on Nov 1 2016, 9:19 PM.

Details

Summary

QSpinBox can't handle plural suffixes. Something previously done by
KIntSpinBox.

Using setSuffix(ki18np("pixel", "pixels")).toString() does nothing, as
at the time of conversion we don't know which one to use.

This patch uses KPluralHandlingSpinBox and correct ki18np.

Note, "new" dependency was already linked implicitly in other kwin, but we need to add it for this KCM.

Test Plan

Opened KCM (in English) set counter to 1 pixel and 2 pixels.
No longer had a big warning. Also appropriate number of s's appeared.

Diff Detail

Repository
R108 KWin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson retitled this revision from to Correctly set i18n suffix in mousemark spinbox..
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptNov 1 2016, 9:19 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
graesslin added inline comments.
CMakeLists.txt
79 ↗(On Diff #7806)

Please move down to the find_package section in line 84. It's a dependency only needed for a config module so it should be together with the other config modules.

effects/mousemark/mousemark_config.ui
9–10 ↗(On Diff #7806)

careful here: you opened the UI on a high DPI system and doubled the size.

davidedmundson marked 2 inline comments as done.Nov 2 2016, 11:22 AM
davidedmundson added inline comments.
effects/mousemark/mousemark_config.ui
9–10 ↗(On Diff #7806)

that's a good theory, but I should reply in case you worry about that being a continual problem.

It's not that, high DPI wouldn't have affected the user space value, I had just dragged the UI whilst editing.

Shouldn't make a difference due to the way the UI is loaded, but I've cut it out the diff to keep the diff clean.

davidedmundson marked an inline comment as done.

changes

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptNov 2 2016, 11:23 AM
graesslin accepted this revision.Nov 2 2016, 12:48 PM
graesslin added a reviewer: graesslin.
graesslin added inline comments.
effects/mousemark/mousemark_config.ui
9–10 ↗(On Diff #7806)

Hmm I had a case in the past where a UI loaded on a high-dpi system and then saved again had the size changed. So I assumed it was the same issue.

This revision is now accepted and ready to land.Nov 2 2016, 12:48 PM
This revision was automatically updated to reflect the committed changes.
shumski added a subscriber: shumski.Nov 4 2016, 6:44 AM
shumski added inline comments.
CMakeLists.txt
90 ↗(On Diff #7806)

Note, "new" dependency was already linked implicitly in other kwin, but we need to add it for this KCM.

For completeness sake, ktextwidgets devel files where not present in buildroot, before this patch, when building kwin. Of KF5, only kparts, khtml and kdelibs4support are publicly pulling in ktextwidgets.