http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg145723.html
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27197
a592a061-630c-0410-9148-
cb99ea01b6c8
docstring response;
bool ok = Alert::askForText(response, _("LyX VC: Initial description"),
_("(no initial description)"));
- if (!ok || response.empty()) {
- // should we insist on checking response.empty()?
+ if (!ok) {
LYXERR(Debug::LYXVC, "LyXVC: user cancelled");
return;
}
-
+ if (response.empty())
+ response = _("(no initial description)");
vcs->registrer(to_utf8(response));
}
*/
void information(docstring const & title, docstring const & message);
-/// Asks for a text. DO NOT USE !!
+/**
+ * Asks for a text. Returns true for OK. Obtained message is in response
+ * (even empty string). dflt stands for default message in the dialog.
+ */
bool askForText(docstring & response, docstring const & msg,
docstring const & dflt = docstring());
QLineEdit::Normal,
toqstr(dflt), &ok);
- if (ok && !text.isEmpty()) {
+ if (ok) {
response = qstring_to_ucs4(text);
return true;
}