diff --git a/development/qmake/qt4/qt4.pro b/development/qmake/qt4/qt4.pro index 77c9a8c95f..ce046c1b6e 100644 --- a/development/qmake/qt4/qt4.pro +++ b/development/qmake/qt4/qt4.pro @@ -41,14 +41,11 @@ HPP += GuiDocument.h HPP += GuiErrorList.h HPP += GuiERT.h HPP += GuiExternal.h -HPP += GuiFloatDialog.h HPP += GuiFloat.h HPP += GuiFontExample.h HPP += GuiFontLoader.h HPP += GuiFontMetrics.h -HPP += GuiGraphicsDialog.h HPP += GuiGraphics.h -HPP += GuiGraphicsUi.h HPP += GuiImage.h HPP += GuiImplementation.h HPP += GuiInclude.h @@ -97,7 +94,6 @@ HPP += qt_helpers.h HPP += socket_callback.h HPP += TocModel.h HPP += TocWidget.h -HPP += UrlView.h HPP += Validator.h CPP += Action.cpp @@ -130,12 +126,10 @@ CPP += GuiErrorList.cpp CPP += GuiERT.cpp CPP += GuiExternal.cpp CPP += GuiFloat.cpp -CPP += GuiFloatDialog.cpp CPP += GuiFontExample.cpp CPP += GuiFontLoader.cpp CPP += GuiFontMetrics.cpp CPP += GuiGraphics.cpp -CPP += GuiGraphicsDialog.cpp CPP += GuiImage.cpp CPP += GuiImplementation.cpp CPP += GuiInclude.cpp @@ -183,7 +177,6 @@ CPP += qt_helpers.cpp CPP += socket_callback.cpp CPP += TocModel.cpp CPP += TocWidget.cpp -CPP += UrlView.cpp CPP += Validator.cpp UI += AboutUi.ui diff --git a/development/scons/scons_manifest.py b/development/scons/scons_manifest.py index ac41733233..899dacd47c 100644 --- a/development/scons/scons_manifest.py +++ b/development/scons/scons_manifest.py @@ -871,11 +871,9 @@ src_frontends_qt4_header_files = Split(''' GuiErrorList.h GuiERT.h GuiExternal.h - GuiFloatDialog.h GuiFloat.h GuiFontExample.h GuiFontLoader.h - GuiGraphicsDialog.h GuiGraphics.h GuiGraphicsUi.h GuiImage.h @@ -923,7 +921,6 @@ src_frontends_qt4_header_files = Split(''' Qt2BC.h TocModel.h TocWidget.h - UrlView.h Validator.h qlkey.h qt_helpers.h @@ -962,12 +959,10 @@ src_frontends_qt4_files = Split(''' GuiERT.cpp GuiExternal.cpp GuiFloat.cpp - GuiFloatDialog.cpp GuiFontExample.cpp GuiFontLoader.cpp GuiFontMetrics.cpp GuiGraphics.cpp - GuiGraphicsDialog.cpp GuiImage.cpp GuiImplementation.cpp GuiInclude.cpp @@ -1013,7 +1008,6 @@ src_frontends_qt4_files = Split(''' Qt2BC.cpp TocModel.cpp TocWidget.cpp - UrlView.cpp Validator.cpp alert_pimpl.cpp qt_helpers.cpp diff --git a/po/POTFILES.in b/po/POTFILES.in index 0fd217fd4e..b3b61268d2 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -50,10 +50,8 @@ src/frontends/controllers/frontend_helpers.cpp src/frontends/qt4/BulletsModule.cpp src/frontends/qt4/Dialogs.cpp src/frontends/qt4/FileDialog.cpp -src/frontends/qt4/GuiApplication.cpp -src/frontends/qt4/GuiView.cpp -src/frontends/qt4/IconPalette.cpp src/frontends/qt4/GuiAbout.cpp +src/frontends/qt4/GuiApplication.cpp src/frontends/qt4/GuiBibitem.cpp src/frontends/qt4/GuiBibtex.cpp src/frontends/qt4/GuiBox.cpp @@ -86,7 +84,9 @@ src/frontends/qt4/GuiTabularCreate.cpp src/frontends/qt4/GuiTexinfo.cpp src/frontends/qt4/GuiThesaurus.cpp src/frontends/qt4/GuiVSpace.cpp +src/frontends/qt4/GuiView.cpp src/frontends/qt4/GuiWrap.cpp +src/frontends/qt4/IconPalette.cpp src/frontends/qt4/Qt2BC.h src/frontends/qt4/UrlView.cpp src/frontends/qt4/Validator.cpp diff --git a/po/ca.po b/po/ca.po index f6d8a10988..7728ad45d0 100644 --- a/po/ca.po +++ b/po/ca.po @@ -18,7 +18,7 @@ msgid "" msgstr "" "Project-Id-Version: ca\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-06-01 18:19+0200\n" "Last-Translator: Joan Montané \n" "Language-Team: catalan \n" @@ -14812,30 +14812,6 @@ msgstr "Reconfigura|R" msgid "Quit %1" msgstr "Surt del LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "Icones petites" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "Icones normals" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "Icones grans" - -#: src/frontends/qt4/GuiView.cpp:194 -msgid "unknown version" -msgstr "versió desconeguda" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "" @@ -15404,10 +15380,34 @@ msgstr "Informaci msgid "Vertical Space Settings" msgstr "" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "Icones petites" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "Icones normals" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "Icones grans" + +#: src/frontends/qt4/GuiView.cpp:194 +msgid "unknown version" +msgstr "versió desconeguda" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "espai" diff --git a/po/cs.po b/po/cs.po index c8ffd1aceb..f9df4aac50 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Lyx 1.5.0svn\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-07-09 04:42+0200\n" "Last-Translator: Pavel Sanda \n" "Language-Team: Czech \n" @@ -14759,30 +14759,6 @@ msgstr "Rekonfigurovat|R" msgid "Quit %1" msgstr "Ukončit LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "Malé ikony" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "Normální ikony" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "Velké ikony" - -#: src/frontends/qt4/GuiView.cpp:194 -msgid "unknown version" -msgstr "neznámá verze" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "Klikněte pro odpojení" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Nastavení hesla bibliografie" @@ -15347,10 +15323,34 @@ msgstr "Informace TeX-u" msgid "Vertical Space Settings" msgstr "Nastavení vertikální mezery" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "Malé ikony" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "Normální ikony" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "Velké ikony" + +#: src/frontends/qt4/GuiView.cpp:194 +msgid "unknown version" +msgstr "neznámá verze" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Nastavení obtékání textu" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "Klikněte pro odpojení" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "mezera" diff --git a/po/es.po b/po/es.po index c7ae4f13da..a30ad98e37 100644 --- a/po/es.po +++ b/po/es.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2006-11-07 18:46+0100\n" "Last-Translator: Eulogio Serradilla \n" "Language-Team: \n" @@ -15264,31 +15264,6 @@ msgstr "Reconfigurar|R" msgid "Quit %1" msgstr "Salir de LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -#, fuzzy -msgid "unknown version" -msgstr "Acción desconocida" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Configuración de entrada bibliográfica" @@ -15853,10 +15828,35 @@ msgstr "Informaci msgid "Vertical Space Settings" msgstr "Configuración del espacio vertical" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +#, fuzzy +msgid "unknown version" +msgstr "Acción desconocida" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Configuración del ajuste de línea" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "espacio" diff --git a/po/eu.po b/po/eu.po index 2c252276ea..f2a68b48e5 100644 --- a/po/eu.po +++ b/po/eu.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: lyx_1.5.0_eu\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2006-11-08 11:47+0000\n" "Last-Translator: Ińaki Larrańaga Murgoitio \n" "Language-Team: Basque \n" @@ -15243,31 +15243,6 @@ msgstr "Birkonfiguratu|B" msgid "Quit %1" msgstr "Irten LyX-etik" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -#, fuzzy -msgid "unknown version" -msgstr "Ekintza ezezaguna" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Bibliografia-sarreren ezarpenak" @@ -15832,10 +15807,35 @@ msgstr "TeX informazioa" msgid "Vertical Space Settings" msgstr "Tarte bertikalaren ezarpenak" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +#, fuzzy +msgid "unknown version" +msgstr "Ekintza ezezaguna" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Testua doitzeko ezarpenak" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "tartea" diff --git a/po/fr.po b/po/fr.po index fd5d883d47..a9a2d9355b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -170,7 +170,7 @@ msgid "" msgstr "" "Project-Id-Version: LyX 1.4.3\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-07-18 08:48+0200\n" "Last-Translator: Adrien Rebollo \n" "Language-Team: lyxfr \n" @@ -15464,31 +15464,6 @@ msgstr "Reconfigurer|R" msgid "Quit %1" msgstr "Quitter %1" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -#, fuzzy -msgid "unknown version" -msgstr "Action inconnue" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Paramčtres d'Entrée de Bibliographie" @@ -16063,10 +16038,35 @@ msgstr "Informations TeX" msgid "Vertical Space Settings" msgstr "Paramčtres d'espacement vertical" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +#, fuzzy +msgid "unknown version" +msgstr "Action inconnue" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Paramčtres d'enrobage" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "espace" diff --git a/po/gl.po b/po/gl.po index d6154913e7..615e577d43 100644 --- a/po/gl.po +++ b/po/gl.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: gl-1.5.0rc2\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-07-11 18:48+0200\n" "Last-Translator: Ramon Flores \n" "Language-Team: Galician \n" @@ -14790,30 +14790,6 @@ msgstr "Reconfigurar|R" msgid "Quit %1" msgstr "Sair de LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "Icones pequenos" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "Icones normais" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "Icones grandes" - -#: src/frontends/qt4/GuiView.cpp:194 -msgid "unknown version" -msgstr "versión descońecida" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "Clique para separar" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Configuración de entrada bibliográfica" @@ -15383,10 +15359,34 @@ msgstr "Informaci msgid "Vertical Space Settings" msgstr "Configuración do espazo vertical" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "Icones pequenos" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "Icones normais" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "Icones grandes" + +#: src/frontends/qt4/GuiView.cpp:194 +msgid "unknown version" +msgstr "versión descońecida" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Configuración do axuste de lińa" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "Clique para separar" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "espazo" diff --git a/po/hu.po b/po/hu.po index 4845ab9e79..53bf852faf 100644 --- a/po/hu.po +++ b/po/hu.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: hu\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-07-24 18:18+0100\n" "Last-Translator: Alex \n" "Language-Team: LyX \n" @@ -14773,30 +14773,6 @@ msgstr " msgid "Quit %1" msgstr "Kilépés LyX-ből" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "Kis-méretű ikonok" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "Normál-méretű ikonok" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "Nagy-méretű ikonok" - -#: src/frontends/qt4/GuiView.cpp:194 -msgid "unknown version" -msgstr "ismeretlen verzió" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "Kattintson ide a leválasztáshoz" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Irodalomjegyzék elem beállítások" @@ -15366,10 +15342,34 @@ msgstr "TeX inform msgid "Vertical Space Settings" msgstr "Függőleges kitöltés beállításai" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "Kis-méretű ikonok" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "Normál-méretű ikonok" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "Nagy-méretű ikonok" + +#: src/frontends/qt4/GuiView.cpp:194 +msgid "unknown version" +msgstr "ismeretlen verzió" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Körbefuttatás beállításai" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "Kattintson ide a leválasztáshoz" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "szóköz" diff --git a/po/it.po b/po/it.po index b8d5cf99af..b43a2b6ff0 100644 --- a/po/it.po +++ b/po/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: it\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2006-09-18 16:03+0200\n" "Last-Translator: Kostantino \n" "Language-Team: italiano \n" @@ -15285,31 +15285,6 @@ msgstr "Riconfigura|g" msgid "Quit %1" msgstr "Chiudi LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -#, fuzzy -msgid "unknown version" -msgstr "Azione sconosciuta" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Impostazioni voce bibliografica" @@ -15884,10 +15859,35 @@ msgstr "Informazione di TeX" msgid "Vertical Space Settings" msgstr "Impostazioni spazio verticale" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +#, fuzzy +msgid "unknown version" +msgstr "Azione sconosciuta" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Impostazioni testo a capo" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "spazio" diff --git a/po/ko.po b/po/ko.po index 65b39cd2d4..534b742429 100644 --- a/po/ko.po +++ b/po/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: LyX 1.4.4\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-05-15 16:13+0900\n" "Last-Translator: cghan \n" "Language-Team: hangul \n" @@ -14566,30 +14566,6 @@ msgstr " msgid "Quit %1" msgstr "" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -msgid "unknown version" -msgstr "¸đ¸Ł´Â ĆÇ(version)" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Âü°í ą®Çĺ ¸ń·Ď ±âŔç »çÇ× ±¸Ľş(Bibliography Entry Settings)" @@ -15146,10 +15122,34 @@ msgstr "TeX msgid "Vertical Space Settings" msgstr "" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +msgid "unknown version" +msgstr "¸đ¸Ł´Â ĆÇ(version)" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "ş»ą® °¨˝Î±â ±¸Ľş(Text Wrap Settings)" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "°ř°Ł(space)" diff --git a/po/nn.po b/po/nn.po index ceaa70af89..efa27c2af6 100644 --- a/po/nn.po +++ b/po/nn.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: nn\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-06-26 21:34+0200\n" "Last-Translator: Ingar Pareliussen \n" "Language-Team: Nynorsk \n" @@ -14772,30 +14772,6 @@ msgstr "Set opp p msgid "Quit %1" msgstr "Skru av LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "Smĺ ikon" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "Normale ikon" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "Store ikon" - -#: src/frontends/qt4/GuiView.cpp:194 -msgid "unknown version" -msgstr "ukjent versjon" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Val for litteraturnřkkel" @@ -15362,10 +15338,34 @@ msgstr "TeX informasjon" msgid "Vertical Space Settings" msgstr "Val for loddrettmellomrom" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "Smĺ ikon" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "Normale ikon" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "Store ikon" + +#: src/frontends/qt4/GuiView.cpp:194 +msgid "unknown version" +msgstr "ukjent versjon" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Tekst brekkingval" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "mellomrom" diff --git a/po/pl.po b/po/pl.po index f1c788e664..87c9a2cdb2 100644 --- a/po/pl.po +++ b/po/pl.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: pl\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2006-07-04 00:28+0200\n" "Last-Translator: Andrzej Tomaszewski \n" "Language-Team: Polski \n" @@ -15263,31 +15263,6 @@ msgstr "Rekonfiguruj|R" msgid "Quit %1" msgstr "Zamknij LyX-a" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -#, fuzzy -msgid "unknown version" -msgstr "Nieznane polecenie" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Ustawienia pozycji bibliografii" @@ -15863,10 +15838,35 @@ msgstr "Konfiguracja TeX-a" msgid "Vertical Space Settings" msgstr "Ustawienia odstępów pionowych" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +#, fuzzy +msgid "unknown version" +msgstr "Nieznane polecenie" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Ustawienia oblewania tekstem" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "odstęp" diff --git a/po/pt.po b/po/pt.po index f919e8a197..a51d2844a4 100644 --- a/po/pt.po +++ b/po/pt.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: pt\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-08-13 22:59+0100\n" "Last-Translator: Susana Barbosa \n" "Language-Team: \n" @@ -15208,30 +15208,6 @@ msgstr "Reconfigurar" msgid "Quit %1" msgstr "Sair do LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "Ícons de tamanho pequeno" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "Ícons de tamanho normal" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "Ícons de tamanho grande" - -#: src/frontends/qt4/GuiView.cpp:194 -msgid "unknown version" -msgstr "versăo desconhecida" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "Clicar para destacar" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Configuraçőes de Ítem Bibliográfico" @@ -15810,10 +15786,34 @@ msgstr "Informa msgid "Vertical Space Settings" msgstr "Configuraçőes de Espaço Vertical" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "Ícons de tamanho pequeno" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "Ícons de tamanho normal" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "Ícons de tamanho grande" + +#: src/frontends/qt4/GuiView.cpp:194 +msgid "unknown version" +msgstr "versăo desconhecida" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Configuraçőes de Repartiçăo de Texto" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "Clicar para destacar" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "Espaço" diff --git a/po/ro.po b/po/ro.po index a00f3ed9e6..9bf7e606ea 100644 --- a/po/ro.po +++ b/po/ro.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: ro\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2007-02-20 21:33-0500\n" "Last-Translator: Marius Ionescu \n" "Language-Team: Romanian \n" @@ -15361,31 +15361,6 @@ msgstr "Reconfigureaz msgid "Quit %1" msgstr "Despre LyX" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -#, fuzzy -msgid "unknown version" -msgstr "necunoscut" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 #, fuzzy msgid "Bibliography Entry Settings" @@ -16017,11 +15992,36 @@ msgstr "Informa msgid "Vertical Space Settings" msgstr "Spaţiere verticală:|#e" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +#, fuzzy +msgid "unknown version" +msgstr "necunoscut" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "" + #: src/frontends/qt4/GuiWrap.cpp:83 #, fuzzy msgid "Text Wrap Settings" msgstr "Setări tabel" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 #, fuzzy msgid "space" diff --git a/po/tr.po b/po/tr.po index 0bbe0518b7..8190699d6e 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: LyX 1.3.6\n" "Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n" -"POT-Creation-Date: 2007-08-31 20:10+0200\n" +"POT-Creation-Date: 2007-08-31 20:14+0200\n" "PO-Revision-Date: 2006-07-01 11:06+0200\n" "Last-Translator: Gürer Özen \n" "Language-Team: Turkish \n" @@ -15157,31 +15157,6 @@ msgstr "Yeniden yap msgid "Quit %1" msgstr "Çýk" -#: src/frontends/qt4/GuiView.cpp:161 -msgid "Small-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:167 -msgid "Normal-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:173 -msgid "Big-sized icons" -msgstr "" - -#: src/frontends/qt4/GuiView.cpp:194 -#, fuzzy -msgid "unknown version" -msgstr "Bilinmeyen kullanýcý" - -#: src/frontends/qt4/GuiView.cpp:756 -msgid "LyX" -msgstr "LyX" - -#: src/frontends/qt4/IconPalette.cpp:39 -msgid "Click to detach" -msgstr "" - #: src/frontends/qt4/GuiBibitem.cpp:69 msgid "Bibliography Entry Settings" msgstr "Kaynakça Giriţ Ayarlarý" @@ -15755,10 +15730,35 @@ msgstr "TeX Bilgisi" msgid "Vertical Space Settings" msgstr "Düţey Boţluk Ayarlarý" +#: src/frontends/qt4/GuiView.cpp:161 +msgid "Small-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:167 +msgid "Normal-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:173 +msgid "Big-sized icons" +msgstr "" + +#: src/frontends/qt4/GuiView.cpp:194 +#, fuzzy +msgid "unknown version" +msgstr "Bilinmeyen kullanýcý" + +#: src/frontends/qt4/GuiView.cpp:756 +msgid "LyX" +msgstr "LyX" + #: src/frontends/qt4/GuiWrap.cpp:83 msgid "Text Wrap Settings" msgstr "Tablo Dönüţ Ayarlarý" +#: src/frontends/qt4/IconPalette.cpp:39 +msgid "Click to detach" +msgstr "" + #: src/frontends/qt4/Validator.cpp:153 msgid "space" msgstr "boţluk" diff --git a/src/frontends/qt4/Dialogs.cpp b/src/frontends/qt4/Dialogs.cpp index 2f87b5e1b5..5a29b43883 100644 --- a/src/frontends/qt4/Dialogs.cpp +++ b/src/frontends/qt4/Dialogs.cpp @@ -86,7 +86,7 @@ #include "GuiTexinfo.h" #include "GuiToc.h" #include "TocWidget.h" -#include "UrlView.h" +#include "GuiURLDialog.h" #include "GuiVSpace.h" #include "GuiWrap.h" @@ -255,7 +255,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) dialog->bc().bp(new OkCancelPolicy); } else if (name == "mathdelimiter") { dialog->setController(new ControlMath(*dialog)); - dialog->setView(new GuiMathDelimiter(*dialog)); + dialog->setView(new GuiDelimiter(*dialog)); dialog->bc().bp(new IgnorantPolicy); } else if (name == "mathmatrix") { dialog->setController(new ControlMath(*dialog)); diff --git a/src/frontends/qt4/GuiAbout.cpp b/src/frontends/qt4/GuiAbout.cpp index 0ed3de0a96..90acf73c91 100644 --- a/src/frontends/qt4/GuiAbout.cpp +++ b/src/frontends/qt4/GuiAbout.cpp @@ -38,10 +38,8 @@ namespace lyx { namespace frontend { -typedef QController > AboutBase; - GuiAbout::GuiAbout(Dialog & parent) - : AboutBase(parent, _("About LyX")) + : GuiView(parent, _("About LyX")) { } diff --git a/src/frontends/qt4/GuiAbout.h b/src/frontends/qt4/GuiAbout.h index f38985a017..0be3eae0e5 100644 --- a/src/frontends/qt4/GuiAbout.h +++ b/src/frontends/qt4/GuiAbout.h @@ -9,18 +9,18 @@ * Full author contact details are available in file CREDITS. */ -#ifndef FORMABOUT_H -#define FORMABOUT_H +#ifndef GUIABOUT_H +#define GUIABOUT_H #include "GuiDialogView.h" +#include "ControlAboutlyx.h" #include "ui_AboutUi.h" + #include namespace lyx { namespace frontend { -class ControlAboutlyx; - class GuiAboutDialog : public QDialog, public Ui::AboutUi { Q_OBJECT public: @@ -33,11 +33,16 @@ public: }; -class GuiAbout - : public QController > +class GuiAbout : public GuiView { public: GuiAbout(Dialog &); + /// parent controller + ControlAboutlyx & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlAboutlyx const & controller() const + { return static_cast(this->getController()); } private: /// not needed virtual void apply() {} @@ -50,4 +55,4 @@ private: } // namespace frontend } // namespace lyx -#endif // FORMABOUT_H +#endif // GUIABOUT_H diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index f830c26ae2..f316019b13 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -141,8 +141,8 @@ GuiApplication::GuiApplication(int & argc, char ** argv) using namespace lyx::graphics; - Image::newImage = boost::bind(&QLImage::newImage); - Image::loadableFormats = boost::bind(&QLImage::loadableFormats); + Image::newImage = boost::bind(&GuiImage::newImage); + Image::loadableFormats = boost::bind(&GuiImage::loadableFormats); // needs to be done before reading lyxrc lyxrc.dpi = getDPI(); diff --git a/src/frontends/qt4/GuiApplication.h b/src/frontends/qt4/GuiApplication.h index 954c48e064..be7b69276d 100644 --- a/src/frontends/qt4/GuiApplication.h +++ b/src/frontends/qt4/GuiApplication.h @@ -1,5 +1,5 @@ /** - * \file qt4/GuiApplication.h + * \file GuiApplication.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -10,8 +10,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QT4_APPLICATION_H -#define QT4_APPLICATION_H +#ifndef GUIAPPLICATION_H +#define GUIAPPLICATION_H #include "ColorCache.h" #include "GuiFontLoader.h" @@ -57,8 +57,8 @@ public: /// Method inherited from \c Application class //@{ - virtual Clipboard& clipboard(); - virtual Selection& selection(); + virtual Clipboard & clipboard(); + virtual Selection & selection(); virtual FontLoader & fontLoader() { return font_loader_; } virtual int const exec(); virtual Gui & gui() { return gui_; } @@ -127,4 +127,4 @@ extern GuiApplication * guiApp; } // namespace lyx -#endif // QT4_APPLICATION_H +#endif // GUIAPPLICATION_H diff --git a/src/frontends/qt4/GuiBibitem.cpp b/src/frontends/qt4/GuiBibitem.cpp index a54542614c..88512371c3 100644 --- a/src/frontends/qt4/GuiBibitem.cpp +++ b/src/frontends/qt4/GuiBibitem.cpp @@ -14,8 +14,7 @@ #include "Qt2BC.h" #include "qt_helpers.h" -#include "controllers/ControlCommand.h" - +#include #include #include @@ -25,7 +24,7 @@ namespace frontend { ///////////////////////////////////////////////////////////////////// // -// QBibItemDialog +// GuiBibItemDialog // ///////////////////////////////////////////////////////////////////// @@ -58,15 +57,13 @@ void GuiBibitemDialog::closeEvent(QCloseEvent *e) ///////////////////////////////////////////////////////////////////// // -// QBibItem +// GuiBibItem // ///////////////////////////////////////////////////////////////////// -typedef QController > BibItemBase; - GuiBibitem::GuiBibitem(Dialog & parent) - : BibItemBase(parent, _("Bibliography Entry Settings")) + : GuiView(parent, _("Bibliography Entry Settings")) { } diff --git a/src/frontends/qt4/GuiBibitem.h b/src/frontends/qt4/GuiBibitem.h index 9c7bac9179..7f6859f4e9 100644 --- a/src/frontends/qt4/GuiBibitem.h +++ b/src/frontends/qt4/GuiBibitem.h @@ -9,15 +9,14 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QBIBITEM_CONTROLLER_H -#define QBIBITEM_CONTROLLER_H +#ifndef GUIBIBITEM_H +#define GUIBIBITEM_H #include "GuiDialogView.h" - +#include "ControlCommand.h" #include "ui_BibitemUi.h" #include -#include namespace lyx { @@ -39,19 +38,21 @@ private: }; -class ControlCommand; - -class GuiBibitem - : public QController > +class GuiBibitem : public GuiView { public: - friend class GuiBibitemDialog; - + /// GuiBibitem(Dialog &); - + /// parent controller + ControlCommand & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlCommand const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); private: + friend class GuiBibitemDialog; /// Apply changes virtual void apply(); /// update @@ -63,4 +64,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QBIBITEM_H +#endif // GUIBIBITEM_H diff --git a/src/frontends/qt4/GuiBibtex.cpp b/src/frontends/qt4/GuiBibtex.cpp index f1ad85b11f..e7546af5da 100644 --- a/src/frontends/qt4/GuiBibtex.cpp +++ b/src/frontends/qt4/GuiBibtex.cpp @@ -24,8 +24,6 @@ #include "controllers/ControlBibtex.h" #include "controllers/ButtonPolicy.h" -#include "controllers/ControlBibtex.h" - #include "support/filetools.h" // changeExtension #include "support/lstrings.h" @@ -35,21 +33,21 @@ #include #include -using lyx::support::changeExtension; -using lyx::support::split; -using lyx::support::trim; - -using std::vector; -using std::string; - #include "debug.h" #include "support/filetools.h" #include "support/lstrings.h" +using std::vector; +using std::string; + namespace lyx { namespace frontend { +using support::changeExtension; +using support::split; +using support::trim; + ///////////////////////////////////////////////////////////////////// // @@ -253,10 +251,8 @@ void GuiBibtexDialog::closeEvent(QCloseEvent *e) ///////////////////////////////////////////////////////////////////// -typedef QController > BibtexBase; - GuiBibtex::GuiBibtex(Dialog & parent) - : BibtexBase(parent, _("BibTeX Bibliography")) + : GuiView(parent, _("BibTeX Bibliography")) { } diff --git a/src/frontends/qt4/GuiBibtex.h b/src/frontends/qt4/GuiBibtex.h index 027d539634..8033c51db3 100644 --- a/src/frontends/qt4/GuiBibtex.h +++ b/src/frontends/qt4/GuiBibtex.h @@ -9,17 +9,15 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QBIBTEX_H -#define QBIBTEX_H +#ifndef GUIBIBTEX_H +#define GUIBIBTEX_H #include "GuiDialogView.h" - +#include "ButtonController.h" +#include "ControlBibtex.h" #include "ui_BibtexUi.h" #include "ui_BibtexAddUi.h" -#include "ButtonController.h" - -#include #include namespace lyx { @@ -68,15 +66,18 @@ private: }; -class ControlBibtex; - -class GuiBibtex - : public QController > +class GuiBibtex : public GuiView { public: friend class GuiBibtexDialog; GuiBibtex(Dialog &); + /// parent controller + ControlBibtex & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlBibtex const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); private: @@ -91,4 +92,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QBIBTEX_H +#endif // GUIBIBTEX_H diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index 751c4683a7..f6ed74df61 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -142,10 +142,9 @@ void GuiBoxDialog::restoreClicked() // ////////////////////////////////////////////////////////////////// -typedef QController > box_base_class; GuiBox::GuiBox(Dialog & parent) - : box_base_class(parent, _("Box Settings")) + : GuiView(parent, _("Box Settings")) {} diff --git a/src/frontends/qt4/GuiBox.h b/src/frontends/qt4/GuiBox.h index 2763a591c6..6d9e3dfc49 100644 --- a/src/frontends/qt4/GuiBox.h +++ b/src/frontends/qt4/GuiBox.h @@ -10,14 +10,13 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QBOX_H -#define QBOX_H +#ifndef GUIBOX_H +#define GUIBOX_H #include "GuiDialogView.h" - +#include "ControlBox.h" #include "ui_BoxUi.h" -#include #include #include @@ -26,7 +25,6 @@ namespace lyx { namespace frontend { -class ControlBox; class GuiBox; class GuiBoxDialog : public QDialog, public Ui::BoxUi { @@ -45,20 +43,24 @@ private: }; -/// -class GuiBox - : public QController > +class GuiBox : public GuiView { public: - /// - friend class GuiBoxDialog; /// GuiBox(Dialog &); + /// parent controller + ControlBox & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlBox const & controller() const + { return static_cast(this->getController()); } /// add and remove special lengths void setSpecial(bool ibox); /// only show valid inner box items void setInnerType(bool frameless, int i); private: + /// + friend class GuiBoxDialog; /// Apply changes virtual void apply(); /// update @@ -78,4 +80,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QBOX_H +#endif // GUIBOX_H diff --git a/src/frontends/qt4/GuiBranch.cpp b/src/frontends/qt4/GuiBranch.cpp index f9d33309d4..f292dc7311 100644 --- a/src/frontends/qt4/GuiBranch.cpp +++ b/src/frontends/qt4/GuiBranch.cpp @@ -16,8 +16,6 @@ #include "BranchList.h" -#include "controllers/ControlBranch.h" - #include "insets/InsetBranch.h" #include @@ -64,11 +62,9 @@ void GuiBranchDialog::change_adaptor() // ///////////////////////////////////////////////////////////////////// -typedef QController > branch_base_class; - GuiBranch::GuiBranch(Dialog & parent) - : branch_base_class(parent, _("Branch Settings")) + : GuiView(parent, _("Branch Settings")) {} diff --git a/src/frontends/qt4/GuiBranch.h b/src/frontends/qt4/GuiBranch.h index 836da8217e..d3c3b66e8d 100644 --- a/src/frontends/qt4/GuiBranch.h +++ b/src/frontends/qt4/GuiBranch.h @@ -9,13 +9,13 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QBRANCH_H -#define QBRANCH_H +#ifndef GUIBRANCH_H +#define GUIBRANCH_H #include "GuiDialogView.h" +#include "ControlBranch.h" #include "ui_BranchUi.h" -#include #include namespace lyx { @@ -35,18 +35,23 @@ private: GuiBranch * form_; }; -class ControlBranch; /** This class provides a QT implementation of the Branch Dialog. */ -class GuiBranch : public QController > +class GuiBranch : public GuiView { public: - friend class GuiBranchDialog; - /// Constructor GuiBranch(Dialog &); + /// parent controller + ControlBranch & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlBranch const & controller() const + { return static_cast(this->getController()); } private: + friend class GuiBranchDialog; + /// Apply changes virtual void apply(); /// Build the dialog @@ -58,4 +63,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QBRANCH_H +#endif // GUIBRANCH_H diff --git a/src/frontends/qt4/GuiBranches.h b/src/frontends/qt4/GuiBranches.h index bd1ed0b0ec..e77dc25a3f 100644 --- a/src/frontends/qt4/GuiBranches.h +++ b/src/frontends/qt4/GuiBranches.h @@ -9,8 +9,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QBRANCHES_H -#define QBRANCHES_H +#ifndef GUIBRANCHES_H +#define GUIBRANCHES_H #include "ui_BranchesUi.h" #include "GuiDocument.h" @@ -30,7 +30,6 @@ class BufferParams; namespace frontend { - class GuiBranches: public QWidget, public Ui::BranchesUi { Q_OBJECT @@ -56,13 +55,11 @@ protected Q_SLOTS: void on_colorPB_clicked(); private: - /// Contains all legal branches for this doc BranchList branchlist_; - }; } // namespace frontend } // namespace lyx -#endif // DOCUMENTDIALOG_H +#endif // GUIBRANCHES diff --git a/src/frontends/qt4/GuiChanges.cpp b/src/frontends/qt4/GuiChanges.cpp index 05d1cf41e7..7f4bb8b7b8 100644 --- a/src/frontends/qt4/GuiChanges.cpp +++ b/src/frontends/qt4/GuiChanges.cpp @@ -17,9 +17,6 @@ #include "support/lstrings.h" -#include "controllers/ControlChanges.h" - -#include #include #include @@ -78,11 +75,9 @@ void GuiChangesDialog::closeEvent(QCloseEvent *e) // ///////////////////////////////////////////////////////////////////// -typedef QController > ChangesBase; - GuiChanges::GuiChanges(Dialog & parent) - : ChangesBase(parent, _("Merge Changes")) + : GuiView(parent, _("Merge Changes")) { } diff --git a/src/frontends/qt4/GuiChanges.h b/src/frontends/qt4/GuiChanges.h index 9df8b9f715..0bb2937da6 100644 --- a/src/frontends/qt4/GuiChanges.h +++ b/src/frontends/qt4/GuiChanges.h @@ -9,12 +9,13 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QCHANGES_H -#define QCHANGES_H +#ifndef GUICHANGES_H +#define GUICHANGES_H #include "GuiDialogView.h" +#include "ControlChanges.h" #include "ui_ChangesUi.h" -#include + #include namespace lyx { @@ -41,15 +42,18 @@ private: GuiChanges * form_; }; -class ControlChanges; -class GuiChanges - : public QController > +class GuiChanges : public GuiView { public: - friend class GuiChangesDialog; - + /// GuiChanges(Dialog &); + /// parent controller + ControlChanges & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlChanges const & controller() const + { return static_cast(this->getController()); } void accept(); @@ -58,6 +62,7 @@ public: void next(); private: + friend class GuiChangesDialog; /// Apply changes virtual void apply() {}; /// update @@ -69,4 +74,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QCHANGES_H +#endif // GUICHANGES_H diff --git a/src/frontends/qt4/GuiCharacter.cpp b/src/frontends/qt4/GuiCharacter.cpp index d9ee64514b..f10b40619e 100644 --- a/src/frontends/qt4/GuiCharacter.cpp +++ b/src/frontends/qt4/GuiCharacter.cpp @@ -12,13 +12,11 @@ #include #include "GuiCharacter.h" -#include "ControlCharacter.h" #include "Qt2BC.h" #include "qt_helpers.h" - +#include "frontend_helpers.h" #include "Color.h" - #include using std::vector; @@ -86,10 +84,9 @@ void GuiCharacterDialog::closeEvent(QCloseEvent * e) // ///////////////////////////////////////////////////////////////////// -typedef QController > CharacterBase; GuiCharacter::GuiCharacter(Dialog & parent) - : CharacterBase(parent, _("Text Style")) + : GuiView(parent, _("Text Style")) { } diff --git a/src/frontends/qt4/GuiCharacter.h b/src/frontends/qt4/GuiCharacter.h index 7cce5132f9..09e9507db0 100644 --- a/src/frontends/qt4/GuiCharacter.h +++ b/src/frontends/qt4/GuiCharacter.h @@ -10,21 +10,18 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QCHARACTER_H_CONTROLLER -#define QCHARACTER_H_CONTROLLER +#ifndef GUICHARACTER_H +#define GUICHARACTER_H #include "GuiDialogView.h" +#include "ControlCharacter.h" #include "ui_CharacterUi.h" -#include -#include "controllers/frontend_helpers.h" +#include #include namespace lyx { - -class Font; - namespace frontend { class GuiCharacter; @@ -42,15 +39,18 @@ protected Q_SLOTS: }; -class ControlCharacter; - -class GuiCharacter - : public QController > +class GuiCharacter : public GuiView { public: friend class GuiCharacterDialog; GuiCharacter(Dialog &); + /// parent controller + ControlCharacter & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlCharacter const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -71,4 +71,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QCHARACTER_H +#endif // GUICHARACTER_H diff --git a/src/frontends/qt4/GuiCitation.h b/src/frontends/qt4/GuiCitation.h index f99b009b67..7059106ef8 100644 --- a/src/frontends/qt4/GuiCitation.h +++ b/src/frontends/qt4/GuiCitation.h @@ -7,15 +7,15 @@ * \author Angus Leeming * \author Kalle Dalheimer * \author Abdelrazak Younes - * \author Richard Heck (adapted to QSelectionManager) + * \author Richard Heck * * Full author contact details are available in file CREDITS. */ -#ifndef QCITATION_H -#define QCITATION_H +#ifndef GUICITATION_H +#define GUICITATION_H -#include "frontends/controllers/ControlCitation.h" +#include "ControlCitation.h" #include "support/docstring.h" #include @@ -82,13 +82,10 @@ public: private: /// available keys. QStringListModel available_model_; - /// selected keys. QStringListModel selected_model_; - /// All keys. QStringList all_keys_; - /// Cited keys. QStringList cited_keys_; }; @@ -97,4 +94,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QCITATION_H +#endif // GUICITATION_H diff --git a/src/frontends/qt4/GuiCitationDialog.h b/src/frontends/qt4/GuiCitationDialog.h index cec477270d..d4e5050629 100644 --- a/src/frontends/qt4/GuiCitationDialog.h +++ b/src/frontends/qt4/GuiCitationDialog.h @@ -11,8 +11,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QCITATIONDIALOG_H -#define QCITATIONDIALOG_H +#ifndef GUICITATIONDIALOG_H +#define GUICITATIONDIALOG_H #include "Dialog.h" #include "GuiSelectionManager.h" @@ -105,4 +105,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QCITATIOINDIALOG_H +#endif // GUICITATIOINDIALOG_H diff --git a/src/frontends/qt4/GuiClipboard.h b/src/frontends/qt4/GuiClipboard.h index f167cc1f97..12a8864a41 100644 --- a/src/frontends/qt4/GuiClipboard.h +++ b/src/frontends/qt4/GuiClipboard.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file qt4/GuiClipboard.h + * \file GuiClipboard.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -11,8 +11,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef CLIPBOARD_H -#define CLIPBOARD_H +#ifndef GUICLIPBOARD_H +#define GUICLIPBOARD_H #include "frontends/Clipboard.h" @@ -22,7 +22,7 @@ namespace frontend { /** * The Qt4 version of the Clipboard. */ -class GuiClipboard: public Clipboard +class GuiClipboard : public Clipboard { public: virtual ~GuiClipboard() {} @@ -42,4 +42,4 @@ public: } // namespace frontend } // namespace lyx -#endif // CLIPBOARD_H +#endif // GUICLIPBOARD_H diff --git a/src/frontends/qt4/GuiCommandBuffer.h b/src/frontends/qt4/GuiCommandBuffer.h index 370c937b9f..3ee0cfab31 100644 --- a/src/frontends/qt4/GuiCommandBuffer.h +++ b/src/frontends/qt4/GuiCommandBuffer.h @@ -9,10 +9,10 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QCOMMANDBUFFER_H -#define QCOMMANDBUFFER_H +#ifndef GUICOMMANDBUFFER_H +#define GUICOMMANDBUFFER_H -#include "controllers/ControlCommandBuffer.h" +#include "ControlCommandBuffer.h" #include @@ -47,10 +47,8 @@ public Q_SLOTS: private: /// owning view GuiViewBase * view_; - /// controller ControlCommandBuffer controller_; - /// command widget GuiCommandEdit * edit_; }; @@ -58,4 +56,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QCOMMANDBUFFER_H +#endif // GUICOMMANDBUFFER_H diff --git a/src/frontends/qt4/GuiCommandEdit.h b/src/frontends/qt4/GuiCommandEdit.h index 76756f4b93..f3587744a0 100644 --- a/src/frontends/qt4/GuiCommandEdit.h +++ b/src/frontends/qt4/GuiCommandEdit.h @@ -9,8 +9,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QCOMMANDEDIT_H -#define QCOMMANDEDIT_H +#ifndef GUICOMMANDEDIT_H +#define GUICOMMANDEDIT_H #include #include @@ -21,8 +21,10 @@ namespace frontend { class GuiCommandEdit : public QLineEdit { Q_OBJECT + public: GuiCommandEdit(QWidget * parent); + Q_SIGNALS: /// cancel void escapePressed(); @@ -45,4 +47,4 @@ protected: } // namespace frontend } // namespace lyx -#endif // QCOMMANDEDIT_H +#endif // GUICOMMANDEDIT_H diff --git a/src/frontends/qt4/GuiDelimiterDialog.cpp b/src/frontends/qt4/GuiDelimiterDialog.cpp index 3162f00c69..a9690aafe8 100644 --- a/src/frontends/qt4/GuiDelimiterDialog.cpp +++ b/src/frontends/qt4/GuiDelimiterDialog.cpp @@ -15,10 +15,7 @@ #include "GuiApplication.h" #include "GuiView.h" - #include "qt_helpers.h" -#include "controllers/ControlMath.h" - #include "gettext.h" #include @@ -63,14 +60,12 @@ QString fix_name(QString const & str, bool big) } // namespace anon -typedef QController > delimiter_base; - -GuiMathDelimiter::GuiMathDelimiter(Dialog & parent) - : delimiter_base(parent, _("Math Delimiter")) +GuiDelimiter::GuiDelimiter(Dialog & parent) + : GuiView(parent, _("Math Delimiter")) {} -void GuiMathDelimiter::build_dialog() +void GuiDelimiter::build_dialog() { dialog_.reset(new GuiDelimiterDialog(this, static_cast(controller().view()))); @@ -102,7 +97,7 @@ char_type GuiDelimiterDialog::doMatch(char_type const symbol) const } -GuiDelimiterDialog::GuiDelimiterDialog(GuiMathDelimiter * form, QWidget * parent) +GuiDelimiterDialog::GuiDelimiterDialog(GuiDelimiter * form, QWidget * parent) : QDialog(parent), form_(form) { setupUi(this); diff --git a/src/frontends/qt4/GuiDelimiterDialog.h b/src/frontends/qt4/GuiDelimiterDialog.h index 7ad132ccda..301eabc7b9 100644 --- a/src/frontends/qt4/GuiDelimiterDialog.h +++ b/src/frontends/qt4/GuiDelimiterDialog.h @@ -9,27 +9,26 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QDELIMITERDIALOG_H -#define QDELIMITERDIALOG_H +#ifndef GUIDELIMITERDIALOG_H +#define GUIDELIMITERDIALOG_H #include "GuiDialogView.h" - +#include "ControlMath.h" #include "ui_DelimiterUi.h" -#include - class QListWidgetItem; namespace lyx { namespace frontend { class ControlMath; -class GuiMathDelimiter; +class GuiDelimiter; -class GuiDelimiterDialog : public QDialog, public Ui::DelimiterUi { +class GuiDelimiterDialog : public QDialog, public Ui::DelimiterUi +{ Q_OBJECT public: - GuiDelimiterDialog(GuiMathDelimiter * form, QWidget * parent); + GuiDelimiterDialog(GuiDelimiter * form, QWidget * parent); public Q_SLOTS: void on_leftLW_itemActivated(QListWidgetItem *); void on_rightLW_itemActivated(QListWidgetItem *); @@ -44,18 +43,24 @@ private: /// void updateTeXCode(int size); /// owning form - GuiMathDelimiter * form_; + GuiDelimiter * form_; /// TeX code that will be inserted. QString tex_code_; }; -class GuiMathDelimiter : public QController > { +class GuiDelimiter : public GuiView +{ public: friend class GuiDelimiterDialog; - - GuiMathDelimiter(Dialog &); - + /// + GuiDelimiter(Dialog &); + /// parent controller + ControlMath & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlMath const & controller() const + { return static_cast(this->getController()); } private: virtual void apply() {} virtual void update_contents() {} @@ -67,4 +72,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QDELIMITERDIALOG_H +#endif // GUIDELIMITERDIALOG_H diff --git a/src/frontends/qt4/GuiDialogView.h b/src/frontends/qt4/GuiDialogView.h index 861025b307..d0eba362bc 100644 --- a/src/frontends/qt4/GuiDialogView.h +++ b/src/frontends/qt4/GuiDialogView.h @@ -9,8 +9,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QDIALOGVIEW_H -#define QDIALOGVIEW_H +#ifndef GUIDIALOGVIEW_H +#define GUIDIALOGVIEW_H #include "Dialog.h" @@ -121,25 +121,7 @@ protected: boost::scoped_ptr dialog_; }; - -template -class QController: public Base -{ -protected: - /// - QController(Dialog & p, docstring const & t): Base(p, t) - {} -public: - /// The parent controller - Controller & controller() - { return static_cast(this->getController()); } - - /// The parent controller - Controller const & controller() const - { return static_cast(this->getController()); } -}; - } // namespace frontend } // namespace lyx -#endif // QDIALOGVIEW_H +#endif // GUIDIALOGVIEW_H diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 7d882df7d1..8f61c641eb 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -25,8 +25,6 @@ #include "GuiViewSource.h" // For latexHighlighter use in the preamble. -#include "controllers/ControlDocument.h" - #include "BufferParams.h" #include "Encoding.h" #include "gettext.h" @@ -37,7 +35,6 @@ #include "Spacing.h" #include "insets/InsetListingsParams.h" -#include "controllers/ControlDocument.h" #include "support/lstrings.h" @@ -1399,16 +1396,13 @@ void GuiDocumentDialog::updateParams(BufferParams const & params) ///////////////////////////////////////////////////////////////////// // -// Document +// GuiDocument // ///////////////////////////////////////////////////////////////////// -typedef QController > - DocumentBase; - GuiDocument::GuiDocument(Dialog & parent) - : DocumentBase(parent, _("Document Settings")) + : GuiView(parent, _("Document Settings")) {} diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index b683521479..7590cdaa93 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -9,11 +9,12 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QDOCUMENT_H -#define QDOCUMENT_H +#ifndef GUIDOCUMENT_H +#define GUIDOCUMENT_H #include "GuiDialogView.h" #include "BulletsModule.h" +#include "ControlDocument.h" #include "ui_DocumentUi.h" #include "ui_FontUi.h" @@ -25,11 +26,8 @@ #include "ui_BiblioUi.h" #include "ui_NumberingUi.h" #include "ui_MarginsUi.h" - -// For the Preamble module #include "ui_PreambleUi.h" -#include #include #include @@ -38,7 +36,7 @@ class FloatPlacement; template -class UiWidget: public QWidget, public UI +class UiWidget : public QWidget, public UI { public: UiWidget(QWidget * parent = 0) : QWidget(parent) @@ -119,10 +117,7 @@ private: }; -class ControlDocument; - -class GuiDocument - : public QController > +class GuiDocument : public GuiView { public: @@ -131,7 +126,12 @@ public: GuiDocument(Dialog &); void showPreamble(); - + /// parent controller + ControlDocument & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlDocument const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes void apply(); @@ -175,8 +175,7 @@ private: }; - } // namespace frontend } // namespace lyx -#endif // QDOCUMENT_H +#endif // GUIDOCUMENT_H diff --git a/src/frontends/qt4/GuiERT.cpp b/src/frontends/qt4/GuiERT.cpp index 66f1fa6ebe..f9b994129b 100644 --- a/src/frontends/qt4/GuiERT.cpp +++ b/src/frontends/qt4/GuiERT.cpp @@ -13,8 +13,6 @@ #include "GuiERT.h" #include "Qt2BC.h" -#include "controllers/ControlERT.h" - #include #include #include @@ -60,11 +58,8 @@ void GuiERTDialog::change_adaptor() // ///////////////////////////////////////////////////////////////////// -typedef QController > ERTBase; - - GuiERT::GuiERT(Dialog & parent) - : ERTBase(parent, _("TeX Code Settings")) + : GuiView(parent, _("TeX Code Settings")) { } diff --git a/src/frontends/qt4/GuiERT.h b/src/frontends/qt4/GuiERT.h index a7c2628af7..4bc641eb1d 100644 --- a/src/frontends/qt4/GuiERT.h +++ b/src/frontends/qt4/GuiERT.h @@ -9,10 +9,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef GuiERT_H -#define GuiERT_H +#ifndef GUIERT_H +#define GUIERT_H #include "GuiDialogView.h" +#include "ControlERT.h" #include "ui_ERTUi.h" #include @@ -23,7 +24,8 @@ namespace frontend { class GuiERT; -class GuiERTDialog : public QDialog, public Ui::ERTUi { +class GuiERTDialog : public QDialog, public Ui::ERTUi +{ Q_OBJECT public: GuiERTDialog(GuiERT * form); @@ -36,16 +38,19 @@ private: }; - -class ControlERT; - -class GuiERT : public QController > +class GuiERT : public GuiView { public: - friend class GuiERTDialog; - + /// constructor GuiERT(Dialog &); + /// parent controller + ControlERT & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlERT const & controller() const + { return static_cast(this->getController()); } private: + friend class GuiERTDialog; /// Apply changes virtual void apply(); /// update @@ -57,4 +62,4 @@ private: } // namespace frontend } // namespace lyx -#endif // GuiERT_H +#endif // GUIERT_H diff --git a/src/frontends/qt4/GuiEmbeddedFiles.cpp b/src/frontends/qt4/GuiEmbeddedFiles.cpp index e9239a9859..0ca5015597 100644 --- a/src/frontends/qt4/GuiEmbeddedFiles.cpp +++ b/src/frontends/qt4/GuiEmbeddedFiles.cpp @@ -10,14 +10,11 @@ #include - #include "GuiEmbeddedFiles.h" #include "Qt2BC.h" #include "debug.h" -using std::string; - namespace lyx { namespace frontend { @@ -27,10 +24,11 @@ namespace frontend { // GuiEmbeddedFilesDialog // ///////////////////////////////////////////////////////////////////// -#define INVALID_COLOR "gray" -#define AUTO_COLOR "green" -#define EMBEDDED_COLOR "black" -#define EXTERNAL_COLOR "blue" + +static QString const INVALID_COLOR = "gray"; +static QString const AUTO_COLOR = "green"; +static QString const EMBEDDED_COLOR = "black"; +static QString const EXTERNAL_COLOR = "blue"; GuiEmbeddedFilesDialog::GuiEmbeddedFilesDialog(GuiEmbeddedFiles * form) : form_(form) @@ -127,7 +125,7 @@ void GuiEmbeddedFilesDialog::on_actionPB_clicked() // FIXME. // ACTION - string action = fromqstr(actionCB->currentText()); + QString action = actionCB->currentText(); if (action == "Add file") { } else if (action == "Extract file") { } else if (action == "Extract all") { diff --git a/src/frontends/qt4/GuiErrorList.cpp b/src/frontends/qt4/GuiErrorList.cpp index b0f0f9ef6e..c05b26c787 100644 --- a/src/frontends/qt4/GuiErrorList.cpp +++ b/src/frontends/qt4/GuiErrorList.cpp @@ -14,8 +14,6 @@ #include "Qt2BC.h" #include "qt_helpers.h" -#include "controllers/ControlErrorList.h" - #include #include #include @@ -71,11 +69,8 @@ void GuiErrorListDialog::showEvent(QShowEvent *e) ///////////////////////////////////////////////////////////////////// -typedef QController > - ErrorListBase; - GuiErrorList::GuiErrorList(Dialog & parent) - : ErrorListBase(parent, docstring()) + : GuiView(parent, docstring()) {} diff --git a/src/frontends/qt4/GuiErrorList.h b/src/frontends/qt4/GuiErrorList.h index ec3ef9496d..b236554170 100644 --- a/src/frontends/qt4/GuiErrorList.h +++ b/src/frontends/qt4/GuiErrorList.h @@ -9,17 +9,16 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QERRORLIST_H -#define QERRORLIST_H +#ifndef GUIERRORLIST_H +#define GUIERRORLIST_H #include "GuiDialogView.h" +#include "ControlErrorList.h" #include "ui_ErrorListUi.h" #include class QListWidgetItem; -class QCloseEvent; -class QShowEvent; namespace lyx { namespace frontend { @@ -41,15 +40,18 @@ private: }; -class ControlErrorList; - -class GuiErrorList : - public QController > +class GuiErrorList : public GuiView { public: friend class GuiErrorListDialog; GuiErrorList(Dialog &); + /// parent controller + ControlErrorList & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlErrorList const & controller() const + { return static_cast(this->getController()); } private: /// select an entry void select(QListWidgetItem *); @@ -64,4 +66,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QERRORLIST_H +#endif // GUIERRORLIST_H diff --git a/src/frontends/qt4/GuiExternal.cpp b/src/frontends/qt4/GuiExternal.cpp index 19cb852a96..0a2b285c0e 100644 --- a/src/frontends/qt4/GuiExternal.cpp +++ b/src/frontends/qt4/GuiExternal.cpp @@ -16,7 +16,6 @@ #include "lengthcommon.h" #include "LyXRC.h" -#include "controllers/ControlExternal.h" #include "controllers/ButtonController.h" #include "insets/ExternalTemplate.h" @@ -489,11 +488,8 @@ void getExtra(external::ExtraData & data, } // namespace anon -typedef QController > - ExternalBase; - GuiExternal::GuiExternal(Dialog & parent) - : ExternalBase(parent, _("External Material")) + : GuiView(parent, _("External Material")) {} diff --git a/src/frontends/qt4/GuiExternal.h b/src/frontends/qt4/GuiExternal.h index dcf2c3d4a8..ffc1efe7ef 100644 --- a/src/frontends/qt4/GuiExternal.h +++ b/src/frontends/qt4/GuiExternal.h @@ -9,11 +9,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QEXTERNAL_H -#define QEXTERNAL_H +#ifndef GUIEXTERNAL_H +#define GUIEXTERNAL_H #include "GuiDialogView.h" - +#include "ControlExternal.h" #include "ui_ExternalUi.h" #include @@ -26,7 +26,8 @@ namespace frontend { class GuiExternal; -class GuiExternalDialog : public QDialog, public Ui::ExternalUi { +class GuiExternalDialog : public QDialog, public Ui::ExternalUi +{ Q_OBJECT public: GuiExternalDialog(GuiExternal * form); @@ -52,18 +53,20 @@ private: }; -class ControlExternal; - -class GuiExternal - : public QController > +class GuiExternal : public GuiView { public: friend class GuiExternalDialog; GuiExternal(Dialog &); - + /// parent controller + ControlExternal & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlExternal const & controller() const + { return static_cast(this->getController()); } + /// typedef std::map MapType; - private: /// Apply changes virtual void apply(); @@ -83,4 +86,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QEXTERNAL_H +#endif // GUIEXTERNAL_H diff --git a/src/frontends/qt4/GuiFloat.cpp b/src/frontends/qt4/GuiFloat.cpp index a29df99728..3312ca9872 100644 --- a/src/frontends/qt4/GuiFloat.cpp +++ b/src/frontends/qt4/GuiFloat.cpp @@ -11,24 +11,56 @@ #include #include "GuiFloat.h" -#include "GuiFloatDialog.h" #include "Qt2BC.h" #include "FloatPlacement.h" -#include "controllers/ControlFloat.h" - #include "insets/InsetFloat.h" +#include #include namespace lyx { namespace frontend { -typedef QController > float_base_class; +GuiFloatDialog::GuiFloatDialog(GuiFloat * form) + : form_(form) +{ + setupUi(this); + connect(restorePB, SIGNAL(clicked()), + form, SLOT(slotRestore())); + connect(okPB, SIGNAL(clicked()), + form, SLOT(slotOK())); + connect(applyPB, SIGNAL(clicked()), + form, SLOT(slotApply())); + connect(closePB, SIGNAL(clicked()), + form, SLOT(slotClose())); + + // enable span columns checkbox + floatFP->useWide(); + + // enable sideways checkbox + floatFP->useSideways(); + + connect(floatFP, SIGNAL(changed()), + this, SLOT(change_adaptor())); +} + + +void GuiFloatDialog::change_adaptor() +{ + form_->changed(); +} + + +void GuiFloatDialog::closeEvent(QCloseEvent * e) +{ + form_->slotWMHide(); + e->accept(); +} GuiFloat::GuiFloat(Dialog & parent) - : float_base_class(parent, _("Float Settings")) + : GuiView(parent, _("Float Settings")) { } @@ -61,3 +93,5 @@ void GuiFloat::apply() } // namespace frontend } // namespace lyx + +#include "GuiFloat_moc.cpp" diff --git a/src/frontends/qt4/GuiFloat.h b/src/frontends/qt4/GuiFloat.h index 64a84ae246..565f8652e9 100644 --- a/src/frontends/qt4/GuiFloat.h +++ b/src/frontends/qt4/GuiFloat.h @@ -9,25 +9,49 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QFLOAT_H -#define QFLOAT_H +#ifndef GUIFLOAT_H +#define GUIFLOAT_H #include "GuiDialogView.h" -#include "GuiFloatDialog.h" +#include "ui_FloatUi.h" +#include "ControlFloat.h" + +#include namespace lyx { namespace frontend { +class GuiFloat; + +class GuiFloatDialog : public QDialog, public Ui::FloatUi { + Q_OBJECT +public: + GuiFloatDialog(GuiFloat * form); + +protected Q_SLOTS: + virtual void change_adaptor(); + +protected: + virtual void closeEvent(QCloseEvent * e); + +private: + GuiFloat * form_; +}; -class ControlFloat; /// -class GuiFloat : public QController > { +class GuiFloat : public GuiView { public: /// friend class GuiFloatDialog; /// GuiFloat(Dialog &); + /// parent controller + ControlFloat & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlFloat const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -40,4 +64,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QFLOAT_H +#endif // GUIFLOAT_H diff --git a/src/frontends/qt4/GuiFloatDialog.cpp b/src/frontends/qt4/GuiFloatDialog.cpp deleted file mode 100644 index 3a8b4f2157..0000000000 --- a/src/frontends/qt4/GuiFloatDialog.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/** - * \file GuiFloatDialog.cpp - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Edwin Leuven - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "GuiFloatDialog.h" -#include "GuiFloat.h" - -#include -#include - -#include "FloatPlacement.h" - - - -namespace lyx { -namespace frontend { - -GuiFloatDialog::GuiFloatDialog(GuiFloat * form) - : form_(form) -{ - setupUi(this); - connect(restorePB, SIGNAL(clicked()), - form, SLOT(slotRestore())); - connect(okPB, SIGNAL(clicked()), - form, SLOT(slotOK())); - connect(applyPB, SIGNAL(clicked()), - form, SLOT(slotApply())); - connect(closePB, SIGNAL(clicked()), - form, SLOT(slotClose())); - - // enable span columns checkbox - floatFP->useWide(); - - // enable sideways checkbox - floatFP->useSideways(); - - connect(floatFP, SIGNAL(changed()), - this, SLOT(change_adaptor())); -} - - -void GuiFloatDialog::change_adaptor() -{ - form_->changed(); -} - - -void GuiFloatDialog::closeEvent(QCloseEvent * e) -{ - form_->slotWMHide(); - e->accept(); -} - -} // namespace frontend -} // namespace lyx - -#include "GuiFloatDialog_moc.cpp" diff --git a/src/frontends/qt4/GuiFloatDialog.h b/src/frontends/qt4/GuiFloatDialog.h deleted file mode 100644 index 1dc3c6a84e..0000000000 --- a/src/frontends/qt4/GuiFloatDialog.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- -/** - * \file GuiFloatDialog.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Edwin Leuven - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef QFLOATDIALOG_H -#define QFLOATDIALOG_H - -#include "ui_FloatUi.h" - -#include -#include - -namespace lyx { -namespace frontend { - -class GuiFloat; - -class GuiFloatDialog : public QDialog, public Ui::FloatUi { - Q_OBJECT -public: - GuiFloatDialog(GuiFloat * form); - -protected Q_SLOTS: - virtual void change_adaptor(); - -protected: - virtual void closeEvent(QCloseEvent * e); - -private: - GuiFloat * form_; -}; - -} // namespace frontend -} // namespace lyx - -#endif // QFLOATDIALOG_H diff --git a/src/frontends/qt4/GuiFontExample.h b/src/frontends/qt4/GuiFontExample.h index a23f4d0b49..c56a566d7d 100644 --- a/src/frontends/qt4/GuiFontExample.h +++ b/src/frontends/qt4/GuiFontExample.h @@ -9,8 +9,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QT_QFONTEXAMPLE_H -#define QT_QFONTEXAMPLE_H +#ifndef GUIFONTEXAMPLE_H +#define GUIFONTEXAMPLE_H #include #include @@ -42,4 +42,4 @@ private: //} // namespace lyx -#endif +#endif // GUIFONTEXAMPLE_H diff --git a/src/frontends/qt4/GuiFontMetrics.h b/src/frontends/qt4/GuiFontMetrics.h index 1a6fdfa408..707b5f336e 100644 --- a/src/frontends/qt4/GuiFontMetrics.h +++ b/src/frontends/qt4/GuiFontMetrics.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file FontMetrics.h + * \file GuiFontMetrics.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -9,8 +9,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QT4_FONT_METRICS_H -#define QT4_FONT_METRICS_H +#ifndef GUI_FONT_METRICS_H +#define GUI_FONT_METRICS_H #include "frontends/FontMetrics.h" @@ -23,10 +23,9 @@ namespace lyx { namespace frontend { -class GuiFontMetrics: public FontMetrics +class GuiFontMetrics : public FontMetrics { public: - GuiFontMetrics(QFont const & font); GuiFontMetrics(QFont const & font, QFont const & smallcaps_font); @@ -83,4 +82,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QT4_FONT_METRICS_H +#endif // GUI_FONT_METRICS_H diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index da7a7888b4..1b804c841c 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -16,15 +16,14 @@ #include "GuiGraphics.h" #include "CheckedLineEdit.h" +#include "debug.h" #include "LengthCombo.h" -#include "GuiGraphicsDialog.h" -#include "Qt2BC.h" -#include "qt_helpers.h" - #include "lengthcommon.h" #include "LyXRC.h" +#include "Qt2BC.h" +#include "qt_helpers.h" +#include "Validator.h" -#include "controllers/ControlGraphics.h" #include "controllers/frontend_helpers.h" #include "insets/InsetGraphicsParams.h" @@ -34,12 +33,17 @@ #include "support/lyxlib.h" #include "support/os.h" +#include + +#include "insets/InsetGraphicsParams.h" + +#include +#include +#include #include #include -#include -#include +#include -#include using lyx::support::float_equal; using lyx::support::token; @@ -53,13 +57,280 @@ using std::floor; using std::vector; using std::string; + namespace lyx { namespace frontend { -typedef QController > graphics_base_class; + +GuiGraphicsDialog::GuiGraphicsDialog(GuiGraphics * form) + : form_(form) +{ + setupUi(this); + //main buttons + connect(okPB, SIGNAL(clicked()), + form, SLOT(slotOK())); + connect(applyPB, SIGNAL(clicked()), + form, SLOT(slotApply())); + connect(closePB, SIGNAL(clicked()), + form, SLOT(slotClose())); + connect(restorePB, SIGNAL(clicked()), + form, SLOT(slotRestore())); + + //graphics pane + connect(filename, SIGNAL(textChanged(const QString &)), + this, SLOT(change_adaptor())); + connect(WidthCB, SIGNAL( clicked()), + this, SLOT(change_adaptor())); + connect(HeightCB, SIGNAL( clicked()), + this, SLOT(change_adaptor())); + connect(Width, SIGNAL(textChanged(const QString &)), + this, SLOT(change_adaptor())); + connect(Height, SIGNAL(textChanged(const QString &)), + this, SLOT(change_adaptor())); + connect(heightUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)), + this, SLOT(change_adaptor())); + connect(widthUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)), + this, SLOT(change_adaptor())); + connect(aspectratio, SIGNAL(stateChanged(int)), + this, SLOT(change_adaptor())); + connect(angle, SIGNAL(textChanged(const QString &)), + this, SLOT(change_adaptor())); + connect(origin, SIGNAL(activated(int)), + this, SLOT(change_adaptor())); + connect(scaleCB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); + connect(Scale, SIGNAL(textChanged(const QString &)), + this, SLOT(change_adaptor())); + connect(rotateOrderCB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); + + filename->setValidator(new PathValidator(true, filename)); + setFocusProxy(filename); + + QDoubleValidator * scaleValidator = new DoubleAutoValidator(Scale); + scaleValidator->setBottom(0); + scaleValidator->setDecimals(256); //I guess that will do + Scale->setValidator(scaleValidator); + Height->setValidator(unsignedLengthAutoValidator(Height)); + Width->setValidator(unsignedLengthAutoValidator(Width)); + angle->setValidator(new QDoubleValidator(-360, 360, 2, angle)); + + //clipping pane + connect(clip, SIGNAL(stateChanged(int)), + this, SLOT(change_adaptor())); + connect(lbY, SIGNAL(textChanged(const QString&)), + this, SLOT(change_bb())); + connect(lbYunit, SIGNAL(activated(int)), + this, SLOT(change_bb())); + connect(rtY, SIGNAL(textChanged(const QString&)), + this, SLOT(change_bb())); + connect(rtYunit, SIGNAL(activated(int)), + this, SLOT(change_bb())); + connect(lbX, SIGNAL(textChanged(const QString&)), + this, SLOT(change_bb())); + connect(lbXunit, SIGNAL(activated(int)), + this, SLOT(change_bb())); + connect(rtX, SIGNAL(textChanged(const QString&)), + this, SLOT(change_bb())); + connect(rtXunit, SIGNAL(activated(int)), + this, SLOT(change_bb())); + connect(getPB, SIGNAL(clicked()), + this, SLOT(change_adaptor())); + + lbX->setValidator(new QDoubleValidator(lbX)); + lbY->setValidator(new QDoubleValidator(lbY)); + rtX->setValidator(new QDoubleValidator(rtX)); + rtY->setValidator(new QDoubleValidator(rtY)); + + //extra options pane + connect(latexoptions, SIGNAL(textChanged(const QString&)), + this, SLOT(change_adaptor())); + connect(draftCB, SIGNAL(stateChanged(int)), + this, SLOT(change_adaptor())); + connect(unzipCB, SIGNAL(stateChanged(int)), + this, SLOT(change_adaptor())); + // FIXME: we should connect to clicked() when we move to Qt 4.2 because + // the toggled(bool) signal is also trigged when we update the widgets + // (rgh-4/07) this isn't as much or a problem as it was, because we're now + // using blockSignals() to keep from triggering that signal when we call + // setChecked(). Note, too, that clicked() would get called whenever it + // is clicked, even right clicked (I think), not just whenever it is + // toggled. + connect(subfigure, SIGNAL(toggled(bool)), + this, SLOT(change_adaptor())); + connect(subcaption, SIGNAL(textChanged(const QString&)), + this, SLOT(change_adaptor())); + connect(displayGB, SIGNAL(toggled(bool)), + this, SLOT(change_adaptor())); + connect(showCB, SIGNAL(currentIndexChanged(int)), + this, SLOT(change_adaptor())); + connect(displayscale, SIGNAL(textChanged(const QString&)), + this, SLOT(change_adaptor())); + displayscale->setValidator(new QIntValidator(displayscale)); +} + + +void GuiGraphicsDialog::show() +{ + QDialog::show(); +} + + +void GuiGraphicsDialog::change_adaptor() +{ + form_->changed(); +} + + +void GuiGraphicsDialog::change_bb() +{ + form_->controller().bbChanged = true; + LYXERR(Debug::GRAPHICS) + << "[controller().bb_Changed set to true]\n"; + form_->changed(); +} + + +void GuiGraphicsDialog::closeEvent(QCloseEvent * e) +{ + form_->slotWMHide(); + e->accept(); +} + + +void GuiGraphicsDialog::on_browsePB_clicked() +{ + docstring const str = + form_->controller().browse(qstring_to_ucs4(filename->text())); + if(!str.empty()){ + filename->setText(toqstr(str)); + form_->changed(); + } +} + + +void GuiGraphicsDialog::on_getPB_clicked() +{ + form_->getBB(); +} + + +void GuiGraphicsDialog::on_editPB_clicked() +{ + form_->controller().editGraphics(); +} + + +void GuiGraphicsDialog::on_filename_textChanged(const QString & filename) +{ + editPB->setDisabled(filename.isEmpty()); +} + + +void GuiGraphicsDialog::setAutoText() +{ + if (scaleCB->isChecked()) return; + if (!Scale->isEnabled() && Scale->text() != "100") + Scale->setText(QString("auto")); + + setAutoTextCB(WidthCB, Width, widthUnit); + setAutoTextCB(HeightCB, Height, heightUnit); +} + + +void GuiGraphicsDialog::on_scaleCB_toggled(bool setScale) +{ + Scale->setEnabled(setScale); + if (setScale) { + Scale->setText("100"); + Scale->setFocus(Qt::OtherFocusReason); + } + + WidthCB->setDisabled(setScale); + WidthCB->blockSignals(true); + WidthCB->setChecked(false); + WidthCB->blockSignals(false); + Width->setEnabled(false); + widthUnit->setEnabled(false); + + HeightCB->setDisabled(setScale); + HeightCB->blockSignals(true); + HeightCB->setChecked(false); + HeightCB->blockSignals(false); + Height->setEnabled(false); + heightUnit->setEnabled(false); + + aspectratio->setDisabled(true); + aspectratio->setChecked(true); + + rotateOrderCB->setEnabled((WidthCB->isChecked() || + HeightCB->isChecked() || + scaleCB->isChecked()) && + (angle->text() != "0")); + + setAutoText(); +} + +void GuiGraphicsDialog::on_WidthCB_toggled(bool setWidth) +{ + Width->setEnabled(setWidth); + widthUnit->setEnabled(setWidth); + if (setWidth) + Width->setFocus(Qt::OtherFocusReason); + + bool const setHeight = HeightCB->isChecked(); + aspectratio->setEnabled(setWidth && setHeight); + aspectratio->blockSignals(true); + aspectratio->setChecked(!(setWidth && setHeight)); + aspectratio->blockSignals(false); + + scaleCB->setEnabled(!setWidth && !setHeight); + //already will be unchecked, so don't need to do that + Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() + && scaleCB->isChecked()); //should be false, but let's check + rotateOrderCB->setEnabled((setWidth || setHeight || + scaleCB->isChecked()) && + (angle->text() != "0")); + + setAutoText(); +} + +void GuiGraphicsDialog::on_HeightCB_toggled(bool setHeight) +{ + Height->setEnabled(setHeight); + heightUnit->setEnabled(setHeight); + if (setHeight) + Height->setFocus(Qt::OtherFocusReason); + + bool const setWidth = WidthCB->isChecked(); + aspectratio->setEnabled(setWidth && setHeight); + aspectratio->blockSignals(true); + aspectratio->setChecked(!(setWidth && setHeight)); + aspectratio->blockSignals(false); + + scaleCB->setEnabled(!setWidth && !setHeight); + //already unchecked + Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() + && scaleCB->isChecked()); //should be false + rotateOrderCB->setEnabled((setWidth || setHeight || + scaleCB->isChecked()) && + (angle->text() != "0")); + + setAutoText(); +} + + +void GuiGraphicsDialog::on_angle_textChanged(const QString & filename) +{ + rotateOrderCB->setEnabled((WidthCB->isChecked() || + HeightCB->isChecked() || + scaleCB->isChecked()) && + (filename != "0")); +} + GuiGraphics::GuiGraphics(Dialog & parent) - : graphics_base_class(parent, _("Graphics")) + : GuiView(parent, _("Graphics")) { } @@ -420,3 +691,7 @@ bool GuiGraphics::isValid() } // namespace frontend } // namespace lyx + + +#include "GuiGraphics_moc.cpp" + diff --git a/src/frontends/qt4/GuiGraphics.h b/src/frontends/qt4/GuiGraphics.h index 45744ae38e..3ff7253384 100644 --- a/src/frontends/qt4/GuiGraphics.h +++ b/src/frontends/qt4/GuiGraphics.h @@ -10,28 +10,62 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QGRAPHICS_H -#define QGRAPHICS_H +#ifndef GUIGRAPHICS_H +#define GUIGRAPHICS_H #include "GuiDialogView.h" -#include "GuiGraphicsDialog.h" +#include "ui_GraphicsUi.h" +#include "ControlGraphics.h" + +#include #include +class QString; + namespace lyx { namespace frontend { -class ControlGraphics; +class GuiGraphics; -/// -class GuiGraphics - : public QController > +class GuiGraphicsDialog : public QDialog, public Ui::GraphicsUi +{ + Q_OBJECT +public: + GuiGraphicsDialog(GuiGraphics * form); + virtual void setAutoText(); + virtual void show(); +protected Q_SLOTS: + virtual void change_adaptor(); + virtual void change_bb(); + virtual void on_browsePB_clicked(); + virtual void on_getPB_clicked(); + virtual void on_editPB_clicked(); + virtual void on_filename_textChanged(const QString &); + virtual void on_scaleCB_toggled(bool); + virtual void on_WidthCB_toggled(bool); + virtual void on_HeightCB_toggled(bool); + virtual void on_angle_textChanged(const QString &); +protected: + virtual void closeEvent(QCloseEvent * e); +private: + GuiGraphics * form_; +}; + + +class GuiGraphics : public GuiView { public: /// friend class GuiGraphicsDialog; /// GuiGraphics(Dialog &); + /// parent controller + ControlGraphics & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlGraphics const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); private: @@ -52,4 +86,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QGRAPHICS_H +#endif // GUIGRAPHICS_H diff --git a/src/frontends/qt4/GuiGraphicsDialog.cpp b/src/frontends/qt4/GuiGraphicsDialog.cpp deleted file mode 100644 index 70f8e79cf5..0000000000 --- a/src/frontends/qt4/GuiGraphicsDialog.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/** - * \file GuiGraphicsDialog.cpp - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * \author Herbert Voß - * \author Abdelrazak Younes - * \author Richard Heck - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "GuiGraphicsDialog.h" -#include "GuiGraphics.h" - -#include "LengthCombo.h" -#include "Validator.h" -#include "qt_helpers.h" - -#include "debug.h" - -#include "controllers/ControlGraphics.h" - -#include "insets/InsetGraphicsParams.h" - -#include -#include -#include -#include - - -using std::string; - -namespace lyx { -namespace frontend { - - -GuiGraphicsDialog::GuiGraphicsDialog(GuiGraphics * form) - : form_(form) -{ - setupUi(this); - //main buttons - connect(okPB, SIGNAL(clicked()), - form, SLOT(slotOK())); - connect(applyPB, SIGNAL(clicked()), - form, SLOT(slotApply())); - connect(closePB, SIGNAL(clicked()), - form, SLOT(slotClose())); - connect(restorePB, SIGNAL(clicked()), - form, SLOT(slotRestore())); - - //graphics pane - connect(filename, SIGNAL(textChanged(const QString &)), - this, SLOT(change_adaptor())); - connect(WidthCB, SIGNAL( clicked()), - this, SLOT(change_adaptor())); - connect(HeightCB, SIGNAL( clicked()), - this, SLOT(change_adaptor())); - connect(Width, SIGNAL(textChanged(const QString &)), - this, SLOT(change_adaptor())); - connect(Height, SIGNAL(textChanged(const QString &)), - this, SLOT(change_adaptor())); - connect(heightUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)), - this, SLOT(change_adaptor())); - connect(widthUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)), - this, SLOT(change_adaptor())); - connect(aspectratio, SIGNAL(stateChanged(int)), - this, SLOT(change_adaptor())); - connect(angle, SIGNAL(textChanged(const QString &)), - this, SLOT(change_adaptor())); - connect(origin, SIGNAL(activated(int)), - this, SLOT(change_adaptor())); - connect(scaleCB, SIGNAL(clicked()), - this, SLOT(change_adaptor())); - connect(Scale, SIGNAL(textChanged(const QString &)), - this, SLOT(change_adaptor())); - connect(rotateOrderCB, SIGNAL(clicked()), - this, SLOT(change_adaptor())); - - filename->setValidator(new PathValidator(true, filename)); - setFocusProxy(filename); - - QDoubleValidator * scaleValidator = new DoubleAutoValidator(Scale); - scaleValidator->setBottom(0); - scaleValidator->setDecimals(256); //I guess that will do - Scale->setValidator(scaleValidator); - Height->setValidator(unsignedLengthAutoValidator(Height)); - Width->setValidator(unsignedLengthAutoValidator(Width)); - angle->setValidator(new QDoubleValidator(-360, 360, 2, angle)); - - //clipping pane - connect(clip, SIGNAL(stateChanged(int)), - this, SLOT(change_adaptor())); - connect(lbY, SIGNAL(textChanged(const QString&)), - this, SLOT(change_bb())); - connect(lbYunit, SIGNAL(activated(int)), - this, SLOT(change_bb())); - connect(rtY, SIGNAL(textChanged(const QString&)), - this, SLOT(change_bb())); - connect(rtYunit, SIGNAL(activated(int)), - this, SLOT(change_bb())); - connect(lbX, SIGNAL(textChanged(const QString&)), - this, SLOT(change_bb())); - connect(lbXunit, SIGNAL(activated(int)), - this, SLOT(change_bb())); - connect(rtX, SIGNAL(textChanged(const QString&)), - this, SLOT(change_bb())); - connect(rtXunit, SIGNAL(activated(int)), - this, SLOT(change_bb())); - connect(getPB, SIGNAL(clicked()), - this, SLOT(change_adaptor())); - - lbX->setValidator(new QDoubleValidator(lbX)); - lbY->setValidator(new QDoubleValidator(lbY)); - rtX->setValidator(new QDoubleValidator(rtX)); - rtY->setValidator(new QDoubleValidator(rtY)); - - //extra options pane - connect(latexoptions, SIGNAL(textChanged(const QString&)), - this, SLOT(change_adaptor())); - connect(draftCB, SIGNAL(stateChanged(int)), - this, SLOT(change_adaptor())); - connect(unzipCB, SIGNAL(stateChanged(int)), - this, SLOT(change_adaptor())); - // FIXME: we should connect to clicked() when we move to Qt 4.2 because - // the toggled(bool) signal is also trigged when we update the widgets - // (rgh-4/07) this isn't as much or a problem as it was, because we're now - // using blockSignals() to keep from triggering that signal when we call - // setChecked(). Note, too, that clicked() would get called whenever it - // is clicked, even right clicked (I think), not just whenever it is - // toggled. - connect(subfigure, SIGNAL(toggled(bool)), - this, SLOT(change_adaptor())); - connect(subcaption, SIGNAL(textChanged(const QString&)), - this, SLOT(change_adaptor())); - connect(displayGB, SIGNAL(toggled(bool)), - this, SLOT(change_adaptor())); - connect(showCB, SIGNAL(currentIndexChanged(int)), - this, SLOT(change_adaptor())); - connect(displayscale, SIGNAL(textChanged(const QString&)), - this, SLOT(change_adaptor())); - displayscale->setValidator(new QIntValidator(displayscale)); -} - - -void GuiGraphicsDialog::show() -{ - QDialog::show(); -} - - -void GuiGraphicsDialog::change_adaptor() -{ - form_->changed(); -} - - -void GuiGraphicsDialog::change_bb() -{ - form_->controller().bbChanged = true; - LYXERR(Debug::GRAPHICS) - << "[controller().bb_Changed set to true]\n"; - form_->changed(); -} - - -void GuiGraphicsDialog::closeEvent(QCloseEvent * e) -{ - form_->slotWMHide(); - e->accept(); -} - - -void GuiGraphicsDialog::on_browsePB_clicked() -{ - docstring const str = - form_->controller().browse(qstring_to_ucs4(filename->text())); - if(!str.empty()){ - filename->setText(toqstr(str)); - form_->changed(); - } -} - - -void GuiGraphicsDialog::on_getPB_clicked() -{ - form_->getBB(); -} - - -void GuiGraphicsDialog::on_editPB_clicked() -{ - form_->controller().editGraphics(); -} - - -void GuiGraphicsDialog::on_filename_textChanged(const QString & filename) -{ - editPB->setDisabled(filename.isEmpty()); -} - - -void GuiGraphicsDialog::setAutoText() -{ - if (scaleCB->isChecked()) return; - if (!Scale->isEnabled() && Scale->text() != "100") - Scale->setText(QString("auto")); - - setAutoTextCB(WidthCB, Width, widthUnit); - setAutoTextCB(HeightCB, Height, heightUnit); -} - - -void GuiGraphicsDialog::on_scaleCB_toggled(bool setScale) -{ - Scale->setEnabled(setScale); - if (setScale) { - Scale->setText("100"); - Scale->setFocus(Qt::OtherFocusReason); - } - - WidthCB->setDisabled(setScale); - WidthCB->blockSignals(true); - WidthCB->setChecked(false); - WidthCB->blockSignals(false); - Width->setEnabled(false); - widthUnit->setEnabled(false); - - HeightCB->setDisabled(setScale); - HeightCB->blockSignals(true); - HeightCB->setChecked(false); - HeightCB->blockSignals(false); - Height->setEnabled(false); - heightUnit->setEnabled(false); - - aspectratio->setDisabled(true); - aspectratio->setChecked(true); - - rotateOrderCB->setEnabled((WidthCB->isChecked() || - HeightCB->isChecked() || - scaleCB->isChecked()) && - (angle->text() != "0")); - - setAutoText(); -} - -void GuiGraphicsDialog::on_WidthCB_toggled(bool setWidth) -{ - Width->setEnabled(setWidth); - widthUnit->setEnabled(setWidth); - if (setWidth) - Width->setFocus(Qt::OtherFocusReason); - - bool const setHeight = HeightCB->isChecked(); - aspectratio->setEnabled(setWidth && setHeight); - aspectratio->blockSignals(true); - aspectratio->setChecked(!(setWidth && setHeight)); - aspectratio->blockSignals(false); - - scaleCB->setEnabled(!setWidth && !setHeight); - //already will be unchecked, so don't need to do that - Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() - && scaleCB->isChecked()); //should be false, but let's check - rotateOrderCB->setEnabled((setWidth || setHeight || - scaleCB->isChecked()) && - (angle->text() != "0")); - - setAutoText(); -} - -void GuiGraphicsDialog::on_HeightCB_toggled(bool setHeight) -{ - Height->setEnabled(setHeight); - heightUnit->setEnabled(setHeight); - if (setHeight) - Height->setFocus(Qt::OtherFocusReason); - - bool const setWidth = WidthCB->isChecked(); - aspectratio->setEnabled(setWidth && setHeight); - aspectratio->blockSignals(true); - aspectratio->setChecked(!(setWidth && setHeight)); - aspectratio->blockSignals(false); - - scaleCB->setEnabled(!setWidth && !setHeight); - //already unchecked - Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() - && scaleCB->isChecked()); //should be false - rotateOrderCB->setEnabled((setWidth || setHeight || - scaleCB->isChecked()) && - (angle->text() != "0")); - - setAutoText(); -} - - -void GuiGraphicsDialog::on_angle_textChanged(const QString & filename) -{ - rotateOrderCB->setEnabled((WidthCB->isChecked() || - HeightCB->isChecked() || - scaleCB->isChecked()) && - (filename != "0")); -} - - -} // namespace frontend -} // namespace lyx - -#include "GuiGraphicsDialog_moc.cpp" diff --git a/src/frontends/qt4/GuiGraphicsDialog.h b/src/frontends/qt4/GuiGraphicsDialog.h deleted file mode 100644 index 6bface03a6..0000000000 --- a/src/frontends/qt4/GuiGraphicsDialog.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- -/** - * \file GuiGraphicsDialog.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * \author Herbert Voß - * \author Richard Heck - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef QGRAPHICSDIALOG_H -#define QGRAPHICSDIALOG_H - -#include "ui_GraphicsUi.h" - -#include -#include -#include - -namespace lyx { -namespace frontend { - -class GuiGraphics; - -class GuiGraphicsDialog : public QDialog, public Ui::GraphicsUi { - Q_OBJECT -public: - GuiGraphicsDialog(GuiGraphics * form); - virtual void setAutoText(); - virtual void show(); -protected Q_SLOTS: - virtual void change_adaptor(); - virtual void change_bb(); - virtual void on_browsePB_clicked(); - virtual void on_getPB_clicked(); - virtual void on_editPB_clicked(); - virtual void on_filename_textChanged(const QString &); - virtual void on_scaleCB_toggled(bool); - virtual void on_WidthCB_toggled(bool); - virtual void on_HeightCB_toggled(bool); - virtual void on_angle_textChanged(const QString &); -protected: - virtual void closeEvent(QCloseEvent * e); -private: - GuiGraphics * form_; -}; - -} // namespace frontend -} // namespace lyx - -#endif // QGRAPHICSDIALOG_H diff --git a/src/frontends/qt4/GuiImage.cpp b/src/frontends/qt4/GuiImage.cpp index 51eb3cf6f7..a65a09deaa 100644 --- a/src/frontends/qt4/GuiImage.cpp +++ b/src/frontends/qt4/GuiImage.cpp @@ -46,16 +46,16 @@ namespace lyx { namespace graphics { /// Access to this class is through this static method. -Image::ImagePtr QLImage::newImage() +Image::ImagePtr GuiImage::newImage() { ImagePtr ptr; - ptr.reset(new QLImage); + ptr.reset(new GuiImage); return ptr; } /// Return the list of loadable formats. -Image::FormatList QLImage::loadableFormats() +Image::FormatList GuiImage::loadableFormats() { static FormatList fmts; @@ -122,38 +122,32 @@ Image::FormatList QLImage::loadableFormats() } -QLImage::QLImage() - : Image() -{ -} - - -QLImage::QLImage(QLImage const & other) +GuiImage::GuiImage(GuiImage const & other) : Image(other), original_(other.original_), transformed_(other.transformed_), transformed_pixmap_(other.transformed_pixmap_) {} -Image * QLImage::clone_impl() const +Image * GuiImage::clone_impl() const { - return new QLImage(*this); + return new GuiImage(*this); } -unsigned int QLImage::getWidth_impl() const +unsigned int GuiImage::getWidth_impl() const { return transformed_.width(); } -unsigned int QLImage::getHeight_impl() const +unsigned int GuiImage::getHeight_impl() const { return transformed_.height(); } -void QLImage::load_impl(support::FileName const & filename) +void GuiImage::load_impl(support::FileName const & filename) { if (!original_.isNull()) { LYXERR(Debug::GRAPHICS) @@ -198,7 +192,7 @@ QImage & toGray(QImage & img) } // namespace anon -bool QLImage::setPixmap_impl(Params const & params) +bool GuiImage::setPixmap_impl(Params const & params) { if (original_.isNull() || params.display == NoDisplay) return false; @@ -223,7 +217,7 @@ bool QLImage::setPixmap_impl(Params const & params) } -void QLImage::clip_impl(Params const & params) +void GuiImage::clip_impl(Params const & params) { if (transformed_.isNull()) return; @@ -254,7 +248,7 @@ void QLImage::clip_impl(Params const & params) } -void QLImage::rotate_impl(Params const & params) +void GuiImage::rotate_impl(Params const & params) { if (transformed_.isNull()) return; @@ -269,7 +263,7 @@ void QLImage::rotate_impl(Params const & params) } -void QLImage::scale_impl(Params const & params) +void GuiImage::scale_impl(Params const & params) { if (transformed_.isNull()) return; diff --git a/src/frontends/qt4/GuiImage.h b/src/frontends/qt4/GuiImage.h index 57cc49e689..55529471bd 100644 --- a/src/frontends/qt4/GuiImage.h +++ b/src/frontends/qt4/GuiImage.h @@ -10,20 +10,18 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QLIMAGE_H -#define QLIMAGE_H - +#ifndef GUIIMAGE_H +#define GUIIMAGE_H #include "graphics/GraphicsImage.h" -#include -//Added by qt3to4: +#include #include namespace lyx { namespace graphics { -class QLImage : public Image { +class GuiImage : public Image { public: /// Access to this class is through this static method. static ImagePtr newImage(); @@ -66,9 +64,9 @@ private: virtual void scale_impl(Params const & params); /// Access to the class is through newImage() and clone. - QLImage(); + GuiImage() {} /// - QLImage(QLImage const &); + GuiImage(GuiImage const &); /// The original loaded image. QImage original_; @@ -82,4 +80,4 @@ private: } // namespace graphics } // namespace lyx -#endif // QLIMAGE_H +#endif // GUIIMAGE_H diff --git a/src/frontends/qt4/GuiImplementation.h b/src/frontends/qt4/GuiImplementation.h index cf6c16b5e2..b88c2f211e 100644 --- a/src/frontends/qt4/GuiImplementation.h +++ b/src/frontends/qt4/GuiImplementation.h @@ -36,7 +36,6 @@ public: GuiImplementation(); virtual ~GuiImplementation() {} - virtual LyXView& createRegisteredView(); virtual bool closeAllViews(); virtual bool unregisterView(int id); diff --git a/src/frontends/qt4/GuiInclude.cpp b/src/frontends/qt4/GuiInclude.cpp index 38b56befca..8debf85106 100644 --- a/src/frontends/qt4/GuiInclude.cpp +++ b/src/frontends/qt4/GuiInclude.cpp @@ -22,7 +22,6 @@ #include "LyXRC.h" #include "insets/InsetListingsParams.h" -#include "controllers/ControlInclude.h" #include #include @@ -187,11 +186,8 @@ void GuiIncludeDialog::browseClicked() ///////////////////////////////////////////////////////////////////// -typedef QController > IncludeBase; - - GuiInclude::GuiInclude(Dialog & parent) - : IncludeBase(parent, _("Child Document")) + : GuiView(parent, _("Child Document")) {} diff --git a/src/frontends/qt4/GuiInclude.h b/src/frontends/qt4/GuiInclude.h index d961650028..d176547a93 100644 --- a/src/frontends/qt4/GuiInclude.h +++ b/src/frontends/qt4/GuiInclude.h @@ -9,11 +9,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QINCLUDE_H -#define QINCLUDE_H +#ifndef GUIINCLUDE_H +#define GUIINCLUDE_H #include "GuiDialogView.h" - +#include "ControlInclude.h" #include "ui_IncludeUi.h" #include @@ -50,16 +50,19 @@ private: }; -class ControlInclude; - -/// -class GuiInclude : public QController > +class GuiInclude : public GuiView { public: /// friend class GuiIncludeDialog; /// GuiInclude(Dialog &); + /// parent controller + ControlInclude & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlInclude const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); private: @@ -81,4 +84,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QINCLUDE_H +#endif // GUIINCLUDE_H diff --git a/src/frontends/qt4/GuiIndex.cpp b/src/frontends/qt4/GuiIndex.cpp index c9e114d948..cebac4debd 100644 --- a/src/frontends/qt4/GuiIndex.cpp +++ b/src/frontends/qt4/GuiIndex.cpp @@ -11,7 +11,6 @@ #include #include "debug.h" -#include "ControlCommand.h" #include "qt_helpers.h" #include "GuiIndex.h" @@ -21,7 +20,6 @@ #include #include #include -#include #include @@ -43,7 +41,7 @@ GuiIndexDialog::GuiIndexDialog(GuiIndex * form) connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); - connect( keywordED, SIGNAL(textChanged(const QString &)), + connect(keywordED, SIGNAL(textChanged(const QString &)), this, SLOT(change_adaptor())); setFocusProxy(keywordED); @@ -92,10 +90,8 @@ void GuiIndexDialog::closeEvent(QCloseEvent * e) ///////////////////////////////////////////////////////////////////// -typedef QController > IndexBase; - GuiIndex::GuiIndex(Dialog & parent, docstring const & title, QString const & label) - : IndexBase(parent, title), label_(label) + : GuiView(parent, title), label_(label) { } diff --git a/src/frontends/qt4/GuiIndex.h b/src/frontends/qt4/GuiIndex.h index fdeea347ff..31929004a9 100644 --- a/src/frontends/qt4/GuiIndex.h +++ b/src/frontends/qt4/GuiIndex.h @@ -10,14 +10,14 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QINDEX_H -#define QINDEX_H +#ifndef GUIINDEX_H +#define GUIINDEX_H #include "GuiDialogView.h" +#include "ControlCommand.h" #include "ui_IndexUi.h" #include -#include namespace lyx { namespace frontend { @@ -39,15 +39,18 @@ private: }; -class ControlCommand; - -class GuiIndex : - public QController > +class GuiIndex : public GuiView { public: friend class GuiIndexDialog; GuiIndex(Dialog &, docstring const & title, QString const & label); + /// parent controller + ControlCommand & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlCommand const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); private: @@ -65,4 +68,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QINDEX_H +#endif // GUIINDEX_H diff --git a/src/frontends/qt4/GuiKeySymbol.h b/src/frontends/qt4/GuiKeySymbol.h index a88314cf91..d172552175 100644 --- a/src/frontends/qt4/GuiKeySymbol.h +++ b/src/frontends/qt4/GuiKeySymbol.h @@ -10,14 +10,12 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QLYXKEYSYM_H -#define QLYXKEYSYM_H +#ifndef GUIKEYSYM_H +#define GUIKEYSYM_H #include "frontends/KeySymbol.h" #include -#include - class QKeyEvent; @@ -85,4 +83,4 @@ key_modifier::state q_key_state(Qt::KeyboardModifiers state); } // namespace lyx -#endif // QLYXKEYSYM_H +#endif // GUIKEYSYM_H diff --git a/src/frontends/qt4/GuiListings.cpp b/src/frontends/qt4/GuiListings.cpp index 2b4d2b049d..04926b24e9 100644 --- a/src/frontends/qt4/GuiListings.cpp +++ b/src/frontends/qt4/GuiListings.cpp @@ -14,7 +14,6 @@ #include "GuiListings.h" #include "Qt2BC.h" #include "qt_helpers.h" -#include "controllers/ControlListings.h" #include "insets/InsetListingsParams.h" #include "debug.h" @@ -408,10 +407,9 @@ void GuiListingsDialog::on_languageCO_currentIndexChanged(int index) // ///////////////////////////////////////////////////////////////////// -typedef QController > listings_wrap_base_class; GuiListings::GuiListings(Dialog & parent) - : listings_wrap_base_class(parent, _("Program Listing Settings")) + : GuiView(parent, _("Program Listing Settings")) { } diff --git a/src/frontends/qt4/GuiListings.h b/src/frontends/qt4/GuiListings.h index 71202e504a..1aa6e0f54c 100644 --- a/src/frontends/qt4/GuiListings.h +++ b/src/frontends/qt4/GuiListings.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file QListings.h + * \file GuiListings.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -9,14 +9,14 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QLISTINGS_H -#define QLISTINGS_H +#ifndef GUILISTINGS_H +#define GUILISTINGS_H #include "GuiDialogView.h" +#include "ControlListings.h" #include "ui_ListingsUi.h" #include -#include namespace lyx { namespace frontend { @@ -53,13 +53,17 @@ private: }; -class ControlListings; - -class GuiListings : public QController > { +class GuiListings : public GuiView { public: friend class GuiListingsDialog; GuiListings(Dialog &); + /// parent controller + ControlListings & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlListings const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -75,4 +79,4 @@ protected: } // namespace frontend } // namespace lyx -#endif // QLISTINGS_H +#endif // GUILISTINGS_H diff --git a/src/frontends/qt4/GuiLog.cpp b/src/frontends/qt4/GuiLog.cpp index 370ab8532f..0515629a4d 100644 --- a/src/frontends/qt4/GuiLog.cpp +++ b/src/frontends/qt4/GuiLog.cpp @@ -15,12 +15,9 @@ #include "frontends/Application.h" -#include "controllers/ControlLog.h" - -#include - +#include +#include #include -#include namespace lyx { namespace frontend { @@ -107,10 +104,9 @@ void LogHighlighter::highlightBlock(QString const & text) // ///////////////////////////////////////////////////////////////////// -typedef QController > LogBase; GuiLog::GuiLog(Dialog & parent) - : LogBase(parent, docstring()) + : GuiView(parent, docstring()) {} diff --git a/src/frontends/qt4/GuiLog.h b/src/frontends/qt4/GuiLog.h index 3d834017bc..430c1e3f36 100644 --- a/src/frontends/qt4/GuiLog.h +++ b/src/frontends/qt4/GuiLog.h @@ -13,12 +13,10 @@ #define GUILOG_H #include "GuiDialogView.h" - - +#include "ControlLog.h" #include "ui_LogUi.h" #include -#include #include namespace lyx { @@ -43,14 +41,19 @@ class ControlLog; class LogHighlighter; /// -class GuiLog - : public QController > +class GuiLog : public GuiView { public: /// friend class GuiLogDialog; /// GuiLog(Dialog &); + /// parent controller + ControlLog & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlLog const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply() {} diff --git a/src/frontends/qt4/GuiMathMatrixDialog.cpp b/src/frontends/qt4/GuiMathMatrixDialog.cpp index 8978fd112b..ba88f541a6 100644 --- a/src/frontends/qt4/GuiMathMatrixDialog.cpp +++ b/src/frontends/qt4/GuiMathMatrixDialog.cpp @@ -14,16 +14,13 @@ #include "EmptyTable.h" #include "qt_helpers.h" - -#include "controllers/ControlMath.h" +#include "gettext.h" #include -#include -#include -#include - -#include "gettext.h" +#include +#include +#include using std::ostringstream; using std::string; @@ -31,19 +28,8 @@ using std::string; namespace lyx { namespace frontend { -namespace { - -char h_align_str[80] = "c"; -char v_align_c[] = "tcb"; - -} // namespace anon - - -typedef QController > matrix_base; - - GuiMathMatrix::GuiMathMatrix(Dialog & parent) - : matrix_base(parent, _("Math Matrix")) + : GuiView(parent, _("Math Matrix")) {} @@ -89,6 +75,7 @@ GuiMathMatrixDialog::GuiMathMatrixDialog(GuiMathMatrix * form) void GuiMathMatrixDialog::columnsChanged(int) { + char h_align_str[80] = "c"; int const nx = int(columnsSB->value()); for (int i = 0; i < nx; ++i) h_align_str[i] = 'c'; @@ -111,6 +98,7 @@ void GuiMathMatrixDialog::change_adaptor() void GuiMathMatrixDialog::slotOK() { + char v_align_c[] = "tcb"; char const c = v_align_c[valignCO->currentIndex()]; string const sh = fromqstr(halignED->text()); int const nx = int(columnsSB->value()); diff --git a/src/frontends/qt4/GuiMathMatrixDialog.h b/src/frontends/qt4/GuiMathMatrixDialog.h index ef3b3814ef..050f20fc53 100644 --- a/src/frontends/qt4/GuiMathMatrixDialog.h +++ b/src/frontends/qt4/GuiMathMatrixDialog.h @@ -11,11 +11,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QMATHMATRIXDIALOG_H -#define QMATHMATRIXDIALOG_H +#ifndef GUIMATHMATRIXDIALOG_H +#define GUIMATHMATRIXDIALOG_H #include "GuiDialogView.h" - +#include "ControlMath.h" #include "ui_MathMatrixUi.h" #include @@ -43,12 +43,17 @@ private: }; -class GuiMathMatrix : public QController > { +class GuiMathMatrix : public GuiView { public: friend class GuiMathMatrixDialog; GuiMathMatrix(Dialog &); - + /// parent controller + ControlMath & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlMath const & controller() const + { return static_cast(this->getController()); } private: virtual void apply() {} virtual void update_contents() {} @@ -60,4 +65,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QMATHMATRIXDIALOG_H +#endif // GUIMATHMATRIXDIALOG_H diff --git a/src/frontends/qt4/GuiMenubar.h b/src/frontends/qt4/GuiMenubar.h index a28ada3d2e..b0c4b256f8 100644 --- a/src/frontends/qt4/GuiMenubar.h +++ b/src/frontends/qt4/GuiMenubar.h @@ -1,6 +1,6 @@ // -*- C++ -*- /** - * \file qt4/GuiMenubar.h + * \file GuiMenubar.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -10,8 +10,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QLMENUBAR_H -#define QLMENUBAR_H +#ifndef GUIMENUBAR_H +#define GUIMENUBAR_H #include "GuiPopupMenu.h" @@ -74,4 +74,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QLMENUBAR_H +#endif // GUIMENUBAR_H diff --git a/src/frontends/qt4/GuiNomencl.cpp b/src/frontends/qt4/GuiNomencl.cpp index 01606ceb3c..48dd5e4e8b 100644 --- a/src/frontends/qt4/GuiNomencl.cpp +++ b/src/frontends/qt4/GuiNomencl.cpp @@ -18,6 +18,7 @@ #include "GuiNomencl.h" #include "Qt2BC.h" #include "ButtonController.h" + #include #include #include @@ -84,11 +85,8 @@ void GuiNomenclDialog::closeEvent(QCloseEvent * e) ///////////////////////////////////////////////////////////////////// -typedef QController > NomenBase; - - GuiNomencl::GuiNomencl(Dialog & parent, docstring const & title) - : NomenBase(parent, title) + : GuiView(parent, title) { } diff --git a/src/frontends/qt4/GuiNomencl.h b/src/frontends/qt4/GuiNomencl.h index 9fcad8bd7b..2d9536ed57 100644 --- a/src/frontends/qt4/GuiNomencl.h +++ b/src/frontends/qt4/GuiNomencl.h @@ -11,16 +11,15 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QNOMENCL_H -#define QNOMENCL_H +#ifndef GUINOMENCL_H +#define GUINOMENCL_H #include "GuiDialogView.h" +#include "ControlCommand.h" #include "ui_NomenclUi.h" #include -class QCloseEvent; - namespace lyx { namespace frontend { @@ -42,15 +41,18 @@ private: }; -class ControlCommand; - -class GuiNomencl : - public QController > +class GuiNomencl : public GuiView { public: friend class GuiNomenclDialog; GuiNomencl(Dialog &, docstring const & title); + /// parent controller + ControlCommand & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlCommand const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); private: @@ -65,4 +67,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QNOMENCL_H +#endif // GUINOMENCL_H diff --git a/src/frontends/qt4/GuiNote.cpp b/src/frontends/qt4/GuiNote.cpp index 03e7c714c8..250d2d34b6 100644 --- a/src/frontends/qt4/GuiNote.cpp +++ b/src/frontends/qt4/GuiNote.cpp @@ -13,8 +13,6 @@ #include "GuiNote.h" #include "Qt2BC.h" -#include "controllers/ControlNote.h" - #include "insets/InsetNote.h" #include @@ -63,11 +61,9 @@ void GuiNoteDialog::change_adaptor() // ///////////////////////////////////////////////////////////////////// -typedef QController > NoteBase; - GuiNote::GuiNote(Dialog & parent) - : NoteBase(parent, _("Note Settings")) + : GuiView(parent, _("Note Settings")) {} diff --git a/src/frontends/qt4/GuiNote.h b/src/frontends/qt4/GuiNote.h index 6032daff2a..1d71caebfb 100644 --- a/src/frontends/qt4/GuiNote.h +++ b/src/frontends/qt4/GuiNote.h @@ -9,14 +9,15 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QNOTE_H -#define QNOTE_H +#ifndef GUINOTE_H +#define GUINOTE_H #include "GuiDialogView.h" +#include "ControlNote.h" #include "ui_NoteUi.h" #include -class QCloseEvent; + namespace lyx { namespace frontend { @@ -36,17 +37,21 @@ private: }; -class ControlNote; - /** This class provides a QT implementation of the Note Dialog. */ -class GuiNote : public QController > +class GuiNote : public GuiView { public: friend class GuiNoteDialog; /// Constructor GuiNote(Dialog &); + /// parent controller + ControlNote & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlNote const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -59,4 +64,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QNOTE_H +#endif // GUINOTE_H diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp index a3bc70cf71..a3fad0e7b1 100644 --- a/src/frontends/qt4/GuiPainter.cpp +++ b/src/frontends/qt4/GuiPainter.cpp @@ -60,7 +60,7 @@ QString generateStringSignature(QString const & str, Font const & f) } // anon namespace -QLPainter::QLPainter(QPaintDevice * device) +GuiPainter::GuiPainter(QPaintDevice * device) : QPainter(device), Painter() { // new QPainter has default QPen: @@ -70,14 +70,14 @@ QLPainter::QLPainter(QPaintDevice * device) } -QLPainter::~QLPainter() +GuiPainter::~GuiPainter() { QPainter::end(); - //lyxerr << "QLPainter::end()" << endl; + //lyxerr << "GuiPainter::end()" << endl; } -void QLPainter::setQPainterPen(Color_color col, +void GuiPainter::setQPainterPen(Color_color col, Painter::line_style ls, Painter::line_width lw) { if (col == current_color_ && ls == current_ls_ && lw == current_lw_) @@ -105,7 +105,7 @@ void QLPainter::setQPainterPen(Color_color col, } -void QLPainter::point(int x, int y, Color_color col) +void GuiPainter::point(int x, int y, Color_color col) { if (!isDrawingEnabled()) return; @@ -115,7 +115,7 @@ void QLPainter::point(int x, int y, Color_color col) } -void QLPainter::line(int x1, int y1, int x2, int y2, +void GuiPainter::line(int x1, int y1, int x2, int y2, Color_color col, line_style ls, line_width lw) @@ -132,7 +132,7 @@ void QLPainter::line(int x1, int y1, int x2, int y2, } -void QLPainter::lines(int const * xp, int const * yp, int np, +void GuiPainter::lines(int const * xp, int const * yp, int np, Color_color col, line_style ls, line_width lw) @@ -160,7 +160,7 @@ void QLPainter::lines(int const * xp, int const * yp, int np, } -void QLPainter::rectangle(int x, int y, int w, int h, +void GuiPainter::rectangle(int x, int y, int w, int h, Color_color col, line_style ls, line_width lw) @@ -173,13 +173,13 @@ void QLPainter::rectangle(int x, int y, int w, int h, } -void QLPainter::fillRectangle(int x, int y, int w, int h, Color_color col) +void GuiPainter::fillRectangle(int x, int y, int w, int h, Color_color col) { fillRect(x, y, w, h, guiApp->colorCache().get(col)); } -void QLPainter::arc(int x, int y, unsigned int w, unsigned int h, +void GuiPainter::arc(int x, int y, unsigned int w, unsigned int h, int a1, int a2, Color_color col) { if (!isDrawingEnabled()) @@ -194,10 +194,10 @@ void QLPainter::arc(int x, int y, unsigned int w, unsigned int h, } -void QLPainter::image(int x, int y, int w, int h, graphics::Image const & i) +void GuiPainter::image(int x, int y, int w, int h, graphics::Image const & i) { - graphics::QLImage const & qlimage = - static_cast(i); + graphics::GuiImage const & qlimage = + static_cast(i); fillRectangle(x, y, w, h, Color::graphicsbg); @@ -208,14 +208,14 @@ void QLPainter::image(int x, int y, int w, int h, graphics::Image const & i) } -int QLPainter::text(int x, int y, char_type c, Font const & f) +int GuiPainter::text(int x, int y, char_type c, Font const & f) { docstring s(1, c); return text(x, y, s, f); } -int QLPainter::smallCapsText(int x, int y, +int GuiPainter::smallCapsText(int x, int y, QString const & s, Font const & f) { Font smallfont(f); @@ -242,7 +242,7 @@ int QLPainter::smallCapsText(int x, int y, } -int QLPainter::text(int x, int y, docstring const & s, +int GuiPainter::text(int x, int y, docstring const & s, Font const & f) { /* Caution: The following ucs4 to QString conversions work for symbol fonts @@ -339,7 +339,7 @@ int QLPainter::text(int x, int y, docstring const & s, int const h = mA + mD; pm = QPixmap(w, h); pm.fill(Qt::transparent); - QLPainter p(&pm); + GuiPainter p(&pm); p.setQPainterPen(f.realColor()); if (p.font() != fi.font) p.setFont(fi.font); diff --git a/src/frontends/qt4/GuiPainter.h b/src/frontends/qt4/GuiPainter.h index 39c50a2724..2f47d616af 100644 --- a/src/frontends/qt4/GuiPainter.h +++ b/src/frontends/qt4/GuiPainter.h @@ -10,8 +10,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QLPAINTER_H -#define QLPAINTER_H +#ifndef GUIPAINTER_H +#define GUIPAINTER_H #include "frontends/Painter.h" @@ -28,12 +28,12 @@ class Font; namespace frontend { /** - * QLPainter - a painter implementation for Qt4 + * GuiPainter - a painter implementation for Qt4 */ -class QLPainter : public QPainter, public Painter { +class GuiPainter : public QPainter, public Painter { public: - QLPainter(QPaintDevice *); - virtual ~QLPainter(); + GuiPainter(QPaintDevice *); + virtual ~GuiPainter(); /// draw a line from point to point virtual void line( @@ -116,4 +116,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QLPAINTER_H +#endif // GUIPAINTER_H diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index e7f750981e..4a6c3d3bc3 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -18,11 +18,10 @@ #include "debug.h" #include "ParagraphParameters.h" #include "Spacing.h" - -#include "controllers/ControlParagraph.h" -#include "controllers/frontend_helpers.h" +#include "frontend_helpers.h" #include +#include #include #include @@ -163,12 +162,9 @@ LyXAlignment GuiParagraphDialog::getAlignmentFromDialog() // ///////////////////////////////////////////////////////////////////// -typedef QController > - ParagraphBase; - GuiParagraph::GuiParagraph(Dialog & parent) - : ParagraphBase(parent, _("Paragraph Settings")) + : GuiView(parent, _("Paragraph Settings")) {} diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index 133437d4ed..746f7cc276 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -10,16 +10,15 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QPARAGRAPH_H -#define QPARAGRAPH_H +#ifndef GUIPARAGRAPH_H +#define GUIPARAGRAPH_H #include "GuiDialogView.h" - +#include "ControlParagraph.h" #include "Layout.h" #include "ui_ParagraphUi.h" #include -#include #include @@ -55,15 +54,18 @@ protected Q_SLOTS: }; -class ControlParagraph; - -class GuiParagraph - : public QController > +class GuiParagraph : public GuiView { public: friend class GuiParagraphDialog; GuiParagraph(Dialog &); + /// parent controller + ControlParagraph & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlParagraph const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); diff --git a/src/frontends/qt4/GuiPopupMenu.h b/src/frontends/qt4/GuiPopupMenu.h index 903e3c4628..a454b105d7 100644 --- a/src/frontends/qt4/GuiPopupMenu.h +++ b/src/frontends/qt4/GuiPopupMenu.h @@ -9,8 +9,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QLPOPUPMENU_H -#define QLPOPUPMENU_H +#ifndef GUIPOPUPMENU_H +#define GUIPOPUPMENU_H #include @@ -23,11 +23,13 @@ namespace frontend { class GuiMenubar; /// a submenu -class GuiPopupMenu : public QMenu { +class GuiPopupMenu : public QMenu +{ Q_OBJECT public: - - GuiPopupMenu(GuiMenubar * owner, MenuItem const & mi, bool topLevelMenu=false); + /// + GuiPopupMenu(GuiMenubar * owner, MenuItem const & mi, + bool topLevelMenu = false); /// populates the menu or one of its submenu /// This is used as a recursive function @@ -37,21 +39,16 @@ public Q_SLOTS: /// populate the toplevel menu and all children void update(); -private: - - /// our owning menubar - GuiMenubar * owner_; - - /// the name of this menu - docstring name_; - private: /// Get a Menu item label from the menu backend docstring const getLabel(MenuItem const & mi); - /// add binding keys a the menu item label. void addBinding(docstring & label, MenuItem const & mi); + /// our owning menubar + GuiMenubar * owner_; + /// the name of this menu + docstring name_; /// Top Level Menu Menu topLevelMenu_; }; @@ -59,4 +56,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QLPOPUPMENU_H +#endif // GUIPOPUPMENU_H diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 54f4ba400c..78dc1c64af 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -2015,10 +2015,9 @@ void GuiPrefsDialog::updateRc(LyXRC const & rc) // ///////////////////////////////////////////////////////////////////// -typedef QController > PrefsBase; GuiPrefs::GuiPrefs(Dialog & parent) - : PrefsBase(parent, _("Preferences")) + : GuiView(parent, _("Preferences")) { } diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index cdb41155c8..00dd244292 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -9,21 +9,16 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QPREFS_H -#define QPREFS_H +#ifndef GUIPREFS_H +#define GUIPREFS_H #include "GuiDialogView.h" - +#include "ControlPrefs.h" #include "Color.h" #include "LyXRC.h" #include "ui_PrefsUi.h" -#include - -#include -#include - #include "ui_PrefPlaintextUi.h" #include "ui_PrefDateUi.h" #include "ui_PrefKeyboardUi.h" @@ -42,6 +37,10 @@ #include "ui_PrefUi.h" #include "ui_PrefIdentityUi.h" +#include + +#include + namespace lyx { class Converters; @@ -371,10 +370,7 @@ private: }; -class ControlPrefs; - -class GuiPrefs - : public QController > +class GuiPrefs : public GuiView { public: GuiPrefs(Dialog &); @@ -382,7 +378,12 @@ public: Converters & converters(); Formats & formats(); Movers & movers(); - + /// parent controller + ControlPrefs & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlPrefs const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -398,4 +399,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QPREFS_H +#endif // GUIPREFS_H diff --git a/src/frontends/qt4/GuiPrint.cpp b/src/frontends/qt4/GuiPrint.cpp index 302b0b73a0..7aea586cce 100644 --- a/src/frontends/qt4/GuiPrint.cpp +++ b/src/frontends/qt4/GuiPrint.cpp @@ -12,14 +12,11 @@ #include #include "GuiPrint.h" -#include "GuiPrintDialog.h" #include "Qt2BC.h" #include "qt_helpers.h" #include "PrinterParams.h" -#include "controllers/ControlPrint.h" - #include "support/os.h" #include @@ -28,16 +25,87 @@ #include #include -using lyx::support::os::internal_path; - namespace lyx { namespace frontend { -typedef QController > print_base_class; +GuiPrintDialog::GuiPrintDialog(GuiPrint * f) + : form_(f) +{ + setupUi(this); + + connect(printPB, SIGNAL(clicked()), form_, SLOT(slotOK())); + connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose())); + + connect(copiesSB, SIGNAL(valueChanged(int)), this, SLOT(copiesChanged(int))); + connect(printerED, SIGNAL(textChanged(const QString&)), + this, SLOT(printerChanged())); + connect(fileED, SIGNAL(textChanged(const QString&)), + this, SLOT(fileChanged() )); + connect(browsePB, SIGNAL(clicked()), this, SLOT(browseClicked())); + connect(allRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); + connect(reverseCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); + connect(collateCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); + connect(fromED, SIGNAL(textChanged(const QString&)), + this, SLOT(pagerangeChanged())); + connect(fromED, SIGNAL(textChanged(const QString&)), + this, SLOT(change_adaptor())); + connect(toED, SIGNAL(textChanged(const QString&)), + this, SLOT(pagerangeChanged())); + connect(toED, SIGNAL(textChanged(const QString&)), + this, SLOT(change_adaptor())); + connect(fileRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); + connect(printerRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); + connect(rangeRB, SIGNAL(toggled(bool)), fromED, SLOT(setEnabled(bool))); + connect(rangeRB, SIGNAL(toggled(bool)), toED, SLOT(setEnabled(bool))); +} + + +void GuiPrintDialog::change_adaptor() +{ + form_->changed(); +} + + +void GuiPrintDialog::browseClicked() +{ + QString file = toqstr(form_->controller().browse(docstring())); + if (!file.isNull()) { + fileED->setText(file); + form_->changed(); + } +} + + +void GuiPrintDialog::fileChanged() +{ + if (!fileED->text().isEmpty()) + fileRB->setChecked(true); + form_->changed(); +} + + +void GuiPrintDialog::copiesChanged(int i) +{ + collateCB->setEnabled(i != 1); + form_->changed(); +} + + +void GuiPrintDialog::printerChanged() +{ + printerRB->setChecked(true); + form_->changed(); +} + + +void GuiPrintDialog::pagerangeChanged() +{ + form_->changed(); +} GuiPrint::GuiPrint(Dialog & parent) - : print_base_class(parent, _("Print Document")) + : GuiView(parent, _("Print Document")) { } @@ -98,7 +166,7 @@ void GuiPrint::apply() PrinterParams const pp(t, fromqstr(dialog_->printerED->text()), - internal_path(fromqstr(dialog_->fileED->text())), + support::os::internal_path(fromqstr(dialog_->fileED->text())), dialog_->allRB->isChecked(), dialog_->fromED->text().toUInt(), dialog_->toED->text().toUInt(), @@ -113,3 +181,5 @@ void GuiPrint::apply() } // namespace frontend } // namespace lyx + +#include "GuiPrint_moc.cpp" diff --git a/src/frontends/qt4/GuiPrint.h b/src/frontends/qt4/GuiPrint.h index dc1a87d814..b8f8c15d8b 100644 --- a/src/frontends/qt4/GuiPrint.h +++ b/src/frontends/qt4/GuiPrint.h @@ -10,26 +10,49 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QPRINT_H -#define QPRINT_H +#ifndef GUIPRINT_H +#define GUIPRINT_H #include "GuiDialogView.h" -#include "GuiPrintDialog.h" +#include "ControlPrint.h" +#include "ui_PrintUi.h" + +#include namespace lyx { namespace frontend { -class ControlPrint; +class GuiPrint; -/// -class GuiPrint - : public QController > +class GuiPrintDialog : public QDialog, public Ui::PrintUi { + Q_OBJECT +public: + GuiPrintDialog(GuiPrint * f); +protected Q_SLOTS: + virtual void change_adaptor(); + virtual void browseClicked(); + virtual void fileChanged(); + virtual void copiesChanged(int); + virtual void printerChanged(); + virtual void pagerangeChanged(); +private: + GuiPrint * form_; +}; + + +class GuiPrint : public GuiView { public: /// friend class GuiPrintDialog; /// GuiPrint(Dialog &); + /// parent controller + ControlPrint & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlPrint const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -42,4 +65,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QPRINT_H +#endif // GUIPRINT_H diff --git a/src/frontends/qt4/GuiPrintDialog.cpp b/src/frontends/qt4/GuiPrintDialog.cpp deleted file mode 100644 index c14867a7a4..0000000000 --- a/src/frontends/qt4/GuiPrintDialog.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/** - * \file GuiPrintDialog.cpp - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * \author Edwin Leuven - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "controllers/ControlPrint.h" -#include "GuiPrintDialog.h" -#include "GuiPrint.h" -#include "qt_helpers.h" - -#include -#include -#include -#include - -namespace lyx { -namespace frontend { - -GuiPrintDialog::GuiPrintDialog(GuiPrint * f) - : form_(f) -{ - setupUi(this); - - connect(printPB, SIGNAL(clicked()), form_, SLOT(slotOK())); - connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose())); - - connect(copiesSB, SIGNAL(valueChanged(int)), this, SLOT(copiesChanged(int))); - connect(printerED, SIGNAL(textChanged(const QString&)), - this, SLOT(printerChanged())); - connect(fileED, SIGNAL(textChanged(const QString&)), - this, SLOT(fileChanged() )); - connect(browsePB, SIGNAL(clicked()), this, SLOT(browseClicked())); - connect(allRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(reverseCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(collateCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(fromED, SIGNAL(textChanged(const QString&)), - this, SLOT(pagerangeChanged())); - connect(fromED, SIGNAL(textChanged(const QString&)), - this, SLOT(change_adaptor())); - connect(toED, SIGNAL(textChanged(const QString&)), - this, SLOT(pagerangeChanged())); - connect(toED, SIGNAL(textChanged(const QString&)), - this, SLOT(change_adaptor())); - connect(fileRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(printerRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(rangeRB, SIGNAL(toggled(bool)), fromED, SLOT(setEnabled(bool))); - connect(rangeRB, SIGNAL(toggled(bool)), toED, SLOT(setEnabled(bool))); -} - - -void GuiPrintDialog::change_adaptor() -{ - form_->changed(); -} - - -void GuiPrintDialog::browseClicked() -{ - QString file = toqstr(form_->controller().browse(docstring())); - if (!file.isNull()) { - fileED->setText(file); - form_->changed(); - } -} - - -void GuiPrintDialog::fileChanged() -{ - if (!fileED->text().isEmpty()) - fileRB->setChecked(true); - form_->changed(); -} - - -void GuiPrintDialog::copiesChanged(int i) -{ - collateCB->setEnabled(i != 1); - form_->changed(); -} - - -void GuiPrintDialog::printerChanged() -{ - printerRB->setChecked(true); - form_->changed(); -} - - -void GuiPrintDialog::pagerangeChanged() -{ - form_->changed(); -} - -} // namespace frontend -} // namespace lyx - -#include "GuiPrintDialog_moc.cpp" diff --git a/src/frontends/qt4/GuiPrintDialog.h b/src/frontends/qt4/GuiPrintDialog.h deleted file mode 100644 index aef630b697..0000000000 --- a/src/frontends/qt4/GuiPrintDialog.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- -/** - * \file GuiPrintDialog.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * \author Edwin Leuven - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef QLPRINTDIALOG_H -#define QLPRINTDIALOG_H - -#include "ui_PrintUi.h" - -#include - -namespace lyx { -namespace frontend { - -class GuiPrint; - -class GuiPrintDialog : public QDialog, public Ui::PrintUi { - Q_OBJECT -public: - GuiPrintDialog(GuiPrint * f); -protected Q_SLOTS: - virtual void change_adaptor(); - virtual void browseClicked(); - virtual void fileChanged(); - virtual void copiesChanged(int); - virtual void printerChanged(); - virtual void pagerangeChanged(); -private: - GuiPrint * form_; -}; - -} // namespace frontend -} // namespace lyx - -#endif // QLPRINTDIALOG_H diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 011e28f39e..b268a3f478 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -15,8 +15,7 @@ #include "Qt2BC.h" #include "qt_helpers.h" -#include "controllers/ButtonController.h" -#include "controllers/ControlRef.h" +#include "ButtonController.h" #include "insets/InsetRef.h" @@ -181,12 +180,9 @@ void GuiRefDialog::closeEvent(QCloseEvent * e) // ///////////////////////////////////////////////////////////////////// -// full qualification because qt4 has also a ControlRef type -typedef QController > RefBase; - GuiRef::GuiRef(Dialog & parent) - : RefBase(parent, _("Cross-reference")), + : GuiView(parent, _("Cross-reference")), sort_(false), at_ref_(false) { } diff --git a/src/frontends/qt4/GuiRef.h b/src/frontends/qt4/GuiRef.h index 63773beada..81288a9cb3 100644 --- a/src/frontends/qt4/GuiRef.h +++ b/src/frontends/qt4/GuiRef.h @@ -9,11 +9,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QREF_H -#define QREF_H +#ifndef GUIREF_H +#define GUIREF_H #include "GuiDialogView.h" - +#include "ControlRef.h" #include "ui_RefUi.h" #include @@ -21,7 +21,6 @@ #include class QListWidgetItem; -class QCloseEvent; namespace lyx { namespace frontend { @@ -53,17 +52,19 @@ private: }; -class ControlRef; - -// full qualification because qt4 has also a ControlRef type -class GuiRef - : public QController > +class GuiRef : public GuiView { public: friend class GuiRefDialog; GuiRef(Dialog &); + /// parent controller + ControlRef & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlRef const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); @@ -77,37 +78,27 @@ private: /// is name allowed for this ? bool nameAllowed(); - /// is type allowed for this ? bool typeAllowed(); - /// go to current reference void gotoRef(); - /// set go back button void setGoBack(); - /// set goto ref button void setGotoRef(); - /// re-enter references void redoRefs(); - /// update references void updateRefs(); /// sort or not persistent state bool sort_; - /// went to a reference ? bool at_ref_; - /// the last reference entered or examined QString last_reference_; - /// store the buffer settings int restored_buffer_; - /// the references std::vector refs_; }; @@ -115,4 +106,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QREF_H +#endif // GUIREF_H diff --git a/src/frontends/qt4/GuiSearch.cpp b/src/frontends/qt4/GuiSearch.cpp index 0c711d923c..f936472384 100644 --- a/src/frontends/qt4/GuiSearch.cpp +++ b/src/frontends/qt4/GuiSearch.cpp @@ -15,8 +15,6 @@ #include "qt_helpers.h" #include "Qt2BC.h" -#include "controllers/ControlSearch.h" - #include #include @@ -132,11 +130,8 @@ void GuiSearchDialog::replaceallClicked() ///////////////////////////////////////////////////////////////////// -typedef QController > SearchBase; - - GuiSearch::GuiSearch(Dialog & parent) - : SearchBase(parent, _("Find and Replace")) + : GuiView(parent, _("Find and Replace")) { } diff --git a/src/frontends/qt4/GuiSearch.h b/src/frontends/qt4/GuiSearch.h index c3267345a9..a022a66bba 100644 --- a/src/frontends/qt4/GuiSearch.h +++ b/src/frontends/qt4/GuiSearch.h @@ -9,11 +9,13 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QSEARCH_H -#define QSEARCH_H +#ifndef GUISEARCH_H +#define GUISEARCH_H #include "GuiDialogView.h" +#include "ControlSearch.h" #include "ui_SearchUi.h" + #include #include @@ -21,8 +23,6 @@ namespace lyx { namespace frontend { -class ControlSearch; - class GuiSearch; class GuiSearchDialog : public QDialog, public Ui::SearchUi { @@ -40,21 +40,23 @@ protected: virtual void closeEvent(QCloseEvent * e); private: - // add a string to the combo if needed - void remember(std::string const & find, QComboBox & combo); - GuiSearch * form_; }; -class GuiSearch - : public QController > +class GuiSearch : public GuiView { public: /// friend class GuiSearchDialog; /// GuiSearch(Dialog &); + /// parent controller + ControlSearch & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlSearch const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply() {} @@ -74,4 +76,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QSEARCH_H +#endif // GUISEARCH_H diff --git a/src/frontends/qt4/GuiSendto.cpp b/src/frontends/qt4/GuiSendto.cpp index 72de66bb7f..3015fd8a00 100644 --- a/src/frontends/qt4/GuiSendto.cpp +++ b/src/frontends/qt4/GuiSendto.cpp @@ -16,8 +16,6 @@ #include "Format.h" -#include "controllers/ControlSendto.h" - #include #include #include @@ -77,11 +75,9 @@ void GuiSendtoDialog::closeEvent(QCloseEvent * e) // ///////////////////////////////////////////////////////////////////// -typedef QController > SendtoBase; - GuiSendto::GuiSendto(Dialog & parent) - : SendtoBase(parent, _("Send Document to Command")) + : GuiView(parent, _("Send Document to Command")) { } diff --git a/src/frontends/qt4/GuiSendto.h b/src/frontends/qt4/GuiSendto.h index 4e4f3ba670..efdd78b41f 100644 --- a/src/frontends/qt4/GuiSendto.h +++ b/src/frontends/qt4/GuiSendto.h @@ -9,17 +9,17 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QSENDTO_H -#define QSENDTO_H +#ifndef GUISENDTO_H +#define GUISENDTO_H #include "GuiDialogView.h" +#include "ControlSendto.h" #include "ui_SendtoUi.h" #include #include -class QCloseEvent; class QListWidgetItem; namespace lyx { @@ -45,18 +45,21 @@ private: }; -class ControlSendto; - /** This class provides a Qt implementation of the Custom Export Dialog. */ -class GuiSendto - : public QController > +class GuiSendto : public GuiView { public: /// friend class GuiSendtoDialog; /// GuiSendto(Dialog &); + /// parent controller + ControlSendto & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlSendto const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); private: @@ -73,4 +76,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QSENDTO_H +#endif // GUISENDTO_H diff --git a/src/frontends/qt4/GuiShowFile.cpp b/src/frontends/qt4/GuiShowFile.cpp index 4de8c4e732..306b3efd5f 100644 --- a/src/frontends/qt4/GuiShowFile.cpp +++ b/src/frontends/qt4/GuiShowFile.cpp @@ -14,10 +14,9 @@ #include "Qt2BC.h" #include "qt_helpers.h" -#include "controllers/ControlShowFile.h" - #include #include +#include namespace lyx { namespace frontend { @@ -49,12 +48,9 @@ void GuiShowFileDialog::closeEvent(QCloseEvent * e) // ///////////////////////////////////////////////////////////////////// -typedef QController > - ShowFileBase; - GuiShowFile::GuiShowFile(Dialog & parent) - : ShowFileBase(parent, _("Show File")) + : GuiView(parent, _("Show File")) { } diff --git a/src/frontends/qt4/GuiShowFile.h b/src/frontends/qt4/GuiShowFile.h index 3c43cd9913..0c72c16428 100644 --- a/src/frontends/qt4/GuiShowFile.h +++ b/src/frontends/qt4/GuiShowFile.h @@ -13,18 +13,19 @@ #define QSHOWFILE_H #include "GuiDialogView.h" - +#include "ControlShowFile.h" #include "ui_ShowFileUi.h" #include -#include + namespace lyx { namespace frontend { class GuiShowFile; -class GuiShowFileDialog : public QDialog, public Ui::ShowFileUi { +class GuiShowFileDialog : public QDialog, public Ui::ShowFileUi +{ Q_OBJECT public: GuiShowFileDialog(GuiShowFile * form); @@ -35,15 +36,18 @@ private: }; -class ControlShowFile; - -class GuiShowFile - : public QController > +class GuiShowFile : public GuiView { public: friend class GuiShowFileDialog; GuiShowFile(Dialog &); + /// parent controller + ControlShowFile & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlShowFile const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply() {} diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index 356b0becb4..15756d51c7 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -14,8 +14,6 @@ #include "Qt2BC.h" #include "qt_helpers.h" -#include "controllers/ControlSpellchecker.h" - #include #include #include @@ -128,11 +126,9 @@ void GuiSpellcheckerDialog::reject() // ///////////////////////////////////////////////////////////////////// -typedef QController > - SpellcheckerBase; GuiSpellchecker::GuiSpellchecker(Dialog & parent) - : SpellcheckerBase(parent, _("Spellchecker")) + : GuiView(parent, _("Spellchecker")) {} diff --git a/src/frontends/qt4/GuiSpellchecker.h b/src/frontends/qt4/GuiSpellchecker.h index d7c8023a30..9c4a9258b5 100644 --- a/src/frontends/qt4/GuiSpellchecker.h +++ b/src/frontends/qt4/GuiSpellchecker.h @@ -10,17 +10,18 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QSPELLCHECKER_H -#define QSPELLCHECKER_H +#ifndef GUISPELLCHECKER_H +#define GUISPELLCHECKER_H #include "GuiDialogView.h" +#include "ControlSpellchecker.h" #include "ui_SpellcheckerUi.h" #include -#include class QListWidgetItem; + namespace lyx { namespace frontend { @@ -49,10 +50,7 @@ private: }; -class ControlSpellchecker; - -class GuiSpellchecker - : public QController > +class GuiSpellchecker : public GuiView { public: friend class GuiSpellcheckerDialog; @@ -61,6 +59,12 @@ public: /// update from controller void partialUpdate(int id); + /// parent controller + ControlSpellchecker & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlSpellchecker const & controller() const + { return static_cast(this->getController()); } private: void accept(); void add(); @@ -78,4 +82,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QSPELLCHECKER_H +#endif // GUISPELLCHECKER_H diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp index 3f48f43dca..bb15b3a1a0 100644 --- a/src/frontends/qt4/GuiTabular.cpp +++ b/src/frontends/qt4/GuiTabular.cpp @@ -12,8 +12,10 @@ #include -#include "CheckedLineEdit.h" #include "GuiTabular.h" + +#include "CheckedLineEdit.h" +#include "GuiSetBorder.h" #include "Qt2BC.h" #include "LengthCombo.h" @@ -21,7 +23,6 @@ #include "qt_helpers.h" #include "controllers/ButtonController.h" -#include "controllers/ControlTabular.h" #include "support/convert.h" @@ -31,8 +32,6 @@ #include #include -#include "GuiSetBorder.h" - using std::string; namespace lyx { @@ -517,10 +516,9 @@ void GuiTabularDialog::ltLastFooterEmpty_clicked() // ///////////////////////////////////////////////////////////////////// -typedef QController > tabular_base_class; GuiTabular::GuiTabular(Dialog & parent) - : tabular_base_class(parent, _("Table Settings")) + : GuiView(parent, _("Table Settings")) { } diff --git a/src/frontends/qt4/GuiTabular.h b/src/frontends/qt4/GuiTabular.h index 79913f07ac..d9bcc9abe2 100644 --- a/src/frontends/qt4/GuiTabular.h +++ b/src/frontends/qt4/GuiTabular.h @@ -12,22 +12,22 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QTABULAR_H -#define QTABULAR_H +#ifndef GUITABULAR_H +#define GUITABULAR_H #include "GuiDialogView.h" - +#include "ControlTabular.h" #include "ui_TabularUi.h" #include -#include namespace lyx { namespace frontend { class GuiTabular; -class GuiTabularDialog : public QDialog, public Ui::TabularUi { +class GuiTabularDialog : public QDialog, public Ui::TabularUi +{ Q_OBJECT public: GuiTabularDialog(GuiTabular * form); @@ -78,16 +78,19 @@ private: }; -class ControlTabular; - -class GuiTabular : - public QController > +class GuiTabular : public GuiView { public: friend class GuiTabularDialog; GuiTabular(Dialog &); + /// parent controller + ControlTabular & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlTabular const & controller() const + { return static_cast(this->getController()); } protected: virtual bool isValid(); @@ -107,4 +110,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QTABULAR_H +#endif // GUITABULAR_H diff --git a/src/frontends/qt4/GuiTabularCreate.cpp b/src/frontends/qt4/GuiTabularCreate.cpp index c521063e6b..e98ab486fb 100644 --- a/src/frontends/qt4/GuiTabularCreate.cpp +++ b/src/frontends/qt4/GuiTabularCreate.cpp @@ -14,8 +14,7 @@ #include "Qt2BC.h" #include "EmptyTable.h" -#include "controllers/ControlTabularCreate.h" - +#include #include #include @@ -64,12 +63,9 @@ void GuiTabularCreateDialog::rowsChanged(int) // ///////////////////////////////////////////////////////////////////// -typedef QController > - TabularCreateBase; - GuiTabularCreate::GuiTabularCreate(Dialog & parent) - : TabularCreateBase(parent, _("Insert Table")) + : GuiView(parent, _("Insert Table")) { } diff --git a/src/frontends/qt4/GuiTabularCreate.h b/src/frontends/qt4/GuiTabularCreate.h index cfb761b99d..474f4e42e9 100644 --- a/src/frontends/qt4/GuiTabularCreate.h +++ b/src/frontends/qt4/GuiTabularCreate.h @@ -9,10 +9,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QTABULARCREATE_H -#define QTABULARCREATE_H +#ifndef GUITABULARCREATE_H +#define GUITABULARCREATE_H #include "GuiDialogView.h" +#include "ControlTabularCreate.h" #include "ui_TabularCreateUi.h" #include @@ -22,7 +23,8 @@ namespace frontend { class GuiTabularCreate; -class GuiTabularCreateDialog : public QDialog, public Ui::TabularCreateUi { +class GuiTabularCreateDialog : public QDialog, public Ui::TabularCreateUi +{ Q_OBJECT public: GuiTabularCreateDialog(GuiTabularCreate * form); @@ -34,16 +36,19 @@ private: }; -class ControlTabularCreate; - -class GuiTabularCreate - : public QController > +class GuiTabularCreate : public GuiView { public: /// friend class GuiTabularCreateDialog; /// GuiTabularCreate(Dialog &); + /// parent controller + ControlTabularCreate & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlTabularCreate const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -56,4 +61,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QTABULARCREATE_H +#endif // GUITABULARCREATE_H diff --git a/src/frontends/qt4/GuiTexinfo.cpp b/src/frontends/qt4/GuiTexinfo.cpp index 8070013bd2..c9eea00434 100644 --- a/src/frontends/qt4/GuiTexinfo.cpp +++ b/src/frontends/qt4/GuiTexinfo.cpp @@ -16,6 +16,7 @@ #include "support/filetools.h" +#include #include #include #include @@ -114,18 +115,15 @@ void GuiTexinfoDialog::enableViewPB() } - ///////////////////////////////////////////////////////////////////// // // GuiTexinfo // ///////////////////////////////////////////////////////////////////// -typedef QController > - texinfo_base_class; GuiTexinfo::GuiTexinfo(Dialog & parent) - : texinfo_base_class(parent, _("TeX Information")), + : GuiView(parent, _("TeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls) { } diff --git a/src/frontends/qt4/GuiTexinfo.h b/src/frontends/qt4/GuiTexinfo.h index a021d108c0..6e840d1f44 100644 --- a/src/frontends/qt4/GuiTexinfo.h +++ b/src/frontends/qt4/GuiTexinfo.h @@ -13,12 +13,10 @@ #define QTEXINFO_H #include "GuiDialogView.h" - #include "ControlTexinfo.h" #include "ui_TexinfoUi.h" #include -#include #include #include @@ -28,7 +26,8 @@ namespace frontend { class GuiTexinfo; -class GuiTexinfoDialog : public QDialog, public Ui::TexinfoUi { +class GuiTexinfoDialog : public QDialog, public Ui::TexinfoUi +{ Q_OBJECT public: GuiTexinfoDialog(GuiTexinfo * form); @@ -47,13 +46,19 @@ private: /// -class GuiTexinfo - : public QController > { +class GuiTexinfo : public GuiView +{ public: /// friend class GuiTexinfoDialog; /// GuiTexinfo(Dialog &); + /// parent controller + ControlTexinfo & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlTexinfo const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply() {} diff --git a/src/frontends/qt4/GuiThesaurus.cpp b/src/frontends/qt4/GuiThesaurus.cpp index e706fa7975..dc076319f0 100644 --- a/src/frontends/qt4/GuiThesaurus.cpp +++ b/src/frontends/qt4/GuiThesaurus.cpp @@ -15,8 +15,7 @@ #include "qt_helpers.h" #include "debug.h" -#include "controllers/ControlThesaurus.h" - +#include #include #include #include @@ -138,14 +137,12 @@ void GuiThesaurusDialog::updateLists() ///////////////////////////////////////////////////////////////////// // -// GuiThesuarus +// GuiThesaurus // ///////////////////////////////////////////////////////////////////// -typedef QController > ThesaurusBase; - GuiThesaurus::GuiThesaurus(Dialog & parent) - : ThesaurusBase(parent, _("Thesaurus")) + : GuiView(parent, _("Thesaurus")) { } diff --git a/src/frontends/qt4/GuiThesaurus.h b/src/frontends/qt4/GuiThesaurus.h index 57b6cadd7d..cb8f48ce1b 100644 --- a/src/frontends/qt4/GuiThesaurus.h +++ b/src/frontends/qt4/GuiThesaurus.h @@ -9,14 +9,14 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QTHESAURUS_H -#define QTHESAURUS_H +#ifndef GUITHESAURUS_H +#define GUITHESAURUS_H #include "GuiDialogView.h" +#include "ControlThesaurus.h" #include "ui_ThesaurusUi.h" #include -#include class QTreeWidgetItem; @@ -28,7 +28,8 @@ class ControlThesaurus; class GuiThesaurus; -class GuiThesaurusDialog : public QDialog, public Ui::ThesaurusUi { +class GuiThesaurusDialog : public QDialog, public Ui::ThesaurusUi +{ Q_OBJECT public: GuiThesaurusDialog(GuiThesaurus * form); @@ -49,14 +50,19 @@ private: /// -class GuiThesaurus - : public QController > +class GuiThesaurus : public GuiView { public: /// friend class GuiThesaurusDialog; /// GuiThesaurus(Dialog &); + /// parent controller + ControlThesaurus & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlThesaurus const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply() {} @@ -72,4 +78,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QTHESAURUS_H +#endif // GUITHESAURUS_H diff --git a/src/frontends/qt4/GuiToc.h b/src/frontends/qt4/GuiToc.h index 60d2cb5a64..7f0599bd9a 100644 --- a/src/frontends/qt4/GuiToc.h +++ b/src/frontends/qt4/GuiToc.h @@ -11,8 +11,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QTOC_H -#define QTOC_H +#ifndef GUITOC_H +#define GUITOC_H #include "ControlToc.h" @@ -63,4 +63,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QTOC_H +#endif // GUITOC_H diff --git a/src/frontends/qt4/GuiToolbar.h b/src/frontends/qt4/GuiToolbar.h index 43fc238abb..22fa093014 100644 --- a/src/frontends/qt4/GuiToolbar.h +++ b/src/frontends/qt4/GuiToolbar.h @@ -13,8 +13,8 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QLTOOLBAR_H -#define QLTOOLBAR_H +#ifndef GUITOOLBAR_H +#define GUITOOLBAR_H #include "frontends/Toolbars.h" #include "Session.h" @@ -99,4 +99,4 @@ std::string const getIcon(FuncRequest const & f, bool unknown = true); } // namespace frontend } // namespace lyx -#endif // NOT QLTOOLBAR_H +#endif // GUITOOLBAR_H diff --git a/src/frontends/qt4/GuiURLDialog.cpp b/src/frontends/qt4/GuiURLDialog.cpp index ceb273f1f4..2728fa2a58 100644 --- a/src/frontends/qt4/GuiURLDialog.cpp +++ b/src/frontends/qt4/GuiURLDialog.cpp @@ -11,11 +11,15 @@ #include #include "GuiURLDialog.h" -#include "UrlView.h" +#include "Qt2BC.h" +#include "qt_helpers.h" +#include "ButtonController.h" +#include +#include #include #include -#include + namespace lyx { namespace frontend { @@ -50,6 +54,60 @@ void GuiURLDialog::closeEvent(QCloseEvent * e) e->accept(); } + + +UrlView::UrlView(Dialog & parent) + : GuiView(parent, _("URL")) +{ +} + + +void UrlView::build_dialog() +{ + dialog_.reset(new GuiURLDialog(this)); + + bcview().setOK(dialog_->okPB); + bcview().setCancel(dialog_->closePB); + bcview().addReadOnly(dialog_->urlED); + bcview().addReadOnly(dialog_->nameED); + bcview().addReadOnly(dialog_->hyperlinkCB); +} + + +void UrlView::update_contents() +{ + InsetCommandParams const & params = controller().params(); + + dialog_->urlED->setText(toqstr(params["target"])); + dialog_->nameED->setText(toqstr(params["name"])); + dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url"); + + bc().valid(isValid()); +} + + +void UrlView::apply() +{ + InsetCommandParams & params = controller().params(); + + params["target"] = qstring_to_ucs4(dialog_->urlED->text()); + params["name"] = qstring_to_ucs4(dialog_->nameED->text()); + + if (dialog_->hyperlinkCB->isChecked()) + params.setCmdName("htmlurl"); + else + params.setCmdName("url"); +} + + +bool UrlView::isValid() +{ + QString const u = dialog_->urlED->text(); + QString const n = dialog_->nameED->text(); + + return !u.isEmpty() || !n.isEmpty(); +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiURLDialog.h b/src/frontends/qt4/GuiURLDialog.h index 84c7cf33d0..6c9c5ffee9 100644 --- a/src/frontends/qt4/GuiURLDialog.h +++ b/src/frontends/qt4/GuiURLDialog.h @@ -12,17 +12,19 @@ #ifndef GUIURLDIALOG_H #define GUIURLDIALOG_H +#include "GuiDialogView.h" +#include "ControlCommand.h" #include "ui_URLUi.h" #include -#include namespace lyx { namespace frontend { class UrlView; -class GuiURLDialog : public QDialog, public Ui::URLUi { +class GuiURLDialog : public QDialog, public Ui::URLUi +{ Q_OBJECT public: GuiURLDialog(UrlView * form); @@ -34,6 +36,29 @@ private: UrlView * form_; }; + +class UrlView : public GuiView +{ +public: + friend class QURLDialog; + UrlView(Dialog &); + /// parent controller + ControlCommand & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlCommand const & controller() const + { return static_cast(this->getController()); } +protected: + virtual bool isValid(); +private: + /// apply dialog + virtual void apply(); + /// build dialog + virtual void build_dialog(); + /// update dialog + virtual void update_contents(); +}; + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiVSpace.cpp b/src/frontends/qt4/GuiVSpace.cpp index 7901590c0b..8828accd77 100644 --- a/src/frontends/qt4/GuiVSpace.cpp +++ b/src/frontends/qt4/GuiVSpace.cpp @@ -182,10 +182,8 @@ static VSpace setVSpaceFromWidgets(int spacing, } -typedef QController > VSpaceBase; - GuiVSpace::GuiVSpace(Dialog & parent) - : VSpaceBase(parent, _("Vertical Space Settings")) + : GuiView(parent, _("Vertical Space Settings")) {} diff --git a/src/frontends/qt4/GuiVSpace.h b/src/frontends/qt4/GuiVSpace.h index 755758a1df..9cc1f74a7a 100644 --- a/src/frontends/qt4/GuiVSpace.h +++ b/src/frontends/qt4/GuiVSpace.h @@ -15,22 +15,18 @@ #define QVSPACE_H #include "GuiDialogView.h" - +#include "ControlVSpace.h" #include "ui_VSpaceUi.h" #include -class QCloseEvent; - namespace lyx { namespace frontend { -class ControlVSpace; - class GuiVSpace; - -class GuiVSpaceDialog : public QDialog, public Ui::VSpaceUi { +class GuiVSpaceDialog : public QDialog, public Ui::VSpaceUi +{ Q_OBJECT public: @@ -48,15 +44,19 @@ private: }; - -class GuiVSpace - : public QController > +class GuiVSpace : public GuiView { public: /// friend class GuiVSpaceDialog; /// GuiVSpace(Dialog &); + /// parent controller + ControlVSpace & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlVSpace const & controller() const + { return static_cast(this->getController()); } private: /// Build the dialog virtual void build_dialog(); diff --git a/src/frontends/qt4/GuiViewSource.h b/src/frontends/qt4/GuiViewSource.h index 10145f7e25..1f3e56e769 100644 --- a/src/frontends/qt4/GuiViewSource.h +++ b/src/frontends/qt4/GuiViewSource.h @@ -11,11 +11,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QVIEWSOURCE_H -#define QVIEWSOURCE_H +#ifndef GUIVIEWSOURCE_H +#define GUIVIEWSOURCE_H -#include "frontends/controllers/ControlViewSource.h" -#include "frontends/Application.h" +#include "ControlViewSource.h" +#include "Application.h" #include "ui_ViewSourceUi.h" #include @@ -43,7 +43,6 @@ private: }; - class GuiViewSource; class GuiViewSourceDialog : public QWidget, public Ui::ViewSourceUi { @@ -81,4 +80,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QVIEWSOURCE_H +#endif // GUIVIEWSOURCE_H diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index c91362a3dd..99f0b4b712 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -490,7 +490,7 @@ void GuiWorkArea::expose(int x, int y, int w, int h) void GuiWorkArea::updateScreen() { - QLPainter pain(&screen_); + GuiPainter pain(&screen_); verticalScrollBar()->show(); buffer_view_->draw(pain); } @@ -559,7 +559,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e) return; } - QLPainter pain(&screen_); + GuiPainter pain(&screen_); buffer_view_->updateMetrics(false); buffer_view_->draw(pain); Font font = buffer_view_->cursor().getFont(); diff --git a/src/frontends/qt4/GuiWrap.cpp b/src/frontends/qt4/GuiWrap.cpp index 88a85a2507..af19e66503 100644 --- a/src/frontends/qt4/GuiWrap.cpp +++ b/src/frontends/qt4/GuiWrap.cpp @@ -16,8 +16,6 @@ #include "LengthCombo.h" #include "qt_helpers.h" -#include "controllers/ControlWrap.h" - #include "insets/InsetWrap.h" #include "support/convert.h" @@ -77,10 +75,8 @@ void GuiWrapDialog::change_adaptor() // ///////////////////////////////////////////////////////////////////// -typedef QController > wrap_base_class; - GuiWrap::GuiWrap(Dialog & parent) - : wrap_base_class(parent, _("Text Wrap Settings")) + : GuiView(parent, _("Text Wrap Settings")) { } diff --git a/src/frontends/qt4/GuiWrap.h b/src/frontends/qt4/GuiWrap.h index 293b26e5bf..8bdf588c86 100644 --- a/src/frontends/qt4/GuiWrap.h +++ b/src/frontends/qt4/GuiWrap.h @@ -9,21 +9,22 @@ * Full author contact details are available in file CREDITS. */ -#ifndef QWRAP_H -#define QWRAP_H +#ifndef GUIWRAP_H +#define GUIWRAP_H #include "GuiDialogView.h" +#include "ControlWrap.h" #include "ui_WrapUi.h" #include -#include namespace lyx { namespace frontend { class GuiWrap; -class GuiWrapDialog : public QDialog, public Ui::WrapUi { +class GuiWrapDialog : public QDialog, public Ui::WrapUi +{ Q_OBJECT public: GuiWrapDialog(GuiWrap * form); @@ -36,13 +37,18 @@ private: }; -class ControlWrap; - -class GuiWrap : public QController > { +class GuiWrap : public GuiView +{ public: friend class GuiWrapDialog; GuiWrap(Dialog &); + /// parent controller + ControlWrap & controller() + { return static_cast(this->getController()); } + /// parent controller + ControlWrap const & controller() const + { return static_cast(this->getController()); } private: /// Apply changes virtual void apply(); @@ -55,4 +61,4 @@ private: } // namespace frontend } // namespace lyx -#endif // QWRAP_H +#endif // GUIWRAP_H diff --git a/src/frontends/qt4/Makefile.am b/src/frontends/qt4/Makefile.am index 998d2eea1c..c331f7f0b8 100644 --- a/src/frontends/qt4/Makefile.am +++ b/src/frontends/qt4/Makefile.am @@ -66,12 +66,10 @@ SOURCEFILES = \ GuiERT.cpp \ GuiExternal.cpp \ GuiFloat.cpp \ - GuiFloatDialog.cpp \ GuiFontExample.cpp \ GuiFontLoader.cpp \ GuiFontMetrics.cpp \ GuiGraphics.cpp \ - GuiGraphicsDialog.cpp \ GuiImage.cpp \ GuiImplementation.cpp \ GuiInclude.cpp \ @@ -89,7 +87,6 @@ SOURCEFILES = \ GuiPopupMenu.cpp \ GuiPrefs.cpp \ GuiPrint.cpp \ - GuiPrintDialog.cpp \ GuiRef.cpp \ GuiSearch.cpp \ GuiSelection.cpp \ @@ -120,7 +117,6 @@ SOURCEFILES = \ socket_callback.cpp \ TocModel.cpp \ TocWidget.cpp \ - UrlView.cpp \ Validator.cpp NOMOCHEADER = \ @@ -129,10 +125,8 @@ NOMOCHEADER = \ GuiFontLoader.h \ GuiFontMetrics.h \ GuiSelection.h \ - GuiGraphics.h \ GuiImage.h \ GuiPainter.h \ - GuiPrint.h \ Qt2BC.h \ qt_helpers.h @@ -163,10 +157,9 @@ MOCHEADER = \ GuiErrorList.h \ GuiERT.h \ GuiExternal.h \ - GuiFloatDialog.h \ GuiFloat.h \ GuiFontExample.h \ - GuiGraphicsDialog.h \ + GuiGraphics.h \ GuiImplementation.h \ GuiInclude.h \ GuiIndex.h \ @@ -180,7 +173,7 @@ MOCHEADER = \ GuiParagraph.h \ GuiPopupMenu.h \ GuiPrefs.h \ - GuiPrintDialog.h \ + GuiPrint.h \ GuiRef.h \ GuiSearch.h \ GuiSelectionManager.h \ diff --git a/src/frontends/qt4/UrlView.cpp b/src/frontends/qt4/UrlView.cpp deleted file mode 100644 index c1cab905c0..0000000000 --- a/src/frontends/qt4/UrlView.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/** - * \file UrlView.cpp - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "UrlView.h" -#include "GuiURLDialog.h" -#include "Qt2BC.h" -#include "qt_helpers.h" - -#include "controllers/ButtonController.h" -#include "controllers/ControlCommand.h" - -#include -#include -#include - -using std::string; - -namespace lyx { -namespace frontend { - -typedef QController< ControlCommand, GuiView > urlview_base_class; - -UrlView::UrlView(Dialog & parent) - : urlview_base_class(parent, _("URL")) -{ -} - - -void UrlView::build_dialog() -{ - dialog_.reset(new GuiURLDialog(this)); - - bcview().setOK(dialog_->okPB); - bcview().setCancel(dialog_->closePB); - bcview().addReadOnly(dialog_->urlED); - bcview().addReadOnly(dialog_->nameED); - bcview().addReadOnly(dialog_->hyperlinkCB); -} - - -void UrlView::update_contents() -{ - InsetCommandParams const & params = controller().params(); - - dialog_->urlED->setText(toqstr(params["target"])); - dialog_->nameED->setText(toqstr(params["name"])); - dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url"); - - bc().valid(isValid()); -} - - -void UrlView::apply() -{ - InsetCommandParams & params = controller().params(); - - params["target"] = qstring_to_ucs4(dialog_->urlED->text()); - params["name"] = qstring_to_ucs4(dialog_->nameED->text()); - - if (dialog_->hyperlinkCB->isChecked()) - params.setCmdName("htmlurl"); - else - params.setCmdName("url"); -} - - -bool UrlView::isValid() -{ - string const u(fromqstr(dialog_->urlED->text())); - string const n(fromqstr(dialog_->nameED->text())); - - return !u.empty() || !n.empty(); -} - -} // namespace frontend -} // namespace lyx diff --git a/src/frontends/qt4/UrlView.h b/src/frontends/qt4/UrlView.h deleted file mode 100644 index a46ed93388..0000000000 --- a/src/frontends/qt4/UrlView.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- -/** - * \file UrlView.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef QT4_URL_VIEW_H -#define QT4_URL_VIEW_H - -#include "GuiDialogView.h" -#include "GuiURLDialog.h" - -namespace lyx { -namespace frontend { - -class ControlCommand; - -class UrlView : - public QController > -{ -public: - friend class QURLDialog; - UrlView(Dialog &); -protected: - virtual bool isValid(); -private: - /// apply dialog - virtual void apply(); - /// build dialog - virtual void build_dialog(); - /// update dialog - virtual void update_contents(); -}; - -} // namespace frontend -} // namespace lyx - -#endif // QT4_URL_VIEW_H