]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Simplify image creation with a new factory function: newImage().
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index ebebce3b7886dcd54df183a7eceba743838716f5..13475a28cb8b42f8215e59ae41d054733d15793b 100644 (file)
@@ -693,10 +693,6 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
 
        connect(this, SIGNAL(lastWindowClosed()), this, SLOT(onLastWindowClosed()));
 
-       using namespace lyx::graphics;
-
-       Image::newImage = boost::bind(&GuiImage::newImage);
-
        // needs to be done before reading lyxrc
        QWidget w;
        lyxrc.dpi = (w.logicalDpiX() + w.logicalDpiY()) / 2;
@@ -895,14 +891,24 @@ void GuiApplication::resetGui()
                // Gives some error box here.
                return;
 
+#ifdef Q_WS_MACX
+       d->global_menubar_->clear();
+       delete d->global_menubar_;
+       // Create the global default menubar which is shown for the dialogs
+       // and if no GuiView is visible.
+       d->global_menubar_ = new GlobalMenuBar();
+
        // init the global menubar on Mac. This must be done after the session
        // was recovered to know the "last files".
-       if (d->global_menubar_)
-               d->menus_.fillMenuBar(d->global_menubar_, 0, true);
+       d->menus_.fillMenuBar(d->global_menubar_, 0, true);
+#endif
 
        QHash<int, GuiView *>::iterator it;
-       for (it = d->views_.begin(); it != d->views_.end(); ++it)
-               (*it)->resetDialogs();
+       for (it = d->views_.begin(); it != d->views_.end(); ++it) {
+               GuiView * gv = *it;
+               gv->setLayoutDirection(layoutDirection());
+               gv->resetDialogs();
+       }
 
        dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
 }
@@ -1044,11 +1050,11 @@ void GuiApplication::setGuiLanguage()
                        QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
                LYXERR(Debug::LOCALE, "Could not find  Qt translations for locale "
                        << language_name);
+       } else {
+               LYXERR(Debug::LOCALE, "Successfully installed Qt translations for locale "
+                       << language_name);
        }
 
-       LYXERR(Debug::LOCALE, "Successfully installed Qt translations for locale "
-               << language_name);
-
        switch (default_locale.language()) {
        case QLocale::Arabic :
        case QLocale::Hebrew :