lyx_mirror/src/frontends/qt4/Dialogs.C

339 lines
11 KiB
C++
Raw Normal View History

/**
* \file qt4/Dialogs.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 "ControlAboutlyx.h"
#include "ControlBibtex.h"
#include "ControlBox.h"
#include "ControlBranch.h"
#include "ControlChanges.h"
#include "ControlCharacter.h"
#include "ControlDocument.h"
#include "ControlErrorList.h"
#include "ControlERT.h"
#include "ControlExternal.h"
#include "ControlFloat.h"
#include "ControlGraphics.h"
#include "ControlInclude.h"
#include "ControlLog.h"
#include "ControlViewSource.h"
#include "ControlMath.h"
#include "ControlNote.h"
#include "ControlParagraph.h"
#include "ControlPrefs.h"
#include "ControlPrint.h"
#include "ControlRef.h"
#include "ControlSearch.h"
#include "ControlSendto.h"
#include "ControlShowFile.h"
#include "ControlSpellchecker.h"
#include "ControlTabular.h"
#include "ControlTabularCreate.h"
#include "ControlVSpace.h"
#include "ControlWrap.h"
#include "Qt2BC.h"
#include "ButtonController.h"
#include "DockView.h"
#include "GuiView.h"
#include "QAbout.h"
#include "QBibitem.h"
#include "QBibtex.h"
#include "QBox.h"
#include "QBranch.h"
#include "QChanges.h"
#include "QCharacter.h"
#include "QCitation.h"
#include "QCitationDialog.h"
#include "QDocument.h"
#include "QErrorList.h"
#include "QERT.h"
#include "QExternal.h"
#include "QFloat.h"
#include "QGraphics.h"
#include "QInclude.h"
#include "QIndex.h"
New nomenclature inset from Ugras * src/LyXAction.C (LyXAction::init): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/insetbase.C (build_translator): ditto * src/LaTeXFeatures.C (LaTeXFeatures::getPackages): Add nomencl * src/insets/insetnomencl.[Ch]: new insets InsetNomencl and InsetPrintNomencl * src/insets/insetbase.h: Add NOMENCL_CODE and NOMENCL_PRINT_CODE * src/insets/insetcommandparams.C (InsetCommandParams::findInfo): Add nomenclature and printnomenclature (InsetCommandParams::getCommand): Extend end of command protection to cover commands with only optional arguments like printnomenclature * src/insets/insetert.C (InsetERT::getStatus): disable LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/Makefile.am: Add new files * src/frontends/qt4/Makefile.dialogs: ditto * src/frontends/qt4/Makefile.am: ditto * src/factory.C (createInset): Handle InsetNomencl and InsetPrintNomencl (readInset): ditto * src/buffer.C (LYX_FORMAT): increase * src/lyxfunc.C (LyXFunc::dispatch): Handle nomenclature * src/LaTeX.C (LaTeX::deleteFilesOnError): Delete .nls file (LaTeX::run): Run makeindex for nomenclature (LaTeX::runMakeIndex): handle nomenclature options (LaTeX::deplog): Recognize nomenclature file * src/frontends/qt4/QNomenclDialog.[Ch]: new * src/frontends/qt4/QNomencl.[Ch]: ditto * src/frontends/qt4/ui/QNomenclUi.ui: ditto * src/frontends/qt4/Dialogs.C (Dialogs::build): handle nomenclature dialog * src/text3.C (LyXText::dispatch): Handle LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT (LyXText::getStatus): Ditto * src/lfuns.h (kb_action): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * lib/lyx2lyx/LyX.py (format_relation): Update 1.5 format range * lib/lyx2lyx/lyx_1_5.py (revert_nomenclature): New (revert_printnomenclature): ditto * lib/chkconfig.ltx: Test for nomencl package * lib/doc/LaTeXConfig.lyx.in: Add nomencl package * lib/doc/Extended.lyx: Add documentation for nomencl * lib/ui/stdtoolbars.ui (Toolbar "extra" "Extra"): Add nomencl-insert * lib/ui/classic.ui: Add nomencl-insert and nomencl-print * lib/ui/stdmenus.ui: ditto * development/scons/scons_manifest.py: Add new files * development/FORMAT: Describe new format git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15739 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-04 17:55:36 +00:00
#include "QNomencl.h"
#include "QLog.h"
#include "QViewSource.h"
#include "QViewSourceDialog.h"
#include "QMath.h"
#include "QNote.h"
#include "QParagraph.h"
#include "QPrefs.h"
#include "QPrint.h"
#include "QRef.h"
#include "QSearch.h"
#include "QSendto.h"
#include "QShowFile.h"
#include "QSpellchecker.h"
#include "QTabular.h"
#include "QTabularCreate.h"
#include "QTexinfo.h"
#include "QToc.h"
#include "TocWidget.h"
#include "UrlView.h"
#include "QVSpace.h"
#include "QWrap.h"
#ifdef HAVE_LIBAIKSAURUS
#include "ControlThesaurus.h"
#include "QThesaurus.h"
#endif
#include "qt_helpers.h"
#include <boost/assert.hpp>
using std::string;
using namespace lyx::frontend;
namespace {
char const * const dialognames[] = {
"aboutlyx", "bibitem", "bibtex", "box", "branch", "changes", "character",
"citation", "document", "errorlist", "ert", "external", "file",
New nomenclature inset from Ugras * src/LyXAction.C (LyXAction::init): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/insetbase.C (build_translator): ditto * src/LaTeXFeatures.C (LaTeXFeatures::getPackages): Add nomencl * src/insets/insetnomencl.[Ch]: new insets InsetNomencl and InsetPrintNomencl * src/insets/insetbase.h: Add NOMENCL_CODE and NOMENCL_PRINT_CODE * src/insets/insetcommandparams.C (InsetCommandParams::findInfo): Add nomenclature and printnomenclature (InsetCommandParams::getCommand): Extend end of command protection to cover commands with only optional arguments like printnomenclature * src/insets/insetert.C (InsetERT::getStatus): disable LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/Makefile.am: Add new files * src/frontends/qt4/Makefile.dialogs: ditto * src/frontends/qt4/Makefile.am: ditto * src/factory.C (createInset): Handle InsetNomencl and InsetPrintNomencl (readInset): ditto * src/buffer.C (LYX_FORMAT): increase * src/lyxfunc.C (LyXFunc::dispatch): Handle nomenclature * src/LaTeX.C (LaTeX::deleteFilesOnError): Delete .nls file (LaTeX::run): Run makeindex for nomenclature (LaTeX::runMakeIndex): handle nomenclature options (LaTeX::deplog): Recognize nomenclature file * src/frontends/qt4/QNomenclDialog.[Ch]: new * src/frontends/qt4/QNomencl.[Ch]: ditto * src/frontends/qt4/ui/QNomenclUi.ui: ditto * src/frontends/qt4/Dialogs.C (Dialogs::build): handle nomenclature dialog * src/text3.C (LyXText::dispatch): Handle LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT (LyXText::getStatus): Ditto * src/lfuns.h (kb_action): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * lib/lyx2lyx/LyX.py (format_relation): Update 1.5 format range * lib/lyx2lyx/lyx_1_5.py (revert_nomenclature): New (revert_printnomenclature): ditto * lib/chkconfig.ltx: Test for nomencl package * lib/doc/LaTeXConfig.lyx.in: Add nomencl package * lib/doc/Extended.lyx: Add documentation for nomencl * lib/ui/stdtoolbars.ui (Toolbar "extra" "Extra"): Add nomencl-insert * lib/ui/classic.ui: Add nomencl-insert and nomencl-print * lib/ui/stdmenus.ui: ditto * development/scons/scons_manifest.py: Add new files * development/FORMAT: Describe new format git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15739 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-04 17:55:36 +00:00
"findreplace", "float", "graphics", "include", "index", "nomenclature", "label", "log",
"mathpanel", "mathdelimiter", "mathmatrix", "note", "paragraph",
"prefs", "print", "ref", "sendto", "spellchecker","tabular", "tabularcreate",
#ifdef HAVE_LIBAIKSAURUS
"thesaurus",
#endif
New nomenclature inset from Ugras * src/LyXAction.C (LyXAction::init): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/insetbase.C (build_translator): ditto * src/LaTeXFeatures.C (LaTeXFeatures::getPackages): Add nomencl * src/insets/insetnomencl.[Ch]: new insets InsetNomencl and InsetPrintNomencl * src/insets/insetbase.h: Add NOMENCL_CODE and NOMENCL_PRINT_CODE * src/insets/insetcommandparams.C (InsetCommandParams::findInfo): Add nomenclature and printnomenclature (InsetCommandParams::getCommand): Extend end of command protection to cover commands with only optional arguments like printnomenclature * src/insets/insetert.C (InsetERT::getStatus): disable LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/Makefile.am: Add new files * src/frontends/qt4/Makefile.dialogs: ditto * src/frontends/qt4/Makefile.am: ditto * src/factory.C (createInset): Handle InsetNomencl and InsetPrintNomencl (readInset): ditto * src/buffer.C (LYX_FORMAT): increase * src/lyxfunc.C (LyXFunc::dispatch): Handle nomenclature * src/LaTeX.C (LaTeX::deleteFilesOnError): Delete .nls file (LaTeX::run): Run makeindex for nomenclature (LaTeX::runMakeIndex): handle nomenclature options (LaTeX::deplog): Recognize nomenclature file * src/frontends/qt4/QNomenclDialog.[Ch]: new * src/frontends/qt4/QNomencl.[Ch]: ditto * src/frontends/qt4/ui/QNomenclUi.ui: ditto * src/frontends/qt4/Dialogs.C (Dialogs::build): handle nomenclature dialog * src/text3.C (LyXText::dispatch): Handle LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT (LyXText::getStatus): Ditto * src/lfuns.h (kb_action): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * lib/lyx2lyx/LyX.py (format_relation): Update 1.5 format range * lib/lyx2lyx/lyx_1_5.py (revert_nomenclature): New (revert_printnomenclature): ditto * lib/chkconfig.ltx: Test for nomencl package * lib/doc/LaTeXConfig.lyx.in: Add nomencl package * lib/doc/Extended.lyx: Add documentation for nomencl * lib/ui/stdtoolbars.ui (Toolbar "extra" "Extra"): Add nomencl-insert * lib/ui/classic.ui: Add nomencl-insert and nomencl-print * lib/ui/stdmenus.ui: ditto * development/scons/scons_manifest.py: Add new files * development/FORMAT: Describe new format git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15739 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-04 17:55:36 +00:00
"texinfo", "toc", "url", "view-source", "vspace", "wrap" };
char const * const * const end_dialognames =
dialognames + (sizeof(dialognames) / sizeof(char *));
class cmpCStr {
public:
cmpCStr(char const * name) : name_(name) {}
bool operator()(char const * other) {
return strcmp(other, name_) == 0;
}
private:
char const * name_;
};
} // namespace anon
namespace lyx {
bool Dialogs::isValidName(string const & name) const
{
return std::find_if(dialognames, end_dialognames,
cmpCStr(name.c_str())) != end_dialognames;
}
Dialogs::DialogPtr Dialogs::build(string const & name)
{
BOOST_ASSERT(isValidName(name));
DialogPtr dialog(new Dialog(lyxview_, name));
dialog->bc().view(new Qt2BC(dialog->bc()));
if (name == "aboutlyx") {
dialog->setController(new ControlAboutlyx(*dialog));
dialog->setView(new QAbout(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "bibitem") {
Rework InsetCommandParams interface and file storage * src/insets/insetcommandparams.[Ch]: (operator[]): New, access a parameter (clear): New, clear all parameters (info_): New, stire info about this command (cmdname): Rename to name_ (contents, options, sec_options): Replace with params_. Parameters are now stored as docstring. (findInfo): New factor for command info for all commands (read, write): Use new syntax (parameter set and get methods): reimplemenmt for new parameter storage * src/insets/insetcommand.h (getParam): New, get a parameter (setParam): New, set a parameter (parameter set and get methods): Adjust to InsetCommandParams changes * src/insets/insetbibitem.[Ch] (write): Remove, not needed anymore (directWrite): ditto * src/insets/insetbibitem.C (InsetBibitem::read): Use InsetCommand::read * src/insets/insetref.C (InsetRef::latex): Use new InsetCommandParams interface * src/mathed/InsetMathHull.C (InsetMathHull::doDispatch): ditto * src/text3.C (LyXText::dispatch): ditto * src/factory.C (createInset): Create InsetCommandParams with command name (readInset): ditto (readInset): Remove error message for bibitem, since bibitem is now a normal command inset * src/buffer.C: Bump file format number * src/frontends/controllers/ControlCommand.[Ch] (ControlCommand): take an additional command name parameter * src/text.C (readParToken): Remove code for \bibitem * lib/lyx2lyx/LyX.py: Bump latest file format number * lib/lyx2lyx/lyx_1_5.py (convert_bibitem, convert_commandparams): new, convert to new format (revert_commandparams): new, convert to old format * development/FORMAT: document new format * many other files: Adjust to the changes above git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
dialog->setController(new ControlCommand(*dialog, name, 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 == "box") {
dialog->setController(new ControlBox(*dialog));
dialog->setView(new QBox(*dialog));
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
} else if (name == "branch") {
dialog->setController(new ControlBranch(*dialog));
dialog->setView(new QBranch(*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") {
QCitation * ci = new QCitation(*dialog);
dialog->setController(ci);
dialog->setView(new QCitationDialog(*dialog, ci));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "document") {
dialog->setController(new ControlDocument(*dialog));
dialog->setView(new QDocument(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "errorlist") {
dialog->setController(new ControlErrorList(*dialog));
dialog->setView(new QErrorList(*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 NoRepeatedApplyReadOnlyPolicy);
} else if (name == "file") {
dialog->setController(new ControlShowFile(*dialog));
dialog->setView(new QShowFile(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "findreplace") {
dialog->setController(new ControlSearch(*dialog));
dialog->setView(new QSearch(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} 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") {
Rework InsetCommandParams interface and file storage * src/insets/insetcommandparams.[Ch]: (operator[]): New, access a parameter (clear): New, clear all parameters (info_): New, stire info about this command (cmdname): Rename to name_ (contents, options, sec_options): Replace with params_. Parameters are now stored as docstring. (findInfo): New factor for command info for all commands (read, write): Use new syntax (parameter set and get methods): reimplemenmt for new parameter storage * src/insets/insetcommand.h (getParam): New, get a parameter (setParam): New, set a parameter (parameter set and get methods): Adjust to InsetCommandParams changes * src/insets/insetbibitem.[Ch] (write): Remove, not needed anymore (directWrite): ditto * src/insets/insetbibitem.C (InsetBibitem::read): Use InsetCommand::read * src/insets/insetref.C (InsetRef::latex): Use new InsetCommandParams interface * src/mathed/InsetMathHull.C (InsetMathHull::doDispatch): ditto * src/text3.C (LyXText::dispatch): ditto * src/factory.C (createInset): Create InsetCommandParams with command name (readInset): ditto (readInset): Remove error message for bibitem, since bibitem is now a normal command inset * src/buffer.C: Bump file format number * src/frontends/controllers/ControlCommand.[Ch] (ControlCommand): take an additional command name parameter * src/text.C (readParToken): Remove code for \bibitem * lib/lyx2lyx/LyX.py: Bump latest file format number * lib/lyx2lyx/lyx_1_5.py (convert_bibitem, convert_commandparams): new, convert to new format (revert_commandparams): new, convert to old format * development/FORMAT: document new format * many other files: Adjust to the changes above git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
dialog->setController(new ControlCommand(*dialog, name, name));
dialog->setView(new QIndex(*dialog,
_("Index Entry"),
qt_("&Keyword:")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
New nomenclature inset from Ugras * src/LyXAction.C (LyXAction::init): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/insetbase.C (build_translator): ditto * src/LaTeXFeatures.C (LaTeXFeatures::getPackages): Add nomencl * src/insets/insetnomencl.[Ch]: new insets InsetNomencl and InsetPrintNomencl * src/insets/insetbase.h: Add NOMENCL_CODE and NOMENCL_PRINT_CODE * src/insets/insetcommandparams.C (InsetCommandParams::findInfo): Add nomenclature and printnomenclature (InsetCommandParams::getCommand): Extend end of command protection to cover commands with only optional arguments like printnomenclature * src/insets/insetert.C (InsetERT::getStatus): disable LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/Makefile.am: Add new files * src/frontends/qt4/Makefile.dialogs: ditto * src/frontends/qt4/Makefile.am: ditto * src/factory.C (createInset): Handle InsetNomencl and InsetPrintNomencl (readInset): ditto * src/buffer.C (LYX_FORMAT): increase * src/lyxfunc.C (LyXFunc::dispatch): Handle nomenclature * src/LaTeX.C (LaTeX::deleteFilesOnError): Delete .nls file (LaTeX::run): Run makeindex for nomenclature (LaTeX::runMakeIndex): handle nomenclature options (LaTeX::deplog): Recognize nomenclature file * src/frontends/qt4/QNomenclDialog.[Ch]: new * src/frontends/qt4/QNomencl.[Ch]: ditto * src/frontends/qt4/ui/QNomenclUi.ui: ditto * src/frontends/qt4/Dialogs.C (Dialogs::build): handle nomenclature dialog * src/text3.C (LyXText::dispatch): Handle LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT (LyXText::getStatus): Ditto * src/lfuns.h (kb_action): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * lib/lyx2lyx/LyX.py (format_relation): Update 1.5 format range * lib/lyx2lyx/lyx_1_5.py (revert_nomenclature): New (revert_printnomenclature): ditto * lib/chkconfig.ltx: Test for nomencl package * lib/doc/LaTeXConfig.lyx.in: Add nomencl package * lib/doc/Extended.lyx: Add documentation for nomencl * lib/ui/stdtoolbars.ui (Toolbar "extra" "Extra"): Add nomencl-insert * lib/ui/classic.ui: Add nomencl-insert and nomencl-print * lib/ui/stdmenus.ui: ditto * development/scons/scons_manifest.py: Add new files * development/FORMAT: Describe new format git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15739 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-04 17:55:36 +00:00
} else if (name == "nomenclature") {
dialog->setController(new ControlCommand(*dialog, name, name));
dialog->setView(new QNomencl(*dialog, _("Glossary Entry")));
New nomenclature inset from Ugras * src/LyXAction.C (LyXAction::init): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/insetbase.C (build_translator): ditto * src/LaTeXFeatures.C (LaTeXFeatures::getPackages): Add nomencl * src/insets/insetnomencl.[Ch]: new insets InsetNomencl and InsetPrintNomencl * src/insets/insetbase.h: Add NOMENCL_CODE and NOMENCL_PRINT_CODE * src/insets/insetcommandparams.C (InsetCommandParams::findInfo): Add nomenclature and printnomenclature (InsetCommandParams::getCommand): Extend end of command protection to cover commands with only optional arguments like printnomenclature * src/insets/insetert.C (InsetERT::getStatus): disable LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * src/insets/Makefile.am: Add new files * src/frontends/qt4/Makefile.dialogs: ditto * src/frontends/qt4/Makefile.am: ditto * src/factory.C (createInset): Handle InsetNomencl and InsetPrintNomencl (readInset): ditto * src/buffer.C (LYX_FORMAT): increase * src/lyxfunc.C (LyXFunc::dispatch): Handle nomenclature * src/LaTeX.C (LaTeX::deleteFilesOnError): Delete .nls file (LaTeX::run): Run makeindex for nomenclature (LaTeX::runMakeIndex): handle nomenclature options (LaTeX::deplog): Recognize nomenclature file * src/frontends/qt4/QNomenclDialog.[Ch]: new * src/frontends/qt4/QNomencl.[Ch]: ditto * src/frontends/qt4/ui/QNomenclUi.ui: ditto * src/frontends/qt4/Dialogs.C (Dialogs::build): handle nomenclature dialog * src/text3.C (LyXText::dispatch): Handle LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT (LyXText::getStatus): Ditto * src/lfuns.h (kb_action): Add LFUN_NOMENCL_INSERT and LFUN_NOMENCL_PRINT * lib/lyx2lyx/LyX.py (format_relation): Update 1.5 format range * lib/lyx2lyx/lyx_1_5.py (revert_nomenclature): New (revert_printnomenclature): ditto * lib/chkconfig.ltx: Test for nomencl package * lib/doc/LaTeXConfig.lyx.in: Add nomencl package * lib/doc/Extended.lyx: Add documentation for nomencl * lib/ui/stdtoolbars.ui (Toolbar "extra" "Extra"): Add nomencl-insert * lib/ui/classic.ui: Add nomencl-insert and nomencl-print * lib/ui/stdmenus.ui: ditto * development/scons/scons_manifest.py: Add new files * development/FORMAT: Describe new format git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15739 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-04 17:55:36 +00:00
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "label") {
Rework InsetCommandParams interface and file storage * src/insets/insetcommandparams.[Ch]: (operator[]): New, access a parameter (clear): New, clear all parameters (info_): New, stire info about this command (cmdname): Rename to name_ (contents, options, sec_options): Replace with params_. Parameters are now stored as docstring. (findInfo): New factor for command info for all commands (read, write): Use new syntax (parameter set and get methods): reimplemenmt for new parameter storage * src/insets/insetcommand.h (getParam): New, get a parameter (setParam): New, set a parameter (parameter set and get methods): Adjust to InsetCommandParams changes * src/insets/insetbibitem.[Ch] (write): Remove, not needed anymore (directWrite): ditto * src/insets/insetbibitem.C (InsetBibitem::read): Use InsetCommand::read * src/insets/insetref.C (InsetRef::latex): Use new InsetCommandParams interface * src/mathed/InsetMathHull.C (InsetMathHull::doDispatch): ditto * src/text3.C (LyXText::dispatch): ditto * src/factory.C (createInset): Create InsetCommandParams with command name (readInset): ditto (readInset): Remove error message for bibitem, since bibitem is now a normal command inset * src/buffer.C: Bump file format number * src/frontends/controllers/ControlCommand.[Ch] (ControlCommand): take an additional command name parameter * src/text.C (readParToken): Remove code for \bibitem * lib/lyx2lyx/LyX.py: Bump latest file format number * lib/lyx2lyx/lyx_1_5.py (convert_bibitem, convert_commandparams): new, convert to new format (revert_commandparams): new, convert to old format * development/FORMAT: document new format * many other files: Adjust to the changes above git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
dialog->setController(new ControlCommand(*dialog, name, name));
dialog->setView(new QIndex(*dialog,
_("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 == "view-source") {
QViewSource * qvs = new QViewSource(*dialog);
dialog->setController(qvs);
GuiView & gui_view = static_cast<GuiView &>(lyxview_);
dialog->setView(new DockView<QViewSource, QViewSourceDialog>(
*dialog, qvs, &gui_view, _("LateX Source"), Qt::BottomDockWidgetArea));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "mathpanel") {
dialog->setController(new ControlMath(*dialog));
dialog->setView(new QMath(*dialog));
dialog->bc().bp(new IgnorantPolicy);
} else if (name == "mathdelimiter") {
dialog->setController(new ControlMath(*dialog));
dialog->setView(new QMathDelimiter(*dialog));
dialog->bc().bp(new IgnorantPolicy);
} else if (name == "mathmatrix") {
dialog->setController(new ControlMath(*dialog));
dialog->setView(new QMathMatrix(*dialog));
dialog->bc().bp(new IgnorantPolicy);
} else if (name == "note") {
dialog->setController(new ControlNote(*dialog));
dialog->setView(new QNote(*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 == "prefs") {
dialog->setController(new ControlPrefs(*dialog));
dialog->setView(new QPrefs(*dialog));
dialog->bc().bp(new PreferencesPolicy);
} else if (name == "print") {
dialog->setController(new ControlPrint(*dialog));
dialog->setView(new QPrint(*dialog));
dialog->bc().bp(new OkApplyCancelPolicy);
} else if (name == "ref") {
// full qualification because qt4 has also a ControlRef type
dialog->setController(new lyx::frontend::ControlRef(*dialog));
dialog->setView(new QRef(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "sendto") {
dialog->setController(new ControlSendto(*dialog));
dialog->setView(new QSendto(*dialog));
dialog->bc().bp(new OkApplyCancelPolicy);
} else if (name == "spellchecker") {
dialog->setController(new ControlSpellchecker(*dialog));
dialog->setView(new QSpellchecker(*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);
} else if (name == "texinfo") {
dialog->setController(new ControlTexinfo(*dialog));
dialog->setView(new QTexinfo(*dialog));
dialog->bc().bp(new OkCancelPolicy);
#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") {
QToc * qtoc = new QToc(*dialog);
dialog->setController(qtoc);
GuiView & gui_view = static_cast<GuiView &>(lyxview_);
dialog->setView(new DockView<QToc, TocWidget>(
*dialog, qtoc, &gui_view, _("Toc")));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "url") {
Rework InsetCommandParams interface and file storage * src/insets/insetcommandparams.[Ch]: (operator[]): New, access a parameter (clear): New, clear all parameters (info_): New, stire info about this command (cmdname): Rename to name_ (contents, options, sec_options): Replace with params_. Parameters are now stored as docstring. (findInfo): New factor for command info for all commands (read, write): Use new syntax (parameter set and get methods): reimplemenmt for new parameter storage * src/insets/insetcommand.h (getParam): New, get a parameter (setParam): New, set a parameter (parameter set and get methods): Adjust to InsetCommandParams changes * src/insets/insetbibitem.[Ch] (write): Remove, not needed anymore (directWrite): ditto * src/insets/insetbibitem.C (InsetBibitem::read): Use InsetCommand::read * src/insets/insetref.C (InsetRef::latex): Use new InsetCommandParams interface * src/mathed/InsetMathHull.C (InsetMathHull::doDispatch): ditto * src/text3.C (LyXText::dispatch): ditto * src/factory.C (createInset): Create InsetCommandParams with command name (readInset): ditto (readInset): Remove error message for bibitem, since bibitem is now a normal command inset * src/buffer.C: Bump file format number * src/frontends/controllers/ControlCommand.[Ch] (ControlCommand): take an additional command name parameter * src/text.C (readParToken): Remove code for \bibitem * lib/lyx2lyx/LyX.py: Bump latest file format number * lib/lyx2lyx/lyx_1_5.py (convert_bibitem, convert_commandparams): new, convert to new format (revert_commandparams): new, convert to old format * development/FORMAT: document new format * many other files: Adjust to the changes above git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
dialog->setController(new ControlCommand(*dialog, name, name));
dialog->setView(new UrlView(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "vspace") {
dialog->setController(new ControlVSpace(*dialog));
dialog->setView(new QVSpace(*dialog));
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
} else if (name == "wrap") {
dialog->setController(new ControlWrap(*dialog));
dialog->setView(new QWrap(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
}
return dialog;
}
/// Are the tooltips on or off?
bool Dialogs::tooltipsEnabled()
{
return false;
}
} // namespace lyx