Commit Graph

164 Commits

Author SHA1 Message Date
Abdelrazak Younes
c07d5e9dd0 delete some Qt "signals" macro reference.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14414 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-10 17:44:36 +00:00
Abdelrazak Younes
a1b60fb963 delete Painter::fillPolygon() and associated frontend implementations
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14410 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-10 15:14:29 +00:00
Georg Baum
c9c6ed0b7f Split clipboard and X selection
* src/LyXAction.C
	(LyXAction::init): handle new LFUN_CLIPBOARD_PASTE

	* src/insets/insettabular.C
	(InsetTabular::doDispatch): ditto

	* src/insets/insetbox.C
	(InsetBox::doDispatch): ditto

	* src/insets/insetert.C
	(InsetERT::doDispatch): ditto
	(InsetERT::getStatus): ditto

	* src/insets/insetcharstyle.C
	(InsetCharStyle::doDispatch): ditto

	* src/BufferView_pimpl.C
	(BufferView::Pimpl::selectionRequest): stuff selection, not clipboard

	* src/mathed/math_nestinset.C
	(MathNestInset::lfunMousePress): get stuff selection, not clipboard
	(MathNestInset::lfunMouseRelease): clipboard -> selection in
	commented code

	* src/CutAndPaste.C
	(cutSelection): ditto

	* src/frontends/{qt3,gtk}/GuiImplementation.C
	(GuiImplementation::newWorkArea): create new selection, not clipboard,
	since the clipboard is now an object
	(GuiImplementation::destroyWorkArea): destroy selection, not clipboard

	* src/frontends/{qt4,qt3,gtk}/GuiSelection.h: new, copied from
	GuiClipboard.h

	* src/frontends/{qt4,qt3,gtk}/GuiSelection.C: new, copied from
	GuiClipboard.C

	* src/frontends/{qt3,gtk}/GuiImplementation.h
	(selection): new accessor for selection_
	(selection_): new, the global selection object

	* src/frontends/{qt4,qt3,gtk}/Makefile.am: add GuiSelection.C and
	GuiSelection.h

	* src/frontends/{qt4,qt3,gtk}/GuiClipboard.C
	(GuiClipboard::get): return clipboard, not selection
	(GuiClipboard::put): stuff clipboard, not selection

	* src/frontends/{qt4,qt3,gtk}/GuiClipboard.h
	(haveSelection): remove (this is now in GuiSelection)

	* src/frontends/{qt3,gtk}/GuiClipboard.h
	(old_work_area_): remove, since it is not needed anymore

	* src/frontends/gtk/ghelpers.C
	(getGTKStockIcon): handle LFUN_CLIPBOARD_PASTE

	* src/frontends/Clipboard.h
	(haveSelection): remove (this is now in Selection)

	* src/frontends/qt4/GuiImplementation.[Ch]
	(GuiImplementation::selection): new accessor for selection_

	* src/frontends/Gui.h
	(selection): New accessor for the global selection object

	* src/frontends/Selection.h; new, copied from Clipboard.h

	* src/frontends/Makefile.am: add Selection.h

	* src/text3.C
	(various): s/clipboard().haveSelection/selection().haveSelection/

	(LyXText::dispatch): handle LFUN_CLIPBOARD_PASTE
	(LyXText::getStatus): ditto

	* src/lfuns.h: new lfun LFUN_CLIPBOARD_PASTE

	* lib/ui/stdmenus.ui: add new lfun LFUN_CLIPBOARD_PASTE


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14408 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-10 11:32:25 +00:00
Lars Gullik Bjønnes
66d51d71f9 Let Meta be an alias for Alt
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14404 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-09 17:30:21 +00:00
Lars Gullik Bjønnes
e7b69c030e Extracted from r14281
* BufferView:
    - hideCursor(): deleted (for real)
* frontends/GuiCursor:
    - deleted. Functionality transfered to WorkArea.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14389 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-08 22:55:22 +00:00
Lars Gullik Bjønnes
721497d5e5 Extracted from 14281
* frontends/WorkArea:
  - processKeySym(): new method that should be used by all frontends
    instead of buffer_view_->workAreaKeyPress().
* frontends/qt4/GuiWorkArea:
  - keyPressEvent(): call WorkArea::processKeySym() instead of
    buffer_view_->workAreaKeyPress().
* frontends/gtk/GWorkArea.C:
* frontends/qt3/QContentPane.C:
  - call WorkArea::processKeySym() instead of
    buffer_view_->workAreaKeyPress()


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14383 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-08 21:04:21 +00:00
Georg Baum
457b334926 Move more methods from WorkArea to Clipboard in qt3 and gtk
* src/frontends/gtk/GWorkArea.[Ch]
	(getClipboard): Move to GuiClipboard.[Ch]
	(putClipboard): ditto

	* src/frontends/gtk/Makefile.am: add GuiClipboard.C

	* src/frontends/gtk/GuiClipboard.C: new file

	* src/frontends/gtk/GuiClipboard.h
	(get, put): only declare

	* src/frontends/qt3/Makefile.am: add GuiClipboard.C

	* src/frontends/qt3/QWorkArea.[Ch]
	(getClipboard): Move to GuiClipboard.[Ch]
	(putClipboard): ditto

	* src/frontends/qt3/GuiClipboard.C: new file

	* src/frontends/qt3/GuiClipboard.h
	(get, put): only declare

	* src/frontends/qt4/GuiClipboard.C: remove unneeded include
	(GuiClipboard::get): adjust debug output
	(GuiClipboard::put): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14378 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-08 15:11:18 +00:00
Georg Baum
a7fe209a13 * src/frontends/gtk/GuiImplementation.C: include config.h
* src/frontends/qt4/GuiImplementation.C: ditto
	* src/frontends/qt4/TocModel.C: ditto
	* src/frontends/qt4/GuiClipboard.C: ditto

	* src/frontends/gtk/GuiClipboard.h fix spelling
	* src/frontends/qt3/GuiClipboard.h: ditto
	* src/frontends/qt4/GuiClipboard.h: ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14375 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-08 13:27:43 +00:00
Abdelrazak Younes
a0d93c0c49 * MSVC Compilation fix: #warning is not supported.
* Change the comment to "This is not a memory leak:"


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14347 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-06 11:28:05 +00:00
Lars Gullik Bjønnes
1afb2a6b05 Remove quite a few compiler warnings:
- Change unsigned -> signed
	- Change signed -> unsigned
        - Add a cast or two (really few of those)
	- Remove/comment out unused variables
	- Comment out unused arguments
	- Add missing cases to switches.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14344 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-06 08:18:51 +00:00
Georg Baum
da9cdaf218 Reduce calls of ::exit()
* src/main.C
	(main): return LyX::exec()

	* src/frontends/{gtk,qt3,qt4}/lyx_gui.C
	(lyx_gui::exec): Change return value to int
	(lyx_gui::start): ditto

	* src/frontends/qt[3,4]/lyx_gui.C
	(lyx_gui::exit): Call QApplication::exit instead of ::exit, this
	hack is not needed anymore

	* src/frontends/lyx_gui.h
	(lyx_gui::exec): Change return value to int
	(lyx_gui::start): ditto

	* src/lyxtextclasslist.[Ch]
	(LyXSetStyle): SChange return value to bool and don't call ::exit

	* src/lyx_main.C
	(showFileError): Don't exit anymore

	* src/lyx_main.[Ch]
	(LyX::exec): Change return value to int
	(LyX::priv_exec): ditto
	(LyX::exec2): ditto
	(LyX::init): Change return value to bool
	(LyX::readRcFile): ditto
	(LyX::readUIFile): ditto



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14339 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-05 17:01:26 +00:00
Lars Gullik Bjønnes
b1a87cc778 Extracted from r14281 from the younes branch.
* BufferView,BufferView::Pimple:
	-  workArea_ removed
* frontends/LyXView:
	- now contains a pointer reference to the current
	  WorkArea instead of the BufferView.
        - workArea(): temporary access method
* frontends/WorkArea:
	- bufferView(): new access methods.

* GuiImplementation: updated due to above changes


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14329 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-03 22:31:51 +00:00
Georg Baum
0c0c43b8eb merge booktabs branch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14319 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-03 19:13:56 +00:00
Bo Peng
84d52901d7 Add config.h to src/frontends/qt4/Application.C to avoid MSVC BOOST_ALL_NO_LIB problem.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14284 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-01 18:14:58 +00:00
Lars Gullik Bjønnes
05eeb3ae77 make sure eol-style native is set and fix eol style
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14279 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-30 14:50:44 +00:00
Lars Gullik Bjønnes
d2b2aa8124 Make signals and slots to not be defined, and replace them with Q_SIGNALS and Q_SLOTS
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14277 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-30 14:37:33 +00:00
Lars Gullik Bjønnes
ecaff823df delete some emits that I missed, add comments about emitting signals
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14273 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-30 14:11:50 +00:00
Lars Gullik Bjønnes
96a7b5d0af Do not use the qt "keyword" emit. Make qt not emit it at all. (pun intended)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14269 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-30 11:57:17 +00:00
Edwin Leuven
c8a91657d2 some connections not made because of:
- signal typo
- slots typos 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14257 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-28 12:48:51 +00:00
Abdelrazak Younes
9f5f309ea2 QURL renamed to UrlView
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14256 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-28 12:09:25 +00:00
Edwin Leuven
1f0a608b99 put citation dialog in good state:
- natbib style (the combox) works
- when moving/up down the item stays selected (allowing sequential ups/downs)
- when deleting the next selected entry gets focus (allowing sequential deletes)
- the info is now shown and updated
- find subsets the available entries as you type
- no additional find dialog (removed QCitationFind.ui)
- selecting with double-click
- removal of unused: Citation class, toVector() function


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14252 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-28 08:28:16 +00:00
Jean-Marc Lasgouttes
f861ba839d Patch from Martin Vermeer for bug 2218.
* src/frontends/xforms/FormSpellchecker.C (update): 
	* src/frontends/qt[34]/QSpellchecker.C (update_contents): fix bug 
	2218: Spellchecker doesn't pop up dialogue window for the first 
	misspelled word.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14246 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-27 12:20:16 +00:00
Jean-Marc Lasgouttes
44a5cfc89c Renaming:
cygwin_path_fix		->	windows_style_tex_paths
	cygwin_path_fix_needed	->	tex_expects_windows_paths
	check_cygwin_path	->	check_windows_style_tex_paths
	use_cygwin_paths	->	use_windows_paths
	RC_CYGWIN_PATH_FIX	->	RC_TEX_EXPECTS_WINDOWS_PATHS

	* src/frontends/qt4/ui/QPrefCygwinPathUi.ui
	* src/frontends/qt3/ui/QPrefCygwinPathModule.ui
	  Updated checkbutton label and description

	* src/frontends/qt4/QPrefsDialog.C
	  (PrefCygwinPath): cygwin_path_fix -> windows_style_tex_paths
	  (QPrefsDialog): Enable checkbutton for native WIN32 builds

	* src/frontends/xforms/forms/form_preferences.fd
	  Updated label and name of checkbutton

	* src/frontends/xforms/FormPreferences.C
	  (apply): cygwin_path_fix -> windows_style_tex_paths
	           check_cygwin_path -> check_windows_style_tex_paths
	  (build): Enable checkbutton for native WIN32 builds
	  (update): Ditto
	  (feedback): Updated description

	* src/frontends/qt3/QPrefs.C
	* src/frontends/qt3/QPrefsDialog.C
	* src/frontends/qt3/QPrefsDialog.h
	  Renaming as above, enabled checkbutton for native WIN32 builds

	* src/support/os_unix.C
	* src/support/os.h
	* src/support/os_win32.C
	  Renaming cygwin_path_fix -> windows_style_tex_paths
	* src/support/os_cygwin.C
	  Ditto
	  (external_path, external_path_list): always return windows
	  style paths, not depending on the checkbutton status

	* src/lyxrc.C
	* src/lyxrc.h
	* src/lyxfunc.C
	* src/lyx_main.C
	  Renaming

	* lib/configure.py
	  Renaming, more meaningful diagnostics




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14242 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-27 10:51:24 +00:00
Abdelrazak Younes
f6cf605786 Potential Bux fix: call "update()" instead of "vieport()->update()"
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14241 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-27 10:28:04 +00:00
Peter Kümmel
152d55cdf6 add link to the task tracker of the Qt4 bug
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14240 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-27 07:53:44 +00:00
Peter Kümmel
2deec8a96a Pass width = 0 and height = 0 as unsigned int to indicate the usage of the geometry option
* lyx_main.C set             width and height to 0
	* frontends/qt3/lyx_gui.C    test on 0
	* frontends/qt4/lyx_gui.C    test on 0  
	


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14235 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-26 18:07:10 +00:00
Abdelrazak Younes
a8bf36a413 GUI API Cleanup step 2: merge of the "younes" branch. What's missing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14234 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-26 17:18:28 +00:00
Abdelrazak Younes
2d4589b4ae Removed files because of conflict when merging the "younes" branch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14233 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-26 17:14:25 +00:00
Abdelrazak Younes
33a6fc122c Removed file because of conflict when merging the "younes" branch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14232 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-26 17:13:31 +00:00
Abdelrazak Younes
3287c44f33 GUI API Cleanup step 2: merge of the "younes" branch.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14231 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-26 16:55:35 +00:00
Lars Gullik Bjønnes
702621aabd Fix 64bit<->32bit issue.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14203 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-25 11:27:33 +00:00
Edwin Leuven
641fae7ed5 * reset color/linestyle/linewidth cache to QPen defaults on QPainter creation
* get rid of QPainter arg in setQPainterPen(..)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14201 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-25 11:18:56 +00:00
Abdelrazak Younes
2335670309 * qp_ member is now used for painting
* QLPainter::start() now re-initialize qp_
* QLPainter::end() now end qp_


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14184 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-23 14:12:17 +00:00
Peter Kümmel
0afff7f598 * frontends/qt3/QtView.C: use QRect ctor, coding style
* frontends/qt4/lyx_gui.C: coding style
	* frontends/qt4/GuiView.C: use QRect ctor, coding style



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14183 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-23 10:19:31 +00:00
Peter Kümmel
04cfa65a96 fix: qt3/qt4 save/restore of the window geometry and maximize status
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14166 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-21 10:30:32 +00:00
Abdelrazak Younes
42e04448d5 QtView renamed to GuiView
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14162 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-20 14:35:36 +00:00
Abdelrazak Younes
d46add7754 QtView renamed to GuiView
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14154 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-20 09:33:01 +00:00
Abdelrazak Younes
c7d3458f99 * [qt3, xforms, gtk]/GuiImplementation::newWorkArea: return 0
* qt4/Application.[Ch]: was not merged (GUI API cleanup merge) for an unknown reason
* qt4/clipboard.C: ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14153 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-20 09:17:19 +00:00
Abdelrazak Younes
d8ae51dbe1 This is the merging of the GUI API cleanup branch that was developed in svn+ssh://svn.lyx.org/lyx/lyx-devel/branches/personal/younes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14152 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-20 08:39:16 +00:00
Jürgen Spitzmüller
54acb900ad The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).

        * lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).

        * lib/chkconfig.ltx: Test for newly supported font packages

        * lib/doc/LaTeXConfig.lyx.in: document newly supported font packages

        * lib/doc/UserGuide.lyx: document new UI.

        * lib/doc/Extended.lyx: update PostScript font documentation

        * development/FORMAT: document file format change 246->247.

        * src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans, 
           tex_fonts_monospaced (with GUI equivalents).

        * src/buffer.C: Format up to 247.

        * src/bufferparams.C:
        new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,    
        fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
        (LyXFont const BufferParams::getFont): consider switch of default family.
        (string const BufferParams::loadFonts): new method to get all the LaTeX 
        font stuff done.

        * src/paragraph.C
        (LyXFont const Paragraph::getFont):
        (LyXFont const Paragraph::getLabelFont):
        (LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's 
        default font

        * src/text.C
        (int LyXText::leftMargin):
        (int LyXText::rightMargin): user buffer's not textclass's default font

        * src/text2.C
        (LyXFont LyXText::getFont):
        (LyXFont LyXText::getLayoutFont):
        (LyXFont LyXText::getLabelFont): check if the family of the default document 
        font has been customized.

        * src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).

        * src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM). 

        * src/frontends/qt3/Makefile.dialogs: add new FontModuleBase

        * src/frontends/qt3/ui/FontModuleBase.ui: new File

        * src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets

        * src/frontends/qt3/QDocument.C
        * src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui

        * src/frontends/qt4/Makefile.dialogs: add new FontUi

        * src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui

        * src/frontends/qt4/ui/FontUi.ui: new File

        * src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets

        * src/frontends/qt4/ui/compile_uic.sh: add new FontUi

        * src/frontends/xforms/FormDocument.[Ch]: implement new font ui

        * src/frontends/xforms/forms/form_document.fd: add new font tab.

        * src/frontends/controllers/ControlDocument.[Ch]
        (char ControlDocument::fontfamilies):
        (char ControlDocument::fontfamilies_gui):
        (bool ControlDocument::isFontAvailable):
        (bool ControlDocument::providesSC):
        (bool ControlDocument::providesOSF):
        (bool ControlDocument::providesScale): new methods, providing font info.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
Abdelrazak Younes
30649ec3b6 Those classes (and their associated [Ch] files) are renamed :
QLAction -> Action
lcolorcache -> ColorCache
qfont_loader.C -> FontLoader




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14136 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-17 09:14:58 +00:00
Peter Kümmel
e97a9f1043 don't break the geometry option
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14122 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-15 16:01:55 +00:00
Georg Baum
20802b7c9b remove references to deleted file QtLyXView.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14112 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 19:26:23 +00:00
Peter Kümmel
fcdbd2357d load and restore correct windows postion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14104 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 14:42:24 +00:00
Peter Kümmel
cd53c67f79 load and restore correct windows postion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14102 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 14:32:39 +00:00
Peter Kümmel
c02f6409ec Fix Qt4 resize bug.
Don't use  multiple QPainter::begin on the same QPaintDevice.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14101 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-14 14:23:25 +00:00
Peter Kümmel
bbc587ee9a coding style and readability corrections
Index: frontends/qt3/lyx_gui.C
===================================================================
--- frontends/qt3/lyx_gui.C     (revision 14088)
+++ frontends/qt3/lyx_gui.C     (working copy)
@@ -222,12 +222,12 @@


 void start(string const & batch, vector<string> const & files,
-          unsigned int width, unsigned int height, int posx, int posy, bool isMax)
+          unsigned int width, unsigned int height, int posx, int posy, bool maximize)
 {
        // this can't be done before because it needs the Languages object
        initEncodings();

-       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
+       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, maximize));
        LyX::ref().addLyXView(view_ptr);

        QtView & view = *view_ptr.get();
Index: frontends/qt3/QtView.C
===================================================================
--- frontends/qt3/QtView.C      (revision 14088)
+++ frontends/qt3/QtView.C      (working copy)
@@ -55,12 +55,12 @@



-QtView::QtView(unsigned int width, unsigned int height, bool isMax)
+QtView::QtView(unsigned int width, unsigned int height, bool maximize)
        : QMainWindow(), LyXView(), commandbuffer_(0)
 {
        resize(width, height);

-       if(isMax)
+       if (maximize)
                this->setWindowState(WindowMaximized);

        qApp->setMainWidget(this);
@@ -164,7 +164,7 @@
 void QtView::closeEvent(QCloseEvent *)
 {
        LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no"));
-       //don't save maximized values
+       // don't save maximized values
        this->showNormal();
        // save windows size and position
        LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
Index: frontends/qt3/QtView.h
===================================================================
--- frontends/qt3/QtView.h      (revision 14088)
+++ frontends/qt3/QtView.h      (working copy)
@@ -37,7 +37,7 @@
        Q_OBJECT
 public:
        /// create a main window of the given dimensions
-       QtView(unsigned int w, unsigned int h, bool isMax);
+       QtView(unsigned int w, unsigned int h, bool maximize);

        ~QtView();

Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C     (revision 14088)
+++ frontends/qt4/lyx_gui.C     (working copy)
@@ -228,12 +228,12 @@


 void start(string const & batch, vector<string> const & files,
-          unsigned int width, unsigned int height, int posx, int posy, bool isMax)
+          unsigned int width, unsigned int height, int posx, int posy, bool maximize)
 {
        // this can't be done before because it needs the Languages object
        initEncodings();

-       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
+       boost::shared_ptr<QtView> view_ptr(new QtView(width, height, maximize));
        LyX::ref().addLyXView(view_ptr);

        QtView & view = *view_ptr.get();
Index: frontends/qt4/QtView.C
===================================================================
--- frontends/qt4/QtView.C      (revision 14088)
+++ frontends/qt4/QtView.C      (working copy)
@@ -70,12 +70,12 @@
 } // namespace anon


-QtView::QtView(unsigned int width, unsigned int height, bool isMax)
+QtView::QtView(unsigned int width, unsigned int height, bool maximize)
        : QMainWindow(), LyXView(), commandbuffer_(0)
 {
        resize(width, height);

-       if(isMax)
+       if (maximize)
                this->setWindowState(Qt::WindowMaximized);

        mainWidget_ = this;
Index: frontends/qt4/QtView.h
===================================================================
--- frontends/qt4/QtView.h      (revision 14088)
+++ frontends/qt4/QtView.h      (working copy)
@@ -47,7 +47,7 @@
        Q_OBJECT
 public:
        /// create a main window of the given dimensions
-       QtView(unsigned int w, unsigned int h, bool isMax);
+       QtView(unsigned int w, unsigned int h, bool maximize);

        ~QtView();

Index: frontends/lyx_gui.h
===================================================================
--- frontends/lyx_gui.h (revision 14088)
+++ frontends/lyx_gui.h (working copy)
@@ -57,7 +57,7 @@
  * batch commands, and loading the given documents
  */
 void start(std::string const & batch, std::vector<std::string> const & files,
-           unsigned int width, unsigned int height, int posx, int posy, bool isMax);
+           unsigned int width, unsigned int height, int posx, int posy, bool maximize);

 /**
  * Enter the main event loop (\sa LyX::exec2)
Index: lyx_main.C
===================================================================
--- lyx_main.C  (revision 14088)
+++ lyx_main.C  (working copy)
@@ -307,7 +307,7 @@
                // initial geometry
                unsigned int width = 690;
                unsigned int height = 510;
-               bool isMax = false;
+               bool maximize = false;
                // first try lyxrc
                if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
                        width = lyxrc.geometry_width;
@@ -322,7 +322,7 @@
                        if (!val.empty())
                                height = convert<unsigned int>(val);
                        if (session().loadSessionInfo("WindowIsMaximized") == "yes")
-                               isMax = true;
+                               maximize = true;
                }
                // if user wants to restore window position
                int posx = -1;
@@ -335,7 +335,7 @@
                        if (!val.empty())
                                posy = convert<int>(val);
                }
-               lyx_gui::start(batch_command, files, width, height, posx, posy, isMax);
+               lyx_gui::start(batch_command, files, width, height, posx, posy, maximize);
        } else {
                // Something went wrong above
                quitLyX(false);



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14089 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-13 08:24:43 +00:00
Peter Kümmel
226acfcbab Qt3/Qt4:
- don't save geometry values of the maximized lyx window
   - save/restore the maximized property of the lyx window

- fix changed lyx_gui::start interface for xform and gtk


Index: frontends/gtk/lyx_gui.C
===================================================================
--- frontends/gtk/lyx_gui.C	(revision 14083)
+++ frontends/gtk/lyx_gui.C	(working copy)
@@ -123,7 +123,7 @@
 
 
 void lyx_gui::start(string const & batch, std::vector<string> const & files,
-		    unsigned int width, unsigned int height, int posx, int posy)
+		    unsigned int width, unsigned int height, int posx, int posy, bool)
 {
 	boost::shared_ptr<GView> view_ptr(new GView);
 	LyX::ref().addLyXView(view_ptr);
Index: frontends/qt3/lyx_gui.C
===================================================================
--- frontends/qt3/lyx_gui.C	(revision 14083)
+++ frontends/qt3/lyx_gui.C	(working copy)
@@ -222,12 +222,12 @@
 
 
 void start(string const & batch, vector<string> const & files,
-	   unsigned int width, unsigned int height, int posx, int posy)
+	   unsigned int width, unsigned int height, int posx, int posy, bool isMax)
 {
 	// this can't be done before because it needs the Languages object
 	initEncodings();
 
-	boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
+	boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
 	LyX::ref().addLyXView(view_ptr);
 
 	QtView & view = *view_ptr.get();
Index: frontends/qt3/QtView.C
===================================================================
--- frontends/qt3/QtView.C	(revision 14083)
+++ frontends/qt3/QtView.C	(working copy)
@@ -55,10 +55,13 @@
 
 
 
-QtView::QtView(unsigned int width, unsigned int height)
+QtView::QtView(unsigned int width, unsigned int height, bool isMax)
 	: QMainWindow(), LyXView(), commandbuffer_(0)
 {
 	resize(width, height);
+	
+	if(isMax)
+		this->setWindowState(WindowMaximized);
 
 	qApp->setMainWidget(this);
 
@@ -160,6 +163,9 @@
 
 void QtView::closeEvent(QCloseEvent *)
 {
+	LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no"));
+	//don't save maximized values
+	this->showNormal();
 	// save windows size and position
 	LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
 	LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(height()));
Index: frontends/qt3/QtView.h
===================================================================
--- frontends/qt3/QtView.h	(revision 14083)
+++ frontends/qt3/QtView.h	(working copy)
@@ -37,7 +37,7 @@
 	Q_OBJECT
 public:
 	/// create a main window of the given dimensions
-	QtView(unsigned int w, unsigned int h);
+	QtView(unsigned int w, unsigned int h, bool isMax);
 
 	~QtView();
 
Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C	(revision 14083)
+++ frontends/qt4/lyx_gui.C	(working copy)
@@ -228,12 +228,12 @@
 
 
 void start(string const & batch, vector<string> const & files,
-	   unsigned int width, unsigned int height, int posx, int posy)
+	   unsigned int width, unsigned int height, int posx, int posy, bool isMax)
 {
 	// this can't be done before because it needs the Languages object
 	initEncodings();
 
-	boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
+	boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
 	LyX::ref().addLyXView(view_ptr);
 
 	QtView & view = *view_ptr.get();
Index: frontends/qt4/QtView.C
===================================================================
--- frontends/qt4/QtView.C	(revision 14083)
+++ frontends/qt4/QtView.C	(working copy)
@@ -70,11 +70,14 @@
 } // namespace anon
 
 
-QtView::QtView(unsigned int width, unsigned int height)
+QtView::QtView(unsigned int width, unsigned int height, bool isMax)
 	: QMainWindow(), LyXView(), commandbuffer_(0)
 {
 	resize(width, height);
 
+	if(isMax)
+		this->setWindowState(Qt::WindowMaximized);
+
 	mainWidget_ = this;
 
 //	setToolButtonStyle(Qt::ToolButtonIconOnly);
@@ -182,11 +185,12 @@
 void QtView::closeEvent(QCloseEvent *)
 {
 	// save windows size and position
-	LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
-	LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(height()));
+	LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(this->normalGeometry().width()));
+	LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(this->normalGeometry().height()));
+	LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no"));
 	if (lyxrc.geometry_xysaved) {
-		LyX::ref().session().saveSessionInfo("WindowPosX", convert<string>(x()));
-		LyX::ref().session().saveSessionInfo("WindowPosY", convert<string>(y()));
+		LyX::ref().session().saveSessionInfo("WindowPosX", convert<string>(this->normalGeometry().x()));
+		LyX::ref().session().saveSessionInfo("WindowPosY", convert<string>(this->normalGeometry().y()));
 	}
 	// trigger LFUN_LYX_QUIT instead of quit directly
 	// since LFUN_LYX_QUIT may have more cleanup stuff
Index: frontends/qt4/QtView.h
===================================================================
--- frontends/qt4/QtView.h	(revision 14083)
+++ frontends/qt4/QtView.h	(working copy)
@@ -47,7 +47,7 @@
 	Q_OBJECT
 public:
 	/// create a main window of the given dimensions
-	QtView(unsigned int w, unsigned int h);
+	QtView(unsigned int w, unsigned int h, bool isMax);
 
 	~QtView();
 
Index: frontends/xforms/lyx_gui.C
===================================================================
--- frontends/xforms/lyx_gui.C	(revision 14083)
+++ frontends/xforms/lyx_gui.C	(working copy)
@@ -256,7 +256,7 @@
 
 
 void start(string const & batch, vector<string> const & files,
-	   unsigned int width, unsigned int height, int posx, int posy)
+	   unsigned int width, unsigned int height, int posx, int posy, bool)
 {
 	int const geometryBitmask =
 		XParseGeometry(geometry, &posx, &posy, &width, &height);
Index: frontends/lyx_gui.h
===================================================================
--- frontends/lyx_gui.h	(revision 14083)
+++ frontends/lyx_gui.h	(working copy)
@@ -57,7 +57,7 @@
  * batch commands, and loading the given documents
  */
 void start(std::string const & batch, std::vector<std::string> const & files,
-           unsigned int width, unsigned int height, int posx, int posy);
+           unsigned int width, unsigned int height, int posx, int posy, bool isMax);
 
 /**
  * Enter the main event loop (\sa LyX::exec2)
Index: lyx_main.C
===================================================================
--- lyx_main.C	(revision 14083)
+++ lyx_main.C	(working copy)
@@ -307,6 +307,7 @@
 		// initial geometry
 		unsigned int width = 690;
 		unsigned int height = 510;
+		bool isMax = false;
 		// first try lyxrc
 		if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
 			width = lyxrc.geometry_width;
@@ -320,6 +321,8 @@
 			val = session().loadSessionInfo("WindowHeight");
 			if (!val.empty())
 				height = convert<unsigned int>(val);
+			if (session().loadSessionInfo("WindowIsMaximized") == "yes")
+				isMax = true;
 		}
 		// if user wants to restore window position
 		int posx = -1;
@@ -332,7 +335,7 @@
 			if (!val.empty())
 				posy = convert<int>(val);
 		}
-		lyx_gui::start(batch_command, files, width, height, posx, posy);
+		lyx_gui::start(batch_command, files, width, height, posx, posy, isMax);
 	} else {
 		// Something went wrong above
 		quitLyX(false);



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14088 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-13 08:05:00 +00:00
Abdelrazak Younes
7efc6e9e0a Deleted because not used anywhere.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14079 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-11 21:45:01 +00:00
Abdelrazak Younes
5c4d89d816 Simple optimisation: reuse current QPainter if no there's no change in settings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14078 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-11 21:22:36 +00:00