2 * \file qt2/Alert_pimpl.C
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
11 #include <qmessagebox.h>
13 #include <qlineedit.h>
14 #include "ui/QAskForTextDialog.h"
16 #include FORMS_H_LOCATION
23 #include "Alert_pimpl.h"
24 #include "xforms_helpers.h"
29 void alert_pimpl(string const & s1, string const & s2, string const & s3)
31 QMessageBox::warning(0, "LyX", (s1 + "\n" + "\n" + s2 + "\n" + s3).c_str());
35 bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3)
37 return !(QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
38 _("&Yes"), _("&No"), 0, 1));
42 int askConfirmation_pimpl(string const & s1, string const & s2, string const & s3)
44 return (QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
45 _("&Yes"), _("&No"), _("&Cancel"), 0, 2)) + 1;
49 pair<bool, string> const askForText_pimpl(string const & msg, string const & dflt)
51 string title = _("LyX: ");
54 QAskForTextDialog d(0, msg.c_str(), true);
56 d.askLA->setText((string("&") + msg).c_str());
57 d.askLE->setText(dflt.c_str());
63 return make_pair<bool, string>(true, d.askLE->text().latin1());
65 return make_pair<bool, string>(false, string());