mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Now that fewer dialogs use the old scheme, can merge three files into one.
Dialogs2.C will go when all dialogs are ported to the new scheme. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6584 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9f330376ac
commit
0784c24d53
@ -1,3 +1,14 @@
|
||||
2003-03-26 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* Dialogs.C:
|
||||
* Dialogs2.C:
|
||||
* Dialogs3.C:
|
||||
* Dialogs_impl.h:
|
||||
move the contents of Dialogs.C and Dialogs_impl.h into Dialogs2.C.
|
||||
move Dialog3.C to Dialogs.C.
|
||||
|
||||
* Makefile.am: remove Dialogs_impl.h, Dialog3.C.
|
||||
|
||||
2003-03-26 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* Dialogs.C:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* \file qt2/Dialogs.C
|
||||
* \file qt2/Dialogs3.C
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -10,28 +10,236 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "Dialogs_impl.h"
|
||||
#include "Dialogs.h"
|
||||
#include "Dialog.h"
|
||||
|
||||
#include "ControlAboutlyx.h"
|
||||
#include "ControlBibtex.h"
|
||||
#include "ControlChanges.h"
|
||||
#include "ControlCharacter.h"
|
||||
#include "ControlCitation.h"
|
||||
#include "ControlError.h"
|
||||
#include "ControlERT.h"
|
||||
#include "ControlExternal.h"
|
||||
#include "ControlFloat.h"
|
||||
#include "ControlGraphics.h"
|
||||
#include "ControlInclude.h"
|
||||
#include "ControlLog.h"
|
||||
#include "ControlMinipage.h"
|
||||
#include "ControlParagraph.h"
|
||||
#include "ControlRef.h"
|
||||
#include "ControlShowFile.h"
|
||||
#include "ControlTabular.h"
|
||||
#include "ControlTabularCreate.h"
|
||||
#include "ControlToc.h"
|
||||
#include "ControlVCLog.h"
|
||||
#include "ControlWrap.h"
|
||||
|
||||
#include "QAbout.h"
|
||||
#include "QBibitem.h"
|
||||
#include "QBibtex.h"
|
||||
#include "QChanges.h"
|
||||
#include "QCharacter.h"
|
||||
#include "QCitation.h"
|
||||
#include "QError.h"
|
||||
#include "QERT.h"
|
||||
#include "QExternal.h"
|
||||
#include "QFloat.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 "QGraphics.h"
|
||||
#include "QInclude.h"
|
||||
#include "QIndex.h"
|
||||
#include "QLog.h"
|
||||
#include "QMinipage.h"
|
||||
#include "QParagraph.h"
|
||||
#include "QRef.h"
|
||||
#include "QShowFile.h"
|
||||
#include "QTabular.h"
|
||||
#include "QTabularCreate.h"
|
||||
#include "QToc.h"
|
||||
#include "QURL.h"
|
||||
#include "QVCLog.h"
|
||||
#include "QWrap.h"
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
#include "ControlThesaurus.h"
|
||||
#include "QThesaurus.h"
|
||||
#endif
|
||||
|
||||
#include "Qt2BC.h"
|
||||
#include "ButtonController.h"
|
||||
#include "qt_helpers.h"
|
||||
|
||||
|
||||
void Dialogs::init_pimpl()
|
||||
namespace {
|
||||
|
||||
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
|
||||
"character", "citation", "error", "ert", "external", "file", "float",
|
||||
"graphics", "include", "index", "label", "log", "minipage", "paragraph",
|
||||
"ref", "tabular", "tabularcreate",
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
"thesaurus",
|
||||
#endif
|
||||
|
||||
"toc", "url", "vclog", "wrap" };
|
||||
|
||||
char const * const * const end_dialognames =
|
||||
dialognames + (sizeof(dialognames) / sizeof(char *));
|
||||
|
||||
struct cmpCStr {
|
||||
cmpCStr(char const * name) : name_(name) {}
|
||||
bool operator()(char const * other) {
|
||||
return strcmp(other, name_) == 0;
|
||||
}
|
||||
private:
|
||||
char const * name_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
bool Dialogs::isValidName(string const & name) const
|
||||
{
|
||||
pimpl_ = new Impl(lyxview_, *this);
|
||||
return std::find_if(dialognames, end_dialognames,
|
||||
cmpCStr(name.c_str())) != end_dialognames;
|
||||
}
|
||||
|
||||
|
||||
Dialogs::~Dialogs()
|
||||
Dialog * Dialogs::build(string const & name)
|
||||
{
|
||||
delete pimpl_;
|
||||
if (!isValidName(name))
|
||||
return 0;
|
||||
|
||||
Dialog * dialog = new Dialog(lyxview_, name);
|
||||
dialog->bc().view(new Qt2BC(dialog->bc()));
|
||||
|
||||
if (name == "about") {
|
||||
dialog->setController(new ControlAboutlyx(*dialog));
|
||||
dialog->setView(new QAbout(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "bibitem") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QBibitem(*dialog));
|
||||
dialog->bc().bp(new OkCancelReadOnlyPolicy);
|
||||
} else if (name == "bibtex") {
|
||||
dialog->setController(new ControlBibtex(*dialog));
|
||||
dialog->setView(new QBibtex(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "changes") {
|
||||
dialog->setController(new ControlChanges(*dialog));
|
||||
dialog->setView(new QChanges(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "character") {
|
||||
dialog->setController(new ControlCharacter(*dialog));
|
||||
dialog->setView(new QCharacter(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "citation") {
|
||||
dialog->setController(new ControlCitation(*dialog));
|
||||
dialog->setView(new QCitation(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "error") {
|
||||
dialog->setController(new ControlError(*dialog));
|
||||
dialog->setView(new QError(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "ert") {
|
||||
dialog->setController(new ControlERT(*dialog));
|
||||
dialog->setView(new QERT(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "external") {
|
||||
dialog->setController(new ControlExternal(*dialog));
|
||||
dialog->setView(new QExternal(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "file") {
|
||||
dialog->setController(new ControlShowFile(*dialog));
|
||||
dialog->setView(new QShowFile(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "float") {
|
||||
dialog->setController(new ControlFloat(*dialog));
|
||||
dialog->setView(new QFloat(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "graphics") {
|
||||
dialog->setController(new ControlGraphics(*dialog));
|
||||
dialog->setView(new QGraphics(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "include") {
|
||||
dialog->setController(new ControlInclude(*dialog));
|
||||
dialog->setView(new QInclude(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "index") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QIndex(*dialog,
|
||||
qt_("LyX: Insert Index Entry"),
|
||||
qt_("&Keyword")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "label") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QIndex(*dialog,
|
||||
qt_("LyX: Insert Label"),
|
||||
qt_("&Label")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "log") {
|
||||
dialog->setController(new ControlLog(*dialog));
|
||||
dialog->setView(new QLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "minipage") {
|
||||
dialog->setController(new ControlMinipage(*dialog));
|
||||
dialog->setView(new QMinipage(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "paragraph") {
|
||||
dialog->setController(new ControlParagraph(*dialog));
|
||||
dialog->setView(new QParagraph(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "ref") {
|
||||
dialog->setController(new ControlRef(*dialog));
|
||||
dialog->setView(new QRef(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabular") {
|
||||
dialog->setController(new ControlTabular(*dialog));
|
||||
dialog->setView(new QTabular(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabularcreate") {
|
||||
dialog->setController(new ControlTabularCreate(*dialog));
|
||||
dialog->setView(new QTabularCreate(*dialog));
|
||||
dialog->bc().bp(new IgnorantPolicy);
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
} else if (name == "thesaurus") {
|
||||
dialog->setController(new ControlThesaurus(*dialog));
|
||||
dialog->setView(new QThesaurus(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
#endif
|
||||
} else if (name == "toc") {
|
||||
dialog->setController(new ControlToc(*dialog));
|
||||
dialog->setView(new QToc(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "url") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QURL(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "vclog") {
|
||||
dialog->setController(new ControlVCLog(*dialog));
|
||||
dialog->setView(new QVCLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "wrap") {
|
||||
dialog->setController(new ControlWrap(*dialog));
|
||||
dialog->setView(new QWrap(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
}
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
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::toggleTooltips()
|
||||
{}
|
||||
|
||||
|
||||
/// Are the tooltips on or off?
|
||||
bool Dialogs::tooltipsEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -12,7 +12,100 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "Dialogs_impl.h"
|
||||
#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::init_pimpl()
|
||||
{
|
||||
pimpl_ = new Impl(lyxview_, *this);
|
||||
}
|
||||
|
||||
|
||||
Dialogs::~Dialogs()
|
||||
{
|
||||
delete pimpl_;
|
||||
}
|
||||
|
||||
|
||||
void Dialogs::showDocument()
|
||||
|
@ -1,245 +0,0 @@
|
||||
/**
|
||||
* \file qt2/Dialogs3.C
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Angus Leeming
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "Dialogs.h"
|
||||
#include "Dialog.h"
|
||||
|
||||
#include "ControlAboutlyx.h"
|
||||
#include "ControlBibtex.h"
|
||||
#include "ControlChanges.h"
|
||||
#include "ControlCharacter.h"
|
||||
#include "ControlCitation.h"
|
||||
#include "ControlError.h"
|
||||
#include "ControlERT.h"
|
||||
#include "ControlExternal.h"
|
||||
#include "ControlFloat.h"
|
||||
#include "ControlGraphics.h"
|
||||
#include "ControlInclude.h"
|
||||
#include "ControlLog.h"
|
||||
#include "ControlMinipage.h"
|
||||
#include "ControlParagraph.h"
|
||||
#include "ControlRef.h"
|
||||
#include "ControlShowFile.h"
|
||||
#include "ControlTabular.h"
|
||||
#include "ControlTabularCreate.h"
|
||||
#include "ControlToc.h"
|
||||
#include "ControlVCLog.h"
|
||||
#include "ControlWrap.h"
|
||||
|
||||
#include "QAbout.h"
|
||||
#include "QBibitem.h"
|
||||
#include "QBibtex.h"
|
||||
#include "QChanges.h"
|
||||
#include "QCharacter.h"
|
||||
#include "QCitation.h"
|
||||
#include "QError.h"
|
||||
#include "QERT.h"
|
||||
#include "QExternal.h"
|
||||
#include "QFloat.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 "QGraphics.h"
|
||||
#include "QInclude.h"
|
||||
#include "QIndex.h"
|
||||
#include "QLog.h"
|
||||
#include "QMinipage.h"
|
||||
#include "QParagraph.h"
|
||||
#include "QRef.h"
|
||||
#include "QShowFile.h"
|
||||
#include "QTabular.h"
|
||||
#include "QTabularCreate.h"
|
||||
#include "QToc.h"
|
||||
#include "QURL.h"
|
||||
#include "QVCLog.h"
|
||||
#include "QWrap.h"
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
#include "ControlThesaurus.h"
|
||||
#include "QThesaurus.h"
|
||||
#endif
|
||||
|
||||
#include "Qt2BC.h"
|
||||
#include "ButtonController.h"
|
||||
#include "qt_helpers.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
|
||||
"character", "citation", "error", "ert", "external", "file", "float",
|
||||
"graphics", "include", "index", "label", "log", "minipage", "paragraph",
|
||||
"ref", "tabular", "tabularcreate",
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
"thesaurus",
|
||||
#endif
|
||||
|
||||
"toc", "url", "vclog", "wrap" };
|
||||
|
||||
char const * const * const end_dialognames =
|
||||
dialognames + (sizeof(dialognames) / sizeof(char *));
|
||||
|
||||
struct cmpCStr {
|
||||
cmpCStr(char const * name) : name_(name) {}
|
||||
bool operator()(char const * other) {
|
||||
return strcmp(other, name_) == 0;
|
||||
}
|
||||
private:
|
||||
char const * name_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
bool Dialogs::isValidName(string const & name) const
|
||||
{
|
||||
return std::find_if(dialognames, end_dialognames,
|
||||
cmpCStr(name.c_str())) != end_dialognames;
|
||||
}
|
||||
|
||||
|
||||
Dialog * Dialogs::build(string const & name)
|
||||
{
|
||||
if (!isValidName(name))
|
||||
return 0;
|
||||
|
||||
Dialog * dialog = new Dialog(lyxview_, name);
|
||||
dialog->bc().view(new Qt2BC(dialog->bc()));
|
||||
|
||||
if (name == "about") {
|
||||
dialog->setController(new ControlAboutlyx(*dialog));
|
||||
dialog->setView(new QAbout(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "bibitem") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QBibitem(*dialog));
|
||||
dialog->bc().bp(new OkCancelReadOnlyPolicy);
|
||||
} else if (name == "bibtex") {
|
||||
dialog->setController(new ControlBibtex(*dialog));
|
||||
dialog->setView(new QBibtex(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "changes") {
|
||||
dialog->setController(new ControlChanges(*dialog));
|
||||
dialog->setView(new QChanges(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "character") {
|
||||
dialog->setController(new ControlCharacter(*dialog));
|
||||
dialog->setView(new QCharacter(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "citation") {
|
||||
dialog->setController(new ControlCitation(*dialog));
|
||||
dialog->setView(new QCitation(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "error") {
|
||||
dialog->setController(new ControlError(*dialog));
|
||||
dialog->setView(new QError(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "ert") {
|
||||
dialog->setController(new ControlERT(*dialog));
|
||||
dialog->setView(new QERT(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "external") {
|
||||
dialog->setController(new ControlExternal(*dialog));
|
||||
dialog->setView(new QExternal(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "file") {
|
||||
dialog->setController(new ControlShowFile(*dialog));
|
||||
dialog->setView(new QShowFile(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "float") {
|
||||
dialog->setController(new ControlFloat(*dialog));
|
||||
dialog->setView(new QFloat(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "graphics") {
|
||||
dialog->setController(new ControlGraphics(*dialog));
|
||||
dialog->setView(new QGraphics(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "include") {
|
||||
dialog->setController(new ControlInclude(*dialog));
|
||||
dialog->setView(new QInclude(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "index") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QIndex(*dialog,
|
||||
qt_("LyX: Insert Index Entry"),
|
||||
qt_("&Keyword")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "label") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QIndex(*dialog,
|
||||
qt_("LyX: Insert Label"),
|
||||
qt_("&Label")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "log") {
|
||||
dialog->setController(new ControlLog(*dialog));
|
||||
dialog->setView(new QLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "minipage") {
|
||||
dialog->setController(new ControlMinipage(*dialog));
|
||||
dialog->setView(new QMinipage(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "paragraph") {
|
||||
dialog->setController(new ControlParagraph(*dialog));
|
||||
dialog->setView(new QParagraph(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "ref") {
|
||||
dialog->setController(new ControlRef(*dialog));
|
||||
dialog->setView(new QRef(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabular") {
|
||||
dialog->setController(new ControlTabular(*dialog));
|
||||
dialog->setView(new QTabular(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabularcreate") {
|
||||
dialog->setController(new ControlTabularCreate(*dialog));
|
||||
dialog->setView(new QTabularCreate(*dialog));
|
||||
dialog->bc().bp(new IgnorantPolicy);
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
} else if (name == "thesaurus") {
|
||||
dialog->setController(new ControlThesaurus(*dialog));
|
||||
dialog->setView(new QThesaurus(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
#endif
|
||||
} else if (name == "toc") {
|
||||
dialog->setController(new ControlToc(*dialog));
|
||||
dialog->setView(new QToc(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "url") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new QURL(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "vclog") {
|
||||
dialog->setController(new ControlVCLog(*dialog));
|
||||
dialog->setView(new QVCLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "wrap") {
|
||||
dialog->setController(new ControlWrap(*dialog));
|
||||
dialog->setView(new QWrap(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
}
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
void Dialogs::toggleTooltips()
|
||||
{}
|
||||
|
||||
|
||||
/// Are the tooltips on or off?
|
||||
bool Dialogs::tooltipsEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file qt2/Dialogs_impl.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
* \author Angus Leeming
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#ifndef DIALOGS_IMPL_H
|
||||
#define DIALOGS_IMP_H
|
||||
|
||||
#include "Dialogs.h"
|
||||
#include "controllers/GUI.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;
|
||||
};
|
||||
|
||||
#endif // DIALOGS_IMPL_H
|
@ -22,8 +22,6 @@ libqt2_la_SOURCES = \
|
||||
bulletstrings.C bulletstrings.h \
|
||||
Dialogs.C \
|
||||
Dialogs2.C \
|
||||
Dialogs3.C \
|
||||
Dialogs_impl.h \
|
||||
FileDialog.C \
|
||||
LyXKeySymFactory.C \
|
||||
LyXScreenFactory.C \
|
||||
|
@ -1,3 +1,14 @@
|
||||
2003-03-26 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* Dialogs.C:
|
||||
* Dialogs2.C:
|
||||
* Dialogs3.C:
|
||||
* Dialogs_impl.h:
|
||||
move the contents of Dialogs.C and Dialogs_impl.h into Dialogs2.C.
|
||||
move Dialog3.C to Dialogs.C.
|
||||
|
||||
* Makefile.am: remove Dialogs_impl.h, Dialog3.C.
|
||||
|
||||
2003-03-26 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* Dialogs.C:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* \file xforms/Dialogs.C
|
||||
* \file xforms/Dialogs3.C
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -10,31 +10,234 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "Dialogs_impl.h"
|
||||
#include "Dialogs.h"
|
||||
#include "Dialog.h"
|
||||
|
||||
#include "Tooltips.h"
|
||||
|
||||
#include "ControlAboutlyx.h"
|
||||
#include "ControlBibtex.h"
|
||||
#include "ControlChanges.h"
|
||||
#include "ControlCharacter.h"
|
||||
#include "ControlCitation.h"
|
||||
#include "ControlCommand.h"
|
||||
#include "ControlError.h"
|
||||
#include "ControlERT.h"
|
||||
#include "ControlExternal.h"
|
||||
#include "ControlFloat.h"
|
||||
#include "ControlGraphics.h"
|
||||
#include "ControlInclude.h"
|
||||
#include "ControlLog.h"
|
||||
#include "ControlMinipage.h"
|
||||
#include "ControlParagraph.h"
|
||||
#include "ControlRef.h"
|
||||
#include "ControlShowFile.h"
|
||||
#include "ControlTabular.h"
|
||||
#include "ControlTabularCreate.h"
|
||||
#include "ControlToc.h"
|
||||
#include "ControlVCLog.h"
|
||||
#include "ControlWrap.h"
|
||||
|
||||
#include "FormAboutlyx.h"
|
||||
#include "FormBibitem.h"
|
||||
#include "FormBibtex.h"
|
||||
#include "FormChanges.h"
|
||||
#include "FormCharacter.h"
|
||||
#include "FormCitation.h"
|
||||
#include "FormError.h"
|
||||
#include "FormERT.h"
|
||||
#include "FormExternal.h"
|
||||
#include "FormFloat.h"
|
||||
#include "FormGraphics.h"
|
||||
#include "FormInclude.h"
|
||||
#include "FormLog.h"
|
||||
#include "FormMinipage.h"
|
||||
#include "FormParagraph.h"
|
||||
#include "FormRef.h"
|
||||
#include "FormTabular.h"
|
||||
#include "FormShowFile.h"
|
||||
#include "FormTabularCreate.h"
|
||||
#include "FormText.h"
|
||||
#include "FormToc.h"
|
||||
#include "FormUrl.h"
|
||||
#include "FormVCLog.h"
|
||||
#include "FormWrap.h"
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
#include "ControlThesaurus.h"
|
||||
#include "FormThesaurus.h"
|
||||
#endif
|
||||
|
||||
#include "xformsBC.h"
|
||||
#include "ButtonController.h"
|
||||
|
||||
|
||||
void Dialogs::init_pimpl()
|
||||
namespace {
|
||||
|
||||
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
|
||||
"character", "citation", "error", "ert", "external", "file", "float",
|
||||
"graphics", "include", "index", "label", "log", "minipage", "paragraph",
|
||||
"ref", "tabular", "tabularcreate",
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
"thesaurus",
|
||||
#endif
|
||||
|
||||
"toc", "url", "vclog", "wrap" };
|
||||
|
||||
char const * const * const end_dialognames =
|
||||
dialognames + (sizeof(dialognames) / sizeof(char *));
|
||||
|
||||
struct cmpCStr {
|
||||
cmpCStr(char const * name) : name_(name) {}
|
||||
bool operator()(char const * other) {
|
||||
return strcmp(other, name_) == 0;
|
||||
}
|
||||
private:
|
||||
char const * name_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
bool Dialogs::isValidName(string const & name) const
|
||||
{
|
||||
pimpl_ = new Impl(lyxview_, *this);
|
||||
return std::find_if(dialognames, end_dialognames,
|
||||
cmpCStr(name.c_str())) != end_dialognames;
|
||||
}
|
||||
|
||||
|
||||
Dialogs::~Dialogs()
|
||||
Dialog * Dialogs::build(string const & name)
|
||||
{
|
||||
delete pimpl_;
|
||||
if (!isValidName(name))
|
||||
return 0;
|
||||
|
||||
Dialog * dialog = new Dialog(lyxview_, name);
|
||||
dialog->bc().view(new xformsBC(dialog->bc()));
|
||||
|
||||
if (name == "about") {
|
||||
dialog->setController(new ControlAboutlyx(*dialog));
|
||||
dialog->setView(new FormAboutlyx(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "bibitem") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormBibitem(*dialog));
|
||||
dialog->bc().bp(new OkCancelReadOnlyPolicy);
|
||||
} else if (name == "bibtex") {
|
||||
dialog->setController(new ControlBibtex(*dialog));
|
||||
dialog->setView(new FormBibtex(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "character") {
|
||||
dialog->setController(new ControlCharacter(*dialog));
|
||||
dialog->setView(new FormCharacter(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "changes") {
|
||||
dialog->setController(new ControlChanges(*dialog));
|
||||
dialog->setView(new FormChanges(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "citation") {
|
||||
dialog->setController(new ControlCitation(*dialog));
|
||||
dialog->setView(new FormCitation(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "error") {
|
||||
dialog->setController(new ControlError(*dialog));
|
||||
dialog->setView(new FormError(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "ert") {
|
||||
dialog->setController(new ControlERT(*dialog));
|
||||
dialog->setView(new FormERT(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "external") {
|
||||
dialog->setController(new ControlExternal(*dialog));
|
||||
dialog->setView(new FormExternal(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "file") {
|
||||
dialog->setController(new ControlShowFile(*dialog));
|
||||
dialog->setView(new FormShowFile(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "float") {
|
||||
dialog->setController(new ControlFloat(*dialog));
|
||||
dialog->setView(new FormFloat(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "graphics") {
|
||||
dialog->setController(new ControlGraphics(*dialog));
|
||||
dialog->setView(new FormGraphics(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "include") {
|
||||
dialog->setController(new ControlInclude(*dialog));
|
||||
dialog->setView(new FormInclude(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "index") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormText(*dialog,
|
||||
_("Index"), _("Keyword:|#K")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "label") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormText(*dialog,
|
||||
_("Label"), _("Label:|#L")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "log") {
|
||||
dialog->setController(new ControlLog(*dialog));
|
||||
dialog->setView(new FormLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "minipage") {
|
||||
dialog->setController(new ControlMinipage(*dialog));
|
||||
dialog->setView(new FormMinipage(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "paragraph") {
|
||||
dialog->setController(new ControlParagraph(*dialog));
|
||||
dialog->setView(new FormParagraph(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "ref") {
|
||||
dialog->setController(new ControlRef(*dialog));
|
||||
dialog->setView(new FormRef(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabular") {
|
||||
dialog->setController(new ControlTabular(*dialog));
|
||||
dialog->setView(new FormTabular(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabularcreate") {
|
||||
dialog->setController(new ControlTabularCreate(*dialog));
|
||||
dialog->setView(new FormTabularCreate(*dialog));
|
||||
dialog->bc().bp(new IgnorantPolicy);
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
} else if (name == "thesaurus") {
|
||||
dialog->setController(new ControlThesaurus(*dialog));
|
||||
dialog->setView(new FormThesaurus(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
#endif
|
||||
} else if (name == "toc") {
|
||||
dialog->setController(new ControlToc(*dialog));
|
||||
dialog->setView(new FormToc(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "url") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormUrl(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "vclog") {
|
||||
dialog->setController(new ControlVCLog(*dialog));
|
||||
dialog->setView(new FormVCLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "wrap") {
|
||||
dialog->setController(new ControlWrap(*dialog));
|
||||
dialog->setView(new FormWrap(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
}
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
|
||||
: document(lv, d),
|
||||
forks(lv, d),
|
||||
mathpanel(lv, d),
|
||||
preamble(lv, d),
|
||||
preferences(lv, d),
|
||||
print(lv, d),
|
||||
search(lv, d),
|
||||
sendto(lv, d),
|
||||
spellchecker(lv, d),
|
||||
texinfo(lv, d)
|
||||
{}
|
||||
void Dialogs::toggleTooltips()
|
||||
{
|
||||
Tooltips::toggleEnabled();
|
||||
}
|
||||
|
||||
|
||||
/// Are the tooltips on or off?
|
||||
bool Dialogs::tooltipsEnabled()
|
||||
{
|
||||
return Tooltips::enabled();
|
||||
}
|
||||
|
@ -12,7 +12,124 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "Dialogs_impl.h"
|
||||
#include "Dialogs.h"
|
||||
#include "controllers/GUI.h"
|
||||
#include "ButtonController.h"
|
||||
|
||||
#include "Tooltips.h"
|
||||
#include "xformsBC.h"
|
||||
#include "combox.h"
|
||||
|
||||
#include "ControlDocument.h"
|
||||
#include "FormDocument.h"
|
||||
#include "forms/form_document.h"
|
||||
|
||||
#include "ControlForks.h"
|
||||
#include "FormForks.h"
|
||||
#include "forms/form_forks.h"
|
||||
|
||||
#include "ControlMath.h"
|
||||
#include "FormMathsPanel.h"
|
||||
#include "forms/form_maths_panel.h"
|
||||
|
||||
#include "ControlPreamble.h"
|
||||
#include "FormPreamble.h"
|
||||
#include "forms/form_preamble.h"
|
||||
|
||||
#include "ControlPrefs.h"
|
||||
#include "FormPreferences.h"
|
||||
#include "forms/form_preferences.h"
|
||||
|
||||
#include "ControlPrint.h"
|
||||
#include "FormPrint.h"
|
||||
#include "forms/form_print.h"
|
||||
|
||||
#include "ControlSearch.h"
|
||||
#include "FormSearch.h"
|
||||
#include "forms/form_search.h"
|
||||
|
||||
#include "ControlSendto.h"
|
||||
#include "FormSendto.h"
|
||||
#include "forms/form_sendto.h"
|
||||
|
||||
#include "ControlSpellchecker.h"
|
||||
#include "FormSpellchecker.h"
|
||||
#include "forms/form_spellchecker.h"
|
||||
|
||||
#include "ControlTexinfo.h"
|
||||
#include "FormTexinfo.h"
|
||||
#include "forms/form_texinfo.h"
|
||||
|
||||
typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
DocumentDialog;
|
||||
|
||||
typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
|
||||
ForksDialog;
|
||||
|
||||
typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC>
|
||||
MathPanelDialog;
|
||||
|
||||
typedef GUI<ControlPreamble, FormPreamble, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
PreambleDialog;
|
||||
|
||||
typedef GUI<ControlPrefs, FormPreferences, OkApplyCancelPolicy, xformsBC>
|
||||
PreferencesDialog;
|
||||
|
||||
typedef GUI<ControlPrint, FormPrint, OkApplyCancelPolicy, xformsBC>
|
||||
PrintDialog;
|
||||
|
||||
typedef GUI<ControlSearch, FormSearch, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
SearchDialog;
|
||||
|
||||
typedef GUI<ControlSendto, FormSendto, OkApplyCancelPolicy, xformsBC>
|
||||
SendtoDialog;
|
||||
|
||||
typedef GUI<ControlSpellchecker, FormSpellchecker, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
SpellcheckerDialog;
|
||||
|
||||
typedef GUI<ControlTexinfo, FormTexinfo, OkCancelPolicy, xformsBC>
|
||||
TexinfoDialog;
|
||||
|
||||
struct Dialogs::Impl {
|
||||
Impl(LyXView & lv, Dialogs & d);
|
||||
|
||||
DocumentDialog document;
|
||||
ForksDialog forks;
|
||||
MathPanelDialog mathpanel;
|
||||
PreambleDialog preamble;
|
||||
PreferencesDialog preferences;
|
||||
PrintDialog print;
|
||||
SearchDialog search;
|
||||
SendtoDialog sendto;
|
||||
SpellcheckerDialog spellchecker;
|
||||
TexinfoDialog texinfo;
|
||||
};
|
||||
|
||||
|
||||
Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
|
||||
: document(lv, d),
|
||||
forks(lv, d),
|
||||
mathpanel(lv, d),
|
||||
preamble(lv, d),
|
||||
preferences(lv, d),
|
||||
print(lv, d),
|
||||
search(lv, d),
|
||||
sendto(lv, d),
|
||||
spellchecker(lv, d),
|
||||
texinfo(lv, d)
|
||||
{}
|
||||
|
||||
|
||||
void Dialogs::init_pimpl()
|
||||
{
|
||||
pimpl_ = new Impl(lyxview_, *this);
|
||||
}
|
||||
|
||||
|
||||
Dialogs::~Dialogs()
|
||||
{
|
||||
delete pimpl_;
|
||||
}
|
||||
|
||||
|
||||
void Dialogs::showDocument()
|
||||
|
@ -1,243 +0,0 @@
|
||||
/**
|
||||
* \file xforms/Dialogs3.C
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Angus Leeming
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "Dialogs.h"
|
||||
#include "Dialog.h"
|
||||
|
||||
#include "Tooltips.h"
|
||||
|
||||
#include "ControlAboutlyx.h"
|
||||
#include "ControlBibtex.h"
|
||||
#include "ControlChanges.h"
|
||||
#include "ControlCharacter.h"
|
||||
#include "ControlCitation.h"
|
||||
#include "ControlCommand.h"
|
||||
#include "ControlError.h"
|
||||
#include "ControlERT.h"
|
||||
#include "ControlExternal.h"
|
||||
#include "ControlFloat.h"
|
||||
#include "ControlGraphics.h"
|
||||
#include "ControlInclude.h"
|
||||
#include "ControlLog.h"
|
||||
#include "ControlMinipage.h"
|
||||
#include "ControlParagraph.h"
|
||||
#include "ControlRef.h"
|
||||
#include "ControlShowFile.h"
|
||||
#include "ControlTabular.h"
|
||||
#include "ControlTabularCreate.h"
|
||||
#include "ControlToc.h"
|
||||
#include "ControlVCLog.h"
|
||||
#include "ControlWrap.h"
|
||||
|
||||
#include "FormAboutlyx.h"
|
||||
#include "FormBibitem.h"
|
||||
#include "FormBibtex.h"
|
||||
#include "FormChanges.h"
|
||||
#include "FormCharacter.h"
|
||||
#include "FormCitation.h"
|
||||
#include "FormError.h"
|
||||
#include "FormERT.h"
|
||||
#include "FormExternal.h"
|
||||
#include "FormFloat.h"
|
||||
#include "FormGraphics.h"
|
||||
#include "FormInclude.h"
|
||||
#include "FormLog.h"
|
||||
#include "FormMinipage.h"
|
||||
#include "FormParagraph.h"
|
||||
#include "FormRef.h"
|
||||
#include "FormTabular.h"
|
||||
#include "FormShowFile.h"
|
||||
#include "FormTabularCreate.h"
|
||||
#include "FormText.h"
|
||||
#include "FormToc.h"
|
||||
#include "FormUrl.h"
|
||||
#include "FormVCLog.h"
|
||||
#include "FormWrap.h"
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
#include "ControlThesaurus.h"
|
||||
#include "FormThesaurus.h"
|
||||
#endif
|
||||
|
||||
#include "xformsBC.h"
|
||||
#include "ButtonController.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
|
||||
"character", "citation", "error", "ert", "external", "file", "float",
|
||||
"graphics", "include", "index", "label", "log", "minipage", "paragraph",
|
||||
"ref", "tabular", "tabularcreate",
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
"thesaurus",
|
||||
#endif
|
||||
|
||||
"toc", "url", "vclog", "wrap" };
|
||||
|
||||
char const * const * const end_dialognames =
|
||||
dialognames + (sizeof(dialognames) / sizeof(char *));
|
||||
|
||||
struct cmpCStr {
|
||||
cmpCStr(char const * name) : name_(name) {}
|
||||
bool operator()(char const * other) {
|
||||
return strcmp(other, name_) == 0;
|
||||
}
|
||||
private:
|
||||
char const * name_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
bool Dialogs::isValidName(string const & name) const
|
||||
{
|
||||
return std::find_if(dialognames, end_dialognames,
|
||||
cmpCStr(name.c_str())) != end_dialognames;
|
||||
}
|
||||
|
||||
|
||||
Dialog * Dialogs::build(string const & name)
|
||||
{
|
||||
if (!isValidName(name))
|
||||
return 0;
|
||||
|
||||
Dialog * dialog = new Dialog(lyxview_, name);
|
||||
dialog->bc().view(new xformsBC(dialog->bc()));
|
||||
|
||||
if (name == "about") {
|
||||
dialog->setController(new ControlAboutlyx(*dialog));
|
||||
dialog->setView(new FormAboutlyx(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "bibitem") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormBibitem(*dialog));
|
||||
dialog->bc().bp(new OkCancelReadOnlyPolicy);
|
||||
} else if (name == "bibtex") {
|
||||
dialog->setController(new ControlBibtex(*dialog));
|
||||
dialog->setView(new FormBibtex(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "character") {
|
||||
dialog->setController(new ControlCharacter(*dialog));
|
||||
dialog->setView(new FormCharacter(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "changes") {
|
||||
dialog->setController(new ControlChanges(*dialog));
|
||||
dialog->setView(new FormChanges(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "citation") {
|
||||
dialog->setController(new ControlCitation(*dialog));
|
||||
dialog->setView(new FormCitation(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "error") {
|
||||
dialog->setController(new ControlError(*dialog));
|
||||
dialog->setView(new FormError(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "ert") {
|
||||
dialog->setController(new ControlERT(*dialog));
|
||||
dialog->setView(new FormERT(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "external") {
|
||||
dialog->setController(new ControlExternal(*dialog));
|
||||
dialog->setView(new FormExternal(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "file") {
|
||||
dialog->setController(new ControlShowFile(*dialog));
|
||||
dialog->setView(new FormShowFile(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "float") {
|
||||
dialog->setController(new ControlFloat(*dialog));
|
||||
dialog->setView(new FormFloat(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "graphics") {
|
||||
dialog->setController(new ControlGraphics(*dialog));
|
||||
dialog->setView(new FormGraphics(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "include") {
|
||||
dialog->setController(new ControlInclude(*dialog));
|
||||
dialog->setView(new FormInclude(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "index") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormText(*dialog,
|
||||
_("Index"), _("Keyword:|#K")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "label") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormText(*dialog,
|
||||
_("Label"), _("Label:|#L")));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "log") {
|
||||
dialog->setController(new ControlLog(*dialog));
|
||||
dialog->setView(new FormLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "minipage") {
|
||||
dialog->setController(new ControlMinipage(*dialog));
|
||||
dialog->setView(new FormMinipage(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "paragraph") {
|
||||
dialog->setController(new ControlParagraph(*dialog));
|
||||
dialog->setView(new FormParagraph(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
} else if (name == "ref") {
|
||||
dialog->setController(new ControlRef(*dialog));
|
||||
dialog->setView(new FormRef(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabular") {
|
||||
dialog->setController(new ControlTabular(*dialog));
|
||||
dialog->setView(new FormTabular(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "tabularcreate") {
|
||||
dialog->setController(new ControlTabularCreate(*dialog));
|
||||
dialog->setView(new FormTabularCreate(*dialog));
|
||||
dialog->bc().bp(new IgnorantPolicy);
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
} else if (name == "thesaurus") {
|
||||
dialog->setController(new ControlThesaurus(*dialog));
|
||||
dialog->setView(new FormThesaurus(*dialog));
|
||||
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
||||
#endif
|
||||
} else if (name == "toc") {
|
||||
dialog->setController(new ControlToc(*dialog));
|
||||
dialog->setView(new FormToc(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "url") {
|
||||
dialog->setController(new ControlCommand(*dialog, name));
|
||||
dialog->setView(new FormUrl(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "vclog") {
|
||||
dialog->setController(new ControlVCLog(*dialog));
|
||||
dialog->setView(new FormVCLog(*dialog));
|
||||
dialog->bc().bp(new OkCancelPolicy);
|
||||
} else if (name == "wrap") {
|
||||
dialog->setController(new ControlWrap(*dialog));
|
||||
dialog->setView(new FormWrap(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
}
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
void Dialogs::toggleTooltips()
|
||||
{
|
||||
Tooltips::toggleEnabled();
|
||||
}
|
||||
|
||||
|
||||
/// Are the tooltips on or off?
|
||||
bool Dialogs::tooltipsEnabled()
|
||||
{
|
||||
return Tooltips::enabled();
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file xforms/Dialogs_impl.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
* \author Angus Leeming
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#ifndef DIALOGS_IMPL_H
|
||||
#define DIALOGS_IMP_H
|
||||
|
||||
#include "Dialogs.h"
|
||||
#include "controllers/GUI.h"
|
||||
|
||||
#include "Tooltips.h"
|
||||
#include "xformsBC.h"
|
||||
#include "combox.h"
|
||||
|
||||
#include "ControlDocument.h"
|
||||
#include "FormDocument.h"
|
||||
#include "forms/form_document.h"
|
||||
|
||||
#include "ControlForks.h"
|
||||
#include "FormForks.h"
|
||||
#include "forms/form_forks.h"
|
||||
|
||||
#include "ControlMath.h"
|
||||
#include "FormMathsPanel.h"
|
||||
#include "forms/form_maths_panel.h"
|
||||
|
||||
#include "ControlPreamble.h"
|
||||
#include "FormPreamble.h"
|
||||
#include "forms/form_preamble.h"
|
||||
|
||||
#include "ControlPrefs.h"
|
||||
#include "FormPreferences.h"
|
||||
#include "forms/form_preferences.h"
|
||||
|
||||
#include "ControlPrint.h"
|
||||
#include "FormPrint.h"
|
||||
#include "forms/form_print.h"
|
||||
|
||||
#include "ControlSearch.h"
|
||||
#include "FormSearch.h"
|
||||
#include "forms/form_search.h"
|
||||
|
||||
#include "ControlSendto.h"
|
||||
#include "FormSendto.h"
|
||||
#include "forms/form_sendto.h"
|
||||
|
||||
#include "ControlSpellchecker.h"
|
||||
#include "FormSpellchecker.h"
|
||||
#include "forms/form_spellchecker.h"
|
||||
|
||||
#include "ControlTexinfo.h"
|
||||
#include "FormTexinfo.h"
|
||||
#include "forms/form_texinfo.h"
|
||||
|
||||
typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
DocumentDialog;
|
||||
|
||||
typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
|
||||
ForksDialog;
|
||||
|
||||
typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC>
|
||||
MathPanelDialog;
|
||||
|
||||
typedef GUI<ControlPreamble, FormPreamble, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
PreambleDialog;
|
||||
|
||||
typedef GUI<ControlPrefs, FormPreferences, OkApplyCancelPolicy, xformsBC>
|
||||
PreferencesDialog;
|
||||
|
||||
typedef GUI<ControlPrint, FormPrint, OkApplyCancelPolicy, xformsBC>
|
||||
PrintDialog;
|
||||
|
||||
typedef GUI<ControlSearch, FormSearch, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
SearchDialog;
|
||||
|
||||
typedef GUI<ControlSendto, FormSendto, OkApplyCancelPolicy, xformsBC>
|
||||
SendtoDialog;
|
||||
|
||||
typedef GUI<ControlSpellchecker, FormSpellchecker, NoRepeatedApplyReadOnlyPolicy, xformsBC>
|
||||
SpellcheckerDialog;
|
||||
|
||||
typedef GUI<ControlTexinfo, FormTexinfo, OkCancelPolicy, xformsBC>
|
||||
TexinfoDialog;
|
||||
|
||||
struct Dialogs::Impl {
|
||||
Impl(LyXView & lv, Dialogs & d);
|
||||
|
||||
DocumentDialog document;
|
||||
ForksDialog forks;
|
||||
MathPanelDialog mathpanel;
|
||||
PreambleDialog preamble;
|
||||
PreferencesDialog preferences;
|
||||
PrintDialog print;
|
||||
SearchDialog search;
|
||||
SendtoDialog sendto;
|
||||
SpellcheckerDialog spellchecker;
|
||||
TexinfoDialog texinfo;
|
||||
};
|
||||
|
||||
#endif // DIALOGS_IMPL_H
|
@ -48,8 +48,6 @@ libxforms_la_SOURCES = \
|
||||
ColorHandler.h \
|
||||
Dialogs.C \
|
||||
Dialogs2.C \
|
||||
Dialogs3.C \
|
||||
Dialogs_impl.h \
|
||||
DropDown.h \
|
||||
DropDown.C \
|
||||
FileDialog.C \
|
||||
|
Loading…
Reference in New Issue
Block a user