mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Remove unneeded cycle checks (#12954)
This commit is contained in:
parent
fd78a25a7c
commit
b5260a3a0f
@ -821,7 +821,7 @@ GuiDocument::GuiDocument(GuiView & lv)
|
||||
: GuiDialog(lv, "document", qt_("Document Settings")),
|
||||
biblioChanged_(false), nonModuleChanged_(false),
|
||||
modulesChanged_(false), shellescapeChanged_(false),
|
||||
switchback_(false), prompted_(false)
|
||||
switchback_(false)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
@ -1887,21 +1887,15 @@ void GuiDocument::onBufferViewChanged()
|
||||
&& theBufferList().exists(FileName(prev_buffer_filename_))
|
||||
&& buttonBox->button(QDialogButtonBox::Apply)->isEnabled()) {
|
||||
// Only ask if we haven't yet in this cycle
|
||||
int const ret = prompted_ ? 3 : Alert::prompt(_("Unapplied changes"),
|
||||
int const ret = Alert::prompt(_("Unapplied changes"),
|
||||
_("Some changes in the previous document were not yet applied.\n"
|
||||
"Do you want to switch back in order to apply them or dismiss the changes?"),
|
||||
1, 1, _("&Switch Back"), _("&Dismiss Changes"));
|
||||
if (ret == 0) {
|
||||
// Switch to previous buffer view
|
||||
switchback_ = true;
|
||||
// Record that we have asked.
|
||||
prompted_ = true;
|
||||
lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH, prev_buffer_filename_));
|
||||
return;
|
||||
} else if (ret == 3) {
|
||||
// We are in the second cycle. Set back.
|
||||
prompted_ = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -358,9 +358,6 @@ private:
|
||||
/// Track if we switch back to a buffer due to unapplied
|
||||
/// changes
|
||||
bool switchback_;
|
||||
/// Track whether we prompted the user about unapplied
|
||||
/// changes
|
||||
bool prompted_;
|
||||
/// Cache margin values
|
||||
std::string tmp_leftmargin_;
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user