Fix the storage of the last opened files list when having multiple windows. We need to know whether a view is closed by the user pressing the x (clearing the last-opened list of previous closed windows), or whether the view is closed in a cascade of all views (no clearing of the last-opened list).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34621 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-06-07 22:07:38 +00:00
parent 8514082c4a
commit a26a9be9bc
3 changed files with 17 additions and 2 deletions

View File

@ -1250,7 +1250,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// clear the last opened list, because
// maybe this will end the session
theSession().lastOpened().clear();
current_view_->close();
current_view_->closeScheduled();
break;
case LFUN_LYX_QUIT:
@ -2254,7 +2254,7 @@ bool GuiApplication::closeAllViews()
QList<GuiView *> views = d->views_.values();
foreach (GuiView * view, views) {
if (!view->close())
if (!view->closeScheduled())
return false;
}

View File

@ -663,6 +663,13 @@ void GuiView::showEvent(QShowEvent * e)
}
bool GuiView::closeScheduled()
{
closing_ = true;
return close();
}
/** Destroy only all tabbed WorkAreas. Destruction of other WorkAreas
** is responsibility of the container (e.g., dialog)
**/
@ -676,6 +683,10 @@ void GuiView::closeEvent(QCloseEvent * close_event)
return;
}
// If the user pressed the x (so we didn't call closeView
// programmatically), we want to clear all existing entries.
if (!closing_)
theSession().lastOpened().clear();
closing_ = true;
writeSession();

View File

@ -71,6 +71,10 @@ public:
~GuiView();
/// closes the view such that the view knows that is closed
/// programmatically and not by the user clicking the x.
bool closeScheduled();
int id() const { return id_; }
///