]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/Dialogs2.C
Use PanelStack for the document dialog too
[lyx.git] / src / frontends / qt2 / Dialogs2.C
index e75d2801a324e79a591488d03a548b19be7dfb22..a3f01a84a2f7eef4fe897139c46c2b23130c286a 100644 (file)
 
 #include <config.h>
 
-#include "Dialogs_impl.h"
-
-
-void Dialogs::showAboutlyx()
-{
-       pimpl_->aboutlyx.controller().show();
-}
-
-
-void Dialogs::showMergeChanges()
-{
-       pimpl_->changes.controller().show();
-}
+#include "Dialogs.h"
+#include "controllers/GUI.h"
+#include "ButtonController.h"
+
+#include "ControlDocument.h"
+#include "ControlForks.h"
+#include "ControlPrefs.h"
+#include "ControlPrint.h"
+#include "ControlSearch.h"
+#include "ControlSendto.h"
+#include "ControlSpellchecker.h"
+#include "ControlTexinfo.h"
+
+#include "QCharacter.h"
+#include "QCharacterDialog.h"
+#include "QDocument.h"
+#include "QDocumentDialog.h"
+//#include "QForks.h"
+// Here would be an appropriate point to lecture on the evils
+// of the Qt headers, those most fucked up of disgusting ratholes.
+// But I won't.
+#undef signals
+#include "QPrefs.h"
+#include "QPrefsDialog.h"
+#include "QPrint.h"
+#include "QLPrintDialog.h"
+#include "QSearch.h"
+#include "QSearchDialog.h"
+#include "QSendto.h"
+#include "QSendtoDialog.h"
+#include "QSpellchecker.h"
+#include "QSpellcheckerDialog.h"
+#include "QTexinfo.h"
+#include "QTexinfoDialog.h"
+
+#include "Qt2BC.h"
+
+
+
+typedef GUI<ControlDocument, QDocument, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
+DocumentDialog;
+
+typedef GUI<ControlPrefs, QPrefs, OkApplyCancelPolicy, Qt2BC>
+PrefsDialog;
+
+typedef GUI<ControlPrint, QPrint, OkApplyCancelPolicy, Qt2BC>
+PrintDialog;
+
+typedef GUI<ControlSearch, QSearch, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
+SearchDialog;
+
+typedef GUI<ControlSendto, QSendto, OkApplyCancelPolicy, Qt2BC>
+SendtoDialog;
+
+typedef GUI<ControlSpellchecker, QSpellchecker, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
+SpellcheckerDialog;
+
+typedef GUI<ControlTexinfo, QTexinfo, OkCancelPolicy, Qt2BC>
+TexinfoDialog;
+
+struct Dialogs::Impl {
+       Impl(LyXView & lv, Dialogs & d);
+
+       DocumentDialog      document;
+       PrefsDialog         prefs;
+       PrintDialog         print;
+       SearchDialog        search;
+       SendtoDialog        sendto;
+       SpellcheckerDialog  spellchecker;
+       TexinfoDialog       texinfo;
+};
+
+
+Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
+       : document(lv, d),
+         prefs(lv, d),
+         print(lv, d),
+         search(lv, d),
+         sendto(lv, d),
+         spellchecker(lv, d),
+         texinfo(lv, d)
+{}
 
 
-void Dialogs::showCharacter()
+void Dialogs::init_pimpl()
 {
-       pimpl_->character.controller().show();
+       pimpl_ = new Impl(lyxview_, *this);
 }
 
 
-void Dialogs::setUserFreeFont()
+Dialogs::~Dialogs()
 {
-       pimpl_->character.controller().apply();
+       delete pimpl_;
 }
 
 
@@ -45,22 +114,10 @@ void Dialogs::showDocument()
 }
 
 
-void Dialogs::showFile(string const & f)
-{
-       pimpl_->file.controller().showFile(f);
-}
-
-
 void Dialogs::showForks()
 {}
 
 
-void Dialogs::showLogFile()
-{
-       pimpl_->logfile.controller().show();
-}
-
-
 void Dialogs::showMathPanel()
 {
        // FIXME FIXME FIXME
@@ -70,21 +127,11 @@ void Dialogs::showMathPanel()
 }
 
 
-void Dialogs::showParagraph()
-{
-       pimpl_->paragraph.controller().show();
-}
-
-
-void Dialogs::updateParagraph()
-{
-       pimpl_->paragraph.controller().changedParagraph();
-}
-
-
 void Dialogs::showPreamble()
 {
-       // FIXME
+       pimpl_->document.controller().show();
+       // Oh Angus, won't you help a poor child ?
+       //pimpl_->document.view()->showPreamble();
 }
 
 
@@ -122,24 +169,3 @@ void Dialogs::showTexinfo()
 {
        pimpl_->texinfo.controller().show();
 }
-
-
-#ifdef HAVE_LIBAIKSAURUS
-
-void Dialogs::showThesaurus(string const & s)
-{
-       pimpl_->thesaurus.controller().showEntry(s);
-}
-
-#else
-
-void Dialogs::showThesaurus(string const &)
-{}
-
-#endif
-
-
-void Dialogs::showVCLogFile()
-{
-       pimpl_->vclogfile.controller().show();
-}