Richard Heck wrote:
> Well, shoot. It's not working for me either, any more. Very strange
> this. 

It's not that strange. The clause where the slider is disabled is not 
necessarily called when the TOC is empty (only when the type list is empty, 
which doesn't happen for me, there's always the one type "toc").

> For what it's worth, I haven't been able to trigger the freeze if 
> I hide the slider altogether. Not that that's a solution. (Then again,
> maybe it is, if it works. We could always swap the slider for a combo
> box or something. 

Please no.

> Or if we're only getting the freeze when the TOC is 
> empty, go ahead and hide it.)
>
> By the way, look at TocWidget::setTocModel(). It enables depthSL no
> matter what. Shouldn't it be: depthSL->setEnabled(buttons_enabled)?
> Should reconnectSelectionModel() be called there if buttons_enabled =
> false? Unfortunately, changing the former by itself doesn't solve the
> problem.

But you were on the right track. The attached patch fixes the problem for me.
John, could you please verify that?

Jürgen
Index: src/frontends/qt4/TocWidget.C
===================================================================
--- src/frontends/qt4/TocWidget.C	(Revision 17834)
+++ src/frontends/qt4/TocWidget.C	(Arbeitskopie)
@@ -253,9 +253,11 @@
 	enableButtons(buttons_enabled);
 
 	reconnectSelectionModel();
-	depthSL->setEnabled(true);
-	depthSL->setMaximum(form_->getTocDepth(type));
-	depthSL->setValue(depth_);
+	if (buttons_enabled) {
+		depthSL->setEnabled(true);
+		depthSL->setMaximum(form_->getTocDepth(type));
+		depthSL->setValue(depth_);
+	}
 
 	LYXERR(Debug::GUI) << "In TocWidget::updateGui()" << endl;
 

Reply via email to