mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix bug 3236 and 3237.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17182 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
aaf4cf6f9f
commit
2ab3247df4
@ -243,12 +243,21 @@ void GuiView::closeEvent(QCloseEvent * close_event)
|
|||||||
{
|
{
|
||||||
// we may have been called through the close window button
|
// we may have been called through the close window button
|
||||||
// which bypasses the LFUN machinery.
|
// which bypasses the LFUN machinery.
|
||||||
if (!quitting_by_menu_) {
|
if (!quitting_by_menu_ && theApp()->gui().viewIds().size() == 1) {
|
||||||
if (!theBufferList().quitWriteAll()) {
|
if (!theBufferList().quitWriteAll()) {
|
||||||
close_event->ignore();
|
close_event->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
theApp()->gui().unregisterView(id());
|
||||||
|
if (!theApp()->gui().viewIds().empty()) {
|
||||||
|
// Just close the window and do nothing else if this is not the
|
||||||
|
// last window.
|
||||||
|
close_event->accept();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (view()->buffer()) {
|
if (view()->buffer()) {
|
||||||
// save cursor position for opened files to .lyx/session
|
// save cursor position for opened files to .lyx/session
|
||||||
LyX::ref().session().lastFilePos().save(
|
LyX::ref().session().lastFilePos().save(
|
||||||
@ -256,17 +265,13 @@ void GuiView::closeEvent(QCloseEvent * close_event)
|
|||||||
boost::tie(view()->cursor().pit(),
|
boost::tie(view()->cursor().pit(),
|
||||||
view()->cursor().pos()));
|
view()->cursor().pos()));
|
||||||
}
|
}
|
||||||
theApp()->gui().unregisterView(id());
|
|
||||||
if (theApp()->gui().viewIds().empty())
|
// this is the place where we leave the frontend.
|
||||||
{
|
// it is the only point at which we start quitting.
|
||||||
// this is the place where we leave the frontend.
|
saveGeometry();
|
||||||
// it is the only point at which we start quitting.
|
|
||||||
saveGeometry();
|
|
||||||
close_event->accept();
|
|
||||||
// quit the event loop
|
|
||||||
qApp->quit();
|
|
||||||
}
|
|
||||||
close_event->accept();
|
close_event->accept();
|
||||||
|
// quit the event loop
|
||||||
|
qApp->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user