]> git.lyx.org Git - features.git/commitdiff
#6902: Enable About and similar menu items without view and create a new view if...
authorStephan Witt <switt@lyx.org>
Sat, 8 Mar 2014 11:51:02 +0000 (12:51 +0100)
committerStephan Witt <switt@lyx.org>
Sat, 8 Mar 2014 11:51:02 +0000 (12:51 +0100)
src/frontends/qt4/GuiApplication.cpp

index fc627a644aff1416389dfb11a5bc9f22c2781c87..48320a4e062d964ae9a8cca2ab598fdccbe68918 100644 (file)
@@ -1245,6 +1245,14 @@ bool GuiApplication::getStatus(FuncRequest const & cmd, FuncStatus & flag) const
                break;
        }
 
+       case LFUN_DIALOG_SHOW: {
+               string const name = cmd.getArg(0);
+               return name == "aboutlyx"
+                       || name == "prefs"
+                       || name == "texinfo"
+                       || name == "progress"
+                       || name == "compare";
+       }
 
        default:
                return false;
@@ -1937,6 +1945,24 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                lyxerr.setLevel(Debug::value(to_utf8(cmd.argument())));
                break;
 
+       case LFUN_DIALOG_SHOW: {
+               string const name = cmd.getArg(0);
+
+               if ( name == "aboutlyx"
+                       || name == "prefs"
+                       || name == "texinfo"
+                       || name == "progress"
+                       || name == "compare")
+               {
+                       // 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_ == 0)
+                               createView();
+               }
+       }
+
        default:
                // The LFUN must be for one of GuiView, BufferView, Buffer or Cursor;
                // let's try that: