[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Fri Jan 14 04:42:47 CET 2005
CVS commit by staikos:
pause updates while the data wizard is running to avoid an event storm
M +24 -28 datawizard.ui.h 1.108
--- kdeextragear-2/kst/kst/datawizard.ui.h #1.107:1.108
@@ -212,5 +212,5 @@ void DataWizard::showPage( QWidget *page
_psdAxisGroup->setEnabled(_radioButtonPlotDataPSD->isChecked() || _radioButtonPlotPSD->isChecked());
- // set window and plot defaults based on some guesses....
+ // set window and plot defaults based on some guesses.
if (_radioButtonPlotDataPSD->isChecked()) { // plotting both psds and XY plots
_newWindows->setEnabled(true);
@@ -401,7 +401,5 @@ void DataWizard::finished()
}
- //
- // check for sufficient memory...
- //
+ // check for sufficient memory
unsigned long memoryRequested = 0, memoryAvailable = 1024*1024*1024; // 1GB
unsigned long frames;
@@ -459,4 +457,10 @@ void DataWizard::finished()
accept();
+ // Pause updates to avoid event storms
+ bool wasPaused = app->paused();
+ if (!wasPaused) {
+ app->setPaused(true);
+ }
+
{
QListViewItemIterator it(_vectors);
@@ -473,11 +477,9 @@ void DataWizard::finished()
}
- n_steps += 1; // for the creation of the x-vector...
+ n_steps += 1; // for the creation of the x-vector
prg = 0;
app->slotUpdateProgress(n_steps, prg, i18n("Creating vectors..."));
- //
- // create the x-vector...
- //
+ // create the x-vector
KstVectorPtr xv = new KstRVector(ds, _xVector->currentText(),
name, _kstDataRange->CountFromEnd->isChecked() ? -1 : _kstDataRange->F0->value(),
@@ -488,7 +490,5 @@ void DataWizard::finished()
app->slotUpdateProgress(n_steps, ++prg, i18n("Creating vectors..."));
- //
- // create the y-vectors...
- //
+ // create the y-vectors
{
QListViewItemIterator it(_vectors);
@@ -518,7 +518,5 @@ void DataWizard::finished()
}
- //
- // get a pointer to the first window...
- //
+ // get a pointer to the first window
QString newName;
KstViewWindow *w;
@@ -536,10 +534,11 @@ void DataWizard::finished()
if (!w) {
+ if (!wasPaused) {
+ app->setPaused(false);
+ }
return;
}
- //
- // create the necessary plots...
- //
+ // create the necessary plots
app->slotUpdateProgress(n_steps, prg, i18n("Creating plots..."));
KstViewObjectList plots;
@@ -604,7 +603,5 @@ void DataWizard::finished()
}
- //
- // create the data curves...
- //
+ // create the data curves
app->slotUpdateProgress(n_steps, prg, i18n("Creating curves..."));
KstViewObjectList::Iterator pit = plots.begin();
@@ -638,5 +635,5 @@ void DataWizard::finished()
plot->addCurve(c);
}
- if (!_onePlot->isChecked()) { // change plots if we are not onePlot...
+ if (!_onePlot->isChecked()) { // change plots if we are not onePlot
if (_radioButtonPlotDataPSD->isChecked()) { // if xy and psd
++pit;
@@ -661,7 +658,5 @@ void DataWizard::finished()
}
- //
- // create the PSDs...
- //
+ // create the PSDs
if (_radioButtonPlotPSD->isChecked() || _radioButtonPlotDataPSD->isChecked()) {
KstVCurvePtr c;
@@ -720,5 +715,5 @@ void DataWizard::finished()
plot->addCurve(c.data());
plot->setLog(_psdLogX->isChecked(),_psdLogY->isChecked());
- if (!_onePlot->isChecked()) { // change plots if we are not onePlot...
+ if (!_onePlot->isChecked()) { // change plots if we are not onePlot
if (++pit == plots.end()) {
if (_radioButtonPlotDataPSD->isChecked()) { // if xy and psd
@@ -734,7 +729,5 @@ void DataWizard::finished()
}
- //
- // legends and labels...
- //
+ // legends and labels
bool xl = _xAxisLabels->isChecked();
bool yl = _yAxisLabels->isChecked();
@@ -782,4 +775,7 @@ void DataWizard::finished()
w->view()->paint(P_DATA);
app->slotUpdateProgress(0, 0, QString::null);
+ if (!wasPaused) {
+ app->setPaused(false);
+ }
}
More information about the Kst
mailing list