mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
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:
parent
8514082c4a
commit
a26a9be9bc
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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_; }
|
||||
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user