Move the Texinfo dialog to the new Dialog scheme.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7193 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-06-19 17:16:12 +00:00
parent 10ca5f5545
commit 87f831b8ba
18 changed files with 87 additions and 89 deletions

View File

@ -1,3 +1,8 @@
2003-06-19 Angus Leeming <leeming@lyx.org>
* Dialogs.h: (showTexinfo):
* guiapi.[Ch] (gui_ShowTexinfo): removed.
2003-06-17 Angus Leeming <leeming@lyx.org>
* Dialogs.h: (showMathPanel):

View File

@ -86,8 +86,6 @@ public:
void showSendto();
/// bring up the spellchecker
void showSpellchecker();
/// show the TexInfo
void showTexinfo();
//@}
/** \param name == "about" etc; an identifier used to

View File

@ -1,3 +1,7 @@
2003-06-19 Angus Leeming <leeming@lyx.org>
* ControlTexinfo.[Ch]: rewritten to use the Dialog-based scheme.
2003-06-17 Angus Leeming <leeming@lyx.org>
* ControlMath.[Ch]:

View File

@ -10,20 +10,10 @@
#include <config.h>
#include "ControlTexinfo.h"
#include "helper_funcs.h"
#include "tex_helpers.h"
#include "funcrequest.h"
#include "frontends/Dialogs.h"
#include "frontends/LyXView.h"
#include "support/filetools.h" // FileSearch
#include "support/path.h"
#include "support/lstrings.h"
extern string user_lyxdir; // home of *Files.lst
namespace {
@ -46,8 +36,8 @@ string getFileList(ControlTexinfo::texFileSuffix type, bool withFullPath)
} // namespace anon
ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
ControlTexinfo::ControlTexinfo(Dialog & parent)
: Dialog::Controller(parent)
{}
@ -81,7 +71,8 @@ ControlTexinfo::getContents(texFileSuffix type, bool withFullPath) const
void ControlTexinfo::viewFile(string const filename) const
{
lv_.getDialogs().show("file", filename);
string const arg = "file " + filename;
kernel().dispatch(FuncRequest(LFUN_DIALOG_SHOW, arg));
}

View File

@ -13,17 +13,26 @@
#define CONTROLTEXINFO_H
#include "ControlDialog_impl.h"
#include "LString.h"
#include "Dialog.h"
/** A controller for Texinfo dialogs. */
class ControlTexinfo : public ControlDialogBI {
class ControlTexinfo : public Dialog::Controller {
public:
///
ControlTexinfo(Dialog &);
///
virtual bool initialiseParams(string const &) { return true; }
///
virtual void clearParams() {}
///
virtual void dispatchParams() {}
///
virtual bool isBufferDependent() const { return false; }
/// the file extensions
enum texFileSuffix {cls, sty, bst};
///
ControlTexinfo(LyXView &, Dialogs &);
/// show contents af a file
void viewFile(string const filename) const;
/// show all classoptions

View File

@ -69,10 +69,4 @@ void gui_ShowSpellchecker(Dialogs & d)
}
void gui_ShowTexinfo(Dialogs & d)
{
d.showTexinfo();
}
} // extern "C"

View File

@ -29,7 +29,6 @@ void gui_ShowPrint(Dialogs &);
void gui_ShowSearch(Dialogs &);
void gui_ShowSendto(Dialogs &);
void gui_ShowSpellchecker(Dialogs &);
void gui_ShowTexinfo(Dialogs &);
} // extern "C"

View File

@ -1,3 +1,9 @@
2003-06-19 Angus Leeming <leeming@lyx.org>
* Dialogs.C:
* Dialogs2.C:
* QTexinfo.[Ch]: changes to use the new Dialog-based scheme.
2003-06-19 Angus Leeming <leeming@lyx.org>
* lyx_gui.C (getStatus): changes due to replacement of lots of lfuns

View File

@ -33,6 +33,7 @@
#include "ControlShowFile.h"
#include "ControlTabular.h"
#include "ControlTabularCreate.h"
#include "ControlTexinfo.h"
#include "ControlToc.h"
#include "ControlVCLog.h"
#include "ControlWrap.h"
@ -63,6 +64,7 @@
#include "QShowFile.h"
#include "QTabular.h"
#include "QTabularCreate.h"
#include "QTexinfo.h"
#include "QToc.h"
#include "QURL.h"
#include "QVCLog.h"
@ -80,11 +82,11 @@
namespace {
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
char const * const dialognames[] = { "aboutlyx", "bibitem", "bibtex", "changes",
"character", "citation", "error", "errorlist", "ert", "external", "file",
"float", "graphics", "include", "index", "label", "log",
"float", "graphics", "include", "index", "label", "latexlog",
"mathpanel", "mathdelimiter", "mathmatrix",
"minipage", "paragraph", "ref", "tabular", "tabularcreate",
"minipage", "paragraph", "ref", "tabular", "tabularcreate", "texinfo",
#ifdef HAVE_LIBAIKSAURUS
"thesaurus",
@ -123,7 +125,7 @@ Dialog * Dialogs::build(string const & name)
Dialog * dialog = new Dialog(lyxview_, name);
dialog->bc().view(new Qt2BC(dialog->bc()));
if (name == "about") {
if (name == "aboutlyx") {
dialog->setController(new ControlAboutlyx(*dialog));
dialog->setView(new QAbout(*dialog));
dialog->bc().bp(new OkCancelPolicy);
@ -191,7 +193,7 @@ Dialog * Dialogs::build(string const & name)
_("LyX: Label"),
qt_("&Label")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "log") {
} else if (name == "latexlog") {
dialog->setController(new ControlLog(*dialog));
dialog->setView(new QLog(*dialog));
dialog->bc().bp(new OkCancelPolicy);
@ -227,6 +229,10 @@ Dialog * Dialogs::build(string const & name)
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));

View File

@ -23,7 +23,6 @@
#include "ControlSearch.h"
#include "ControlSendto.h"
#include "ControlSpellchecker.h"
#include "ControlTexinfo.h"
#include "QCharacter.h"
#include "QCharacterDialog.h"
@ -44,8 +43,6 @@
#include "QSendtoDialog.h"
#include "QSpellchecker.h"
#include "QSpellcheckerDialog.h"
#include "QTexinfo.h"
#include "QTexinfoDialog.h"
#include "Qt2BC.h"
@ -69,9 +66,6 @@ SendtoDialog;
typedef GUI<ControlSpellchecker, QSpellchecker, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
SpellcheckerDialog;
typedef GUI<ControlTexinfo, QTexinfo, OkCancelPolicy, Qt2BC>
TexinfoDialog;
struct Dialogs::Impl {
Impl(LyXView & lv, Dialogs & d);
@ -81,7 +75,6 @@ struct Dialogs::Impl {
SearchDialog search;
SendtoDialog sendto;
SpellcheckerDialog spellchecker;
TexinfoDialog texinfo;
};
@ -91,8 +84,7 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
print(lv, d),
search(lv, d),
sendto(lv, d),
spellchecker(lv, d),
texinfo(lv, d)
spellchecker(lv, d)
{}
@ -154,9 +146,3 @@ void Dialogs::showSpellchecker()
{
pimpl_->spellchecker.controller().show();
}
void Dialogs::showTexinfo()
{
pimpl_->texinfo.controller().show();
}

View File

@ -26,11 +26,11 @@
using std::vector;
typedef Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> > base_class;
typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
QTexinfo::QTexinfo()
: base_class(_("LyX: LaTeX Information")),
QTexinfo::QTexinfo(Dialog & parent)
: base_class(parent, _("LyX: LaTeX Information")),
warningPosted(false), activeStyle(ControlTexinfo::cls)
{
}

View File

@ -13,8 +13,7 @@
#define QTEXINFO_H
#include "Qt2Base.h"
#include "QDialogView.h"
#include "ControlTexinfo.h"
#include <vector>
@ -23,13 +22,12 @@ class QTexinfoDialog;
///
class QTexinfo
: public Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> >
{
: public QController<ControlTexinfo, QView<QTexinfoDialog> > {
public:
///
friend class QTexinfoDialog;
///
QTexinfo();
QTexinfo(Dialog &);
private:
/// Apply changes
virtual void apply() {}

View File

@ -1,3 +1,10 @@
2003-06-19 Angus Leeming <leeming@lyx.org>
* Dialogs.C:
* Dialogs2.C:
* FormTexinfo.[Ch]:
* forms/form_texinfo.fd: changes to use the new Dialog-based scheme.
2003-06-19 Juergen Spitzmueller <juergen.sp@t-online.de>
* forms/form_preferences.fd Revert Rob Lahaye's patch.

View File

@ -36,6 +36,7 @@
#include "ControlShowFile.h"
#include "ControlTabular.h"
#include "ControlTabularCreate.h"
#include "ControlTexinfo.h"
#include "ControlToc.h"
#include "ControlVCLog.h"
#include "ControlWrap.h"
@ -64,6 +65,7 @@
#include "FormParagraph.h"
#include "FormRef.h"
#include "FormTabular.h"
#include "FormTexinfo.h"
#include "FormShowFile.h"
#include "FormTabularCreate.h"
#include "FormText.h"
@ -108,14 +110,14 @@ FormMathsBitmap * createFormBitmap(Dialog & parent, string const & title,
}
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
char const * const dialognames[] = { "aboutlyx", "bibitem", "bibtex", "changes",
"character", "citation", "error", "errorlist" , "ert", "external", "file",
"float", "graphics", "include", "index", "label", "log", "mathpanel",
"float", "graphics", "include", "index", "label", "latexlog", "mathpanel",
"mathaccents", "matharrows", "mathoperators", "mathrelations", "mathgreek",
"mathmisc", "mathdots", "mathbigoperators", "mathamsmisc",
"mathamsarrows", "mathamsrelations", "mathamsnegatedrelations", "mathamsoperators",
"mathdelimiter", "mathmatrix", "mathspace", "mathstyle",
"minipage", "paragraph", "ref", "tabular", "tabularcreate",
"minipage", "paragraph", "ref", "tabular", "tabularcreate", "texinfo",
#ifdef HAVE_LIBAIKSAURUS
"thesaurus",
@ -153,7 +155,7 @@ Dialog * Dialogs::build(string const & name)
Dialog * dialog = new Dialog(lyxview_, name);
dialog->bc().view(new xformsBC(dialog->bc()));
if (name == "about") {
if (name == "aboutlyx") {
dialog->setController(new ControlAboutlyx(*dialog));
dialog->setView(new FormAboutlyx(*dialog));
dialog->bc().bp(new OkCancelPolicy);
@ -219,7 +221,7 @@ Dialog * Dialogs::build(string const & name)
dialog->setView(new FormText(*dialog,
_("Label"), _("Label:|#L")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "log") {
} else if (name == "latexlog") {
dialog->setController(new ControlLog(*dialog));
dialog->setView(new FormLog(*dialog));
dialog->bc().bp(new OkCancelPolicy);
@ -425,6 +427,10 @@ Dialog * Dialogs::build(string const & name)
dialog->setController(new ControlTabularCreate(*dialog));
dialog->setView(new FormTabularCreate(*dialog));
dialog->bc().bp(new IgnorantPolicy);
} else if (name == "texinfo") {
dialog->setController(new ControlTexinfo(*dialog));
dialog->setView(new FormTexinfo(*dialog));
dialog->bc().bp(new OkCancelPolicy);
#ifdef HAVE_LIBAIKSAURUS
} else if (name == "thesaurus") {
dialog->setController(new ControlThesaurus(*dialog));

View File

@ -51,10 +51,6 @@
#include "FormSpellchecker.h"
#include "forms/form_spellchecker.h"
#include "ControlTexinfo.h"
#include "FormTexinfo.h"
#include "forms/form_texinfo.h"
typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
DocumentDialog;
@ -79,8 +75,6 @@ SendtoDialog;
typedef GUI<ControlSpellchecker, FormSpellchecker, NoRepeatedApplyReadOnlyPolicy, xformsBC>
SpellcheckerDialog;
typedef GUI<ControlTexinfo, FormTexinfo, OkCancelPolicy, xformsBC>
TexinfoDialog;
struct Dialogs::Impl {
Impl(LyXView & lv, Dialogs & d);
@ -93,7 +87,6 @@ struct Dialogs::Impl {
SearchDialog search;
SendtoDialog sendto;
SpellcheckerDialog spellchecker;
TexinfoDialog texinfo;
};
@ -105,8 +98,7 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
print(lv, d),
search(lv, d),
sendto(lv, d),
spellchecker(lv, d),
texinfo(lv, d)
spellchecker(lv, d)
{}
@ -168,9 +160,3 @@ void Dialogs::showSpellchecker()
{
pimpl_->spellchecker.controller().show();
}
void Dialogs::showTexinfo()
{
pimpl_->texinfo.controller().show();
}

View File

@ -26,9 +26,10 @@
using std::vector;
typedef FormCB<ControlTexinfo, FormDB<FD_texinfo> > base_class;
FormTexinfo::FormTexinfo()
: base_class(_("LaTeX Information")),
typedef FormController<ControlTexinfo, FormView<FD_texinfo> > base_class;
FormTexinfo::FormTexinfo(Dialog & parent)
: base_class(parent, _("LaTeX Information")),
activeStyle(ControlTexinfo::cls)
{}
@ -37,7 +38,8 @@ void FormTexinfo::build() {
dialog_.reset(build_texinfo(this));
// callback for double click in browser to view the selected file
fl_set_browser_dblclick_callback(dialog_->browser, C_FormBaseInputCB, 2);
fl_set_browser_dblclick_callback(dialog_->browser,
C_FormDialogView_InputCB, 2);
string const classes_List = _("LaTeX classes|LaTeX styles|BibTeX styles");
fl_addto_choice(dialog_->choice_classes, classes_List.c_str());

View File

@ -13,15 +13,16 @@
#define FORMTEXINFO_H
#include "FormBase.h"
#include "FormDialogView.h"
#include "ControlTexinfo.h"
struct FD_texinfo;
class FormTexinfo : public FormCB<ControlTexinfo, FormDB<FD_texinfo> > {
class FormTexinfo
: public FormController<ControlTexinfo, FormView<FD_texinfo> > {
public:
///
FormTexinfo();
FormTexinfo(Dialog &);
private:
/// not needed
virtual void apply() {}

View File

@ -46,7 +46,7 @@ shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NorthWest FL_SouthEast
name: browser
callback: C_FormBaseInputCB
callback: C_FormDialogView_InputCB
argument: 0
--------------------
@ -64,7 +64,7 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthWest FL_South
name: button_rescan
callback: C_FormBaseInputCB
callback: C_FormDialogView_InputCB
argument: 2
--------------------
@ -82,7 +82,7 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_North FL_North
name: check_fullpath
callback: C_FormBaseInputCB
callback: C_FormDialogView_InputCB
argument: 2
--------------------
@ -100,7 +100,7 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_close
callback: C_FormBaseCancelCB
callback: C_FormDialogView_CancelCB
argument: 0
--------------------
@ -118,7 +118,7 @@ shortcut:
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_North
name: choice_classes
callback: C_FormBaseInputCB
callback: C_FormDialogView_InputCB
argument: 0
--------------------
@ -136,7 +136,7 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthWest FL_South
name: button_texhash
callback: C_FormBaseInputCB
callback: C_FormDialogView_InputCB
argument: 2
==============================