Commit 50cd36f7 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov Committed by Mikhail Svechnikov
Browse files

gradient and interpolation are not stored in QSettings anymore

parent e0b1a4db
......@@ -66,7 +66,6 @@ void IntensityDataCanvas::setItem(SessionItem* intensityItem)
SessionItemWidget::setItem(intensityItem);
m_colorMap->setItem(intensityDataItem());
applyPersistentSettings();
if (!m_rotateDataAction)
initRotation();
}
......@@ -106,12 +105,6 @@ void IntensityDataCanvas::onMousePress(QMouseEvent* event)
emit customContextMenuRequested(event->globalPos());
}
void IntensityDataCanvas::subscribeToItem()
{
intensityDataItem()->mapper()->setOnPropertyChange(
[this](const QString& name) { onPropertyChanged(name); }, this);
}
void IntensityDataCanvas::rotateData()
{
auto* realDataItem = dynamic_cast<RealDataItem*>(intensityDataItem()->parentItem());
......@@ -169,38 +162,3 @@ void IntensityDataCanvas::initRotation()
connect(m_rotateDataAction, &QAction::triggered, this, &IntensityDataCanvas::rotateData);
}
}
//! Reads gradient/ interpolation settings from IntensityDataItem and writes to persistant
//! project settings.
void IntensityDataCanvas::onPropertyChanged(const QString& name)
{
// if (IntensityDataItem::isGradientPropertyName(name)) {
// QSettings settings;
// settings.setValue(SettingsKeyGradient, intensityDataItem()->getGradientValue());
// } else if (IntensityDataItem::isInterpolatedPropertyName(name)) {
// QSettings settings;
// settings.setValue(SettingsKeyInterpolation, intensityDataItem()->isInterpolated());
// }
}
//! Apply persistent settings (gradient, interpolation) to IntensityDataItem.
void IntensityDataCanvas::applyPersistentSettings()
{
// QSettings settings;
// if (settings.contains(SettingsKeyGradient)) {
// ComboProperty combo = intensityDataItem()->getGradient();
// QString persistentGradient = settings.value(SettingsKeyGradient).toString();
// if (combo.getValue() != persistentGradient) {
// combo.setValue(persistentGradient);
// intensityDataItem()->setGradient(combo);
// }
// }
// if (settings.contains(SettingsKeyInterpolation)) {
// bool value = settings.value(SettingsKeyInterpolation).toBool();
// intensityDataItem()->setInterpolated(value);
// }
}
......@@ -45,15 +45,12 @@ public slots:
void onMousePress(QMouseEvent* event);
protected:
void subscribeToItem() override;
void rotateData();
private:
IntensityDataItem* intensityDataItem();
void initActions();
void initRotation();
void onPropertyChanged(const QString& name);
void applyPersistentSettings();
ColorMapCanvas* m_colorMap;
QAction* m_resetViewAction;
......
......@@ -159,7 +159,7 @@ void IntensityDataPropertyWidget::setItem(QVector<IntensityDataItem*> itemsVec)
#else
FOR_EACH_ITEM
connect(item, &IntensityDataItem::axesUnitsChanged, this, [=](){
connect(item, &IntensityDataItem::axesUnitsChanged, this, [=]() {
if(jobItem()) {
item->blockSignals(true);
item->updateCoords(jobItem()->instrumentItem());
......
Supports Markdown
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