]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
* activate the view from the constructor. This makes sure that the
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index b3ba440f41beaea0864fbe553f20d1e3322b0f84..69e5f09a28b06979f2409e807f456a75494e25bd 100644 (file)
@@ -161,9 +161,9 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
        QCoreApplication::setOrganizationDomain("lyx.org");
        QCoreApplication::setApplicationName(app_name + "-" + lyx_version);
 
-       //FIXME: quitOnLastWindowClosed is true by default, at least on Windows and
-       // X11 platforms. We should have a lyxrc setting for this in order to let the
-       // application stay resident.
+       // FIXME: quitOnLastWindowClosed is true by default. We should have a
+       // lyxrc setting for this in order to let the application stay resident.
+       // But then we need some kind of dock icon, at least on Windows.
        /*
        if (lyxrc.quit_on_last_window_closed)
                setQuitOnLastWindowClosed(false);
@@ -318,14 +318,14 @@ bool GuiApplication::dispatch(FuncRequest const & cmd)
 
        case LFUN_BUFFER_NEW:
                if (viewCount() == 0
-                   || (!lyxrc.single_window && current_view_->buffer() != 0))
+                   || (!lyxrc.open_buffers_in_tabs && current_view_->buffer() != 0))
                        createView();
                current_view_->newDocument(to_utf8(cmd.argument()), false);
                break;
 
        case LFUN_BUFFER_NEW_TEMPLATE:
                if (viewCount() == 0 
-                   || (!lyxrc.single_window && current_view_->buffer() != 0)) {
+                   || (!lyxrc.open_buffers_in_tabs && current_view_->buffer() != 0)) {
                        createView();
                        current_view_->newDocument(to_utf8(cmd.argument()), true);
                        if (!current_view_->buffer())
@@ -336,7 +336,7 @@ bool GuiApplication::dispatch(FuncRequest const & cmd)
 
        case LFUN_FILE_OPEN:
                if (viewCount() == 0
-                   || (!lyxrc.single_window && current_view_->buffer() != 0)) {
+                   || (!lyxrc.open_buffers_in_tabs && current_view_->buffer() != 0)) {
                        createView();
                        current_view_->openDocument(to_utf8(cmd.argument()));
                        if (!current_view_->buffer())
@@ -376,6 +376,9 @@ static void updateIds(map<int, GuiView *> const & stdmap, vector<int> & ids)
 
 void GuiApplication::createView(QString const & geometry_arg)
 {
+       if (global_menubar_)
+               global_menubar_->releaseKeyboard();
+
        // create new view
        updateIds(views_, view_ids_);
        int id = 0;
@@ -390,8 +393,7 @@ void GuiApplication::createView(QString const & geometry_arg)
        // register view
        views_[id] = view;
        updateIds(views_, view_ids_);
-       
-       theLyXFunc().setLyXView(view);
+
        view->show();
        if (!geometry_arg.isEmpty()) {
 #ifdef Q_WS_WIN