From: Juergen Spitzmueller Date: Sun, 21 Dec 2014 10:49:08 +0000 (+0100) Subject: When switching classes, warn user about all unapplied document changes X-Git-Tag: 2.1.3~50 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c213243600faafd0dd7795bb2d525e524ea6ef9a;p=features.git When switching classes, warn user about all unapplied document changes Currently, this is limited to modules. Part of #9356. --- diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index caa3d22d2e..5085792ea0 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -2166,30 +2166,13 @@ void GuiDocument::classChanged() return; string const classname = fromqstr(latexModule->classCO->getData(idx)); - // check whether the selected modules have changed. - bool modules_changed = false; - unsigned int const srows = selectedModel()->rowCount(); - if (srows != bp_.getModules().size()) - modules_changed = true; - else { - list::const_iterator mit = bp_.getModules().begin(); - list::const_iterator men = bp_.getModules().end(); - for (unsigned int i = 0; i < srows && mit != men; ++i, ++mit) - if (selectedModel()->getIDString(i) != *mit) { - modules_changed = true; - break; - } - } - - if (modules_changed || lyxrc.auto_reset_options) { - if (applyPB->isEnabled()) { - int const ret = Alert::prompt(_("Unapplied changes"), - _("Some changes in the dialog were not yet applied.\n" - "If you do not apply now, they will be lost after this action."), - 1, 1, _("&Apply"), _("&Dismiss")); - if (ret == 0) - applyView(); - } + if (applyPB->isEnabled()) { + int const ret = Alert::prompt(_("Unapplied changes"), + _("Some changes in the dialog were not yet applied.\n" + "If you do not apply now, they will be lost after this action."), + 1, 1, _("&Apply"), _("&Dismiss")); + if (ret == 0) + applyView(); } // We load the TextClass as soon as it is selected. This is diff --git a/status.21x b/status.21x index dd63e65c51..4c4269aed0 100644 --- a/status.21x +++ b/status.21x @@ -143,6 +143,9 @@ What's new - Only allow 1 paragraph in footnotes when they are part of a title layout (bug 2666). +- When switching classes, warn user about all unapplied document changes + (part of bug 9356). + * INTERNALS