comparison main/PreferencesDialog.cpp @ 114:a46d68ae3c3e sv1-1.0pre1

* Make getPropertyRangeAndValue return the default separately from the current value. Previously some contexts were incorrectly treating the current value as a default.
author Chris Cannam
date Fri, 02 Mar 2007 14:00:12 +0000
parents f3516e520652
children c9930ec7a3f9
comparison
equal deleted inserted replaced
113:8a38b9aeba12 114:a46d68ae3c3e
47 47
48 // Create this first, as slots that get called from the ctor will 48 // Create this first, as slots that get called from the ctor will
49 // refer to it 49 // refer to it
50 m_applyButton = new QPushButton(tr("Apply")); 50 m_applyButton = new QPushButton(tr("Apply"));
51 51
52 int min, max, i; 52 int min, max, deflt, i;
53 53
54 m_windowType = WindowType(prefs->getPropertyRangeAndValue 54 m_windowType = WindowType(prefs->getPropertyRangeAndValue
55 ("Window Type", &min, &max)); 55 ("Window Type", &min, &max, &deflt));
56 m_windowTypeSelector = new WindowTypeSelector(m_windowType); 56 m_windowTypeSelector = new WindowTypeSelector(m_windowType);
57 57
58 connect(m_windowTypeSelector, SIGNAL(windowTypeChanged(WindowType)), 58 connect(m_windowTypeSelector, SIGNAL(windowTypeChanged(WindowType)),
59 this, SLOT(windowTypeChanged(WindowType))); 59 this, SLOT(windowTypeChanged(WindowType)));
60 60
65 65
66 connect(smoothing, SIGNAL(stateChanged(int)), 66 connect(smoothing, SIGNAL(stateChanged(int)),
67 this, SLOT(smoothSpectrogramChanged(int))); 67 this, SLOT(smoothSpectrogramChanged(int)));
68 68
69 QComboBox *propertyLayout = new QComboBox; 69 QComboBox *propertyLayout = new QComboBox;
70 int pl = prefs->getPropertyRangeAndValue("Property Box Layout", &min, &max); 70 int pl = prefs->getPropertyRangeAndValue("Property Box Layout", &min, &max,
71 &deflt);
71 m_propertyLayout = pl; 72 m_propertyLayout = pl;
72 73
73 for (i = min; i <= max; ++i) { 74 for (i = min; i <= max; ++i) {
74 propertyLayout->addItem(prefs->getPropertyValueLabel("Property Box Layout", i)); 75 propertyLayout->addItem(prefs->getPropertyValueLabel("Property Box Layout", i));
75 } 76 }
92 connect(frequency, SIGNAL(valueChanged(double)), 93 connect(frequency, SIGNAL(valueChanged(double)),
93 this, SLOT(tuningFrequencyChanged(double))); 94 this, SLOT(tuningFrequencyChanged(double)));
94 95
95 QComboBox *resampleQuality = new QComboBox; 96 QComboBox *resampleQuality = new QComboBox;
96 97
97 int rsq = prefs->getPropertyRangeAndValue("Resample Quality", &min, &max); 98 int rsq = prefs->getPropertyRangeAndValue("Resample Quality", &min, &max,
99 &deflt);
98 m_resampleQuality = rsq; 100 m_resampleQuality = rsq;
99 101
100 for (i = min; i <= max; ++i) { 102 for (i = min; i <= max; ++i) {
101 resampleQuality->addItem(prefs->getPropertyValueLabel("Resample Quality", i)); 103 resampleQuality->addItem(prefs->getPropertyValueLabel("Resample Quality", i));
102 } 104 }