Commit Graph

3376 Commits

Author SHA1 Message Date
Peter Kümmel
91abd65a92 Don't forget bug in GuiImplementation::closeAllViews()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16251 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-12 10:54:37 +00:00
Enrico Forestieri
d08210e961 Fix cancel on quit
* src/lyxfunc.C
	(LyXFunc::dispatch): Move to GuiView::closeEvent the session code
	for lastpos in LFUN_LYX_QUIT. Check for unsaved changes before
	initiating the quit procedure in LFUN_LYX_QUIT and LFUN_WINDOW_CLOSE. 

	* src/frontends/qt4/GuiView.h
	(class GuiView): New boolean member quitting_by_menu_.

	* src/frontends/qt4/GuiView.C
	(GuiView::GuiView): Initialize quitting_by_menu_.
	(GuiView::close): Set to true quitting_by_menu_ before calling
	the quit procedure and reset it afterwards.
	(GuiView::closeEvent): Account for the close window button.
	Save last positions to the session file. Remove wrongly placed
	call to quitWriteAll.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16248 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-12 01:39:50 +00:00
Georg Baum
ff2bea7d39 Fix spell two checker bugs. The reason for both bugs was a string->docstring
commit from an unclean tree.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16235 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-10 19:00:57 +00:00
Georg Baum
55f575c4dd convert thesaurus and spellchecker to docstring
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16229 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-10 11:52:46 +00:00
Georg Baum
6836e00c07 eliminate some occurances of fromqstr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16228 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-10 10:31:42 +00:00
Michael Schmitt
205cf77715 po/de.po:
src/frontends/qt4/QDelimiterDialog.C: cosmetics: change text "Variable size" to just "Variable", because "size" is already given by the label

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16227 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-10 10:07:31 +00:00
Jürgen Spitzmüller
a2dd2953fa clean up the clean up of the font panel in document dialog (roman family combo has to come first, not last).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16215 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-09 09:54:50 +00:00
Enrico Forestieri
aff98b305c Fix returned width for small caps (these values are not cached, though)
* src/frontends/qt4/GuiFontMetrics.C
	(GuiFontMetrics::width): return correct width for small caps.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16214 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-09 07:07:00 +00:00
Georg Baum
26460b39ee Convert the spell checking machinery to docstring.
Fix a conversion char -> char_type without encoding conversion in
cap::replaceSelectionWithString().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16212 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-08 19:46:16 +00:00
Georg Baum
e04c134ec2 Fix incorrect conversion from QString to std::string. lyxerr output is wrong
now (always UTF8 as in the core).

	* src/frontends/qt4/qt_helpers.C
	(fromqstr): Convert to UTF8, not the locale encoding

	* src/frontends/qt4/qt_helpers.h
	(toqstr): update documentation
	(qchar_to_ucs4): ditto
	(ucs4_to_qchar): ditto
	(ucs4_to_qstring): ditto
	(qstring_to_ucs4): ditto
	(qt_): ditto
	(fromqstr): ditto

	* src/frontends/qt4/README: Update unicode part


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16207 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-08 08:57:57 +00:00
Georg Baum
4453c591fc fix compiler warning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16205 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-07 17:48:38 +00:00
Bo Peng
16072b8e09 Button face-lift: stop shifting text under mouse
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16203 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-07 16:26:17 +00:00
Abdelrazak Younes
d2574b7d8e unneeded header
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16198 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-07 12:03:58 +00:00
Abdelrazak Younes
5ce7ae1883 * BufferView:
- update(): return bool only, and cleanup of the DOX comments.
  - workAreaDispatch(): return bool only, cleanup of the DOX comments, change update() call to updateMetrics() and add some FIXMEs.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16197 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-07 11:46:27 +00:00
Enrico Forestieri
053c14d17b On *nix, report the font family name instead of "Multi"
* src/frontends/qt4/GuiFontLoader.C
	(QLFontInfo): use font.family() instead of font.rawName()
	as the latter always returns "Multi" on *nix.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16195 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-07 00:49:56 +00:00
Enrico Forestieri
30ba00a0c3 Directly use the family name in QFontInfo to ascertain whether the requested
font is available. This is now possible because the old bug needing a
workaround has been solved in Qt4. This also solves the problem of missing
integral symbols in mathed on Windows when the esint10 font is not available.

	* src/frontends/qt4/GuiFontLoader.C
	(isSymbolFamily): directly check the family name in QFontInfo.
	(getSymbolFont): add some debugging info.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16191 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-06 13:38:07 +00:00
Michael Schmitt
ca55737398 * FileDialog.C: always return POSIX-like path names ('/' instead of '\' on Windows)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16186 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-05 19:51:50 +00:00
Georg Baum
95579c2a71 more unicode filenames (+ fix one possible initialization order bug in
needsUpdate() in src/lyx_main.C).
toFilesystemEncoding() is now used in all places where it is needed if I did
not forget anything.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16184 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-05 12:57:01 +00:00
Georg Baum
534095ce9e more unicode filenames
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16172 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 15:07:05 +00:00
Abdelrazak Younes
c6e4985a07 * GuiApplication::x11EventFilter(): check for currentView() before using it.
* Application::currentView(): now returns a pointer.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16170 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 13:52:02 +00:00
Georg Baum
c4320d24cd Make string conversion work with non-ucs2-characters if using qt 4.2
* src/frontends/qt4/qt_helpers.[Ch]
	(toqstr): Use QString::fromUcs4 if the qt version is at
	least 4.2.
	(qstring_to_ucs4): Use QString::toUcs4 if the qt version is at
	least 4.2
	(ucs4_to_qstring): Delete to avoid confusion, since it was only
	used in one place

	* src/frontends/qt4/panelstack.C
	(PanelStack::addCategory): Use toqstr instead of ucs4_to_qstring

	* src/support/unicode.[Ch]
	(ucs2_to_ucs4): Replace with utf16_to_ucs4
	(ucs4_to_ucs2): Replace with ucs4_to_utf16


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16169 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 13:50:46 +00:00
Abdelrazak Younes
493ec52c3f * Dimension is a simple wrapper class again.
* other files: use FontMetrics::dimension() method instead of old Dimension interface.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16167 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 10:45:43 +00:00
Abdelrazak Younes
b056d35db4 Forgot this!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16166 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 10:33:47 +00:00
Abdelrazak Younes
e318e0e4ef * enable font metrics cache for all platforms.
* introduce defaultDimension() and dimension() in preparation of Dimension class cleanup.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16165 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 10:09:22 +00:00
Bo Peng
7c184e5426 Button face-lift: use mouse hover-buttons.
* src/insets/insetbase.h: add setMouseHover function
	* src/insets/insetcommand.h/C: handle setMouseHover
	* src/insets/insetcollapsable.h/C: handle setMouseHover
	* src/LColor.h/C: redefine some colors
	* src/insets/render_base.h: add state_
	* src/insets/render_button.C: draw differently according to state_
	* src/frontends/Painter.h/C: hover-stype button
	* src/frontends/qt4/GuiWorkArea.C: enable mouse tracking
	* src/BufferView.C: track mouse_motion without button events


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16162 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 04:31:18 +00:00
Abdelrazak Younes
99cae6c723 two lines between function.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16158 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 13:17:35 +00:00
Abdelrazak Younes
7df55755ac Fix memory leaks with multiple windows and crash when deleteOnClose is set.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16157 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 13:09:57 +00:00
Abdelrazak Younes
6a96321573 * WorkArea::dispatch(): avoid GUI tweaks if cmd is a mouse motion with no button pressed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16156 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 10:43:55 +00:00
Peter Kümmel
a5b66d297f prepare fixing some memory leaks
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16155 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 10:30:18 +00:00
Peter Kümmel
2d0e33fc3f remove unused signal
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16154 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 10:14:35 +00:00
Peter Kümmel
f6cf871deb fix quit problems on Mac
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16153 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 10:05:41 +00:00
Michael Schmitt
103c37af4e * src/frontends/qt4/ui/QPrefUi.ui: clarify message
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16150 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 01:16:03 +00:00
Michael Schmitt
99d4acd183 * qt4/QExternal.C:
* qt4/lengthcombo.C:
	* qt4/QBox.C: make length units translateable


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16149 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 01:11:37 +00:00
Michael Schmitt
a85cc03780 * qt_helpers.h: qt_() - set parameter 'comment' to default 0
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16148 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 01:09:09 +00:00
Michael Schmitt
b5331d6261 * src/frontends/qt4/qt_helpers.h: fix comment on the use of qt_()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16147 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-03 00:28:14 +00:00
Abdelrazak Younes
88d16356f2 update comments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16142 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 21:55:28 +00:00
Michael Schmitt
75d0226ce8 * src/lyxfunc.C:
* src/frontends/qt4/GuiView.C:
	* src/lyx_main.C: fix various typos in comments


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16141 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 21:27:31 +00:00
Michael Schmitt
f099bf461e * src/frontends/qt4/qt_helpers.h: add #include <boost/assert.hpp>
because gcc 3.3.5pre (SUSE Linux 9.3) fails otherwise


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16140 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 21:25:24 +00:00
Georg Baum
9d1f78acb5 remove unused function
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16138 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 20:37:11 +00:00
Georg Baum
c5629aab95 remove duplicate of toqstr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16137 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 19:53:21 +00:00
Peter Kümmel
7b2cce9d5d Clean up quit code.
We still need a solution for the Mac.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16135 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 17:39:31 +00:00
Peter Kümmel
19df31aa0a --style=Andre
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16134 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 17:32:15 +00:00
Georg Baum
ed99f752f9 more unicode filenames
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16133 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 16:07:15 +00:00
Abdelrazak Younes
591d47a64b * qt_helpers.h:
- ucs4_to_qchar(): add a FIXME and an assertion

* GuiFontMetrics: replace the table based cache with two QHash based cache. With this change, the speed overhead is not negligible (exact same score with the UserGuide test) and the required additional memory is minimal (maybe one or two megabytes).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16132 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 15:54:49 +00:00
Abdelrazak Younes
52dc269fae CharMetrics: use short int instead of int. This halves the memory required for the font metrics cache.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16129 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-01 23:45:06 +00:00
Abdelrazak Younes
5f4e6d9a7c * GuiFontMetrics
- add constants instead of hard-coded values.
  - add assertions and comments for out of range values.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16126 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-01 17:23:58 +00:00
Abdelrazak Younes
8f98ec35e4 This commit fixes the following bug:
http://bugzilla.lyx.org/show_bug.cgi?id=2900

The only drawback is that it requires about 20Mo extra-memory when loading the UserGuide. If it turns out to be too much, we can switch to a QHash based solution instead of a table.

* dimension.[Ch]:
  - Dimension(LyXFont const, char_typec): new ctor
  - set(LyXFont const & font, char_type c): new method.

* frontends/FontMetrics.h:
  - width(char_type): is now a pure virtual method.

* GuiFontMetrics:
  - CharMetrics: new structure;
  - the metrics cache now also cache ascent and descent. This is especially useful for mathed.

* MathSupport.[Ch]:
  - mathed_char_dim(): deleted. We now use Dimension::set() directly instead.

* rowpainter.C: fixe empty space.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16124 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-01 16:12:24 +00:00
Peter Kümmel
67f2a91dcc FIXME: remove global variable theApp
This pointer was one reason for the Mac crashes because it not always had 
the same value as the application_ smart pointer



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16119 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-30 00:04:51 +00:00
Peter Kümmel
f4c32de361 remove size_t/int warning: QString doesn't use size_t so we must cast it to avoid the warning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16117 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-29 22:57:34 +00:00
Georg Baum
868dd237d1 fix compiler warning:
../../../../src/frontends/qt4/GuiView.C:142: warning: comparison between signed and unsigned integer expressions
../../../../src/frontends/qt4/GuiView.C:144: warning: comparison between signed and unsigned integer expressions
../../../../src/frontends/qt4/GuiView.C:146: warning: comparison between signed and unsigned integer expressions


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16113 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-29 21:52:56 +00:00