Commit 8dfc98a1 authored by Mike Kremer's avatar Mike Kremer

Corrected crossing of signals that caused early saving of uninitialized values.

Added update of counter labels when moving the philips stereo settings sliders
in options widget. Now everything works fine.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7571 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fd4e2463
......@@ -536,17 +536,17 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
connect(stereoSettingsWidget_->stereoPhilips, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->focalDistance, SIGNAL(valueChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->focalDistance, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->eyeDistance, SIGNAL(editingFinished()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerContentType, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerFactor, SIGNAL(valueChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerOffsetCC, SIGNAL(valueChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerFactor, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerOffsetCC, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerSelect, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
......
......@@ -347,6 +347,12 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) {
stereoSettingsWidget_->focalDistance->setValue(OpenFlipper::Options::focalDistance() * 1000);
// Philips stereo mode part
// Block signals such that slotApplyStereoSettings
// won't be called when setting the initial values here...
stereoSettingsWidget_->headerContentType->blockSignals(true);
stereoSettingsWidget_->headerSelect->blockSignals(true);
stereoSettingsWidget_->headerContentType->setCurrentIndex(OpenFlipper::Options::stereoPhilipsContent());
stereoSettingsWidget_->headerFactor->setValue(OpenFlipper::Options::stereoPhilipsFactor());
stereoSettingsWidget_->headerOffsetCC->setValue(OpenFlipper::Options::stereoPhilipsOffset());
......@@ -354,11 +360,9 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) {
stereoSettingsWidget_->offsetCounter->setNum(OpenFlipper::Options::stereoPhilipsOffset());
stereoSettingsWidget_->headerSelect->setCurrentIndex(OpenFlipper::Options::stereoPhilipsSelect());
// // Default values are strange...
// std::cerr << "Content type: " << OpenFlipper::Options::stereoPhilipsContent() << std::endl;
// std::cerr << "Factor: " << OpenFlipper::Options::stereoPhilipsFactor() << std::endl;
// std::cerr << "Offset: " << OpenFlipper::Options::stereoPhilipsOffset() << std::endl;
// std::cerr << "Select: " << OpenFlipper::Options::stereoPhilipsSelect() << std::endl;
// Unblock signals
stereoSettingsWidget_->headerContentType->blockSignals(false);
stereoSettingsWidget_->headerSelect->blockSignals(false);
// Show right stacked widget
if (stereoSettingsWidget_->stereoPhilips->isChecked()) {
......
......@@ -87,6 +87,11 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
connect(stereoPhilips, SIGNAL(clicked()),
this, SLOT(switchStackedWidget()));
connect(headerFactor, SIGNAL(valueChanged(int)),
this, SLOT(updateSliderCounter(int)));
connect(headerOffsetCC, SIGNAL(valueChanged(int)),
this, SLOT(updateSliderCounter(int)));
uint mode = 2;
for (uint i=1; i < 22; i++) {
std::vector< QString > dm = drawModeToDescriptions( mode );
......@@ -188,6 +193,12 @@ void OptionsWidget::switchStackedWidget() {
}
}
void OptionsWidget::updateSliderCounter(int /*_tmpParam*/) {
// Update labels that display the current values
factorCounter->setNum(headerFactor->value());
offsetCounter->setNum(headerOffsetCC->value());
}
void OptionsWidget::updateViewerSettings(int _row){
updatingViewerSettings_ = true;
......
......@@ -112,6 +112,10 @@ private slots:
/// Switch between the stacked widgets of the stereo settings
void switchStackedWidget();
/// Update the labels that show th current values of the sliders
/// Note: The parameter just makes sure the signal and slot can be connected
void updateSliderCounter(int _tmpParam);
protected:
void showEvent ( QShowEvent * event );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment