void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
{
LASSERT(lyx_view_, /**/);
- if (!LyX::ref().session().bookmarks().isValid(idx))
+ if (!theSession().bookmarks().isValid(idx))
return;
- BookmarksSection::Bookmark const & bm = LyX::ref().session().bookmarks().bookmark(idx);
+ BookmarksSection::Bookmark const & bm = theSession().bookmarks().bookmark(idx);
LASSERT(!bm.filename.empty(), /**/);
string const file = bm.filename.absFilename();
// if the file is not opened, open it.
enable = !buf->lyxvc().inUse();
break;
case LFUN_VC_CHECK_IN:
- enable = buf->lyxvc().inUse() && !buf->isReadonly();
+ enable = buf->lyxvc().checkInEnabled();
break;
case LFUN_VC_CHECK_OUT:
- enable = buf->lyxvc().inUse() && buf->isReadonly();
+ enable = buf->lyxvc().checkOutEnabled();
break;
case LFUN_VC_REVERT:
- case LFUN_VC_UNDO_LAST:
enable = buf->lyxvc().inUse();
break;
+ case LFUN_VC_UNDO_LAST:
+ enable = buf->lyxvc().undoLastEnabled();
+ break;
case LFUN_BUFFER_RELOAD:
enable = !buf->isUnnamed() && buf->fileName().exists()
&& (!buf->isClean() || buf->isExternallyModified(Buffer::timestamp_method));
case LFUN_BOOKMARK_GOTO: {
const unsigned int num = convert<unsigned int>(to_utf8(cmd.argument()));
- enable = LyX::ref().session().bookmarks().isValid(num);
+ enable = theSession().bookmarks().isValid(num);
break;
}
case LFUN_BOOKMARK_CLEAR:
- enable = LyX::ref().session().bookmarks().size() > 0;
+ enable = theSession().bookmarks().size() > 0;
break;
// this one is difficult to get right. As a half-baked
case LFUN_CALL: {
FuncRequest func;
string name = to_utf8(cmd.argument());
- if (LyX::ref().topLevelCmdDef().lock(name, func)) {
+ if (theTopLevelCmdDef().lock(name, func)) {
func.origin = cmd.origin;
flag = getStatus(func);
- LyX::ref().topLevelCmdDef().release(name);
+ theTopLevelCmdDef().release(name);
} else {
// catch recursion or unknown command definiton
// all operations until the recursion or unknown command
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
if (!ensureBufferClean(view()))
break;
- if (lyx_view_->buffer()->lyxvc().inUse()
- && lyx_view_->buffer()->isReadonly()) {
+ if (lyx_view_->buffer()->lyxvc().inUse()) {
lyx_view_->buffer()->lyxvc().checkOut();
reloadBuffer();
}
case LFUN_CALL: {
FuncRequest func;
- if (LyX::ref().topLevelCmdDef().lock(argument, func)) {
+ if (theTopLevelCmdDef().lock(argument, func)) {
func.origin = cmd.origin;
dispatch(func);
- LyX::ref().topLevelCmdDef().release(argument);
+ theTopLevelCmdDef().release(argument);
} else {
if (func.action == LFUN_UNKNOWN_ACTION) {
// unknown command definition
actOnUpdatedPrefs(lyxrc_orig, lyxrc);
- // Set the language defined by the user.
- LyX::ref().setRcGuiLanguage();
-
theApp()->resetGui();
/// We force the redraw in any case because there might be
break;
case LFUN_BOOKMARK_CLEAR:
- LyX::ref().session().bookmarks().clear();
+ theSession().bookmarks().clear();
break;
default:
case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
case LyXRC::RC_LANGUAGE_PACKAGE:
case LyXRC::RC_LANGUAGE_USE_BABEL:
+ case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
case LyXRC::RC_MACRO_EDIT_STYLE:
case LyXRC::RC_MAKE_BACKUP:
case LyXRC::RC_MARK_FOREIGN_LANGUAGE: