Dot not swallow log messages

This commit is contained in:
Georg Baum 2013-02-03 19:21:54 +01:00
parent e82cc5d498
commit 1a48d5a967
3 changed files with 12 additions and 10 deletions

View File

@ -2253,8 +2253,11 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
switch (func.action()) {
case LFUN_BUFFER_TOGGLE_READ_ONLY:
if (lyxvc().inUse())
lyxvc().toggleReadOnly();
if (lyxvc().inUse()) {
string log = lyxvc().toggleReadOnly();
if (!log.empty())
dr.setMessage(log);
}
else
setReadonly(!isReadonly());
break;

View File

@ -259,25 +259,24 @@ void LyXVC::undoLast()
}
void LyXVC::toggleReadOnly()
string LyXVC::toggleReadOnly()
{
if (!vcs)
return;
return string();
if (!vcs->toggleReadOnlyEnabled())
return;
return string();
switch (vcs->status()) {
case VCS::UNLOCKED:
LYXERR(Debug::LYXVC, "LyXVC: toggle to locked");
checkOut();
break;
return checkOut();
case VCS::LOCKED:
LYXERR(Debug::LYXVC, "LyXVC: toggle to unlocked");
checkIn();
break;
return checkIn();
case VCS::NOLOCKING:
break;
}
return string();
}

View File

@ -135,7 +135,7 @@ public:
* keep things in synchro once we would allow user to toggle
* read-only flags.
*/
void toggleReadOnly();
std::string toggleReadOnly();
/// Is the document under administration by VCS?
bool inUse() const;