mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
* 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:
parent
a18d18fecb
commit
3ec9ac5ff5
@ -237,7 +237,7 @@ TocModels::TocModels()
|
||||
}
|
||||
|
||||
|
||||
void TocModels::clear()
|
||||
void TocModels::clear()
|
||||
{
|
||||
names_->blockSignals(true);
|
||||
names_->clear();
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user