mere two functions

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20670 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-10-02 21:01:25 +00:00
parent 19ab5ceef9
commit 8279ab9cf0
3 changed files with 13 additions and 30 deletions

View File

@ -48,20 +48,6 @@ Dialog * Dialogs::find_or_build(string const & name)
} }
void Dialogs::show(string const & name, string const & data)
{
if (in_show_)
return;
in_show_ = true;
Dialog * dialog = find_or_build(name);
if (dialog)
dialog->showData(data);
in_show_ = false;
}
void Dialogs::show(string const & name, string const & data, Inset * inset) void Dialogs::show(string const & name, string const & data, Inset * inset)
{ {
if (in_show_) if (in_show_)
@ -71,6 +57,7 @@ void Dialogs::show(string const & name, string const & data, Inset * inset)
Dialog * dialog = find_or_build(name); Dialog * dialog = find_or_build(name);
if (dialog) { if (dialog) {
dialog->showData(data); dialog->showData(data);
if (inset)
open_insets_[name] = inset; open_insets_[name] = inset;
} }
in_show_ = false; in_show_ = false;

View File

@ -52,30 +52,25 @@ public:
void hideBufferDependent() const; void hideBufferDependent() const;
/** Update visible, buffer-dependent dialogs /** Update visible, buffer-dependent dialogs
If the bool is true then a buffer change has occurred If the bool is true then a buffer change has occurred
else its still the same buffer. else it is still the same buffer.
*/ */
void updateBufferDependent(bool) const ; void updateBufferDependent(bool) const;
/** \param name == "about" etc; an identifier used to
launch a particular dialog.
\param data is a string encoding of the data used to populate
the dialog. Several of these dialogs do not need any data,
so it defaults to string().
*/
void show(std::string const & name, std::string const & data = std::string());
/** \param name == "bibtex", "citation" etc; an identifier used to /** \param name == "bibtex", "citation" etc; an identifier used to
launch a particular dialog. launch a particular dialog.
\param data is a string representation of the Inset contents. \param data is a string representation of the Inset contents.
It is often little more than the output from Inset::write. It is often little more than the output from Inset::write.
It is passed to, and parsed by, the frontend dialog. It is passed to, and parsed by, the frontend dialog.
\param inset is _not_ passed to the frontend dialog. Several of these dialogs do not need any data,
so it defaults to string().
\param inset ownership is _not_ passed to the frontend dialog.
It is stored internally and used by the kernel to ascertain It is stored internally and used by the kernel to ascertain
what to do with the FuncRequest dispatched from the frontend what to do with the FuncRequest dispatched from the frontend
dialog on 'Apply'; should it be used to create a new inset at dialog on 'Apply'; should it be used to create a new inset at
the current cursor position or modify an existing, 'open' inset? the current cursor position or modify an existing, 'open' inset?
*/ */
void show(std::string const & name, std::string const & data, Inset * inset); void show(std::string const & name,
std::string const & data = std::string(), Inset * inset = 0);
/** \param name == "citation", "bibtex" etc; an identifier used /** \param name == "citation", "bibtex" etc; an identifier used
to update the contents of a particular dialog with \param data. to update the contents of a particular dialog with \param data.

View File

@ -77,9 +77,10 @@ namespace frontend {
namespace { namespace {
//This list should be kept in sync with the list of insets in src/insets/Inset.cpp. // This list should be kept in sync with the list of insets in
//I.e., if a dialog goes with an inset, the dialog should have the same name as the // src/insets/Inset.cpp. I.e., if a dialog goes with an inset, the
//inset. // dialog should have the same name as the inset.
char const * const dialognames[] = { char const * const dialognames[] = {
"aboutlyx", "bibitem", "bibtex", "box", "branch", "changes", "character", "aboutlyx", "bibitem", "bibtex", "box", "branch", "changes", "character",
"citation", "document", "embedding", "errorlist", "ert", "external", "file", "citation", "document", "embedding", "errorlist", "ert", "external", "file",