mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
#6902: Enable About and similar menu items without view and create a new view if needed
This commit is contained in:
parent
0e7eaef349
commit
d39eae0a88
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user