]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
* There are cases where updateLabels is not called because no
[lyx.git] / src / LyXFunc.cpp
index dfde956fb6230b25ee2549b0119bd02764c21153..31644b10b9cd31f3ad915b96b6813020243b7944 100644 (file)
@@ -77,7 +77,6 @@
 #include "frontends/alert.h"
 #include "frontends/Application.h"
 #include "frontends/FileDialog.h"
-#include "frontends/FontLoader.h"
 #include "frontends/KeySymbol.h"
 #include "frontends/LyXView.h"
 #include "frontends/Selection.h"
@@ -513,6 +512,15 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        case LFUN_DIALOG_TOGGLE:
        case LFUN_DIALOG_SHOW:
        case LFUN_DIALOG_UPDATE:
+               if (cmd.argument() == "prefs"
+                   || cmd.argument() == "aboutlyx")
+                       enable = true;
+               else if (lyx_view_)
+                       return lyx_view_->getStatus(cmd);
+               else
+                       enable = false;
+               break;
+
        case LFUN_TOOLBAR_TOGGLE:
        case LFUN_INSET_APPLY:
        case LFUN_BUFFER_WRITE:
@@ -571,7 +579,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        }
        
        // This could be used for the no-GUI version. The GUI version is handled in
-       // LyXView::getStatus().
+       // LyXView::getStatus(). See above.
        /*
        case LFUN_BUFFER_WRITE:
        case LFUN_BUFFER_WRITE_AS: {
@@ -1650,6 +1658,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        TextClassPtr oldClass = buffer->params().getTextClassPtr();
                        view()->cursor().recordUndoFullDocument();
                        buffer->params().clearLayoutModules();
+                       buffer->params().makeTextClass();
                        updateLayout(oldClass, buffer);
                        updateFlags = Update::Force | Update::FitCursor;
                        break;
@@ -1661,6 +1670,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        TextClassPtr oldClass = buffer->params().getTextClassPtr();
                        view()->cursor().recordUndoFullDocument();
                        buffer->params().addLayoutModule(argument);
+                       buffer->params().makeTextClass();
                        updateLayout(oldClass, buffer);
                        updateFlags = Update::Force | Update::FitCursor;
                        break;
@@ -1689,6 +1699,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        TextClassPtr oldClass = buffer->params().getTextClassPtr();
                        view()->cursor().recordUndoFullDocument();
                        buffer->params().setBaseClass(new_class);
+                       buffer->params().makeTextClass();
                        updateLayout(oldClass, buffer);
                        updateFlags = Update::Force | Update::FitCursor;
                        break;
@@ -1701,6 +1712,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        textclass_type const tc = buffer->params().getBaseClass();
                        textclasslist.reset(tc);
                        buffer->params().setBaseClass(tc);
+                       buffer->params().makeTextClass();
                        updateLayout(oldClass, buffer);
                        updateFlags = Update::Force | Update::FitCursor;
                        break;
@@ -1738,6 +1750,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_BOOKMARK_GOTO:
                        // go to bookmark, open unopened file and switch to buffer if necessary
                        gotoBookmark(convert<unsigned int>(to_utf8(cmd.argument())), true, true);
+                       updateFlags = Update::FitCursor;
                        break;
 
                case LFUN_BOOKMARK_CLEAR:
@@ -1790,7 +1803,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        if (flag.enabled()
                            && !lyxaction.funcHasFlag(action, LyXAction::NoBuffer)
                            && !lyxaction.funcHasFlag(action, LyXAction::ReadOnly))
-                               lyx_view_->buffer()->markDirty();
+                               lyx_view_->buffer()->markDirty();                       
 
                        //Do we have a selection?
                        theSelection().haveSelection(view()->cursor().selection());
@@ -1916,8 +1929,9 @@ void LyXFunc::open(string const & fname)
                filename = fname;
 
        // get absolute path of file and add ".lyx" to the filename if
-       // necessary
-       FileName const fullname = fileSearch(string(), filename, "lyx");
+       // necessary. 
+       FileName const fullname = 
+                       fileSearch(string(), filename, "lyx", support::may_not_exist);
        if (!fullname.empty())
                filename = fullname.absFilename();
 
@@ -2196,8 +2210,10 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
        case LyXRC::RC_LANGUAGE_PACKAGE:
        case LyXRC::RC_LANGUAGE_USE_BABEL:
+       case LyXRC::RC_MACRO_EDIT_STYLE:
        case LyXRC::RC_MAKE_BACKUP:
        case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
+       case LyXRC::RC_MOUSE_WHEEL_SPEED:
        case LyXRC::RC_NUMLASTFILES:
        case LyXRC::RC_PATH_PREFIX:
                if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
@@ -2257,6 +2273,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_USE_ESC_CHARS:
        case LyXRC::RC_USE_INP_ENC:
        case LyXRC::RC_USE_PERS_DICT:
+       case LyXRC::RC_USE_TOOLTIP:
        case LyXRC::RC_USE_PIXMAP_CACHE:
        case LyXRC::RC_USE_SPELL_LIB:
        case LyXRC::RC_VIEWDVI_PAPEROPTION: