[rkward-devel] limiting onscreen graphics history

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Jul 5 17:03:05 UTC 2010


Hi,

On Monday 05 July 2010, Prasenjit Kapat wrote:
> 2. What to do when the max history length (or size) is reduced from
> the settings, while there is an existing history? What I mean to say
> is this: suppose L = 10 is set in the settings. Let H = length of the
> current recorded history. Suppose H = 8. Now suppose the user decides
> to reduce L to 5 in the settings. So, there are 3 extra plots in the
> history. Two ways out:
> 
> 2a. Do nothing (which is the status quo). In this case, there is a
> warning displayed in R (not in KDE) and no new plot is added the
> history.
> 
> 2b. Pop out the first 3 plots, so that H = 5 and then any new plot can
> be added the usual way (pop the first and push the last)
> 
> Do you think 2b is a better solution than 2a? Opinions? I (think, I)
> have all the necessary code in place to implement 2b, so it should be
> relatively easy.

I think 2b is the only sound solution, after all, if no new plots can get 
added, that's a bit pointless.

> There is a similar situation if 's' is reduced below max (all
> individual recorded plot sizes). So, popping plots out of history in
> this case would almost reduce to the case 5 above; which I'm not too
> comfortable with it.

I suggest to ignore this case. Users are not going to switch these limits back 
and forth all the time, and if they have acute memory issues, they can simply 
clear the entire history.

Keeping the code simple is an important consideration, too, and at this point 
I don't think adding a lot of complexity is worth the trouble.
 
> In any case, it would be nice to show a KMessageBox warning (instead
> of / along with, the warning in R) from KDE in both these situations.
> This would require R to send the value to H back to C++ whenever the
> length of history changes - which is already being by
> updateDeviceHistory. Can it be accessed from the
> rksettingsmoduleouput?

How about this (could cover the case of reduced 's', too, if you think it's 
important enough): When the limit is decreased:
0) Accept the setting, i.e. reduce the limit.
1) Check whether the history will need to be reduced. If so:
2) Notify the user that the history will be trimmed. This *could* include the 
question, whether to trim the history at once, or to delay that until the next 
plot is added. In either case the notification will come from R, and be all R 
code (i.e. do not make the C++ more complex). 

2 can be done today using readline(). I always intented to add something like 
rk.ask.yesnocancel (question="Go for it?", label.yes=NA, label.no=NA, 
label.cancel=NA) to have a simple generic way to display a messagebox from R 
code. This will be relatively easy to do, so you can assume it will be done 
before the release (and nag me about it, if necessary).

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20100705/b3965218/attachment.sig>


More information about the Rkward-devel mailing list