port the various dialogs to display the contents of an external file to the new Dialog-based scheme

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6575 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-03-25 18:13:46 +00:00
parent 37e2388f8e
commit 6d47abda7f
39 changed files with 200 additions and 258 deletions

View File

@ -1,3 +1,7 @@
2003-03-25 Angus Leeming <leeming@lyx.org>
* lyxfunc.C (dispatch): changes to the Dialogs interface.
2003-03-25 Alfredo Braunstein <abraunst@libero.it>
* text2.C:

View File

@ -1,3 +1,8 @@
2003-03-25 Angus Leeming <leeming@lyx.org>
* Dialogs.h: remove showFile, showLogFile, showVCLogFile.
* guiapi.[Ch]: remove the gui_ equivalents.
2003-03-22 John Levon <levon@movementarian.org>
* screen.C:

View File

@ -72,12 +72,8 @@ public:
//@{
///
void showDocument();
/// show the contents of a file.
void showFile(string const &);
/// show all forked child processes
void showForks();
/// show the LaTeX log or build file
void showLogFile();
/// display the top-level maths panel
void showMathPanel();
///
@ -96,8 +92,6 @@ public:
void showTexinfo();
/// show the thesaurus dialog
void showThesaurus(string const &);
/// show the version control log
void showVCLogFile();
//@}
/** \param name == "about" etc; an identifier used to

View File

@ -1,3 +1,9 @@
2003-03-25 Angus Leeming <leeming@lyx.org>
* ControlLog.[Ch]:
* ControlShowFile.[Ch]:
* ControlVCLog.[Ch]: rewrite to use the Dialog-based scheme.
2003-03-24 John Levon <levon@movementarian.org>
* ControlMath.C: include Pr function

View File

@ -11,20 +11,18 @@
#include <config.h>
#include "ControlLog.h"
#include "buffer.h"
ControlLog::ControlLog(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d)
ControlLog::ControlLog(Dialog & parent)
: Dialog::Controller(parent)
{}
void ControlLog::setParams()
bool ControlLog::initialiseParams(string const &)
{
logfile_ = buffer()->getLogName();
logfile_ = kernel().buffer()->getLogName();
return true;
}

View File

@ -13,30 +13,30 @@
#ifndef CONTROLLOG_H
#define CONTROLLOG_H
#include <utility>
#include "ControlDialog_impl.h"
#include "Dialog.h"
#include "buffer.h" // Buffer::LogType
#include <utility>
/**
* A controller for a read-only text browser.
*/
class ControlLog : public ControlDialogBD {
class ControlLog : public Dialog::Controller {
public:
///
ControlLog(LyXView &, Dialogs &);
ControlLog(Dialog &);
///
std::pair<Buffer::LogType, string> const & logfile() {
virtual bool initialiseParams(string const &);
///
virtual void clearParams();
///
virtual void dispatchParams() {}
///
virtual bool isBufferDependent() const { return true; }
///
std::pair<Buffer::LogType, string> const & logfile() const {
return logfile_;
}
private:
///
virtual void apply() {}
/// set the params before show or update
virtual void setParams();
/// clean-up on hide.
virtual void clearParams();
std::pair<Buffer::LogType, string> logfile_;
};

View File

@ -10,21 +10,25 @@
#include <config.h>
#include "ControlShowFile.h"
#include "support/filetools.h" // FileSearch
#include "support/filetools.h"
ControlShowFile::ControlShowFile(LyXView & lv, Dialogs & d)
: ControlDialogBI(lv, d)
ControlShowFile::ControlShowFile(Dialog & parent)
: Dialog::Controller(parent)
{}
void ControlShowFile::showFile(string const & file)
bool ControlShowFile::initialiseParams(string const & data)
{
filename_ = file;
show();
filename_ = data;
return true;
}
void ControlShowFile::clearParams()
{
filename_.erase();
}

View File

@ -4,6 +4,7 @@
* Licence details can be found in the file COPYING.
*
* \file ControlShowFile.h
*
* \author Herbert Voss
*
* Full author contact details are available in file CREDITS
@ -11,26 +12,28 @@
#ifndef CONTROLSHOWFILE_H
#define CONTROLSHOWFILE_H
#include "ControlDialog_impl.h"
#include "LString.h"
#include "Dialog.h"
/** A controller for the ShowFile dialog. */
class ControlShowFile : public ControlDialogBI {
class ControlShowFile : public Dialog::Controller {
public:
///
ControlShowFile(LyXView &, Dialogs &);
ControlShowFile(Dialog &);
///
virtual void showFile(string const &);
virtual bool initialiseParams(string const &);
///
virtual void clearParams();
///
virtual void dispatchParams() {}
///
virtual bool isBufferDependent() const { return false; }
///
string getFileContents();
///
string getFileName();
private:
/// not needed.
virtual void apply() {}
///
string filename_;
};

View File

@ -81,7 +81,7 @@ ControlTexinfo::getContents(texFileSuffix type, bool withFullPath) const
void ControlTexinfo::viewFile(string const filename) const
{
lv_.getDialogs().showFile(filename);
lv_.getDialogs().show("file", filename);
}

View File

@ -11,35 +11,30 @@
#include <config.h>
#include "ControlVCLog.h"
#include "ButtonController.h"
#include "buffer.h"
#include "lyxrc.h"
#include "gettext.h"
#include "support/lyxlib.h"
#include <fstream>
using std::endl;
using std::ostream;
ControlVCLog::ControlVCLog(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d)
ControlVCLog::ControlVCLog(Dialog & parent)
: Dialog::Controller(parent)
{}
string const ControlVCLog::getBufferFileName() const
{
return buffer()->fileName();
return kernel().buffer()->fileName();
}
void ControlVCLog::getVCLogFile(ostream & ss) const
{
string const name = buffer()->lyxvc.getLogFile();
string const name = kernel().buffer()->lyxvc.getLogFile();
std::ifstream in(name.c_str());

View File

@ -13,25 +13,24 @@
#ifndef CONTROLVCLOG_H
#define CONTROLVCLOG_H
#include "Dialog.h"
#include "ControlDialog_impl.h"
#include "LString.h"
/**
* A controller for the Version Control log viewer.
*/
class ControlVCLog : public ControlDialogBD {
class ControlVCLog : public Dialog::Controller {
public:
///
ControlVCLog(LyXView &, Dialogs &);
ControlVCLog(Dialog &);
///
virtual bool initialiseParams(string const &) { return true; }
///
virtual void clearParams() {}
///
virtual void dispatchParams() {}
///
virtual bool isBufferDependent() const { return true; }
/// put the log file into the ostream
void getVCLogFile(std::ostream & ss) const;
/// get the filename of the buffer
string const getBufferFileName() const;
private:
///
virtual void apply() {}
};
#endif // CONTROLVCLOG_H

View File

@ -27,24 +27,12 @@ void gui_ShowDocument(Dialogs & d)
}
void gui_ShowFile(string const & f, Dialogs & d)
{
d.showFile(f);
}
void gui_ShowForks(Dialogs & d)
{
d.showForks();
}
void gui_ShowLogFile(Dialogs & d)
{
d.showLogFile();
}
void gui_ShowMathPanel(Dialogs & d)
{
d.showMathPanel();
@ -99,9 +87,4 @@ void gui_ShowThesaurus(string const & s, Dialogs & d)
}
void gui_ShowVCLogFile(Dialogs & d)
{
d.showVCLogFile();
}
} // extern "C"

View File

@ -22,9 +22,7 @@ extern "C" {
void gui_show_dialog(Dialogs *, char const * name, char const * data);
void gui_ShowDocument(Dialogs &);
void gui_ShowFile(string const &, Dialogs &);
void gui_ShowForks(Dialogs &);
void gui_ShowLogFile(Dialogs &);
void gui_ShowMathPanel(Dialogs &);
void gui_ShowPreamble(Dialogs &);
void gui_ShowPreferences(Dialogs &);
@ -34,7 +32,6 @@ void gui_ShowSendto(Dialogs &);
void gui_ShowSpellchecker(Dialogs &);
void gui_ShowTexinfo(Dialogs &);
void gui_ShowThesaurus(string const &, Dialogs &);
void gui_ShowVCLogFile(Dialogs &);
} // extern "C"

View File

@ -1,3 +1,15 @@
2003-03-25 Angus Leeming <leeming@lyx.org>
* Dialogs.C:
* Dialogs2.C:
* Dialogs_impl.h: remove the log, showfile and vclog dialogs.
* Dialogs3.C: add these dialogs.
* QLog.[Ch]:
* QShowFile.[Ch]:
* QVCLog.[Ch]: changes to use the new Dialog-based scheme.
2003-03-23 John Levon <levon@movementarian.org>
* lyx_gui.C: remove unused variables
@ -33,7 +45,7 @@
* Dialogs2.C:
* Dialogs_impl.h: remove paragraph dialog.
* Dialogs3.C: addparagraph dialog.
* Dialogs3.C: add paragraph dialog.
* QParagraph.[Ch]: changes to use the new Dialog-based scheme.

View File

@ -27,19 +27,15 @@ Dialogs::~Dialogs()
Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
: document(lv, d),
file(lv, d),
logfile(lv, d),
:
#ifdef HAVE_LIBAIKSAURUS
thesaurus(lv, d),
#endif
document(lv, d),
prefs(lv, d),
print(lv, d),
search(lv, d),
sendto(lv, d),
spellchecker(lv, d),
texinfo(lv, d),
#ifdef HAVE_LIBAIKSAURUS
thesaurus(lv, d),
#endif
vclogfile(lv, d)
texinfo(lv, d)
{}

View File

@ -21,22 +21,10 @@ void Dialogs::showDocument()
}
void Dialogs::showFile(string const & f)
{
pimpl_->file.controller().showFile(f);
}
void Dialogs::showForks()
{}
void Dialogs::showLogFile()
{
pimpl_->logfile.controller().show();
}
void Dialogs::showMathPanel()
{
// FIXME FIXME FIXME
@ -101,9 +89,3 @@ void Dialogs::showThesaurus(string const &)
{}
#endif
void Dialogs::showVCLogFile()
{
pimpl_->vclogfile.controller().show();
}

View File

@ -24,12 +24,15 @@
#include "ControlFloat.h"
#include "ControlGraphics.h"
#include "ControlInclude.h"
#include "ControlLog.h"
#include "ControlMinipage.h"
#include "ControlParagraph.h"
#include "ControlRef.h"
#include "ControlShowFile.h"
#include "ControlTabular.h"
#include "ControlTabularCreate.h"
#include "ControlToc.h"
#include "ControlVCLog.h"
#include "ControlWrap.h"
#include "QAbout.h"
@ -62,12 +65,16 @@
#include "QIncludeDialog.h"
#include "QIndex.h"
#include "QIndexDialog.h"
#include "QLog.h"
#include "QLogDialog.h"
#include "QMinipage.h"
#include "QMinipageDialog.h"
#include "QParagraph.h"
#include "QParagraphDialog.h"
#include "QRef.h"
#include "QRefDialog.h"
#include "QShowFile.h"
#include "QShowFileDialog.h"
#include "QTabular.h"
#include "QTabularDialog.h"
#include "QTabularCreate.h"
@ -76,6 +83,9 @@
#include "QTocDialog.h"
#include "QURL.h"
#include "QURLDialog.h"
#include "QVCLog.h"
#include "QVCLogDialog.h"
#include "QWrap.h"
#include "QWrapDialog.h"
@ -87,9 +97,9 @@
namespace {
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
"character", "citation", "error", "ert", "external", "float", "graphics",
"include", "index", "label", "minipage", "paragraph", "ref", "tabular",
"tabularcreate", "toc", "url", "wrap" };
"character", "citation", "error", "ert", "external", "file", "float",
"graphics", "include", "index", "label", "log", "minipage", "paragraph",
"ref", "tabular", "tabularcreate", "toc", "url", "vclog", "wrap" };
char const * const * const end_dialognames =
dialognames + (sizeof(dialognames) / sizeof(char *));
@ -158,6 +168,10 @@ Dialog * Dialogs::build(string const & name)
dialog->setController(new ControlExternal(*dialog));
dialog->setView(new QExternal(*dialog));
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
} else if (name == "file") {
dialog->setController(new ControlShowFile(*dialog));
dialog->setView(new QShowFile(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "float") {
dialog->setController(new ControlFloat(*dialog));
dialog->setView(new QFloat(*dialog));
@ -182,6 +196,10 @@ Dialog * Dialogs::build(string const & name)
qt_("LyX: Insert Label"),
qt_("&Label")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "log") {
dialog->setController(new ControlLog(*dialog));
dialog->setView(new QLog(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "minipage") {
dialog->setController(new ControlMinipage(*dialog));
dialog->setView(new QMinipage(*dialog));
@ -210,6 +228,10 @@ Dialog * Dialogs::build(string const & name)
dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QURL(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "vclog") {
dialog->setController(new ControlVCLog(*dialog));
dialog->setView(new QVCLog(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "wrap") {
dialog->setController(new ControlWrap(*dialog));
dialog->setView(new QWrap(*dialog));

View File

@ -16,15 +16,12 @@
#include "ControlDocument.h"
#include "ControlForks.h"
#include "ControlLog.h"
#include "ControlPrefs.h"
#include "ControlPrint.h"
#include "ControlSearch.h"
#include "ControlSendto.h"
#include "ControlShowFile.h"
#include "ControlSpellchecker.h"
#include "ControlTexinfo.h"
#include "ControlVCLog.h"
#include "QCharacter.h"
#include "QCharacterDialog.h"
@ -35,8 +32,6 @@
// of the Qt headers, those most fucked up of disgusting ratholes.
// But I won't.
#undef signals
#include "QLog.h"
#include "QLogDialog.h"
#include "QPrefs.h"
#include "QPrefsDialog.h"
#include "QPrint.h"
@ -45,8 +40,6 @@
#include "QSearchDialog.h"
#include "QSendto.h"
#include "QSendtoDialog.h"
#include "QShowFile.h"
#include "QShowFileDialog.h"
#include "QSpellchecker.h"
#include "QSpellcheckerDialog.h"
#include "QTexinfo.h"
@ -58,9 +51,6 @@
#include "QThesaurusDialog.h"
#endif
#include "QVCLog.h"
#include "QVCLogDialog.h"
#include "Qt2BC.h"
@ -68,12 +58,6 @@
typedef GUI<ControlDocument, QDocument, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
DocumentDialog;
typedef GUI<ControlShowFile, QShowFile, OkCancelPolicy, Qt2BC>
FileDialog;
typedef GUI<ControlLog, QLog, OkCancelPolicy, Qt2BC>
LogFileDialog;
typedef GUI<ControlPrefs, QPrefs, OkApplyCancelPolicy, Qt2BC>
PrefsDialog;
@ -97,16 +81,10 @@ typedef GUI<ControlThesaurus, QThesaurus, OkApplyCancelReadOnlyPolicy, Qt2BC>
ThesaurusDialog;
#endif
typedef GUI<ControlVCLog, QVCLog, OkCancelPolicy, Qt2BC>
VCLogFileDialog;
struct Dialogs::Impl {
Impl(LyXView & lv, Dialogs & d);
DocumentDialog document;
FileDialog file;
LogFileDialog logfile;
PrefsDialog prefs;
PrintDialog print;
SearchDialog search;
@ -117,8 +95,6 @@ struct Dialogs::Impl {
#ifdef HAVE_LIBAIKSAURUS
ThesaurusDialog thesaurus;
#endif
VCLogFileDialog vclogfile;
};
#endif // DIALOGS_IMPL_H

View File

@ -28,10 +28,10 @@
using std::ifstream;
using std::getline;
typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
typedef QController<ControlLog, QView<QLogDialog> > base_class;
QLog::QLog()
: base_class(qt_("LyX: LaTeX Log"))
QLog::QLog(Dialog & parent)
: base_class(parent, qt_("LyX: LaTeX Log"))
{
}

View File

@ -13,20 +13,21 @@
#define QLOG_H
#include "Qt2Base.h"
#include "QDialogView.h"
class ControlLog;
class QLogDialog;
///
class QLog
: public Qt2CB<ControlLog, Qt2DB<QLogDialog> >
: public QController<ControlLog, QView<QLogDialog> >
{
public:
///
friend class QLogDialog;
///
QLog();
QLog(Dialog &);
private:
/// Apply changes
virtual void apply() {}

View File

@ -21,11 +21,11 @@
#include <qtextview.h>
#include <qpushbutton.h>
typedef Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> > base_class;
typedef QController<ControlShowFile, QView<QShowFileDialog> > base_class;
QShowFile::QShowFile()
: base_class(qt_("LyX: Show File"))
QShowFile::QShowFile(Dialog & parent)
: base_class(parent, qt_("LyX: Show File"))
{
}

View File

@ -13,19 +13,20 @@
#define QSHOWFILE_H
#include "Qt2Base.h"
#include "QDialogView.h"
class ControlShowFile;
class QShowFileDialog;
class QShowFile
: public Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> >
: public QController<ControlShowFile, QView<QShowFileDialog> >
{
public:
friend class QShowFileDialog;
QShowFile();
QShowFile(Dialog &);
private:
/// Apply changes
virtual void apply() {}

View File

@ -25,11 +25,11 @@
#include "BoostFormat.h"
typedef Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> > base_class;
typedef QController<ControlVCLog, QView<QVCLogDialog> > base_class;
QVCLog::QVCLog()
: base_class(qt_("LyX: Version Control Log"))
QVCLog::QVCLog(Dialog & parent)
: base_class(parent, qt_("LyX: Version Control Log"))
{
}

View File

@ -13,20 +13,21 @@
#define QVCLOG_H
#include "Qt2Base.h"
#include "QDialogView.h"
class ControlVCLog;
class QVCLogDialog;
///
class QVCLog
: public Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> >
: public QController<ControlVCLog, QView<QVCLogDialog> >
{
public:
///
friend class QVCLogDialog;
///
QVCLog();
QVCLog(Dialog &);
private:
/// Apply changes
virtual void apply() {}

View File

@ -1,3 +1,17 @@
2003-03-25 Angus Leeming <leeming@lyx.org>
* Dialogs.C:
* Dialogs2.C:
* Dialogs_impl.h: remove the log, showfile and vclog dialogs.
* Dialogs3.C: add these dialogs.
* FormBrowser.[Ch]:
* forms/form_browser.fd:
* FormLog.[Ch]:
* FormShowFile.[Ch]:
* FormVCLog.[Ch]: changes to use the new Dialog-based scheme.
2003-03-25 Angus Leeming <leeming@lyx.org>
* xformsImage.C (clip): cure compiler warnings.

View File

@ -27,10 +27,12 @@ Dialogs::~Dialogs()
Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
: document(lv, d),
file(lv, d),
:
#ifdef HAVE_LIBAIKSAURUS
thesaurus(lv, d),
#endif
document(lv, d),
forks(lv, d),
logfile(lv, d),
mathpanel(lv, d),
preamble(lv, d),
preferences(lv, d),
@ -38,11 +40,5 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
search(lv, d),
sendto(lv, d),
spellchecker(lv, d),
texinfo(lv, d),
#ifdef HAVE_LIBAIKSAURUS
thesaurus(lv, d),
#endif
vclogfile(lv, d)
texinfo(lv, d)
{}

View File

@ -21,24 +21,12 @@ void Dialogs::showDocument()
}
void Dialogs::showFile(string const & f)
{
pimpl_->file.controller().showFile(f);
}
void Dialogs::showForks()
{
pimpl_->forks.controller().show();
}
void Dialogs::showLogFile()
{
pimpl_->logfile.controller().show();
}
void Dialogs::showMathPanel()
{
pimpl_->mathpanel.controller().show();
@ -100,9 +88,3 @@ void Dialogs::showThesaurus(string const &)
{}
#endif
void Dialogs::showVCLogFile()
{
pimpl_->vclogfile.controller().show();
}

View File

@ -27,56 +27,41 @@
#include "ControlFloat.h"
#include "ControlGraphics.h"
#include "ControlInclude.h"
#include "ControlLog.h"
#include "ControlMinipage.h"
#include "ControlParagraph.h"
#include "ControlRef.h"
#include "ControlShowFile.h"
#include "ControlTabular.h"
#include "ControlTabularCreate.h"
#include "ControlToc.h"
#include "ControlVCLog.h"
#include "ControlWrap.h"
#include "FormAboutlyx.h"
#include "forms/form_aboutlyx.h"
#include "FormBibitem.h"
#include "forms/form_bibitem.h"
#include "FormBibtex.h"
#include "forms/form_bibtex.h"
#include "FormChanges.h"
#include "forms/form_changes.h"
#include "FormCharacter.h"
#include "forms/form_character.h"
#include "FormCitation.h"
#include "forms/form_citation.h"
#include "FormError.h"
#include "forms/form_error.h"
#include "FormERT.h"
#include "forms/form_ert.h"
#include "FormExternal.h"
#include "forms/form_external.h"
#include "FormFloat.h"
#include "forms/form_float.h"
#include "FormGraphics.h"
#include "forms/form_graphics.h"
#include "FormInclude.h"
#include "forms/form_include.h"
#include "FormLog.h"
#include "FormMinipage.h"
#include "forms/form_minipage.h"
#include "FormParagraph.h"
#include "forms/form_paragraph.h"
#include "FormRef.h"
#include "forms/form_ref.h"
#include "FormTabular.h"
#include "forms/form_tabular.h"
#include "FormShowFile.h"
#include "FormTabularCreate.h"
#include "forms/form_tabular_create.h"
#include "FormText.h"
#include "forms/form_text.h"
#include "FormToc.h"
#include "forms/form_toc.h"
#include "FormUrl.h"
#include "forms/form_url.h"
#include "FormVCLog.h"
#include "FormWrap.h"
#include "forms/form_wrap.h"
#include "xformsBC.h"
#include "ButtonController.h"
@ -85,9 +70,9 @@
namespace {
char const * const dialognames[] = { "about", "bibitem", "bibtex", "changes",
"character", "citation", "error", "ert", "external", "float", "graphics",
"include", "index", "label", "minipage", "paragraph", "ref", "tabular",
"tabularcreate", "toc", "url", "wrap" };
"character", "citation", "error", "ert", "external", "file", "float",
"graphics", "include", "index", "label", "log", "minipage", "paragraph",
"ref", "tabular", "tabularcreate", "toc", "url", "vclog", "wrap" };
char const * const * const end_dialognames =
dialognames + (sizeof(dialognames) / sizeof(char *));
@ -156,6 +141,10 @@ Dialog * Dialogs::build(string const & name)
dialog->setController(new ControlExternal(*dialog));
dialog->setView(new FormExternal(*dialog));
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
} else if (name == "file") {
dialog->setController(new ControlShowFile(*dialog));
dialog->setView(new FormShowFile(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "float") {
dialog->setController(new ControlFloat(*dialog));
dialog->setView(new FormFloat(*dialog));
@ -178,6 +167,10 @@ Dialog * Dialogs::build(string const & name)
dialog->setView(new FormText(*dialog,
_("Label"), _("Label:|#L")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "log") {
dialog->setController(new ControlLog(*dialog));
dialog->setView(new FormLog(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "minipage") {
dialog->setController(new ControlMinipage(*dialog));
dialog->setView(new FormMinipage(*dialog));
@ -206,6 +199,10 @@ Dialog * Dialogs::build(string const & name)
dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new FormUrl(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "vclog") {
dialog->setController(new ControlVCLog(*dialog));
dialog->setView(new FormVCLog(*dialog));
dialog->bc().bp(new OkCancelPolicy);
} else if (name == "wrap") {
dialog->setController(new ControlWrap(*dialog));
dialog->setView(new FormWrap(*dialog));

View File

@ -18,9 +18,6 @@
#include "xformsBC.h"
#include "combox.h"
#include "FormBrowser.h"
#include "forms/form_browser.h"
#include "ControlDocument.h"
#include "FormDocument.h"
#include "forms/form_document.h"
@ -29,12 +26,6 @@
#include "FormForks.h"
#include "forms/form_forks.h"
#include "ControlLog.h"
#include "FormLog.h"
#include "ControlShowFile.h"
#include "FormShowFile.h"
#include "ControlMath.h"
#include "FormMathsPanel.h"
#include "forms/form_maths_panel.h"
@ -73,21 +64,12 @@
#include "forms/form_thesaurus.h"
#endif
#include "ControlVCLog.h"
#include "FormVCLog.h"
typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
DocumentDialog;
typedef GUI<ControlShowFile, FormShowFile, OkCancelPolicy, xformsBC>
FileDialog;
typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
ForksDialog;
typedef GUI<ControlLog, FormLog, OkCancelPolicy, xformsBC>
LogFileDialog;
typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC>
MathPanelDialog;
@ -117,16 +99,11 @@ typedef GUI<ControlThesaurus, FormThesaurus, OkApplyCancelReadOnlyPolicy, xforms
ThesaurusDialog;
#endif
typedef GUI<ControlVCLog, FormVCLog, OkCancelPolicy, xformsBC>
VCLogFileDialog;
struct Dialogs::Impl {
Impl(LyXView & lv, Dialogs & d);
DocumentDialog document;
FileDialog file;
ForksDialog forks;
LogFileDialog logfile;
MathPanelDialog mathpanel;
PreambleDialog preamble;
PreferencesDialog preferences;
@ -139,8 +116,6 @@ struct Dialogs::Impl {
#ifdef HAVE_LIBAIKSAURUS
ThesaurusDialog thesaurus;
#endif
VCLogFileDialog vclogfile;
};
#endif // DIALOGS_IMPL_H

View File

@ -15,8 +15,9 @@
#include "forms/form_browser.h"
#include "xformsBC.h"
FormBrowser::FormBrowser(string const & t, bool allowResize)
: FormDB<FD_browser>(t, allowResize)
FormBrowser::FormBrowser(Dialog & parent,
string const & title, bool allowResize)
: FormView<FD_browser>(parent, title, allowResize)
{}

View File

@ -14,7 +14,7 @@
#define FORMBROWSER_H
#include "FormBase.h"
#include "FormDialogView.h"
/**
* This class provides an XForms implementation of a read only
@ -22,10 +22,10 @@
*/
struct FD_browser;
class FormBrowser : public FormDB<FD_browser> {
class FormBrowser : public FormView<FD_browser> {
public:
///
FormBrowser(string const &, bool allowResize = true);
FormBrowser(Dialog &, string const &, bool allowResize = true);
private:
/// Build the dialog.
virtual void build();

View File

@ -18,8 +18,8 @@
#include "gettext.h"
#include FORMS_H_LOCATION
FormLog::FormLog()
: FormCB<ControlLog, FormBrowser>( _("LaTeX Log"))
FormLog::FormLog(Dialog & parent)
: FormController<ControlLog, FormBrowser>(parent, _("LaTeX Log"))
{}

View File

@ -12,7 +12,6 @@
#ifndef FORMLOG_H
#define FORMLOG_H
#include "FormBrowser.h"
class ControlLog;
@ -21,10 +20,10 @@ class ControlLog;
* This class provides an XForms implementation of the LaTeX log dialog
* for viewing the last LaTeX log file.
*/
class FormLog : public FormCB<ControlLog, FormBrowser> {
class FormLog : public FormController<ControlLog, FormBrowser> {
public:
///
FormLog();
FormLog(Dialog &);
// Functions accessible to the Controller.

View File

@ -19,8 +19,8 @@
#include FORMS_H_LOCATION
FormShowFile::FormShowFile()
: FormCB<ControlShowFile, FormBrowser>(_("Show File"))
FormShowFile::FormShowFile(Dialog & parent)
: FormController<ControlShowFile, FormBrowser>(parent, _("Show File"))
{}

View File

@ -12,7 +12,6 @@
#ifndef FORMSHOWFILE_H
#define FORMSHOWFILE_H
#include "FormBrowser.h"
class ControlShowFile;
@ -21,10 +20,10 @@ class ControlShowFile;
* This class provides an XForms implementation of a dialog to browse through a
* Help file.
*/
class FormShowFile : public FormCB<ControlShowFile, FormBrowser> {
class FormShowFile : public FormController<ControlShowFile, FormBrowser> {
public:
///
FormShowFile();
FormShowFile(Dialog &);
// Functions accessible to the Controller.

View File

@ -20,8 +20,8 @@
#include FORMS_H_LOCATION
FormVCLog::FormVCLog()
: FormCB<ControlVCLog, FormBrowser>(_("Version Control Log"))
FormVCLog::FormVCLog(Dialog & parent)
: FormController<ControlVCLog, FormBrowser>(parent, _("Version Control Log"))
{}

View File

@ -21,10 +21,10 @@ class ControlVCLog;
* This class provides an XForms implementation of the Version Control
* log viewer
*/
class FormVCLog : public FormCB<ControlVCLog, FormBrowser> {
class FormVCLog : public FormController<ControlVCLog, FormBrowser> {
public:
///
FormVCLog();
FormVCLog(Dialog &);
// Functions accessible to the Controller.

View File

@ -64,7 +64,7 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_close
callback: C_FormBaseCancelCB
callback: C_FormDialogView_CancelCB
argument: 0
--------------------
@ -82,7 +82,7 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name: button_update
callback: C_FormBaseRestoreCB
callback: C_FormDialogView_RestoreCB
argument: 0
==============================

View File

@ -1202,7 +1202,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
case LFUN_VC_HISTORY:
{
owner->getDialogs().showVCLogFile();
owner->getDialogs().show("vclog");
break;
}
@ -1226,7 +1226,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
break;
case LFUN_LATEX_LOG:
owner->getDialogs().showLogFile();
owner->getDialogs().show("log");
break;
case LFUN_LAYOUT_DOCUMENT: