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

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, ...@@ -536,17 +536,17 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
connect(stereoSettingsWidget_->stereoPhilips, SIGNAL(clicked()), connect(stereoSettingsWidget_->stereoPhilips, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings())); this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->focalDistance, SIGNAL(valueChanged(int)), connect(stereoSettingsWidget_->focalDistance, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings(int))); this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->eyeDistance, SIGNAL(editingFinished()), connect(stereoSettingsWidget_->eyeDistance, SIGNAL(editingFinished()),
this, SLOT(slotApplyStereoSettings())); this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerContentType, SIGNAL(currentIndexChanged(int)), connect(stereoSettingsWidget_->headerContentType, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int))); this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerFactor, SIGNAL(valueChanged(int)), connect(stereoSettingsWidget_->headerFactor, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings(int))); this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerOffsetCC, SIGNAL(valueChanged(int)), connect(stereoSettingsWidget_->headerOffsetCC, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings(int))); this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerSelect, SIGNAL(currentIndexChanged(int)), connect(stereoSettingsWidget_->headerSelect, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int))); this, SLOT(slotApplyStereoSettings(int)));
......
...@@ -347,6 +347,12 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) { ...@@ -347,6 +347,12 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) {
stereoSettingsWidget_->focalDistance->setValue(OpenFlipper::Options::focalDistance() * 1000); stereoSettingsWidget_->focalDistance->setValue(OpenFlipper::Options::focalDistance() * 1000);
// Philips stereo mode part // 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_->headerContentType->setCurrentIndex(OpenFlipper::Options::stereoPhilipsContent());
stereoSettingsWidget_->headerFactor->setValue(OpenFlipper::Options::stereoPhilipsFactor()); stereoSettingsWidget_->headerFactor->setValue(OpenFlipper::Options::stereoPhilipsFactor());
stereoSettingsWidget_->headerOffsetCC->setValue(OpenFlipper::Options::stereoPhilipsOffset()); stereoSettingsWidget_->headerOffsetCC->setValue(OpenFlipper::Options::stereoPhilipsOffset());
...@@ -354,11 +360,9 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) { ...@@ -354,11 +360,9 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) {
stereoSettingsWidget_->offsetCounter->setNum(OpenFlipper::Options::stereoPhilipsOffset()); stereoSettingsWidget_->offsetCounter->setNum(OpenFlipper::Options::stereoPhilipsOffset());
stereoSettingsWidget_->headerSelect->setCurrentIndex(OpenFlipper::Options::stereoPhilipsSelect()); stereoSettingsWidget_->headerSelect->setCurrentIndex(OpenFlipper::Options::stereoPhilipsSelect());
// // Default values are strange... // Unblock signals
// std::cerr << "Content type: " << OpenFlipper::Options::stereoPhilipsContent() << std::endl; stereoSettingsWidget_->headerContentType->blockSignals(false);
// std::cerr << "Factor: " << OpenFlipper::Options::stereoPhilipsFactor() << std::endl; stereoSettingsWidget_->headerSelect->blockSignals(false);
// std::cerr << "Offset: " << OpenFlipper::Options::stereoPhilipsOffset() << std::endl;
// std::cerr << "Select: " << OpenFlipper::Options::stereoPhilipsSelect() << std::endl;
// Show right stacked widget // Show right stacked widget
if (stereoSettingsWidget_->stereoPhilips->isChecked()) { if (stereoSettingsWidget_->stereoPhilips->isChecked()) {
......
...@@ -87,6 +87,11 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB ...@@ -87,6 +87,11 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
connect(stereoPhilips, SIGNAL(clicked()), connect(stereoPhilips, SIGNAL(clicked()),
this, SLOT(switchStackedWidget())); this, SLOT(switchStackedWidget()));
connect(headerFactor, SIGNAL(valueChanged(int)),
this, SLOT(updateSliderCounter(int)));
connect(headerOffsetCC, SIGNAL(valueChanged(int)),
this, SLOT(updateSliderCounter(int)));
uint mode = 2; uint mode = 2;
for (uint i=1; i < 22; i++) { for (uint i=1; i < 22; i++) {
std::vector< QString > dm = drawModeToDescriptions( mode ); std::vector< QString > dm = drawModeToDescriptions( mode );
...@@ -188,6 +193,12 @@ void OptionsWidget::switchStackedWidget() { ...@@ -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){ void OptionsWidget::updateViewerSettings(int _row){
updatingViewerSettings_ = true; updatingViewerSettings_ = true;
......
...@@ -112,6 +112,10 @@ private slots: ...@@ -112,6 +112,10 @@ private slots:
/// Switch between the stacked widgets of the stereo settings /// Switch between the stacked widgets of the stereo settings
void switchStackedWidget(); 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: protected:
void showEvent ( QShowEvent * event ); 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