When opening another document, the following is printed to the console:
QWidget::repaint: recursive repaint detected.
QPixmap::operator=: Cannot assign to pixmap during painting
Painter must be active to set rendering hints
[repeated many times here]
Painter must be active to set rendering hints
QPainter:🔚 Painter is not active, aborted
QPixmap::operator=: Cannot assign to pixmap during painting
QPixmap::operator=: Cannot assign to pixmap during painting
currentTabChanged 1File/c/work/file2.lyx
and, when closing LyX:
QPixmap::operator=: Cannot assign to pixmap during painting
QPaintDevice: Cannot destroy paint device that is being painted. Be sure to QPainter::end() painters!
I suspect that solving these issues might also solve the missing close
tab button problem.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19783 a592a061-630c-0410-9148-cb99ea01b6c8
* Toolbar::focusCommandBuffer(): new pure virtual method.
* Toolbars::display(): now return the address of the found toolbar.
* GuiView: get rid of command_buffer_, transferred to QLToolbar.
* QCommandBuffer: replace focus_command with setFocusProxy on edit_;
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19767 a592a061-630c-0410-9148-cb99ea01b6c8
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
* LyXView:
- getToolbars(): deleted.
- toolbars_: now protected. The goal is to transfer that to GuiView.
- openLayoutList(): new method. The core should not know how this list is displayed.
- showMiniBuffer(): new pure virtual method to show the mini-buffer.
- focus_command_buffer: deleted.
* GuiView:
- focus_command_widget(): deleted.
- showMiniBuffer(): implemented.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19748 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView::moveToPosition()
- now only return success boolean
- now schedule a screen centering
- now set the current font to the new position.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19722 a592a061-630c-0410-9148-cb99ea01b6c8
* loadLyXFile::setBuffer(): get rid of a premature optimisation, we make sure that everything is properly drawn in any case.
* GuiView::setCurrentWorkArea(): make sure everything is updated if we don't change tab.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19717 a592a061-630c-0410-9148-cb99ea01b6c8
- setBuffer(): LyXView has no business in setting parent document.
- loadLyXFile(): delete dead code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19703 a592a061-630c-0410-9148-cb99ea01b6c8
* Buffer:
- get rid of cursor_ and anchor_
- ~Buffer(): update the labels of its master buffer before closing
- closing(): pass the Buffer address.
* BufferView():
- BufferView(): needs a valid Buffer (should be const in the future.
- most of the change is about removing all test of buffer_ nullity.
- resize(): deleted.
- setBuffer(): deleted.
* Application:
- newLyXView(): simplification
- updated design description in Application.h
* Gui/GuiImplementation: remove all WorkAreas and BufferView creation/Deletion. Workareas are directly handled by LyXView/GuiView and BufferView is created/delete by WorkArea.
* LyXView/GuiView: implement the new design
What is not working yet:
- the close tab button: it is implemented but does not show up.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19686 a592a061-630c-0410-9148-cb99ea01b6c8
The changes are essentially of three types.
First, the std::maps previously used here for storing BibTeX data have become full-fledged classes and so what were previously just a bunch of functions have now become methods of these new classes. This leads to a lot of minor changes in other files, to adapt to the new signature. The changes in insets/ are mostly of this kind.
Second, there are some slightly more substantial changes in src/insets/InsetBibtex.cpp. We now store lists of the field names and entry types that have been used.
Finally, there are the changes to the citation UI. These are mostly straightforward, though adding the new functionality exposed some inadequacies in the previous code that also had to be fixed.
One other change: BibTeX keys are now docstring. This solves some Unicode issues.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19657 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=4123
* GuiView:
- closeEvent(): set quitting=true only when quitting. I don't know why and how this was changed but it was clearly wrong.
- update_view_state_qt(): only update when focus is in. Make sure this is the current LyXView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19643 a592a061-630c-0410-9148-cb99ea01b6c8
a structure representing field->value instead of just a single string with
all the data. The data structures are defined in src/Biblio_typedefs.h, and
the main changes are to the parser code in src/insets/InsetBibtex.cpp.
-src/Biblio_typedefs.h
Contains typedefs for new representation. Separating them out limits how much
gets #include'd by other files, and also resolves a circularity problem with
Buffer.h.
-src/Biblio.{h,cpp}
Signature changes and massive simplifications to routines that report
BibTeX data, since we now have an articulate representation.
-src/insets/InsetBibtex.{h,cpp}
Re-write the parser code so we store a key->value map of the BibTeX data
rather than just one long string. This is the main work.
-src/frontends/controllers/ControlCitation.{h,cpp}
-src/insets/InsetBibitem.{h,cpp}
-src/insets/InsetCitation.cpp
Adaptations and simplifications.
-src/insets/Inset.h
-src/Buffer.{h,cpp}
-src/insets/InsetInclude.{h,cpp}
Signature changes.
-src/Makefile.am
-development/scons/scons_manifest.py
Add src/Biblio_typedefs.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19598 a592a061-630c-0410-9148-cb99ea01b6c8
information is acquired. This involves (i) moving the bulk of fillWithBibKeys()
into Biblio.cpp, (ii) introducing a virtual method Inset::fillWithBibKeys() that,
by default, does nothing, and (iii) over-riding this method in the insets that do
need to do something.
This is all preparatory for a more substantial re-working of the BibTex code,
which should follow shortly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19565 a592a061-630c-0410-9148-cb99ea01b6c8
that caused the bug, but it does.
Also fix some other UI bugs, relating to resets of the selection models. These
look gratuitous and cause problems in the current code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19530 a592a061-630c-0410-9148-cb99ea01b6c8
- reorganize the code to minimize indentation by returning early for special cases
- use a pixmap cache for word drawing. This can be disabled by setting USE_PIXMAP_CACHE to 0 at the top of QLPainter.cpp.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19513 a592a061-630c-0410-9148-cb99ea01b6c8
in the view source panel
* Buffer.cpp (getSourceCode, writeLaTeXSource): fix sync between output and texrow
* frontends/controllers/ControlViewSource.{h,cpp} (getRows): new method to get the current selection in term of latex rows
* frontends/qt4/QViewSource.{h,cpp}: make a selection in the ViewSource widget
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19503 a592a061-630c-0410-9148-cb99ea01b6c8
* development/MacOSX/Makefile.am: when installing, create bogus
language directories to allow translation through Qt.
* src/frontends/qt4/GuiApplication.cpp (MenuTranslator): new class,
redirects some Qt translation requests to gettext.
(GuiApplication): install the MenuTranslator.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19354 a592a061-630c-0410-9148-cb99ea01b6c8
The effect is this: If you try to open a file that is already open,
LyX (i) checks if the buffer is dirty, and just switches buffers if
it is not; (ii) if it is, you get this message:
The document %1$s is already loaded and has unsaved changes.
Do you want to abandon your changes and reload the document?
[Reload] [Keep Changes]
If you hit the latter, you just get switched to the document.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19331 a592a061-630c-0410-9148-cb99ea01b6c8
- new function getSortedColors
* src/frontends/qt4/QPrefs.cpp:
- use that to sort the colors (bug 2571)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19236 a592a061-630c-0410-9148-cb99ea01b6c8
* InsetTabular:
- remove the is_deleted_ boolean
- dispatch(): remove the call to updateDialog at the end
* ControlTabular::initialiseParams(): connect to the current tabular if found.
* QTabular::update_contents(): initialiseParams() each time.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19112 a592a061-630c-0410-9148-cb99ea01b6c8
1) LyXFunc::lyx_view_ is not set to 0
2) quiting is not set to true.
This patch add safe guards when closing a view and/or exiting.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19095 a592a061-630c-0410-9148-cb99ea01b6c8
1) create a doc
2) insert an ert inset
3) right-click the inset
4) new window
5) delete the ert inset: BOOM!
This commit replace the static hideDialog signal which was in effect shared by all views with a direct call to Dialog::hide().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19094 a592a061-630c-0410-9148-cb99ea01b6c8
* Layout.h:
- name_, obsoleted_by_, depends_on_ are now docstrings.
All other changes results from the above string -> docstring changes. In particular, we now try to translate the layout names only if possible (i.e. if they are ASCII only).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19042 a592a061-630c-0410-9148-cb99ea01b6c8
- don't try to trim after a dot that is the last character in the name
(fixes crash, bug 3981)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18992 a592a061-630c-0410-9148-cb99ea01b6c8
* src/support/docstring.{cpp,h}:
- rename normalize_kc to normalize_c and use normalization form C (instead of KC)
* src/callback.cpp:
* src/Trans.cpp:
* src/frontends/qt4/GuiClipboard.cpp:
* src/frontends/qt4/GuiSelection.cpp:
* lib/lyx2lyx/lyx_1_5.py:
- use normalization forms C and D instead of KC and KD.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18991 a592a061-630c-0410-9148-cb99ea01b6c8
* frontend_helpers.cpp (Sorter): use the current locale for sorting
(bug 2739)
* frontend_helpers.cpp: cleanup headers.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18988 a592a061-630c-0410-9148-cb99ea01b6c8
- new boolean canApplyToReadonly that allows to apply params/update view
even if the buffer is readOnly for specific dialogs.
* src/frontends/controllers/ControlPrint.h:
- use that (fix bug 3909)
* src/frontends/controllers/ControlViewSource:
- dto. (fix bug 3943)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18959 a592a061-630c-0410-9148-cb99ea01b6c8
1. Open a document with child documents, each comprising divisions;
2. Show the outline pane. You can see childs' divisions;
3. Select (view) one of the childs;
4. Close this child doc. The focus comes back to the master doc;
5. Click in the outline pane at some point corresponding to the child doc you closed. LyX crashes with SIGSEGV (instead of reopening the child...).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18939 a592a061-630c-0410-9148-cb99ea01b6c8
LyXFunc.cpp
Quote file paths in printer dialog
Fix bug 3915: http://bugzilla.lyx.org/show_bug.cgi?id=3915
(patch from Jürgen and JMarc)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18934 a592a061-630c-0410-9148-cb99ea01b6c8
is that we distinguish between the "Default" alignment and whatever
that default happens to be: I.e., so far as the code goes, the UI now
distinguishes LYX_ALIGN_LAYOUT from LYX_ALIGN_WHATEVER, when WHATEVER
happens to be the default. So you can explicitly force, say, left-align,
and that will stick between document classes.
* src/Paragraph.cpp:
Don't output params if alignment is the default.
* src/ParagraphParameters.cpp
Treat LYX_ALIGN_LAYOUT as its own alignment.
* src/Text2.cpp
Treat LYX_ALIGN_LAYOUT as its own alignment, and force it to be accepted
as a possible alignment.
* src/frontends/controllers/ControlParagraph.{h,cpp}
New method haveMultiParSelection().
*src/frontends/qt4/QParagraph.{h,cpp}
*src/frontends/qt4/ui/ParagraphUi.ui
UI adjustments as mentioned.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18922 a592a061-630c-0410-9148-cb99ea01b6c8
- use internal_path to prevent assert on windows (bug 3916).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18896 a592a061-630c-0410-9148-cb99ea01b6c8
* po/lyx_pot.py:
- new function external_l10n: parse external_templates and extract the relevant parts for translation.
* development/scons/SConstruct:
* po/Makefile.in.in:
- use external_l10n
* src/insets/InsetExternal.cpp:
* src/frontends/qt4/QExternal.cpp:
- make eveything translatable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18866 a592a061-630c-0410-9148-cb99ea01b6c8
checkbox has been changed to a radio button, so that other alignments
can be chosen without the user's having to uncheck "Default".
There was some disagreement about the interface here. See, for example,
this thread:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg121328.html
For now, this will do.
The interface here is not fully functional. At present, if the Default
happens to be Justified, then checking Justified is simply equivalent to
checking Default. This is due to the behavior of Text::setParagraph(), and
it should be changed if this interface is retained.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18860 a592a061-630c-0410-9148-cb99ea01b6c8
does not close the command completion popup. Moreover setFocus does
not focus the widget correctly, probably because the popup widget
behavior is different. An activateWindow solves the problem by
selecting the LyX view again as active window.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18840 a592a061-630c-0410-9148-cb99ea01b6c8
* LyXView::setBuffer(): update labels and toc only if we change parents.
* LyXView::loadLyXFile():
- update labels in _any_ case and before setting the Buffer.
- update GUI controls in case we move to a saved position.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18829 a592a061-630c-0410-9148-cb99ea01b6c8
* buffer_funcs.{h,cpp}: new checkAndLoadLyXFile() transferred from BufferView::loadLyXFile().
* BufferView::loadLyXFile(): deleted.
* LyXView::loadLyXFile(): simplify logic and fix some issues:
- buggy child document leads to crash due to error list dialog.
- ensure that we switch to buffer if there's some errors.
- use LyXView::setBuffer() instead of repeating code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18828 a592a061-630c-0410-9148-cb99ea01b6c8
Fix Bug 3860: Toc crash when loading a child documents.
* BufferView::loadLyXFile(): simplify, transfer last part to
LyXView::loadLyXFile().
Change return value to Buffer created by load (or 0 if none).
Ultimately, this should all be moved to buffer_funcs.cpp, as it is no
longer needed here.
* Buffer::setParentName(): small fix to avoid recursive includes.
* LyXView:
- setBuffer(): properly update the labels and the Toc if this is [LOAD Child
Document] command. Move buffer connection and disconnection, simplifying
earlier code.
- loadLyXFile(): get some code from BufferView::loadLyXFile() and from
LyXFunc::LFUN_BUFFER_CHILD_OPEN, properly handle the child document case.
There's a lot of overlap with setBuffer() here. This needs cleaning.
* LyXFunc: add optional argument to LFUN_BUFFER_CHILD_OPEN to indicate if
the document is being opened by LyX itself rather than the user (as on
View>DVI, for example).
* LyX: adapt to loadLyXFile() API changes.
* insets/InsetInclude: use LFUN_BUFFER_CHILD_OPEN rather than calling
loadLyXFile() directly. Make use of new optional argument.
With this in place, the only thing missing for proper multipart document support is to automatically update the parent Buffer when switching from the parent Buffer. This would be very useful when you work with multiple document sharing the same child documents (as I often do).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18825 a592a061-630c-0410-9148-cb99ea01b6c8
the coordinate cache of the math inset is not valid and InsetMathNest
depends on that to compute the cursor position.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18816 a592a061-630c-0410-9148-cb99ea01b6c8
IconPalette now subclasses QWidgetAction so that we can
insert them in QMenu (before we were painting ourselves)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18812 a592a061-630c-0410-9148-cb99ea01b6c8
* remove spacing in the layout of the tab bar and the central widget
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18770 a592a061-630c-0410-9148-cb99ea01b6c8
this is already what we have; fixes a crash (bug 3793)
* src/frontends/controllers/ControlToc.h: make getGUIName private
* src/frontends/controllers/ControlToc.cpp (getGUIName): handle
correctly the lists of floats.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18648 a592a061-630c-0410-9148-cb99ea01b6c8
bug is fixed in Qt an upper version bound should be added.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18647 a592a061-630c-0410-9148-cb99ea01b6c8
* In the "Available" list, double clicking or hitting Enter adds a
citation. Hitting Ctrl-Enter adds the citation and closes the
dialog. Previously, Enter did what Ctrl-Enter now does if there
was no other citation already selected and double clicking would
close the dialog after adding the citation.
* In the "Selected" list, Delete and Backspace delete the
selection.
Ctrl-Delete and Ctrl-Backspace clear the whole list.
Thanks to Abdel, Andre, and Lars for comments and help.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18633 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=3759
It also simplifies and fix the smallcaps case which was not correct WRT unicode. Even though I don't know if toUpper() means something in the non ucs2 range.
FYI, I used toqstr() to do the ucs4 -> ucs2 conversion when needed. This helper method works only with Qt >= 4.2.
* GuiFontMetrics::smallcapsWidth(): changed to work with single ucs4 characters.
* GuiFontMetrics::xxx(): make sure that font metrics works with characters not in the ucs2 range.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18593 a592a061-630c-0410-9148-cb99ea01b6c8
* added Qt::Drawer flag to TOC
* reverted Jürgen's patch (i.e. the source view is docked below the text again),
wide drawers are not Mac-like (tm)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18557 a592a061-630c-0410-9148-cb99ea01b6c8
* Inset: new destroyed signal (copy ctor and operator= needed because of a signal is not copiable)
* CursorSlice:
- connect to inset destructor wherever possible
- invalidate(), isValid(): new method.
- inset_: now private
* DocIterator::fixIfBroken(): new method for properly fixing cursors.
* StableDocIterator::asDocIterator(): verify cursor sanity before creating it.
* Cursor::fixIfBroken(): now a simple wrapper around DocIterator::fixIfBroken()
* BufferView::setBuffer(): verify cursor sanity before restoring it.
* WorkArea::redraw(): verify cursor sanity of concurrent BufferView display.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18516 a592a061-630c-0410-9148-cb99ea01b6c8
* src/Buffer.cpp:
- make view-source string translatable
* src/frontends/controllers/ControlToc.h:
- make getGuiName public
* src/frontends/qt4/TocWidget.cpp:
- use getGuiName for the combo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18505 a592a061-630c-0410-9148-cb99ea01b6c8
- adds a "toggle math toolbar" and "toggle table toolbar" buttons to the main toolbar
(i also moved "toggle toc" there)
- adds a "toggle math panels" button to the math toolbar
- reshuffles the Big Operators panel to avoid confusion with the sum icon on the math toolbar
- adds some icons
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18478 a592a061-630c-0410-9148-cb99ea01b6c8
* src/insets/InsetListingsParams.cpp:
- complete list of languages/dialects
- fix some typos
- (validate): check for braces
* src/frontends/qt4/QListings.cpp:
- fix list of languages (not yet complete)
- make it possible to enter [dialect]language in the advanced widget
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18451 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/qt4/QListings.cpp (validate_listings_params):
- care for the apply button as well.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18444 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/qt4/QListings.cpp:
- make widget entries translatable
- clean up and shuffle around some code
* src/frontends/qt4/ui/ListingsUi.ui:
- set isEditable here, not in QListings.cpp
* src/frontends/qt4/QDocument.cpp:
* src/frontends/qt4/QInclude.cpp:
- make Listings strings translatable
Fix bug 3654 (by Bo Peng):
* src/frontends/qt4/QListings.h:
- new slot on_numberSideCO_currentIndexChanged
* src/frontends/qt4/QListings.cpp:
- use this slot and enable(disable the appropriate widgets
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18432 a592a061-630c-0410-9148-cb99ea01b6c8
* Sqrt and Root draw their vertical horizontal line with a single line command to make them showup non-antialiased.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18419 a592a061-630c-0410-9148-cb99ea01b6c8
1) Open EmbeddedObject.lyx
2) Open Toc
3) Click on section 7.2.2 which is in the second child document
4) assertion.
This commit adds proper support for multi-part documents. With this each child document has access to the _full_ TOC tree (including LOT and LOF). This enables to switch between master and child document using the TOC.
* buffer_funcs.cpp:
- updateLabels(): do not emit Buffer::structureChanged() signal for child document
- checkBufferStructure(): update the structure of the master document.
* ControlToc.cpp: always use the TocBackend of the master document.
* LyXView::connectBuffer(): connect structureChanged() of master document.
* TocBackend:
- TocItem: get rid of child_ member.
- TocBackend::item(): only compare items from the same document.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18386 a592a061-630c-0410-9148-cb99ea01b6c8
Delete cached conversions if the converter changes.
* src/frontends/qt4/QPrefs.cpp
(PrefConverters::update_converter): delete cached files since the
new converter might create different ones
(PrefConverters::remove_converter): ditto
* src/support/convert.cpp
(unsigned long convert<unsigned long>): New template specialization
* src/ConverterCache.h
(ConverterCache::remove_all): New method, removes all cached
conversions of a particular converter
* src/ConverterCache.cpp
(CacheType): Also store source file format
(ConverterCache::Impl::readIndex): Handle files with spaces correctly
(ConverterCache::Impl::writeIndex): ditto
(various): adapt to changed CacheType
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18378 a592a061-630c-0410-9148-cb99ea01b6c8
* TocWidget::select()
- Do not allow select ModelItem from the code for non-TOC types
- add a FIXME explaining the situation.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18348 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/qt4/TocWidget.{cpp,h}:
- new member disconnectSelectionModel()
- (select): replace blockSignal() directives for tocTV selectionModel()
with disconnect (the above new function) and reconnect relevant signal
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18338 a592a061-630c-0410-9148-cb99ea01b6c8
* ControlDocument::id(): new method returning the id of the current buffer.
* PreambleModule: new class for the preamble module. Handle everything preamble related, including memorizing the cursor position for each Buffer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18307 a592a061-630c-0410-9148-cb99ea01b6c8
In insert graphic window: canceling open dialog erases entry in text box). This bug is not Mac specific, but exist in Linux. (should exist in other OSes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18268 a592a061-630c-0410-9148-cb99ea01b6c8
Solution: Move the color initialization from the constructor to the update() method. I've read the mail from Richard (referenced in the source code) concerning this, but i don't understand why we should not move parts of the initialization the constructor does into the update method. With this changes the hack for fixing http://bugzilla.lyx.org/show_bug.cgi?id=3109 is not needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18249 a592a061-630c-0410-9148-cb99ea01b6c8
Solution: Disable the alter button if no item is selected and add an additional test for a valid index.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18247 a592a061-630c-0410-9148-cb99ea01b6c8
Solution: Add a test whether the color returned from the color dialog is valid.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18245 a592a061-630c-0410-9148-cb99ea01b6c8
with skips.
Added helper method canIndent() to controller and appropriate logic to
QParagraph::update_contents().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18236 a592a061-630c-0410-9148-cb99ea01b6c8
* GuiApplication::event():
special case for FileOpen events: memorize the filenames if LyX is not properly started yet.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18201 a592a061-630c-0410-9148-cb99ea01b6c8
* ControlDocument::params(): replace BufferParams local copy with Buffer::params() direct access.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18186 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/controllers/ControlCommandBuffer.{cpp,h}:
- new member hide()
* src/frontends/qt4QCommandEdit.{cpp,h}:
- new signal hidePressed(), emit it on M-x/Alt-x
* src/frontends/qt4/QCommandBuffer.{cpp,h}:
- new slot hideParent(), connected to QCommandEdit::hidePressed()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18081 a592a061-630c-0410-9148-cb99ea01b6c8
somewhat better layout; ideally, the whole dialog should be laid out in a grid,
but then qt insists on drawing the listwidgets much wider than the need to be.
The drawback of this approach is that the dialog cannot really be resized.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17949 a592a061-630c-0410-9148-cb99ea01b6c8
some code is moved from QMath
to QDelimiterDialog and QMathMatrixDialog
for the rest pretty mechanical
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17872 a592a061-630c-0410-9148-cb99ea01b6c8
add signal that provides action when triggered
* ToolbarBackend.[Ch]
add popupmenu and iconpallete item types
* QLToolbar.[Ch]
take care of popupmenu and iconpallete
* stdtoolbars.inc
add panels and menus (and move spellchecker to main ;-)
* functions.xpm
icon for function list
* iconpalette.[Ch]
new iconpanel that will replace old iconpalette,
als subclass of qmenu that updates parent toolbutton
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17868 a592a061-630c-0410-9148-cb99ea01b6c8
toolbaritems, toolbar(info) and backend
stdtoolbars.inc now defines the toolbars inbetween
a ToolbarSet/End tag just as the menus
* the other files contain straightforward changes
because of the toolbarbackend refactoring
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17867 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=3460
The problem was that the list_items map is ordered by key.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17858 a592a061-630c-0410-9148-cb99ea01b6c8
* bigleft, bigright: move empty item from last to first to synchronize it with GUI representation
* fix_name(): add FIXME for Enrico
* updateTeXCode():
- move C-style string declaration.
- simplify empty string logic.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17848 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/qt4/TocWidget.[Ch]:
- rename enableButtons to enableControls and include slider enabling/disabling
- only set slider if there is some content
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17835 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=3450
* ControlMath
- new MathSymbol struct that summarize the symbol attributes (including font and fontcode)
* QDelimiterDialog:
- make use of the new MathSymbol for the ListWidget.
- store the latex name in the tooltip instead of lookup for it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17786 a592a061-630c-0410-9148-cb99ea01b6c8
options accepted by the current paragraph.
ui/QParagraphUi.ui
Changed combo box for alignment to radio buttons. Added
checkbox for default alignment.
QParagraphDialog.[Ch]
public:
void checkAlignmentRadioButtons();
void alignmentToRadioButtons(LyXAlignment);
LyXAlignment getAlignmentFromDialog();
private:
typedef std::map<LyXAlignment, QRadioButton *> QPRadioMap;
QPRadioMap radioMap;
protected Q_SLOTS:
void change_adaptor();
void enableLinespacingValue(int);
void on_alignDefaultCB_toggled(bool);
QParagraph.C
Rework apply() and update_contents() using new functions just
mentioned.
Thanks to Abdel for his help.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17776 a592a061-630c-0410-9148-cb99ea01b6c8
* src/mathed/MathSupport.C:
add "slash" to the decoration table.
* src/mathed/InsetMathBig.C
(InsetMathBig::draw): don't remove backslash delimiter.
(InsetMathBig::isBigInsetDelim): add "\\" and "\slash" to
the delimiters table.
* src/frontends/qt4/QDelimiterDialog.C
(fix_name): return "\\" instead of "\backslash" as that now
works after the fixes above.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17771 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/qt4/QDelimiterDialog.C
(fix_name): Return "|" instead of "\|" as this is equivalent to \Vert.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17752 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=3413
* ui/QNomenclUi.ui
- description field: replace LineEdit with TexEdit
* QNomencl.C: take care of the \n <-> \\ conversion in the description field.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17748 a592a061-630c-0410-9148-cb99ea01b6c8
* ControlMath.[Ch]
- mathSymbol(), texName(): new method for easy access of math symbols and associated TeX names
- latex_delimiters: allowed delimiters transferred from QDelimiterDialog.C
* QDelimiterDialog.C:
- makes use of the above.
- display the TeX code in a label instead of beside the symbol.
* QDelimiterUi.ui
- shrink it so that it could nicely fit in a DockWidget but this doesn't work, the dialog is too large!
- texCodeL: new label.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17747 a592a061-630c-0410-9148-cb99ea01b6c8
This fixes some encoding problems, and hopefully also bug 3410.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17746 a592a061-630c-0410-9148-cb99ea01b6c8
Changed dialog and added routines to deal with an "auto" label
in cases where defaults are used.
ui/MarginsUi.ui: Changed labels for width and height to checkboxes. Removed connections.
checkwidgets.[Ch]: Extended checkedLineEdit routines to take a QWidget.
qt_helpers.[Ch]:
Added void lengthToWidgets(QLineEdit *, LengthCombo *, LyXLength const &, LyXLength::UNIT)
Added void lengthAutoToWidgets(QLineEdit *, LengthCombo *, LyXLength const &, LyXLength::UNIT)
Added void setAutoTextCB(QCheckBox *, QLineEdit *, LengthCombo *)
validators.[Ch]:
Added class LengthAutoValidator : public LengthValidator
Added class DoubleAutoValidator : public QDoubleValidator
QGraphicsDialog.[Ch]
Added virtual void setAutoText()
Added virtual void on_WidthCB_toggled(bool)
Added virtual void on_HeightCB_toggled(bool)
Used the new functions to set "auto" in default cases and toggle checkboxes as needed.
Set validator for scale.
Re-organized connect routines.
QGraphics.C:
Completely re-worked update_contents().
Significant changes to apply().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17735 a592a061-630c-0410-9148-cb99ea01b6c8
1) launch the dialog
2) select a delimiter in the left pane
3) Tab
4) select a delimiter in the right pane
5) Enter
So:
- Also enable the quick insertion while in the right pane
- Do not limit the quick insertion to matched key
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17732 a592a061-630c-0410-9148-cb99ea01b6c8
- ListWidget instead of combo,
- matched delimiters on the same row,
- immediate insertion on "enter" or "double-click" if the 'match' option is checked.
- simplification of the code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17731 a592a061-630c-0410-9148-cb99ea01b6c8
Most of the change is about using the new private member delimiters_ instead of the "delim" table. Also, we don't display an icon when the delimiter is one character.
I did not manage to let the combos expand to the maximum.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17727 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=3412
* QNomenclDialog::QNomenclDialog(): setting the focus proxy in the Description edit box.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17719 a592a061-630c-0410-9148-cb99ea01b6c8
* ControlToc::update(): get rid of the pure virutal method.
* QToc::initialiseParams(): overload ControlToc method.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17708 a592a061-630c-0410-9148-cb99ea01b6c8
keyboard input via kmap, clipboard and selection) to normalized form KC
(precomposed characters) since we don't support the decomposed form very
well.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17702 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/qt4/QTabular.C: change "Block" to "Justified"
to avoid translation clash and to align with paragraph settings
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17694 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=3288
This is recommended by Qt:
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.
* GuiApplication::notify(): reimplemented from QApplication::notify().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17688 a592a061-630c-0410-9148-cb99ea01b6c8
* Painter:
- preeditText(), dashedUnderline(): new methods for CJK support.
* GuiWorkArea:
- inputMethodQuery(): new Qt inherited method for proper CJK support.
- inputMethodEvent(): now properly take care of input methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17671 a592a061-630c-0410-9148-cb99ea01b6c8
Problem was that SIGNAL itemSelectionChanged was not connected to anything.
* QRefDialog::selectionChanged(): new slot for itemSelectionChanged signal.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17615 a592a061-630c-0410-9148-cb99ea01b6c8
"View" button in TeX information dialog not enabled when file is selected with the keyboard. Problem was that SIGNAL itemSelectionChanged was not connected to anything. Also made some minor stylistic changes to the code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17614 a592a061-630c-0410-9148-cb99ea01b6c8
- whitespace. I forgot to save the changes before committing :-(
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17595 a592a061-630c-0410-9148-cb99ea01b6c8
- some further refinement (and cleanup) of the triple click behaviour,
from Richard G. Heck.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17594 a592a061-630c-0410-9148-cb99ea01b6c8
- reimplement doubleClickTimeout() from the qt3 frontend
in order to get triple clicking working (bug 3272).
This is just an emultation of triple clicking, since qt does not have
a mouseTripleClickEvent()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17588 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/qt4/ui/BulletsUi.ui:
- assure that six columns of bullets are displayed in the widget
(fix bug 3147).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17584 a592a061-630c-0410-9148-cb99ea01b6c8
This changes the semantics of isOK() and operator(), comments from Bernhard below:
With the old version of lyxlex it was _impossible_ to check whether reading an integer, float, ... succeeded or not. The current solution to check for is.bad() in some cases and in other cases use is.good() does not give the desired information. Moreover the result of is.bad() depends on the stl implementation and behaves different for linux and windows.
the bug was introduced by the patch that fixed the bug that crashed lyx when "inset-insert ert" was executed from the command buffer.
The lexer has the method isOK() which reflects the status of the stream is.
The operators void* and ! are not really well defined (they depend on the value of is.bad()). What is missing is a test if the last reading operation was successful and thus the returned value is valid.
That's what i implemented in this patch.
The new rule for using the lexer:
if you want to know if the lexer still has data to read (either from the stream or from the pushed token) then use "lex.isOK()".
If you want to test if the last reading operation was successful then use eg. "if (lex) {...}" or unsuccessful then use eg. "if (!lex) {...}"
an example:
int readParam(LyxLex &lex) {
int param = 1; // default value
if (lex.isOK()) { // the lexer has data to read
int p; // temporary variable
lex >> p;
if (lex) param = p; // only use the input if the reading operation was successful
}
return param;
}
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17569 a592a061-630c-0410-9148-cb99ea01b6c8
- add flags for debug/release/profile
- also build qt4 as one file with gcc
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17558 a592a061-630c-0410-9148-cb99ea01b6c8
TODO: extract the latexHighlighter class into its own .[Ch] files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17553 a592a061-630c-0410-9148-cb99ea01b6c8
Those arguments are not needed because update() will always look at what is currently selected and the info is there.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17546 a592a061-630c-0410-9148-cb99ea01b6c8
- now simple citation insertion can be done with the keyboard only (enter key will close the dialog and insert the chosen key).
- now search also within bib entry information (very fast)
- new case sensitive option
- new regex option.
- QCitation: code simplified, some code went to ControlCitation.
- QCitationDialog: code simplified
- lots of polish in the dialogs...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17539 a592a061-630c-0410-9148-cb99ea01b6c8
* DockView.h: add the orientation option.
* QViewSource: now a model and a controller
* QViewSourceDialog: now only a simple QWidget.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17538 a592a061-630c-0410-9148-cb99ea01b6c8
* transfer CiteEngine enum declaration to biblio.h
* delete unneeded CiteEngine_enum
* cite_engine is now cite_engine_ and is private.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17537 a592a061-630c-0410-9148-cb99ea01b6c8
* src/frontends/controllers/ControlCharacter.[Ch]
(reset_lang_) New flag (needed because the language is never
inherited)
* src/frontends/controllers/ControlCharacter.C
(ControlCharacter::getLanguage): Use reset_lang_
(ControlCharacter::setLanguage): Set reset_lang_ if needed
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17526 a592a061-630c-0410-9148-cb99ea01b6c8
* insetcite: call getEngine()
* bufferparams: move getEngine() here, and let it sense the
provides(natbib)
flag
* ControlBibtex, ControlCitation: correct getEngine() call
* biblio: remove old getEngine()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17505 a592a061-630c-0410-9148-cb99ea01b6c8
"Include" was for good reason the default method but not the first item in the dropdown list.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17467 a592a061-630c-0410-9148-cb99ea01b6c8
* TocBackend
- addType(), types_, types(): deleted.
* ControlToc
- tocs(): new
- selectedType(): access to selected_type_
- initialiseParams(): transfer code from QToc::update() and look for selected type.
- getTypes(), getContents(): deleted
* QToc: do not maintain current type. Get the info from the View.
- setTocModel(): deleted
* TocWidget: always pass the currently selected type to the model/controller.
- setTocModel(): new slot.
- updateGui(): transfer code to setTocModel().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17455 a592a061-630c-0410-9148-cb99ea01b6c8
- initialiseParams(): overload ControlCommand::initialiseParams() so that we can update the model at this point (QToc is the controller _and_ the model).
- update(): new
- updateBackend(): new protected method to update the TocBackend (called for the "Update" button).
* QToc:
- is now a QObject
- modelReset: new Qt signal to indicate a model reset to associated dialog(s).
- QToc(): avoid the duplicate update() call that will be done in the show command anyway.
* Dialogs.C
- use new TocWidget in a DockView.
* TocWidget.[Ch]: renamed from QTocDialog. This striped down widget is only a widget that connects to the 'QToc' model/controller.
* DockView.h: new template class that encapsulates a given Widget inside a DockWidget and presents a Dialog::View interface.
* QTocUi.ui:
- now is a simple Widget.
- rearrange the buttons a bit
- get rid of the unneeded close button.
- modify the shortcut to "Promote" to 'r' because of a clash with "Alt-p" number (we really need real, always valid, shortcuts for all outline action!)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17416 a592a061-630c-0410-9148-cb99ea01b6c8
- update dialogs instead of hiding for dialogs that support that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17414 a592a061-630c-0410-9148-cb99ea01b6c8
* buffer.h:
- structureChanged(): new boost signal. I intend to use that also when a text is changed in a section or caption item.
* buffer_funcs.C:
- updateLabels(): emit Buffer::structureChanged() after TocBackend is updated.
- checkBufferStructure(): new method for updating the TocBackend if needed.
* LyXView:
- updateToc(): new slot for Buffer::structureChanged() signal.
* text.C:
- call checkBufferStructure() whenever text is added or erased.
* TocBackend.[Ch]:
- updateItem(): new method to update a specific item (called from checkBufferStructure()).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17413 a592a061-630c-0410-9148-cb99ea01b6c8
support directory, return as a relative path (enclosed in brackets)
* frontends/qt4/GuiView.C (updateTabs): use makeDisplayPath instead
of onlyFileName.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17384 a592a061-630c-0410-9148-cb99ea01b6c8