Mercurial > hg > svgui
comparison view/View.cpp @ 1458:009f22e03bf6 single-point
Make it possible to disable cancel buttons
author | Chris Cannam |
---|---|
date | Thu, 16 May 2019 15:50:11 +0100 |
parents | 160e6d010141 |
children | 84c4ddb38415 |
comparison
equal
deleted
inserted
replaced
1457:160e6d010141 | 1458:009f22e03bf6 |
---|---|
1743 << "m_showProgress is off" << endl; | 1743 << "m_showProgress is off" << endl; |
1744 #endif | 1744 #endif |
1745 return; | 1745 return; |
1746 } | 1746 } |
1747 | 1747 |
1748 QSettings settings; | |
1749 settings.beginGroup("View"); | |
1750 bool showCancelButton = settings.value("showcancelbuttons", true).toBool(); | |
1751 settings.endGroup(); | |
1752 | |
1748 int ph = height(); | 1753 int ph = height(); |
1749 bool found = false; | 1754 bool found = false; |
1750 | 1755 |
1751 for (ProgressMap::iterator i = m_progressBars.begin(); | 1756 for (ProgressMap::iterator i = m_progressBars.begin(); |
1752 i != m_progressBars.end(); ++i) { | 1757 i != m_progressBars.end(); ++i) { |
1831 i->second.lastCheck = 0; | 1836 i->second.lastCheck = 0; |
1832 timer->setInterval(2000); | 1837 timer->setInterval(2000); |
1833 timer->start(); | 1838 timer->start(); |
1834 } | 1839 } |
1835 | 1840 |
1836 int scaled20 = scalePixelSize(20); | 1841 if (showCancelButton) { |
1837 | 1842 |
1838 cancel->move(0, ph - pb->height()/2 - scaled20/2); | 1843 int scaled20 = scalePixelSize(20); |
1839 cancel->show(); | 1844 |
1840 | 1845 cancel->move(0, ph - pb->height()/2 - scaled20/2); |
1841 pb->setValue(completion); | 1846 cancel->show(); |
1842 pb->move(scaled20, ph - pb->height()); | 1847 |
1848 pb->setValue(completion); | |
1849 pb->move(scaled20, ph - pb->height()); | |
1850 | |
1851 } else { | |
1852 | |
1853 cancel->hide(); | |
1854 | |
1855 pb->setValue(completion); | |
1856 pb->move(0, ph - pb->height()); | |
1857 } | |
1843 | 1858 |
1844 pb->show(); | 1859 pb->show(); |
1845 pb->update(); | 1860 pb->update(); |
1846 | 1861 |
1847 ph -= pb->height(); | 1862 ph -= pb->height(); |