2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-04-26 03:53:02 +00:00
|
|
|
* \file qt4/Dialogs.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
* 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"
|
Add support for listings package. Two listings command \lstinline, \lstinputlisting and an environment \lstlisting are supported, along with preamble \lstset. \lstinputlisting is implemented through Include dialog, and the other two are implemented with a new inset listings, along with its dialog.
* src/LyXAction.cpp: listing-insert action
* src/insets/Inset.h,cpp: LISTINGS_CODE
* src/insets/InsetInclude.cpp: handle \lstinputlisting
* src/insets/InsetListings.h,cpp: new listings inset
* src/insets/InsetListingsParams.h,cpp: parameters from listings package
* src/insets/InsetCommandParams.h,cpp: handle lstinputlisting option
* src/Bidi.cpp: handle LISTINGS_CODE
* src/frontends/qt4/ui/TextLayoutUi.ui: update UI
* src/frontends/qt4/ui/ListingsUi.ui: new dialog
* src/frontends/qt4/ui/IncludeUi.ui: update UI
* src/frontends/qt4/QInclude.h,cpp: add lstinputlisting
* src/frontends/qt4/QDocument.h,cpp: add textedit for preamble listings_params
* src/frontends/qt4/QListings.h,cpp: new listings inset
* src/frontends/qt4/Dialogs.cpp: new listings dialog
* src/frontends/controllers/ControlInclude.h,cpp: add lstinputlisting
* src/frontends/controllers/ControlListings.h,cpp: new listings inset
* src/LyXFunc.cpp: handle LISTING_CODE
* src/Paragraph.cpp: handle LISTING_CODE
* src/factory.cpp: new listings inset
* src/CutAndPaste.cpp: handle LISTINGS_CODE
* src/LaTeXFeatures.cpp: require listings
* src/Text3.cpp: Handle LISTINGS_CODE
* src/lfuns.h: add LFUN_LISTING_INSERT
* src/Buffer.cpp: change lyx file format to 269
* src/BufferParams.h,cpp: add listings_params to preamble
* lib/lyx2lyx/LyX.py: lyx2lyx
* lib/lyx2lyx/lyx_1_5.py: lyx2lyx
* lib/ui/stdmenus.inc: new menu item (no shortcut!)
* src/insets/Makefile.am: update autotools
* src/frontends/controllers/Makefile.am
* src/frontends/qt4/Makefile.dialogs
* src/frontends/qt4/Makefile.am
* po/POTFILES.in: a few more translatable files.
* development/scons/scons_manifest.py: scons build system
* development/FORMAT: document format changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18243 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 19:11:42 +00:00
|
|
|
#include "ControlListings.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#include "ControlLog.h"
|
2006-04-15 14:13:41 +00:00
|
|
|
#include "ControlViewSource.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#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"
|
2007-03-12 14:23:44 +00:00
|
|
|
#include "DockView.h"
|
|
|
|
#include "GuiView.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#include "QAbout.h"
|
|
|
|
#include "QBibitem.h"
|
|
|
|
#include "QBibtex.h"
|
|
|
|
#include "QBox.h"
|
|
|
|
#include "QBranch.h"
|
|
|
|
#include "QChanges.h"
|
|
|
|
#include "QCharacter.h"
|
|
|
|
#include "QCitation.h"
|
2006-04-11 08:26:43 +00:00
|
|
|
#include "QCitationDialog.h"
|
2007-04-19 21:42:42 +00:00
|
|
|
#include "QDelimiterDialog.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#include "QDocument.h"
|
|
|
|
#include "QErrorList.h"
|
|
|
|
#include "QERT.h"
|
|
|
|
#include "QExternal.h"
|
|
|
|
#include "QFloat.h"
|
|
|
|
#include "QGraphics.h"
|
|
|
|
#include "QInclude.h"
|
|
|
|
#include "QIndex.h"
|
2007-04-19 21:42:42 +00:00
|
|
|
#include "QMathMatrixDialog.h"
|
2006-11-04 17:55:36 +00:00
|
|
|
#include "QNomencl.h"
|
Add support for listings package. Two listings command \lstinline, \lstinputlisting and an environment \lstlisting are supported, along with preamble \lstset. \lstinputlisting is implemented through Include dialog, and the other two are implemented with a new inset listings, along with its dialog.
* src/LyXAction.cpp: listing-insert action
* src/insets/Inset.h,cpp: LISTINGS_CODE
* src/insets/InsetInclude.cpp: handle \lstinputlisting
* src/insets/InsetListings.h,cpp: new listings inset
* src/insets/InsetListingsParams.h,cpp: parameters from listings package
* src/insets/InsetCommandParams.h,cpp: handle lstinputlisting option
* src/Bidi.cpp: handle LISTINGS_CODE
* src/frontends/qt4/ui/TextLayoutUi.ui: update UI
* src/frontends/qt4/ui/ListingsUi.ui: new dialog
* src/frontends/qt4/ui/IncludeUi.ui: update UI
* src/frontends/qt4/QInclude.h,cpp: add lstinputlisting
* src/frontends/qt4/QDocument.h,cpp: add textedit for preamble listings_params
* src/frontends/qt4/QListings.h,cpp: new listings inset
* src/frontends/qt4/Dialogs.cpp: new listings dialog
* src/frontends/controllers/ControlInclude.h,cpp: add lstinputlisting
* src/frontends/controllers/ControlListings.h,cpp: new listings inset
* src/LyXFunc.cpp: handle LISTING_CODE
* src/Paragraph.cpp: handle LISTING_CODE
* src/factory.cpp: new listings inset
* src/CutAndPaste.cpp: handle LISTINGS_CODE
* src/LaTeXFeatures.cpp: require listings
* src/Text3.cpp: Handle LISTINGS_CODE
* src/lfuns.h: add LFUN_LISTING_INSERT
* src/Buffer.cpp: change lyx file format to 269
* src/BufferParams.h,cpp: add listings_params to preamble
* lib/lyx2lyx/LyX.py: lyx2lyx
* lib/lyx2lyx/lyx_1_5.py: lyx2lyx
* lib/ui/stdmenus.inc: new menu item (no shortcut!)
* src/insets/Makefile.am: update autotools
* src/frontends/controllers/Makefile.am
* src/frontends/qt4/Makefile.dialogs
* src/frontends/qt4/Makefile.am
* po/POTFILES.in: a few more translatable files.
* development/scons/scons_manifest.py: scons build system
* development/FORMAT: document format changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18243 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 19:11:42 +00:00
|
|
|
#include "QListings.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#include "QLog.h"
|
2006-04-15 14:13:41 +00:00
|
|
|
#include "QViewSource.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#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"
|
2007-03-12 14:23:44 +00:00
|
|
|
#include "TocWidget.h"
|
2006-06-28 12:09:25 +00:00
|
|
|
#include "UrlView.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#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",
|
2006-11-04 17:55:36 +00:00
|
|
|
"findreplace", "float", "graphics", "include", "index", "nomenclature", "label", "log",
|
2007-04-19 21:42:42 +00:00
|
|
|
"mathdelimiter", "mathmatrix", "note", "paragraph",
|
2006-03-05 17:24:44 +00:00
|
|
|
"prefs", "print", "ref", "sendto", "spellchecker","tabular", "tabularcreate",
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBAIKSAURUS
|
|
|
|
"thesaurus",
|
|
|
|
#endif
|
|
|
|
|
Add support for listings package. Two listings command \lstinline, \lstinputlisting and an environment \lstlisting are supported, along with preamble \lstset. \lstinputlisting is implemented through Include dialog, and the other two are implemented with a new inset listings, along with its dialog.
* src/LyXAction.cpp: listing-insert action
* src/insets/Inset.h,cpp: LISTINGS_CODE
* src/insets/InsetInclude.cpp: handle \lstinputlisting
* src/insets/InsetListings.h,cpp: new listings inset
* src/insets/InsetListingsParams.h,cpp: parameters from listings package
* src/insets/InsetCommandParams.h,cpp: handle lstinputlisting option
* src/Bidi.cpp: handle LISTINGS_CODE
* src/frontends/qt4/ui/TextLayoutUi.ui: update UI
* src/frontends/qt4/ui/ListingsUi.ui: new dialog
* src/frontends/qt4/ui/IncludeUi.ui: update UI
* src/frontends/qt4/QInclude.h,cpp: add lstinputlisting
* src/frontends/qt4/QDocument.h,cpp: add textedit for preamble listings_params
* src/frontends/qt4/QListings.h,cpp: new listings inset
* src/frontends/qt4/Dialogs.cpp: new listings dialog
* src/frontends/controllers/ControlInclude.h,cpp: add lstinputlisting
* src/frontends/controllers/ControlListings.h,cpp: new listings inset
* src/LyXFunc.cpp: handle LISTING_CODE
* src/Paragraph.cpp: handle LISTING_CODE
* src/factory.cpp: new listings inset
* src/CutAndPaste.cpp: handle LISTINGS_CODE
* src/LaTeXFeatures.cpp: require listings
* src/Text3.cpp: Handle LISTINGS_CODE
* src/lfuns.h: add LFUN_LISTING_INSERT
* src/Buffer.cpp: change lyx file format to 269
* src/BufferParams.h,cpp: add listings_params to preamble
* lib/lyx2lyx/LyX.py: lyx2lyx
* lib/lyx2lyx/lyx_1_5.py: lyx2lyx
* lib/ui/stdmenus.inc: new menu item (no shortcut!)
* src/insets/Makefile.am: update autotools
* src/frontends/controllers/Makefile.am
* src/frontends/qt4/Makefile.dialogs
* src/frontends/qt4/Makefile.am
* po/POTFILES.in: a few more translatable files.
* development/scons/scons_manifest.py: scons build system
* development/FORMAT: document format changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18243 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 19:11:42 +00:00
|
|
|
"texinfo", "toc", "url", "view-source", "vspace", "wrap", "listings" };
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
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));
|
2006-03-05 17:24:44 +00:00
|
|
|
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") {
|
2006-04-11 08:26:43 +00:00
|
|
|
QCitation * ci = new QCitation(*dialog);
|
|
|
|
dialog->setController(ci);
|
|
|
|
dialog->setView(new QCitationDialog(*dialog, ci));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
2006-07-10 18:58:44 +00:00
|
|
|
} else if (name == "document") {
|
|
|
|
dialog->setController(new ControlDocument(*dialog));
|
|
|
|
dialog->setView(new QDocument(*dialog));
|
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
2006-03-05 17:24:44 +00:00
|
|
|
} 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));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->setView(new QIndex(*dialog,
|
2006-10-09 10:35:14 +00:00
|
|
|
_("Index Entry"),
|
2006-03-05 17:24:44 +00:00
|
|
|
qt_("&Keyword:")));
|
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
2006-11-04 17:55:36 +00:00
|
|
|
} else if (name == "nomenclature") {
|
|
|
|
dialog->setController(new ControlCommand(*dialog, name, name));
|
2007-04-29 22:21:00 +00:00
|
|
|
dialog->setView(new QNomencl(*dialog, _("Nomenclature Entry")));
|
2006-11-04 17:55:36 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
2006-03-05 17:24:44 +00:00
|
|
|
} 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));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->setView(new QIndex(*dialog,
|
2006-10-09 10:35:14 +00:00
|
|
|
_("Label"),
|
2006-03-05 17:24:44 +00:00
|
|
|
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);
|
2006-04-15 14:13:41 +00:00
|
|
|
} else if (name == "view-source") {
|
2007-03-25 01:25:29 +00:00
|
|
|
QViewSource * qvs = new QViewSource(*dialog);
|
|
|
|
dialog->setController(qvs);
|
|
|
|
GuiView & gui_view = static_cast<GuiView &>(lyxview_);
|
|
|
|
dialog->setView(new DockView<QViewSource, QViewSourceDialog>(
|
2007-03-27 17:40:05 +00:00
|
|
|
*dialog, qvs, &gui_view, _("LaTeX Source"), Qt::BottomDockWidgetArea));
|
2006-04-15 14:13:41 +00:00
|
|
|
dialog->bc().bp(new OkCancelPolicy);
|
2006-03-05 17:24:44 +00:00
|
|
|
} 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") {
|
2006-06-06 10:10:11 +00:00
|
|
|
// full qualification because qt4 has also a ControlRef type
|
|
|
|
dialog->setController(new lyx::frontend::ControlRef(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
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") {
|
2007-03-12 14:23:44 +00:00
|
|
|
GuiView & gui_view = static_cast<GuiView &>(lyxview_);
|
2007-04-07 00:04:38 +00:00
|
|
|
QToc * qtoc = new QToc(*dialog, &gui_view);
|
|
|
|
dialog->setController(qtoc);
|
2007-05-29 11:38:28 +00:00
|
|
|
#ifdef Q_WS_MACX
|
|
|
|
// On Mac show as a drawer at the right
|
|
|
|
dialog->setView(new DockView<QToc, TocWidget>(
|
|
|
|
*dialog, qtoc, &gui_view, _("Outline"), Qt::RightDockWidgetArea, Qt::Drawer));
|
|
|
|
#else
|
2007-03-12 14:23:44 +00:00
|
|
|
dialog->setView(new DockView<QToc, TocWidget>(
|
2007-05-29 07:38:38 +00:00
|
|
|
*dialog, qtoc, &gui_view, _("Outline")));
|
2007-05-29 11:38:28 +00:00
|
|
|
#endif
|
2006-03-05 17:24:44 +00:00
|
|
|
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));
|
2006-06-28 12:09:25 +00:00
|
|
|
dialog->setView(new UrlView(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
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);
|
Add support for listings package. Two listings command \lstinline, \lstinputlisting and an environment \lstlisting are supported, along with preamble \lstset. \lstinputlisting is implemented through Include dialog, and the other two are implemented with a new inset listings, along with its dialog.
* src/LyXAction.cpp: listing-insert action
* src/insets/Inset.h,cpp: LISTINGS_CODE
* src/insets/InsetInclude.cpp: handle \lstinputlisting
* src/insets/InsetListings.h,cpp: new listings inset
* src/insets/InsetListingsParams.h,cpp: parameters from listings package
* src/insets/InsetCommandParams.h,cpp: handle lstinputlisting option
* src/Bidi.cpp: handle LISTINGS_CODE
* src/frontends/qt4/ui/TextLayoutUi.ui: update UI
* src/frontends/qt4/ui/ListingsUi.ui: new dialog
* src/frontends/qt4/ui/IncludeUi.ui: update UI
* src/frontends/qt4/QInclude.h,cpp: add lstinputlisting
* src/frontends/qt4/QDocument.h,cpp: add textedit for preamble listings_params
* src/frontends/qt4/QListings.h,cpp: new listings inset
* src/frontends/qt4/Dialogs.cpp: new listings dialog
* src/frontends/controllers/ControlInclude.h,cpp: add lstinputlisting
* src/frontends/controllers/ControlListings.h,cpp: new listings inset
* src/LyXFunc.cpp: handle LISTING_CODE
* src/Paragraph.cpp: handle LISTING_CODE
* src/factory.cpp: new listings inset
* src/CutAndPaste.cpp: handle LISTINGS_CODE
* src/LaTeXFeatures.cpp: require listings
* src/Text3.cpp: Handle LISTINGS_CODE
* src/lfuns.h: add LFUN_LISTING_INSERT
* src/Buffer.cpp: change lyx file format to 269
* src/BufferParams.h,cpp: add listings_params to preamble
* lib/lyx2lyx/LyX.py: lyx2lyx
* lib/lyx2lyx/lyx_1_5.py: lyx2lyx
* lib/ui/stdmenus.inc: new menu item (no shortcut!)
* src/insets/Makefile.am: update autotools
* src/frontends/controllers/Makefile.am
* src/frontends/qt4/Makefile.dialogs
* src/frontends/qt4/Makefile.am
* po/POTFILES.in: a few more translatable files.
* development/scons/scons_manifest.py: scons build system
* development/FORMAT: document format changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18243 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 19:11:42 +00:00
|
|
|
} else if (name == "listings") {
|
|
|
|
dialog->setController(new ControlListings(*dialog));
|
|
|
|
dialog->setView(new QListings(*dialog));
|
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return dialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Are the tooltips on or off?
|
|
|
|
bool Dialogs::tooltipsEnabled()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|