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"
28 void alert_pimpl(string const & s1, string const & s2, string const & s3)
30 QMessageBox::warning(0, "LyX", (s1 + "\n" + "\n" + s2 + "\n" + s3).c_str());
34 bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3)
36 return !(QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
37 _("&Yes"), _("&No"), 0, 1));
41 int askConfirmation_pimpl(string const & s1, string const & s2, string const & s3)
43 return (QMessageBox::information(0, "LyX", (s1 + "\n" + s2 + "\n" + s3).c_str(),
44 _("&Yes"), _("&No"), _("&Cancel"), 0, 2)) + 1;
48 pair<bool, string> const askForText_pimpl(string const & msg, string const & dflt)
50 string title = _("LyX: ");
53 QAskForTextDialog d(0, msg.c_str(), true);
55 d.askLA->setText((string("&") + msg).c_str());
56 d.askLE->setText(dflt.c_str());
62 return make_pair<bool, string>(true, d.askLE->text().latin1());
64 return make_pair<bool, string>(false, string());