Repeat last action when pressing "=" or Enter
ClosedPublic

Authored by mschiller on Apr 10 2018, 8:31 PM.

Details

Summary

This patch allows to press the equal sign again in order to repeat the last action again. For example "5+10" yields "15" on enter
and if you press enter or equal sign again it repeats the "+ 10" by showing you "25" now.

This behaivior is disabled by default and can be turned on in KCalc's settings panel under "Misc".

FEATURE: 108473

Diff Detail

Repository
R353 KCalc
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mschiller created this revision.Apr 10 2018, 8:31 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptApr 10 2018, 8:31 PM
mschiller requested review of this revision.Apr 10 2018, 8:31 PM
cfeck added a reviewer: teran.Apr 10 2018, 9:54 PM
cfeck added a subscriber: cfeck.

I like the idea. I remember calculators that enabled "repeated operations" automatically when the operation key was pressed twice (and cleared the mode when pressed again). A 'K' was displayed (whatever that meant) next to the memory indicator, whenever the repeated mode was activated.

What I am unsure about is the label of the checkbox. It could mention "Operation" instead of "Action", and the wording "Equal Press" sounds confusing due to word classes. My suggestion for the label would be something like "Repeat Operation for each Result". Maybe :)

The setting is not saved, is it? I guess users would expect any setting from the settings dialog to not be temporary, unlike maybe options that are toggled via the menus.

kcalc_core.cpp
846

Space before '{'

I've seen similiar things to the "K" indicator marker, might be useful to know whether you already pressed equal or not, so you don't mess up your result.

The settings should be saved on pressing Apply or Ok. I'm using the same KConfig (kcalc.kcfg) technique like the other settings and it seems persistent to me.

Like your suggestion of the label, will change that.

mschiller updated this revision to Diff 31854.Apr 11 2018, 8:21 AM

Changed the text label of the checkbox.

mschiller marked an inline comment as done.Apr 11 2018, 8:21 AM
cfeck added inline comments.Apr 11 2018, 10:48 AM
general.ui
199

I just checked the other labels, and we don't use Titlecase for checkbox labels, so it needs to be "Repeat operation for each result".

kcalc.kcfg
107

No dot at the end.

mschiller updated this revision to Diff 31869.Apr 11 2018, 10:58 AM
mschiller marked 2 inline comments as done.

Anyone knows an additional reviewer I could add to get this patch going?

cfeck added inline comments.Jun 29 2018, 5:41 PM
general.ui
199

Casing is still wrong.

mschiller updated this revision to Diff 36958.Jun 30 2018, 4:28 PM

actually change the titlecase issue

mschiller marked an inline comment as done.Jun 30 2018, 4:29 PM
cfeck accepted this revision.Aug 15 2018, 2:53 PM
This revision is now accepted and ready to land.Aug 15 2018, 2:53 PM
cfeck added a comment.Aug 15 2018, 2:59 PM

Maximilian, please state your mail address for proper attribution.

manimax3@hotmail.de

This revision was automatically updated to reflect the committed changes.

Thanks, committed.