Do not warn about changed modules when changing modules.

Part of #9356
Also fixes #9365
This commit is contained in:
Juergen Spitzmueller 2014-12-21 19:08:41 +01:00
parent cc58d61744
commit 0be08dde6d
3 changed files with 30 additions and 15 deletions

View File

@ -629,7 +629,8 @@ void LocalLayout::validatePressed() {
GuiDocument::GuiDocument(GuiView & lv)
: GuiDialog(lv, "document", qt_("Document Settings"))
: GuiDialog(lv, "document", qt_("Document Settings")),
nonModuleChanged_(false)
{
setupUi(this);
@ -1322,8 +1323,6 @@ GuiDocument::GuiDocument(GuiView & lv)
availableModel(), selectedModel(), this);
connect(selectionManager, SIGNAL(updateHook()),
this, SLOT(updateModuleInfo()));
connect(selectionManager, SIGNAL(updateHook()),
this, SLOT(change_adaptor()));
connect(selectionManager, SIGNAL(selectionChanged()),
this, SLOT(modulesChanged()));
@ -1443,6 +1442,7 @@ void GuiDocument::useDefaultsClicked()
void GuiDocument::change_adaptor()
{
nonModuleChanged_ = true;
changed();
}
@ -1463,7 +1463,7 @@ void GuiDocument::includeonlyClicked(QTreeWidgetItem * item, int)
includeonlys_.push_back(child);
updateIncludeonlys();
changed();
change_adaptor();
}
@ -1640,7 +1640,7 @@ void GuiDocument::changeBackgroundColor()
// save color
set_backgroundcolor = rgbFromHexName(fromqstr(newColor.name()));
is_backgroundcolor = true;
changed();
change_adaptor();
}
@ -1653,7 +1653,7 @@ void GuiDocument::deleteBackgroundColor()
// save default color (white)
set_backgroundcolor = rgbFromHexName("#ffffff");
is_backgroundcolor = false;
changed();
change_adaptor();
}
@ -1670,7 +1670,7 @@ void GuiDocument::changeFontColor()
// save color
set_fontcolor = rgbFromHexName(fromqstr(newColor.name()));
is_fontcolor = true;
changed();
change_adaptor();
}
@ -1683,7 +1683,7 @@ void GuiDocument::deleteFontColor()
// save default color (black)
set_fontcolor = rgbFromHexName("#000000");
is_fontcolor = false;
changed();
change_adaptor();
}
@ -1698,7 +1698,7 @@ void GuiDocument::changeNoteFontColor()
colorButtonStyleSheet(newColor));
// save color
set_notefontcolor = rgbFromHexName(fromqstr(newColor.name()));
changed();
change_adaptor();
}
@ -1708,7 +1708,7 @@ void GuiDocument::deleteNoteFontColor()
theApp()->getRgbColor(Color_greyedouttext, set_notefontcolor);
colorModule->noteFontColorPB->setStyleSheet(
colorButtonStyleSheet(rgb2qcolor(set_notefontcolor)));
changed();
change_adaptor();
}
@ -1723,7 +1723,7 @@ void GuiDocument::changeBoxBackgroundColor()
colorButtonStyleSheet(newColor));
// save color
set_boxbgcolor = rgbFromHexName(fromqstr(newColor.name()));
changed();
change_adaptor();
}
@ -1733,7 +1733,7 @@ void GuiDocument::deleteBoxBackgroundColor()
theApp()->getRgbColor(Color_shadedbg, set_boxbgcolor);
colorModule->boxBackgroundPB->setStyleSheet(
colorButtonStyleSheet(rgb2qcolor(set_boxbgcolor)));
changed();
change_adaptor();
}
@ -2208,7 +2208,7 @@ void GuiDocument::languagePackageChanged(int i)
void GuiDocument::biblioChanged()
{
biblioChanged_ = true;
changed();
change_adaptor();
}
@ -2359,7 +2359,7 @@ void GuiDocument::modulesChanged()
{
modulesToParams(bp_);
if (applyPB->isEnabled()) {
if (applyPB->isEnabled() && nonModuleChanged_) {
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."),
@ -2370,6 +2370,7 @@ void GuiDocument::modulesChanged()
bp_.makeDocumentClass();
paramsToDialog();
changed();
}
@ -2909,6 +2910,9 @@ void GuiDocument::applyView()
pdf.pagemode.clear();
pdf.quoted_options = pdf.quoted_options_check(
fromqstr(pdfSupportModule->optionsLE->text()));
// reset tracker
nonModuleChanged_ = false;
}
@ -3428,6 +3432,9 @@ void GuiDocument::paramsToDialog()
// clear changed branches cache
changedBranches_.clear();
// reset tracker
nonModuleChanged_ = false;
}

View File

@ -273,6 +273,8 @@ private:
std::list<std::string> includeonlys_;
///
bool biblioChanged_;
/// Track if a non-module document param changed
bool nonModuleChanged_;
};

View File

@ -147,7 +147,13 @@ What's new
layout (bug 2666).
- When switching classes, warn user about all unapplied document changes
(part of bug 9356).
(1. part of bug 9356).
- When adding a module, warn user about all unapplied document changes
(2. part of bug 9356).
- Do not enable the Apply button in the document dialog just because a
module was selected in the widget (without actual change) (bug 9365).
* INTERNALS