]> git.lyx.org Git - lyx.git/blobdiff - src/LyX.cpp
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / LyX.cpp
index 4d8f10eafbef16e142835423185642c5822dc3e1..c2b2b62845a7aa75f16a24a6cb16a3810afa5283 100644 (file)
@@ -46,6 +46,7 @@
 
 #include "frontends/alert.h"
 #include "frontends/Application.h"
+#include "frontends/Dialogs.h"
 #include "frontends/Gui.h"
 #include "frontends/LyXView.h"
 
@@ -363,7 +364,7 @@ void LyX::setGuiLanguage(std::string const & language)
 
 Buffer const * const LyX::updateInset(Inset const * inset) const
 {
-       if (!inset)
+       if (quitting || !inset)
                return 0;
 
        Buffer const * buffer_ptr = 0;
@@ -380,6 +381,20 @@ Buffer const * const LyX::updateInset(Inset const * inset) const
 }
 
 
+void LyX::hideDialogs(std::string const & name, Inset * inset) const
+{
+       if (quitting || !use_gui)
+               return;
+
+       vector<int> const & view_ids = pimpl_->application_->gui().viewIds();
+       vector<int>::const_iterator it = view_ids.begin();
+       vector<int>::const_iterator const end = view_ids.end();
+       for (; it != end; ++it)
+               pimpl_->application_->gui().view(*it).getDialogs().
+                       hide(name, inset);
+}
+
+
 int LyX::exec(int & argc, char * argv[])
 {
        // Here we need to parse the command line. At least
@@ -398,6 +413,10 @@ int LyX::exec(int & argc, char * argv[])
                }
        }
 
+       // Reinit the messages machinery in case package() knows
+       // something interesting about the locale directory.
+       Messages::init();
+
        if (!use_gui) {
                // FIXME: create a ConsoleApplication
                int exit_status = init(argc, argv);
@@ -613,7 +632,7 @@ void LyX::restoreGuiSession()
        if (!pimpl_->files_to_load_.empty()) {
                for_each(pimpl_->files_to_load_.begin(),
                        pimpl_->files_to_load_.end(),
-                       bind(&LyXView::loadLyXFile, view, _1, true));
+                       bind(&LyXView::loadLyXFile, view, _1, true, false, false));
                // clear this list to save a few bytes of RAM
                pimpl_->files_to_load_.clear();
                pimpl_->session_->lastOpened().clear();
@@ -628,7 +647,7 @@ void LyX::restoreGuiSession()
        // last session, and should be already there (regular files), or should
        // not be added at all (help files).
        for_each(lastopened.begin(), lastopened.end(),
-               bind(&LyXView::loadLyXFile, view, _1, false));
+               bind(&LyXView::loadLyXFile, view, _1, false, false, false));
 
        // clear this list to save a few bytes of RAM
        pimpl_->session_->lastOpened().clear();