[Kst] branches/work/kst/portto4/kst/src/libkstapp

Barth Netterfield netterfield at astro.utoronto.ca
Mon Apr 11 15:45:06 CEST 2011


SVN commit 1227655 by netterfield:

Use a more sensible default for cleanup layout->custom.



 M  +3 -1      view.cpp  
 M  +4 -1      viewitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/view.cpp #1227654:1227655
@@ -24,6 +24,7 @@
 #include "plotitemmanager.h"
 #include "plotitem.h"
 #include "dialogdefaults.h"
+#include "datacollection.h"
 
 #include <math.h>
 
@@ -342,8 +343,9 @@
 
 void View::createCustomLayout() {
   bool ok;
+  int default_cols = qMax(1,int(sqrt(Data::self()->plotList().count())));
   int columns = QInputDialog::getInteger(this, tr("Kst"),
-                                      tr("Select Number of Columns"),1, 0,
+                                      tr("Select Number of Columns"),default_cols, 0,
                                       10, 1, &ok);
   if (ok) {
     createLayout(columns);
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #1227654:1227655
@@ -17,6 +17,7 @@
 #include "plotitem.h"
 #include "plotitemmanager.h"
 #include "document.h"
+#include "datacollection.h"
 
 #include "layoutboxitem.h"
 
@@ -812,9 +813,11 @@
 
 void ViewItem::createCustomLayout() {
   bool ok;
+  int default_cols = qMax(1,int(sqrt(Data::self()->plotList().count())));
   int columns = QInputDialog::getInteger(view(), tr("Kst"),
-                                      tr("Select Number of Columns"),1, 0,
+                                      tr("Select Number of Columns"),default_cols, 0,
                                       10, 1, &ok);
+
   if (ok) {
     if (parentViewItem()) {
       LayoutCommand *layout = new LayoutCommand(parentViewItem());


More information about the Kst mailing list