dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"));
// if the current buffer is not that one, switch to it.
- if (lyx_view_->buffer()->fileName() != tmp.filename) {
+ if (!lyx_view_->buffer() || lyx_view_->buffer()->fileName() != tmp.filename) {
if (!switchToBuffer)
return;
dispatch(FuncRequest(LFUN_BUFFER_SWITCH, file));
case LFUN_VC_CHECK_OUT:
enable = buf->lyxvc().checkOutEnabled();
break;
+ case LFUN_VC_LOCKING_TOGGLE:
+ enable = !buf->isReadonly() && buf->lyxvc().lockingToggleEnabled();
+ flag.setOnOff(enable && !buf->lyxvc().locker().empty());
+ break;
case LFUN_VC_REVERT:
enable = buf->lyxvc().inUse();
break;
flag = getStatus(func);
theTopLevelCmdDef().release(name);
} else {
- // catch recursion or unknown command definiton
- // all operations until the recursion or unknown command
- // definiton occures are performed, so set the state to enabled
+ // catch recursion or unknown command
+ // definition. all operations until the
+ // recursion or unknown command definition
+ // occurs are performed, so set the state to
+ // enabled
enable = true;
}
break;
}
break;
+ case LFUN_VC_LOCKING_TOGGLE:
+ LASSERT(lyx_view_ && buffer, /**/);
+ if (!ensureBufferClean(view()) || buffer->isReadonly())
+ break;
+ if (buffer->lyxvc().inUse()) {
+ string res = buffer->lyxvc().lockingToggle();
+ if (res.empty())
+ frontend::Alert::error(_("Revision control error."),
+ _("Error when setting the locking property."));
+ else {
+ setMessage(from_utf8(res));
+ reloadBuffer();
+ }
+ }
+ break;
+
case LFUN_VC_REVERT:
LASSERT(lyx_view_ && buffer, /**/);
buffer->lyxvc().revert();
bool loaded = false;
string const abstmp = package().temp_dir().absFilename();
string const realtmp = package().temp_dir().realPath();
- if (prefixIs(file_name, abstmp) || prefixIs(file_name, realtmp)) {
+ // We have to use os::path_prefix_is() here, instead of
+ // simply prefixIs(), because the file name comes from
+ // an external application and may need case adjustment.
+ if (os::path_prefix_is(file_name, abstmp, os::CASE_ADJUSTED)
+ || os::path_prefix_is(file_name, realtmp, os::CASE_ADJUSTED)) {
// Needed by inverse dvi search. If it is a file
// in tmpdir, call the apropriated function.
// If tmpdir is a symlink, we may have the real
case LyXRC::RC_SORT_LAYOUTS:
case LyXRC::RC_FULL_SCREEN_LIMIT:
case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
+ case LyXRC::RC_FULL_SCREEN_MENUBAR:
case LyXRC::RC_FULL_SCREEN_TABBAR:
case LyXRC::RC_FULL_SCREEN_TOOLBARS:
case LyXRC::RC_FULL_SCREEN_WIDTH: