]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiApplication.cpp
Move LYX_(BEGIN|END)_MUTE_GCC_WARNING macros to their own header.
[lyx.git] / src / frontends / qt / GuiApplication.cpp
index a2372429f3a3a56b314792212e3b515304e38957..26288a5f55dd1cf148b1153fa56493f947480c7f 100644 (file)
@@ -71,6 +71,7 @@
 #include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h" // sorted
+#include "support/mute_warning.h"
 #include "support/textutils.h"
 #include "support/Messages.h"
 #include "support/os.h"
@@ -1268,6 +1269,11 @@ docstring Application::mathIcon(docstring const & c)
        return qstring_to_ucs4(findImg(toqstr(c)));
 }
 
+void Application::applyPrefs()
+{
+       if (lyxrc.ui_style != "default")
+               lyx::frontend::GuiApplication::setStyle(toqstr(lyxrc.ui_style));
+}
 
 FuncStatus GuiApplication::getStatus(FuncRequest const & cmd) const
 {
@@ -1901,12 +1907,6 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
        }
 
        case LFUN_LYXFILES_OPEN: {
-               // This is the actual reason for this method (#12106).
-               validateCurrentView();
-               if (!current_view_
-                  || (!lyxrc.open_buffers_in_tabs
-                      && current_view_->documentBufferView() != nullptr))
-                       createView();
                string arg = to_utf8(cmd.argument());
                if (arg.empty())
                        // set default
@@ -2263,17 +2263,15 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
 
        case LFUN_DIALOG_SHOW: {
                string const name = cmd.getArg(0);
-
-               if ( name == "aboutlyx"
-                       || name == "prefs"
-                       || name == "texinfo"
-                       || name == "progress"
-                       || name == "compare")
+               // Workaround: on Mac OS the application
+               // is not terminated when closing the last view.
+               // With the following dialogs which should still
+               // be usable, create a new one to be able
+               // to dispatch LFUN_DIALOG_SHOW to this view.
+               if (name == "aboutlyx" || name == "compare"
+                   || name == "lyxfiles" || name == "prefs"
+                   || name == "progress" || name == "texinfo")
                {
-                       // work around: on Mac OS the application
-                       // is not terminated when closing the last view.
-                       // Create a new one to be able to dispatch the
-                       // LFUN_DIALOG_SHOW to this view.
                        if (current_view_ == nullptr)
                                createView();
                }
@@ -3495,7 +3493,7 @@ bool GuiApplication::longOperationStarted() {
 
 #if defined(QPA_XCB)
 bool GuiApplication::nativeEventFilter(const QByteArray & eventType,
-                                      void * message, long *)
+                                      void * message, QINTPTR *)
 {
        if (!current_view_ || eventType != "xcb_generic_event_t")
                return false;