Bug 140625

Summary: New plot is created in non-intuitive location
Product: [Applications] kst Reporter: Andrew Walker <arwalker>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: JPG image of result of creating new plot

Description Andrew Walker 2007-01-25 22:54:23 UTC
Version:           HEAD (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:
When a new plot is created it is not added to the end of the already existing plots, which would seem to be the intuitive place for it.

STEPS TO REPRODUCE:
Start Kst
Using the data wizard create 4 plots arranged in a single window on a 2x2 grid
Select the Plots... New Plot... menu item

RESULTS:
The new plot is added to a newly created row in the middle of the window

EXPECTED RESULTS:
The new plot is added to a newly created row at the bottom of the window
Comment 1 Nicolas Brisset 2007-01-29 09:10:32 UTC
I agree that this is quite annoying...
Comment 2 Andrew Walker 2007-02-12 22:58:12 UTC
This problem is caused by a shortcoming in KstViewObject::cleanup(...) which by default prefers to place new plots at the left-middle of a window.
Comment 3 Andrew Walker 2007-04-04 21:05:22 UTC
Created attachment 20179 [details]
JPG image of result of creating new plot

The new (empty) plot position is shown.
Comment 4 Andrew Walker 2007-05-07 22:48:17 UTC
Barth, was there any particular reason for placing new plots in the left-middle of a window?
Comment 5 Andrew Walker 2007-06-07 23:05:07 UTC
There are at least three scenarios when regriding will occur:

* the plots are laid out randomly and the user wishes them placed on a grid
* the plots are already laid out on a grid and the user wishes to change the number of columns
* the user creates a new plot when existing plots are laid out randomly
* the user creates a new plot when existing plots are already laid out on a grid

Under each of these four scenarios the user will probably expect something different to be done. At present the code only handles the first case well. The expected responses are outline below:

* plots move to their closest grid location. Unassigned plots are added to holes - the existing behaviour
* the plot sequence is retained reading left to right and top to bottom. This operation is reversible.
* the new plot is added to some arbitrary location
* the plot sequence is retained reading left to right and top to bottom. The new plot(s) are added to the end of the sequence.
Comment 6 Andrew Walker 2007-09-11 20:32:32 UTC
A simple approach would be to pass a list of the newly created plots to the cleanup(...) routine. This can be used to distinguish between the case where the user has requested a regrid operation (there are no plots in the newly created plot list), plots have been added to a window, and plots have been added to a new window.
Comment 7 Andrew Walker 2007-09-11 23:47:01 UTC
SVN commit 711269 by arwalker:

BUG:140625 If the plots are already arranged on a grid then retain the natural order and add new plots to a logical location

 M  +3 -7      kstcsddialog_i.cpp  
 M  +1 -5      kstcurvedialog_i.cpp  
 M  +2 -2      kstdatawizard_i.cpp  
 M  +3 -7      ksteqdialog_i.cpp  
 M  +3 -7      ksthsdialog_i.cpp  
 M  +3 -7      kstimagedialog_i.cpp  
 M  +1 -5      kstpsddialog_i.cpp  
 M  +4 -9      ksttoplevelview.cpp  
 M  +1 -5      ksttoplevelview.h  
 M  +173 -131  kstviewobject.cpp  
 M  +3 -2      kstviewobject.h  
 M  +3 -7      kstvvdialog_i.cpp