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"
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiAbout.h"
|
|
|
|
#include "GuiBibitem.h"
|
|
|
|
#include "GuiBibtex.h"
|
|
|
|
#include "GuiBox.h"
|
|
|
|
#include "GuiBranch.h"
|
|
|
|
#include "GuiChanges.h"
|
|
|
|
#include "GuiCharacter.h"
|
|
|
|
#include "GuiCitation.h"
|
|
|
|
#include "GuiCitationDialog.h"
|
|
|
|
#include "GuiDelimiterDialog.h"
|
|
|
|
#include "GuiDocument.h"
|
|
|
|
#include "GuiErrorList.h"
|
|
|
|
#include "GuiERT.h"
|
|
|
|
#include "GuiExternal.h"
|
|
|
|
#include "GuiFloat.h"
|
|
|
|
#include "GuiGraphics.h"
|
|
|
|
#include "GuiInclude.h"
|
|
|
|
#include "GuiIndex.h"
|
|
|
|
#include "GuiMathMatrixDialog.h"
|
|
|
|
#include "GuiNomencl.h"
|
|
|
|
#include "GuiListings.h"
|
|
|
|
#include "GuiLog.h"
|
|
|
|
#include "GuiViewSource.h"
|
|
|
|
#include "GuiNote.h"
|
|
|
|
#include "GuiParagraph.h"
|
|
|
|
#include "GuiPrefs.h"
|
|
|
|
#include "GuiPrint.h"
|
|
|
|
#include "GuiRef.h"
|
|
|
|
#include "GuiSearch.h"
|
|
|
|
#include "GuiSendto.h"
|
|
|
|
#include "GuiShowFile.h"
|
|
|
|
#include "GuiSpellchecker.h"
|
|
|
|
#include "GuiTabular.h"
|
|
|
|
#include "GuiTabularCreate.h"
|
|
|
|
#include "GuiTexinfo.h"
|
|
|
|
#include "GuiToc.h"
|
2007-03-12 14:23:44 +00:00
|
|
|
#include "TocWidget.h"
|
2006-06-28 12:09:25 +00:00
|
|
|
#include "UrlView.h"
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiVSpace.h"
|
|
|
|
#include "GuiWrap.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBAIKSAURUS
|
|
|
|
#include "ControlThesaurus.h"
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiThesaurus.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "qt_helpers.h"
|
|
|
|
|
|
|
|
#include <boost/assert.hpp>
|
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
2007-08-14 09:54:59 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiAbout(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiBibitem(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkCancelReadOnlyPolicy);
|
|
|
|
} else if (name == "bibtex") {
|
|
|
|
dialog->setController(new ControlBibtex(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiBibtex(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "box") {
|
|
|
|
dialog->setController(new ControlBox(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiBox(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
|
|
|
} else if (name == "branch") {
|
|
|
|
dialog->setController(new ControlBranch(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiBranch(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "changes") {
|
|
|
|
dialog->setController(new ControlChanges(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiChanges(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "character") {
|
|
|
|
dialog->setController(new ControlCharacter(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiCharacter(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
|
|
|
} else if (name == "citation") {
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiCitation * ci = new GuiCitation(*dialog);
|
2006-04-11 08:26:43 +00:00
|
|
|
dialog->setController(ci);
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiCitationDialog(*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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiDocument(*dialog));
|
2006-07-10 18:58:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
2006-03-05 17:24:44 +00:00
|
|
|
} else if (name == "errorlist") {
|
|
|
|
dialog->setController(new ControlErrorList(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiErrorList(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkCancelPolicy);
|
|
|
|
} else if (name == "ert") {
|
|
|
|
dialog->setController(new ControlERT(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiERT(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "external") {
|
|
|
|
dialog->setController(new ControlExternal(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiExternal(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "file") {
|
|
|
|
dialog->setController(new ControlShowFile(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiShowFile(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkCancelPolicy);
|
|
|
|
} else if (name == "findreplace") {
|
|
|
|
dialog->setController(new ControlSearch(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiSearch(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "float") {
|
|
|
|
dialog->setController(new ControlFloat(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiFloat(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "graphics") {
|
|
|
|
dialog->setController(new ControlGraphics(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiGraphics(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "include") {
|
|
|
|
dialog->setController(new ControlInclude(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiInclude(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiIndex(*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-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiNomencl(*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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiIndex(*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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiLog(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkCancelPolicy);
|
2006-04-15 14:13:41 +00:00
|
|
|
} else if (name == "view-source") {
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiViewSource * qvs = new GuiViewSource(*dialog);
|
2007-03-25 01:25:29 +00:00
|
|
|
dialog->setController(qvs);
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiViewBase & gui_view = static_cast<GuiViewBase &>(lyxview_);
|
|
|
|
dialog->setView(new DockView<GuiViewSource, GuiViewSourceDialog>(
|
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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiMathDelimiter(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new IgnorantPolicy);
|
|
|
|
} else if (name == "mathmatrix") {
|
|
|
|
dialog->setController(new ControlMath(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiMathMatrix(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new IgnorantPolicy);
|
|
|
|
} else if (name == "note") {
|
|
|
|
dialog->setController(new ControlNote(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiNote(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "paragraph") {
|
|
|
|
dialog->setController(new ControlParagraph(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiParagraph(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
|
|
|
} else if (name == "prefs") {
|
|
|
|
dialog->setController(new ControlPrefs(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiPrefs(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new PreferencesPolicy);
|
|
|
|
} else if (name == "print") {
|
|
|
|
dialog->setController(new ControlPrint(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiPrint(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
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
|
2007-08-14 09:54:59 +00:00
|
|
|
dialog->setController(new ControlRef(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiRef(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "sendto") {
|
|
|
|
dialog->setController(new ControlSendto(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiSendto(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkApplyCancelPolicy);
|
|
|
|
} else if (name == "spellchecker") {
|
|
|
|
dialog->setController(new ControlSpellchecker(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiSpellchecker(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "tabular") {
|
|
|
|
dialog->setController(new ControlTabular(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiTabular(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
} else if (name == "tabularcreate") {
|
|
|
|
dialog->setController(new ControlTabularCreate(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiTabularCreate(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new IgnorantPolicy);
|
|
|
|
} else if (name == "texinfo") {
|
|
|
|
dialog->setController(new ControlTexinfo(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiTexinfo(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkCancelPolicy);
|
|
|
|
#ifdef HAVE_LIBAIKSAURUS
|
|
|
|
} else if (name == "thesaurus") {
|
|
|
|
dialog->setController(new ControlThesaurus(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiThesaurus(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
|
|
|
#endif
|
|
|
|
} else if (name == "toc") {
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiViewBase & gui_view = static_cast<GuiViewBase &>(lyxview_);
|
|
|
|
GuiToc * qtoc = new GuiToc(*dialog, &gui_view);
|
2007-04-07 00:04:38 +00:00
|
|
|
dialog->setController(qtoc);
|
2007-05-29 11:38:28 +00:00
|
|
|
#ifdef Q_WS_MACX
|
|
|
|
// On Mac show as a drawer at the right
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new DockView<GuiToc, TocWidget>(
|
2007-05-29 11:38:28 +00:00
|
|
|
*dialog, qtoc, &gui_view, _("Outline"), Qt::RightDockWidgetArea, Qt::Drawer));
|
|
|
|
#else
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new DockView<GuiToc, 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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiVSpace(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
|
|
|
|
} else if (name == "wrap") {
|
|
|
|
dialog->setController(new ControlWrap(*dialog));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiWrap(*dialog));
|
2006-03-05 17:24:44 +00:00
|
|
|
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));
|
2007-08-31 05:53:55 +00:00
|
|
|
dialog->setView(new GuiListings(*dialog));
|
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
|
|
|
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
|
|
|
|
2007-08-14 09:54:59 +00:00
|
|
|
} // namespace frontend
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|