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

Mike Fenton mike at staikos.net
Thu Oct 25 20:49:39 CEST 2007


SVN commit 729346 by fenton:

Initial port of ChangeDataSampleDialog and update to load of
ChooseColorDialog.


 A             changedatasampledialog.cpp   [License: GPL (v2+)]
 A             changedatasampledialog.h   [License: GPL (v2+)]
 A             changedatasampledialog.ui  
 M  +5 -6      choosecolordialog.cpp  
 M  +1 -1      choosecolordialog.h  
 M  +3 -0      choosecolordialog.ui  
 M  +3 -0      libkstapp.pro  
 M  +12 -0     mainwindow.cpp  
 M  +3 -0      mainwindow.h  


--- branches/work/kst/portto4/kst/src/libkstapp/choosecolordialog.cpp #729345:729346
@@ -20,8 +20,10 @@
 
 ChooseColorDialog::ChooseColorDialog(QWidget *parent)
   : QDialog(parent) {
-   setupUi(this);
 
+  setupUi(this);
+  grid = 0;
+
 }
 
 
@@ -29,9 +31,9 @@
 }
 
 
-void ChooseColorDialog::show() {
+void ChooseColorDialog::exec() {
   updateColorGroup();
-  QDialog::show();
+  QDialog::exec();
 }
 
 
@@ -42,7 +44,6 @@
   // are not used by any curves or vectors
   DataVectorList vcList = ObjectSubList<Vector, DataVector>(vectorList);
 
-  // buildup a list of filenames
   QStringList fileNameList;
   for (DataVectorList::Iterator vc_iter = vcList.begin();
         vc_iter != vcList.end();
@@ -52,10 +53,8 @@
       fileNameList.push_back((*vc_iter)->filename());
   }
 
-  // cleanup the dialog
   cleanColorGroup();
 
-  // new grid
   grid = new QGridLayout(colorFrame, fileNameList.count(), 2, 0, 8);
   grid->setColumnStretch(1,0);
 
--- branches/work/kst/portto4/kst/src/libkstapp/choosecolordialog.h #729345:729346
@@ -30,7 +30,7 @@
     ChooseColorDialog(QWidget *parent);
     virtual ~ChooseColorDialog();
 
-    void show();
+    void exec();
 
   private:
     QGridLayout* grid;
--- branches/work/kst/portto4/kst/src/libkstapp/choosecolordialog.ui #729345:729346
@@ -116,6 +116,9 @@
         <property name="text" >
          <string>X Vector</string>
         </property>
+        <property name="checked" >
+         <bool>true</bool>
+        </property>
        </widget>
       </item>
       <item row="0" column="1" >
--- branches/work/kst/portto4/kst/src/libkstapp/libkstapp.pro #729345:729346
@@ -28,6 +28,7 @@
     boxitem.cpp \
     builtingraphics.cpp \
     cartesianrenderitem.cpp \
+    changedatasampledialog.cpp \
     choosecolordialog.cpp \
     csddialog.cpp \
     curvedialog.cpp \
@@ -107,6 +108,7 @@
     boxitem.h \
     builtingraphics.h \
     cartesianrenderitem.h \
+    changedatasampledialog.h \
     choosecolordialog.h \
     csddialog.h \
     curvedialog.h \
@@ -182,6 +184,7 @@
 FORMS += \
     aboutdialog.ui \
     basicplugintab.ui \
+    changedatasampledialog.ui \
     choosecolordialog.ui \
     csdtab.ui \
     curvetab.ui \
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #729345:729346
@@ -37,6 +37,7 @@
 #include "applicationsettingsdialog.h"
 #include "differentiatecurvesdialog.h"
 #include "choosecolordialog.h"
+#include "changedatasampledialog.h"
 
 #include <QtGui>
 
@@ -542,6 +543,11 @@
   _chooseColorDialogAct = new QAction(tr("Assign &Curve Color per File"), this);
   _chooseColorDialogAct->setStatusTip(tr("Show Kst's Choose Color Dialog"));
   connect(_chooseColorDialogAct, SIGNAL(triggered()), this, SLOT(showChooseColorDialog()));
+
+  _changeDataSampleDialogAct = new QAction(tr("Change Data Sample Range"), this);
+  _changeDataSampleDialogAct->setStatusTip(tr("Show Kst's Change Data Sample Range Dialog"));
+  connect(_changeDataSampleDialogAct, SIGNAL(triggered()), this, SLOT(showChangeDataSampleDialog()));
+
 }
 
 
@@ -589,6 +595,7 @@
   _layoutMenu->addAction(_createSvgAct);
 
   _toolsMenu = menuBar()->addMenu(tr("&Tools"));
+  _toolsMenu->addAction(_changeDataSampleDialogAct);
   _toolsMenu->addAction(_chooseColorDialogAct);
   _toolsMenu->addAction(_differentiateCurvesDialogAct);
 
@@ -737,7 +744,12 @@
 }
 
 
+void MainWindow::showChangeDataSampleDialog() {
+  ChangeDataSampleDialog changeDataSampleDialog(this);
+  changeDataSampleDialog.exec();
+}
 
+
 void MainWindow::readSettings() {
   QSettings settings;
   QPoint pos = settings.value("pos", QPoint(20, 20)).toPoint();
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.h #729345:729346
@@ -56,6 +56,7 @@
     void showSettingsDialog();
     void showDifferentiateCurvesDialog();
     void showChooseColorDialog();
+    void showChangeDataSampleDialog();
 
     void save();
     void saveAs();
@@ -165,6 +166,8 @@
 
     QAction *_differentiateCurvesDialogAct;
     QAction *_chooseColorDialogAct;
+    QAction *_changeDataSampleDialogAct;
+
 };
 
 }


More information about the Kst mailing list