2 * \file InsetDialog.cpp
\r
3 * This file is part of LyX, the document processor.
\r
4 * Licence details can be found in the file COPYING.
\r
6 * \author Abdelrazak Younes
\r
8 * Full author contact details are available in file CREDITS.
\r
13 #include "InsetDialog.h"
\r
15 #include "qt_helpers.h"
\r
18 #include "buffer_funcs.h"
\r
19 #include "BufferParams.h"
\r
20 #include "BufferView.h"
\r
22 #include "FuncRequest.h"
\r
24 #include "support/debug.h"
\r
25 #include "support/lstrings.h"
\r
27 using namespace std;
\r
28 using namespace lyx::support;
\r
31 namespace frontend {
\r
33 /////////////////////////////////////////////////////////////////
\r
35 // InsetDialog::Private
\r
37 /////////////////////////////////////////////////////////////////
\r
39 struct InsetDialog::Private
\r
41 Private(InsetCode code, FuncCode creation_code)
\r
42 : inset_code_(code), creation_code_(creation_code)
\r
47 InsetCode inset_code_;
\r
49 FuncCode creation_code_;
\r
52 /////////////////////////////////////////////////////////////////
\r
56 /////////////////////////////////////////////////////////////////
\r
58 InsetDialog::InsetDialog(GuiView & lv, InsetCode code, FuncCode creation_code,
\r
59 char const * name, char const * display_name)
\r
60 : DialogView(lv, name, qt_(display_name)), d(new Private(code, creation_code))
\r
65 void InsetDialog::on_closePB_clicked()
\r
71 void InsetDialog::on_newPB_clicked()
\r
73 docstring const argument = dialogToParams();
\r
74 dispatch(FuncRequest(d->creation_code_, argument));
\r
78 void InsetDialog::applyView()
\r
80 if (!checkWidgets())
\r
83 Inset const * i = inset(d->inset_code_);
\r
87 docstring const argument = dialogToParams();
\r
88 if (!i->validateModifyArgument(argument))
\r
91 dispatch(FuncRequest(LFUN_INSET_MODIFY, argument));
\r
95 void InsetDialog::updateView()
\r
97 Inset const * i = inset(d->inset_code_);
\r
103 //FIXME: the newPB push button cannot be accessed here and so cannot be
\r
106 docstring const argument = dialogToParams();
\r
108 getStatus(FuncRequest(LFUN_INSET_MODIFY, argument).enabled());
\r
112 } // namespace frontend
\r
115 #include "moc_InsetDialog.cpp"
\r