mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
d5d665482e
The changes that accomplish this part are in ModuleList.{h,cpp}, configure.py, and the *.module files themselves. This is a format change, and the lyx2lyx is in those files. By itself, that change would not be major, except for the fact that we do not want the module to be represented in the UI by its filename---e.g., theorems-std---but rather by a descriptive name, such as "Theorems". But that change turns out to be wholly non-trivial. The mechanism for choosing modules was the same as---indeed, was borrowed from---that in GuiCitation: You get a list of modules, and choosing them involves moving strings from one QListView to another. The models underlying these views are just QStringListModels, which means that, when you want to know what modules have been selected, you see what strings are in the "selected" QListView. But these are just the descriptive names, and we can't look up a module by its descriptive name if it's been translated. That, indeed, was the whole point of the change to the new representation. So, we need a more complicated model underlying the QListView, one that will pair an identifying string---the filename minus the extension, in this case---with each item. This turns out not to be terribly difficult, though it took rather a while for me to understand why it's not difficult. There are two parts: (i) GuiSelectionManger gets re-written to use any QAbstractListModel, not just a QStringListModel. This actually seems to improve the code, independently. (ii) We then subclass QAbstractListModel to get the associated ID string, using the Qt::UserRole slot associated with each item to store its ID. This would be almost completely trivial if QAbstractListItem::itemData() included the QVariant associated with this role, but it doesn't, so there are some additional hoops through which to jump. The new model, a GuiIdListModel, is defined in the files by that name. The changes in GuiSelectionManger.{h,cpp} make it more abstract; the changes in GuiDocument.{h,cpp} adapt it to the new framework. I've also updated the module documenation to accord with this change. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22501 a592a061-630c-0410-9148-cb99ea01b6c8 |
||
---|---|---|
.. | ||
biblio | ||
clipart | ||
cs | ||
da | ||
de | ||
es | ||
eu | ||
fr | ||
gl | ||
he | ||
hu | ||
it | ||
nb | ||
nl | ||
pl | ||
pt | ||
ro | ||
ru | ||
sk | ||
sl | ||
sv | ||
Customization.lyx | ||
depend.py | ||
doc_toc.py | ||
DocStyle.lyx | ||
DummyDocument1.lyx | ||
DummyDocument2.lyx | ||
DummyTextDocument.txt | ||
EmbeddedObjects.lyx | ||
Extended.lyx | ||
FAQ.lyx | ||
Intro.lyx | ||
LaTeXConfig.lyx | ||
Makefile.am | ||
Makefile.depend | ||
README.Documentation | ||
Reference.lyx | ||
Shortcuts.lyx | ||
Tutorial.lyx | ||
UserGuide.lyx |
README.Documentation by John Weiss [3/2000] jpweiss@idsi.net ================ Introduction The purpose of this file is *used* *to* *be* to provide a style sheet and helpful hints to those wishing to help with the LyX Documentation Project. There's now a separate style-sheet for that. If you're actually looking for documentation, check out the "Help" menu. Start by reading the Introduction. ================ Why a separate documentation project? Can't the developers do it? In a word, no. They're too busy adding features and squishing bugs. Also, g++ is far more forgiving of style changes than a human brain. As long as the code is correct, g++ will happilly compile it, and compile it the same way from machine to machine. Human brains are far less forgiving and far more individualized. So, the documentation needs to all be in a uniform style, in addition to being grammatically correct and easily readable. That's a pretty big undertaking - which is why I volunteered to administrate the docs back in 1997. Since then, I've passed the duty of maintaining the docs on to others. ================ Helping Out If you'd like to contribute to the LyX Documentation Project, start by reading the file Intro.lyx. It contains a description of the style of the documentation from a reader's perspective. After that, read the LyX Documentation Style Sheet (DocStyle.lyx) and commit it to memory! John Weiss March, 2000