# HG changeset patch # User Chris Cannam # Date 1483456526 0 # Node ID f5c828d1f3e2ca85c4a0f7e2a71d0fe4303354f3 # Parent f5180edc5dda6cdb319dbd1de2fa06353454a2fc Store/recall colours by hex name; simpler and more general (was having trouble with reloading on Mac). Also update subrepos inc PortAudio build diff -r f5180edc5dda -r f5c828d1f3e2 .hgsubstate --- a/.hgsubstate Tue Jan 03 14:34:46 2017 +0000 +++ b/.hgsubstate Tue Jan 03 15:15:26 2017 +0000 @@ -6,8 +6,8 @@ 3768bdde6fdf866aa63fff5bde8d9fa64a8979ef dataquay 7d46098431f39c265e47254e420576559587b3fe icons/scalable 3257ddb6fff110cc88f3ffeaeefa0f29d5eb3b6f piper-cpp -284acf908dcd9f5bdaf805a7f5aeaac1764b4604 sv-dependency-builds +af97cad61ff0a443cdf4a33a4ac867431dadaaae sv-dependency-builds 022d6a9e6d75f77a693d31765faead2e578cf014 svapp 47768571681e9ef5a14dbfd066b7a1510580c53e svcore -67f437277069ed83664691fc179421fdbfe9ad70 svgui +f91cf4a60ad6034030a35e6fd74eba4b76b9cf1f svgui 0eebd22a081a824067bf3d5de65326696feab653 vamp-plugin-sdk diff -r f5180edc5dda -r f5c828d1f3e2 main/MainWindow.cpp --- a/main/MainWindow.cpp Tue Jan 03 14:34:46 2017 +0000 +++ b/main/MainWindow.cpp Tue Jan 03 15:15:26 2017 +0000 @@ -3587,9 +3587,9 @@ defaultColourName = tr("Bright Green"); } ColourDatabase *cdb = ColourDatabase::getInstance(); - QColor colour = - ((settings.value("overview-colour", cdb->getColour(defaultColourName))) - .value()); + QColor colour = QColor + (settings.value("overview-colour", + cdb->getColour(defaultColourName).name()).toString()); settings.endGroup(); int index = cdb->getColourIndex(colour); diff -r f5180edc5dda -r f5c828d1f3e2 main/PreferencesDialog.cpp --- a/main/PreferencesDialog.cpp Tue Jan 03 14:34:46 2017 +0000 +++ b/main/PreferencesDialog.cpp Tue Jan 03 15:15:26 2017 +0000 @@ -148,10 +148,14 @@ int(ColourMapper::Sunset)).toInt()); m_colour3DColour = (settings.value("colour-3d-plot-colour", int(ColourMapper::Green)).toInt()); - m_overviewColour = - (settings.value("overview-colour", - ColourDatabase::getInstance()->getColour(tr("Green")))) - .value(); + m_overviewColour = ColourDatabase::getInstance()->getColour(tr("Green")); + if (settings.contains("overview-colour")) { + QString qcolorName = + settings.value("overview-colour", m_overviewColour.name()) + .toString(); + m_overviewColour.setNamedColor(qcolorName); + cerr << "loaded colour " << m_overviewColour.name() << " from settings" << endl; + } settings.endGroup(); ColourMapComboBox *spectrogramGColour = new ColourMapComboBox(true); @@ -167,6 +171,7 @@ ColourComboBox *overviewColour = new ColourComboBox(false); int overviewColourIndex = ColourDatabase::getInstance()->getColourIndex(m_overviewColour); + cerr << "index = " << overviewColourIndex << " for colour " << m_overviewColour.name() << endl; if (overviewColourIndex >= 0) { overviewColour->setCurrentIndex(overviewColourIndex); } @@ -976,7 +981,7 @@ settings.setValue("spectrogram-colour", m_spectrogramGColour); settings.setValue("spectrogram-melodic-colour", m_spectrogramMColour); settings.setValue("colour-3d-plot-colour", m_colour3DColour); - settings.setValue("overview-colour", m_overviewColour); + settings.setValue("overview-colour", m_overviewColour.name()); settings.endGroup(); settings.beginGroup("MainWindow");