]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
cleanup and reorder initialisation code of GuiView and GuiToolbars. Move some things...
[lyx.git] / src / LyXFunc.cpp
index a743fd261a3ed33fd599e246ca17c5590b1a3cc8..ca9428fc26b070749b5aca48399b1800ce9b8820 100644 (file)
@@ -609,7 +609,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
        }
 
        case LFUN_DIALOG_TOGGLE:
-               flag.setOnOff(lyx_view_->isDialogVisible(cmd.getArg(0)));
+               flag.setOnOff(lyx_view_?
+                       lyx_view_->isDialogVisible(cmd.getArg(0)) : false);
                // fall through to set "enable"
        case LFUN_DIALOG_SHOW: {
                string const name = cmd.getArg(0);
@@ -695,7 +696,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                break;
 
        case LFUN_TOOLBAR_TOGGLE: {
-               bool const current = lyx_view_->isToolbarVisible(cmd.getArg(0));
+               bool const current = lyx_view_?
+                       lyx_view_->isToolbarVisible(cmd.getArg(0)) : false;
                flag.setOnOff(current);
                break;
        }
@@ -1080,7 +1082,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");
+                               lyx_view_->showDialog("sendto", string());
                        else
                                lyx_view_->buffer()->doExport(argument, false);
                        break;
@@ -1423,7 +1425,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        if (name == "character") {
                                data = freefont2string();
                                if (!data.empty())
-                                       lyx_view_->showDialogWithData("character", data);
+                                       lyx_view_->showDialog("character", data);
                        } else if (name == "latexlog") {
                                Buffer::LogType type; 
                                string const logfile = lyx_view_->buffer()->logName(&type);
@@ -1436,13 +1438,13 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                        break;
                                }
                                data += Lexer::quoteString(logfile);
-                               lyx_view_->showDialogWithData("log", data);
+                               lyx_view_->showDialog("log", data);
                        } else if (name == "vclog") {
                                string const data = "vc " +
                                        Lexer::quoteString(lyx_view_->buffer()->lyxvc().getLogFile());
-                               lyx_view_->showDialogWithData("log", data);
+                               lyx_view_->showDialog("log", data);
                        } else
-                               lyx_view_->showDialogWithData(name, data);
+                               lyx_view_->showDialog(name, data);
                        break;
                }