# HG changeset patch # User Chris Cannam # Date 1299865332 0 # Node ID f166f70c64f97ae783d99fdd531db5df78fb651b # Parent 6e1fdda1dff2991489c4a3ff8eac00e4f7fbc420 Make Add/Remove active only when Work tab is selected (again!) -- because they are the only selection-modal toolbar buttons now diff -r 6e1fdda1dff2 -r f166f70c64f9 hgtabwidget.cpp --- a/hgtabwidget.cpp Fri Mar 11 15:33:16 2011 +0000 +++ b/hgtabwidget.cpp Fri Mar 11 17:42:12 2011 +0000 @@ -163,6 +163,9 @@ bool HgTabWidget::canAdd() const { + // Permit this only when work tab is visible + if (currentIndex() != 0) return false; + QStringList addable = m_fileStatusWidget->getSelectedAddableFiles(); if (addable.empty()) return false; @@ -174,6 +177,9 @@ bool HgTabWidget::canRemove() const { + // Permit this only when work tab is visible + if (currentIndex() != 0) return false; + if (m_fileStatusWidget->getSelectedRemovableFiles().empty()) return false; if (!m_fileStatusWidget->getSelectedAddableFiles().empty()) return false; return true; diff -r 6e1fdda1dff2 -r f166f70c64f9 mainwindow.cpp --- a/mainwindow.cpp Fri Mar 11 15:33:16 2011 +0000 +++ b/mainwindow.cpp Fri Mar 11 17:42:12 2011 +0000 @@ -2221,6 +2221,9 @@ void MainWindow::connectTabsSignals() { + connect(m_hgTabs, SIGNAL(currentChanged(int)), + this, SLOT(enableDisableActions())); + connect(m_hgTabs, SIGNAL(commit()), this, SLOT(hgCommit()));