* TocWidget.cpp: disable sort option for TOC (bug 5983).

* TocModel.cpp: whitespace

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30760 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2009-07-24 13:58:02 +00:00
parent a18d18fecb
commit 3ec9ac5ff5
2 changed files with 12 additions and 3 deletions

View File

@ -244,6 +244,7 @@ void TocWidget::on_sortCB_stateChanged(int state)
updateView();
}
void TocWidget::on_persistentCB_stateChanged(int state)
{
persistent_ = state == Qt::Checked;
@ -394,6 +395,13 @@ static bool canNavigate(QString const & type)
}
/// Test whether sorting is possible
static bool isSortable(QString const & type)
{
return type != "tableofcontents";
}
void TocWidget::updateView()
{
if (!gui_view_.view()) {
@ -408,7 +416,7 @@ void TocWidget::updateView()
depthSL->setEnabled(false);
return;
}
sortCB->setEnabled(true);
sortCB->setEnabled(isSortable(current_type_));
depthSL->setEnabled(true);
typeCO->setEnabled(true);
tocTV->setEnabled(false);
@ -423,7 +431,8 @@ void TocWidget::updateView()
}
sortCB->blockSignals(true);
sortCB->setChecked(gui_view_.tocModels().isSorted(current_type_));
sortCB->setChecked(isSortable(current_type_)
&& gui_view_.tocModels().isSorted(current_type_));
sortCB->blockSignals(false);