]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
Move Dialog.{h,cpp} and ButtonPolicy.{h,cpp} to frontends/qt4/
[lyx.git] / src / LyXFunc.cpp
index 8960b102544a7853e96a442d3db7d9060410f3cb..ee89ed58a651fb9c8bb8b831d72849e60e77a660 100644 (file)
@@ -487,17 +487,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        //lyxerr << "LyXFunc::getStatus: cmd: " << cmd << endl;
        FuncStatus flag;
 
-       /* In LyX/Mac, when a dialog is open, the menus of the
-          application can still be accessed without giving focus to
-          the main window. In this case, we want to disable the menu
-          entries that are buffer-related.
-
-          Note that this code is not perfect, as bug 1941 attests:
-          http://bugzilla.lyx.org/show_bug.cgi?id=1941#c4
-       */
        Buffer * buf = lyx_view_? lyx_view_->buffer() : 0;
-       if (lyx_view_ && cmd.origin == FuncRequest::MENU && !lyx_view_->hasFocus())
-               buf = 0;
 
        if (cmd.action == LFUN_NOACTION) {
                flag.message(from_utf8(N_("Nothing to do")));
@@ -885,6 +875,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_DIALOG_TOGGLE:
                case LFUN_DIALOG_DISCONNECT_INSET:
                case LFUN_DIALOG_HIDE:
+               case LFUN_DIALOG_SHOW:
                        BOOST_ASSERT(lyx_view_);
                        lyx_view_->dispatch(cmd);
                        break;
@@ -1048,7 +1039,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_BUFFER_EXPORT:
                        BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
                        if (argument == "custom")
-                               lyx_view_->showDialog("sendto", string());
+                               dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto"));
                        else
                                lyx_view_->buffer()->doExport(argument, false);
                        break;
@@ -1477,7 +1468,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                break;
                        } // end switch(code)
                        if (insetCodeOK)
-                               lyx_view_->showDialog(name, data, 0);
+                               dispatch(FuncRequest(LFUN_DIALOG_SHOW, name + " " + data));
                        break;
                }
 
@@ -1888,8 +1879,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                        actOnUpdatedPrefs(lyxrc_orig, lyxrc);
 
-                       if (lyx_view_ && lyx_view_->buffer())
-                               lyx_view_->updateLayoutChoice(true);
+                       theApp()->resetGui();
 
                        /// We force the redraw in any case because there might be
                        /// some screen font changes.
@@ -1940,7 +1930,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        // (at least partially) visible top-level paragraphs.
                        // We will redraw the screen only if needed.
                        view()->processUpdateFlags(updateFlags);
-                       lyx_view_->updateStatusBar();
 
                        // if we executed a mutating lfun, mark the buffer as dirty
                        if (flag.enabled()
@@ -1952,12 +1941,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        theSelection().haveSelection(view()->cursor().selection());
 
                        if (view()->cursor().inTexted()) {
-                               lyx_view_->updateLayoutChoice(false);
                        }
                }
        }
        if (!quitting && lyx_view_) {
-               lyx_view_->updateToolbars();
                // Some messages may already be translated, so we cannot use _()
                sendDispatchMessage(translateIfPossible(getMessage()), cmd);
        }
@@ -2070,7 +2057,6 @@ Buffer * LyXFunc::loadAndViewFile(FileName const & filename, bool tolastfiles)
 
        if (!newBuffer) {
                lyx_view_->message(_("Document not loaded."));
-               lyx_view_->updateStatusBar();
                lyx_view_->setBusy(false);
                return 0;
        }