commit d39eae0a8883dd9861ccd2a5b8c4d73cb7519b32
Author: Stephan Witt <[email protected]>
Date: Sat Mar 8 12:51:02 2014 +0100
#6902: Enable About and similar menu items without view and create a new
view if needed
diff --git a/src/frontends/qt4/GuiApplication.cpp
b/src/frontends/qt4/GuiApplication.cpp
index fc627a6..48320a4 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -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: