#6902: Enable About and similar menu items without view and create a new view if needed

This commit is contained in:
Stephan Witt 2014-03-08 12:51:02 +01:00
parent 0e7eaef349
commit d39eae0a88

View 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: