]> git.lyx.org Git - features.git/commitdiff
Fix http://bugzilla.lyx.org/show_bug.cgi?id=5430 .
authorPavel Sanda <sanda@lyx.org>
Thu, 30 Oct 2008 13:47:41 +0000 (13:47 +0000)
committerPavel Sanda <sanda@lyx.org>
Thu, 30 Oct 2008 13:47:41 +0000 (13:47 +0000)
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

src/LyXVC.cpp
src/frontends/alert.h
src/frontends/qt4/GuiAlert.cpp

index 7f5beea70469da18e83b83497f21adf1b002ede0..770706c3e5eca8aa816b75c725eccdb943edd9d0 100644 (file)
@@ -132,12 +132,12 @@ void LyXVC::registrer()
        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));
 }
 
index 004a17988578e52b04118e91dcfb25ed32883a41..b4e123731c0878cfb4d303578fbf20bb1c2a422d 100644 (file)
@@ -54,7 +54,10 @@ void error(docstring const & title, docstring const & message);
  */
 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());
 
index 75da5ee21e2a8c766378bbfcd2070f959865bdc8..e399835a7bf8073a4bfbc9ec6d64056e229e4e6c 100644 (file)
@@ -236,7 +236,7 @@ bool askForText(docstring & response, docstring const & msg,
                QLineEdit::Normal,
                toqstr(dflt), &ok);
 
-       if (ok && !text.isEmpty()) {
+       if (ok) {
                response = qstring_to_ucs4(text);
                return true;
        }