#include "GuiDialog.h"
#include "GuiView.h"
#include "qt_helpers.h"
+#include "FuncRequest.h"
+
+#include "insets/InsetCommand.h"
#include "support/debug.h"
namespace lyx {
namespace frontend {
-GuiDialog::GuiDialog(GuiView & lv, std::string const & name)
- : DialogView(lv, name), is_closing_(false)
+GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
+ : QDialog(&lv), Dialog(lv, name, "LyX: " + title), is_closing_(false)
{}
+void GuiDialog::closeEvent(QCloseEvent * ev)
+{
+ slotClose();
+ ev->accept();
+}
+
+
void GuiDialog::setButtonsValid(bool valid)
{
bc().setValid(valid);
is_closing_ = true;
apply();
is_closing_ = false;
- QDialog::hide();
+ hideView();
bc().ok();
}
void GuiDialog::slotClose()
{
- QDialog::hide();
+ hideView();
bc().cancel();
}
{
bc().setReadOnly(!enable);
bc().setValid(enable);
- DialogView::enableView(enable);
+ Dialog::enableView(enable);
}
setUpdatesEnabled(true);
}
-} // namespace frontend
-} // namespace lyx
-
/////////////////////////////////////////////////////////////////////
//
//
/////////////////////////////////////////////////////////////////////
-#include "FuncRequest.h"
-#include "insets/InsetCommand.h"
-
-using namespace std;
-
-namespace lyx {
-namespace frontend {
-GuiCommand::GuiCommand(GuiView & lv, string const & name)
- : GuiDialog(lv, name), params_(insetCode(name)), lfun_name_(name)
+GuiCommand::GuiCommand(GuiView & lv, QString const & name,
+ QString const & title)
+ : GuiDialog(lv, name, title), params_(insetCode(fromqstr(name))),
+ lfun_name_(fromqstr(name))
{
}