// clear the last opened list, because
// maybe this will end the session
theSession().lastOpened().clear();
// 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:
break;
case LFUN_LYX_QUIT:
QList<GuiView *> views = d->views_.values();
foreach (GuiView * view, views) {
QList<GuiView *> views = d->views_.values();
foreach (GuiView * view, views) {
+ if (!view->closeScheduled())
+bool GuiView::closeScheduled()
+{
+ closing_ = true;
+ return close();
+}
+
+
/** Destroy only all tabbed WorkAreas. Destruction of other WorkAreas
** is responsibility of the container (e.g., dialog)
**/
/** Destroy only all tabbed WorkAreas. Destruction of other WorkAreas
** is responsibility of the container (e.g., dialog)
**/
+ // 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();
closing_ = true;
writeSession();
+ /// 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_; }
///
int id() const { return id_; }
///