Commit Graph

43 Commits

Author SHA1 Message Date
Abdelrazak Younes
2a3f27a80c Code simplification.
TocTypeModel is not needed outside TocModel.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33707 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-10 21:00:34 +00:00
Richard Heck
0bddd759d7 Another try at #6522. This works here, for the most part, with no ill
effects that I can see. That said, I believe there is still a crash you
could get. I'll explain in a moment.

Since we may run into this kind of thing again, let me explain why this
is necessary. The problem was that resetting the model was causing a
signal to be emitted that the current index had changed, which was
triggering an update of the Buffer, eventually. I'm not sure why this
did not happen in Qt 4.5, but in Qt 4.6, you have to call
beginResetModel() before doing anything, so that the combo box will
remember its previous setting. Then you can change the data; then you
can call endResetModel(). This will attempt to restore the previous
setting. Only if it cannot do so will currentIndexChanged() be emitted.

You can see, therefore, that if whatever the user did caused the current
setting to become invalid---e.g., she deleted the only footnote---then
the signal will be emitted and LyX will still crash. Still, that is a
fair bit better than presently.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33702 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-10 18:41:28 +00:00
Richard Heck
c653974e9d Revert r33630 and do something more sensible.
I don't think this fixes the underlying problem, but I think that
problem is very extensive. Fixing it would involve a re-thinking of
where and how we call updateBuffer()---the old updateLabels().

This fix also reveals another problem with the TOC, again due to the
early call of on_typeCO_currentIndexChanged(). But that problem is a
slightly different one, I think.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33680 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-08 19:52:48 +00:00
Richard Heck
1fcc1c0f18 Fix bug 6522 and its relatives in trunk. I am not absolutely sure this
is right, though. Someone please check.

The problem, in branch, was that (in Qt 4.6.x, anyway) the call to
reset() eventually triggers the on_typeCO_currentIndexChanged() method,
which eventually leads to GuiView::setFocus(), which leads to
GuiWorkArea::focusInEvent(), which tries to start the cursor, whose
position hasn't been updated yet, from what I can see.

The problem in trunk is similar. The crash happens, I think, because,
while we are in the middle of resetting the model, the same method is
triggered, which leads us to try to access the model while we are in the
middle of resetting it.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33630 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-05 20:47:50 +00:00
Abdelrazak Younes
377cdd5f6c Transfer LyXfunc code to GuiApplication::dispatch() and getStatus(). Now
a lot of simplification is possible. Except some instability period...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33389 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-09 16:11:13 +00:00
Jürgen Spitzmüller
3ec9ac5ff5 * 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
2009-07-24 13:58:02 +00:00
Uwe Stöhr
8f3acbb484 remove unused includes of convert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29772 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-21 21:02:14 +00:00
Vincent van Ravesteijn
695870771f Add "Copy label as reference" to context menu of the TOC.
(Note: it is not perfect yet for references in the same model as the labels).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29156 a592a061-630c-0410-9148-cb99ea01b6c8
2009-04-08 21:40:42 +00:00
André Pönitz
1fc477efac thrid attempt at changing the naming pattern of the intermediated 'mocced' files
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27420 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 14:28:50 +00:00
Abdelrazak Younes
7bd33462a0 Avoid a complete Toc reset in case when only a toc item update is needed.
* Buffer: new updateTocItem() signal (with Delegates and GuiView associates).
* TocBackend: take care of the signal emission instead of the Cursor::checkBufferStructure()
* TocModel: new updateTocItem() method.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26636 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-30 09:50:54 +00:00
Abdelrazak Younes
6bd9b43ce5 cosmetics and doxygen.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26634 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-30 07:38:34 +00:00
André Pönitz
0985bab38e cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26629 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-29 21:53:24 +00:00
Abdelrazak Younes
4b8f0d359c Add a new 'Sort' box to the Navigator so that each list can be optionally sorted.
* TocModel: redesign so that sorted list are available.
* TocWidget/TocUi: handle the new Sort check box.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26602 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-28 17:14:29 +00:00
Richard Heck
bb11f79ca0 I need some sleep.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26358 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-11 21:35:26 +00:00
Richard Heck
7380e914d4 Fix bug: TOC depth slider wasn't reset when switching to empty documents.
This doubly fixes the previous bug, too.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26357 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-11 21:15:45 +00:00
Richard Heck
e2b8ea875d Fix bug reported by Helge. Vincent found the problem, really, which was a
pair of uninitialized variables. The reason the crash doesn't happen when 
you open the User Guide is that they get set in TocModel::populate() before 
the slider's maximum value is fixed. It was setting that value to some huge
number that caused the problem.

I've added an assertion to make sure we don't run into this kind of problem
again. Probably not necessary, but it can't hurt.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26356 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-11 21:02:18 +00:00
Abdelrazak Younes
bd569ada80 Local aware sorting of the toc type.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25304 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-18 11:35:24 +00:00
Abdelrazak Younes
6ad1b1cd09 General cleanup of the Outline/Navigator:
- Make use the Qt Model/View separation concept, TocWidget is now really just a view of the current toc model.
- the toc type combo now use a model defined in TocModels.
- the models are not deleted at each reset, they are now just cleared out.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25289 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-17 15:10:03 +00:00
Abdelrazak Younes
d353a6f899 Mac compile fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25241 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-12 17:34:01 +00:00
Abdelrazak Younes
825bac4b43 Fix crash on new document.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25237 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-12 15:43:31 +00:00
Abdelrazak Younes
edd117f27a remove unneeded TocModel::clear() method.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25236 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-12 15:34:12 +00:00
Abdelrazak Younes
6876ffa65b Simplify TocModel by using UserRole data.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25235 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-12 15:31:10 +00:00
Abdelrazak Younes
2003a50e14 Fix http://bugzilla.lyx.org/show_bug.cgi?id=4904
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25070 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-02 13:59:00 +00:00
Abdelrazak Younes
fb212b9112 Factorize out some code between TocModel.cpp and Menus.cpp.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24801 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-16 13:49:49 +00:00
Abdelrazak Younes
fb31797d13 reverse Toc searching: use DocIterator instead of ParconsIterator.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24800 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-16 13:11:43 +00:00
Abdelrazak Younes
2dfc84a22c More accurate toc navigation (LFUN_PARAGRAPH_GOTO).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24798 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-16 12:48:13 +00:00
Abdelrazak Younes
ffa722e0b7 Cleanup Toc dialog and GuiView interaction. The toc models are now part of GuiView. The TocWidget is just a view of this model.
* GuiView::tocModel(): new method to access the toc models.
* TocModels: new class with code transferred from GuiToc.
* TocWidget: only needs a TocModels reference.

Thoughts:
- We should find a way to get rid of GuiToc.{c,h}
- tocModels() should perhaps be transferred to GuiWorkArea instead of GuiView in order to have Buffer dependent navigators.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24578 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-02 12:09:51 +00:00
Jean-Marc Lasgouttes
9b4a26a252 rename assert.h to lassert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24559 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-30 08:26:40 +00:00
André Pönitz
1e4f4fcd91 move the string conversion functions out-of-line to minimize #includes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24396 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-20 20:32:00 +00:00
André Pönitz
7f461f4392 infrastructure for 'graceful asserts'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24216 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-10 21:49:34 +00:00
André Pönitz
d9a3ca2033 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23988 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-26 22:25:43 +00:00
José Matox
03fb3b0aec Patch to please gcc 4.3. Less bloat in the include headers means that
we need to include explicitly some header files now.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22846 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-07 17:04:06 +00:00
Abdelrazak Younes
9383f4c3c6 'using namespace std' instead of 'using std::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 10:16:00 +00:00
André Pönitz
9d0ea8aeff Move debug.{cpp,h}, Messages.{cpp,h} and gettext.{cpp,h} to support/.
Now support/* should have no dependencies on src/* anymore.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 07:04:28 +00:00
André Pönitz
7c108afd14 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21837 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-27 22:19:36 +00:00
André Pönitz
e1ce2f92db reduce line noise
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21631 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-15 20:04:51 +00:00
André Pönitz
d93679c1db cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21596 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-14 00:21:31 +00:00
André Pönitz
14f7e7fffe shuffle stuff around
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21511 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-08 00:09:58 +00:00
Lars Gullik Bjønnes
26f336769a Remove warnings reported with gcc 4.3:
- Modifier on return type ignored
	- Ambigous else
	- Ambigous logical operators
	- Semi-colon instead of empty block
	- Missing header files
	- Missing using std::XX
	- Initialization out of order


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20304 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-16 10:36:57 +00:00
André Pönitz
a1cec91afa move our stuff off the Q* namespace
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19935 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-31 05:53:55 +00:00
Abdelrazak Younes
37333444c0 Cosmetics.
* TocItem:
  - add a default constructor instead of default initialisation.
  - delete unneeded and not really used isValid() method.

* TocBackend:
  - updateItem(): re-add debug info erased previously.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18749 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-12 12:29:19 +00:00
Lars Gullik Bjønnes
897436efbb Whitespace cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18550 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-28 22:27:45 +00:00
Bo Peng
8c5f097b5d Rename .C ==> .cpp for files in src/frontends/qt4, part two
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18015 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-26 03:53:51 +00:00