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

Barth Netterfield netterfield at astro.utoronto.ca
Wed Nov 12 17:29:18 CET 2008


SVN commit 883304 by netterfield:

Update command line documentation.
Fix warning message in command line options
Auto layout should lay out in an sqrt(N) by sqrt(N) grid, 
not in a collumn.



 M             devel-docs/Kst2Specs/commandline.pdf  
 M             devel-docs/Kst2Specs/src/commandline.odt  
 M  +2 -4      src/libkstapp/commandlineparser.cpp  
 M  +0 -1      src/libkstapp/commandlineparser.h  
 M  +3 -0      src/libkstapp/viewitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/commandlineparser.cpp #883303:883304
@@ -38,7 +38,6 @@
 
   _fileNames.clear();
   _vectors.clear();
-  _plotNames.clear();
   _plotItems.clear();
 }
 
@@ -232,12 +231,11 @@
       cmd->createItem();
       _plotItem = static_cast<PlotItem*>(cmd->item());
       _plotItem->setName(QString("P-")+curve->Name());
+      _plotItem->parentView()->appendToLayout(CurvePlacement::Auto, _plotItem);
     }
     PlotRenderItem *renderItem = _plotItem->renderItem(PlotRenderItem::Cartesian);
     renderItem->addRelation(kst_cast<Relation>(curve));
     _plotItem->update();
-
-    _plotItem->parentView()->appendToLayout(CurvePlacement::Auto, _plotItem);
 }
 
 void CommandLineParser::createOrFindPlot( const QString plot_name ) {
@@ -260,8 +258,8 @@
       pi = static_cast<PlotItem*> ( cmd->item() );
 
       pi->setName ( plot_name );
-      _plotNames.append(plot_name);
       _plotItems.append(pi);
+      pi->parentView()->appendToLayout(CurvePlacement::Auto, pi);
     }
     _plotItem = pi;
 }
--- branches/work/kst/portto4/kst/src/libkstapp/commandlineparser.h #883303:883304
@@ -50,7 +50,6 @@
   
   // lists of command line named plot items (and their names).
   QList<PlotItem*> _plotItems;
-  QStringList _plotNames;
 
   DataVectorList _vectors;
 
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #883303:883304
@@ -1887,6 +1887,9 @@
       viewItems.append(item);
       appendRequired = false;
     }
+    if (layout == CurvePlacement::Auto) {
+      columns = (int)sqrt((double)viewItems.count()+1);
+    }
 
     Grid *grid = Grid::buildGrid(viewItems, columns);
     Q_ASSERT(grid);


More information about the Kst mailing list