[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Mon May 17 18:31:05 CEST 2004
CVS commit by arwalker:
Put the generated fit in the same window as the original curve.
M +5 -1 kst2dplot.cpp 1.18
M +3 -2 kstfitdialog_i.cpp 1.5
M +2 -1 kstfitdialog_i.h 1.4
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.17:1.18
@@ -1649,7 +1649,11 @@ void Kst2DPlot::editCurve( int id )
void Kst2DPlot::fitCurve( int id )
{
+ KstApp *app = KstApp::inst();
KstBaseCurvePtr curve;
QString strCurve;
+ QString strWindow;
+ KMdiChildView* c = app->activeWindow();
+ strWindow = c->caption();
if( _pMenuFitCurve ) {
strCurve = _pMenuFitCurve->text( id );
@@ -1657,5 +1661,5 @@ void Kst2DPlot::fitCurve( int id )
if (Curves.findTag(strCurve) != Curves.end()) {
curve = *(Curves.findTag(strCurve));
- KstFitDialogI::globalInstance()->setCurve(curve->tagName(),tagName());
+ KstFitDialogI::globalInstance()->setCurve(curve->tagName(),tagName(),strWindow);
KstFitDialogI::globalInstance()->show_I();
}
--- kdeextragear-2/kst/kst/kstfitdialog_i.cpp #1.4:1.5
@@ -106,8 +106,9 @@ void KstFitDialogI::show_I(const QString
-void KstFitDialogI::setCurve(const QString& strCurve, const QString& strPlotName) {
+void KstFitDialogI::setCurve(const QString& strCurve, const QString& strPlotName, const QString& strWindow) {
KstVCurvePtr curve;
KstVCurveList curves = kstObjectSubList<KstDataObject, KstVCurve>(KST::dataObjectList);
+ _strWindow = strWindow;
_strPlotName = strPlotName;
_strCurve = strCurve;
@@ -451,5 +452,5 @@ void KstFitDialogI::createCurve(KstPlugi
Kst2DPlotPtr plot;
- KstViewWindow *w = dynamic_cast<KstViewWindow*>(KstApp::inst()->findWindow("Untitled")); // ***
+ KstViewWindow *w = dynamic_cast<KstViewWindow*>(KstApp::inst()->findWindow(_strWindow));
if (w) {
if( w->view()->findChild(_strPlotName) ) {
--- kdeextragear-2/kst/kst/kstfitdialog_i.h #1.3:1.4
@@ -36,5 +36,5 @@ public slots:
void update(int new_index = -1);
void updatePlugin(int new_index = -1);
- void setCurve(const QString& strCurve, const QString& strPlotName);
+ void setCurve(const QString& strCurve, const QString& strPlotName, const QString& strWindow);
/** Calls update(), then shows/raises the dialog */
@@ -62,4 +62,5 @@ private:
QString _yvector;
QString _evector;
+ QString _strWindow;
QString _strPlotName;
QString _strCurve;
More information about the Kst
mailing list