Mercurial > hg > easyhg
comparison src/filestatuswidget.cpp @ 484:896b7903e8f2
Make "Show all files" persistent (fixing #203), and rationalise some config group names (noting that "General" is actually the default group "" as it appears in the config file, not the name of a group called "General": that appears as "%General")
author | Chris Cannam |
---|---|
date | Wed, 17 Aug 2011 16:09:04 +0100 |
parents | c6ea3eb00635 |
children | 7829da6abe97 |
comparison
equal
deleted
inserted
replaced
483:a582c6417004 | 484:896b7903e8f2 |
---|---|
155 layout->addItem(new QSpacerItem(8, 8), ++row, 0); | 155 layout->addItem(new QSpacerItem(8, 8), ++row, 0); |
156 | 156 |
157 m_showAllFiles = new QCheckBox(tr("Show all files"), this); | 157 m_showAllFiles = new QCheckBox(tr("Show all files"), this); |
158 m_showAllFiles->setEnabled(false); | 158 m_showAllFiles->setEnabled(false); |
159 layout->addWidget(m_showAllFiles, ++row, 0, Qt::AlignLeft); | 159 layout->addWidget(m_showAllFiles, ++row, 0, Qt::AlignLeft); |
160 | |
161 QSettings settings; | |
162 m_showAllFiles->setChecked(settings.value("showall", false).toBool()); | |
163 | |
160 connect(m_showAllFiles, SIGNAL(toggled(bool)), | 164 connect(m_showAllFiles, SIGNAL(toggled(bool)), |
161 this, SIGNAL(showAllChanged(bool))); | 165 this, SIGNAL(showAllChanged())); |
162 } | 166 } |
163 | 167 |
164 FileStatusWidget::~FileStatusWidget() | 168 FileStatusWidget::~FileStatusWidget() |
165 { | 169 { |
170 QSettings settings; | |
171 settings.setValue("showall", m_showAllFiles->isChecked()); | |
172 | |
166 delete m_dateReference; | 173 delete m_dateReference; |
174 } | |
175 | |
176 bool FileStatusWidget::shouldShowAll() const | |
177 { | |
178 return m_showAllFiles->isChecked(); | |
167 } | 179 } |
168 | 180 |
169 QString FileStatusWidget::labelFor(FileStates::State s, bool addHighlightExplanation) | 181 QString FileStatusWidget::labelFor(FileStates::State s, bool addHighlightExplanation) |
170 { | 182 { |
171 QSettings settings; | 183 QSettings settings; |