comparison hgtabwidget.cpp @ 327:f166f70c64f9 filelist_right_button_menu

Make Add/Remove active only when Work tab is selected (again!) -- because they are the only selection-modal toolbar buttons now
author Chris Cannam
date Fri, 11 Mar 2011 17:42:12 +0000
parents 6e1fdda1dff2
children 4cd753e083cc
comparison
equal deleted inserted replaced
326:6e1fdda1dff2 327:f166f70c64f9
161 return true; 161 return true;
162 } 162 }
163 163
164 bool HgTabWidget::canAdd() const 164 bool HgTabWidget::canAdd() const
165 { 165 {
166 // Permit this only when work tab is visible
167 if (currentIndex() != 0) return false;
168
166 QStringList addable = m_fileStatusWidget->getSelectedAddableFiles(); 169 QStringList addable = m_fileStatusWidget->getSelectedAddableFiles();
167 if (addable.empty()) return false; 170 if (addable.empty()) return false;
168 171
169 QStringList removable = m_fileStatusWidget->getSelectedRemovableFiles(); 172 QStringList removable = m_fileStatusWidget->getSelectedRemovableFiles();
170 if (!removable.empty()) return false; 173 if (!removable.empty()) return false;
172 return true; 175 return true;
173 } 176 }
174 177
175 bool HgTabWidget::canRemove() const 178 bool HgTabWidget::canRemove() const
176 { 179 {
180 // Permit this only when work tab is visible
181 if (currentIndex() != 0) return false;
182
177 if (m_fileStatusWidget->getSelectedRemovableFiles().empty()) return false; 183 if (m_fileStatusWidget->getSelectedRemovableFiles().empty()) return false;
178 if (!m_fileStatusWidget->getSelectedAddableFiles().empty()) return false; 184 if (!m_fileStatusWidget->getSelectedAddableFiles().empty()) return false;
179 return true; 185 return true;
180 } 186 }
181 187