]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
* GuiDocument.cpp:
[lyx.git] / src / LyXFunc.cpp
index 256f136dc8ca63304a0e555334c7639bed110122..29d4db283267782891ecfe519fd6a7ac3f986abc 100644 (file)
@@ -265,7 +265,7 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
                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));
@@ -408,9 +408,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
 
        switch (cmd.action) {
        case LFUN_UNKNOWN_ACTION:
-#if !defined(HAVE_LIBMYTHES) && !defined(HAVE_LIBAIKSAURUS)
-       case LFUN_THESAURUS_ENTRY:
-#endif
                flag.unknown(true);
                flag.setEnabled(false);
                break;
@@ -474,6 +471,10 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        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;
@@ -566,9 +567,11 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                        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;
@@ -1046,6 +1049,22 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        }
                        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();
@@ -1081,7 +1100,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        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
@@ -1132,6 +1155,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        case INDEX_CODE:
                        case LABEL_CODE:
                        case NOMENCL_CODE:
+                       case NOMENCL_PRINT_CODE:
                        case REF_CODE:
                        case TOC_CODE:
                        case HYPERLINK_CODE: {
@@ -2013,6 +2037,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        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: