Commit 8c455efc authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Read/write attribute order from/to configuration

With the changes in libkleo, the AppearanceConfigWidget is now
responsibile for reading/writing the attribute order from/to the
configuration and for setting the order to use by DN.

This chanage makes resetting the attribute order to the default order
work. DNAttributeOrderConfigWidget::defaults() was not implemented.

GnuPG-bug-id: 5791
parent 7b5fcff7
......@@ -304,7 +304,7 @@ public:
if (Kleo::Settings{}.cmsEnabled()) {
auto w = new QWidget;
dnOrderWidget = Kleo::DNAttributeMapper::instance()->configWidget(w);
dnOrderWidget = new DNAttributeOrderConfigWidget{w};
dnOrderWidget->setObjectName(QStringLiteral("dnOrderWidget"));
(new QVBoxLayout(w))->addWidget(dnOrderWidget);
......@@ -430,7 +430,10 @@ void AppearanceConfigWidget::defaults()
d->tooltipDetailsCheckBox->setChecked(false);
if (d->dnOrderWidget) {
d->dnOrderWidget->defaults();
const Settings settings;
if (!settings.isImmutable(QStringLiteral("AttributeOrder"))) {
d->dnOrderWidget->setAttributeOrder(DN::defaultAttributeOrder());
}
}
Q_EMIT changed();
......@@ -439,7 +442,9 @@ void AppearanceConfigWidget::defaults()
void AppearanceConfigWidget::load()
{
if (d->dnOrderWidget) {
d->dnOrderWidget->load();
const Settings settings;
d->dnOrderWidget->setAttributeOrder(settings.attributeOrder());
d->dnOrderWidget->setEnabled(!settings.isImmutable(QStringLiteral("AttributeOrder")));
}
d->categoriesLV->clear();
......@@ -474,7 +479,11 @@ void AppearanceConfigWidget::load()
void AppearanceConfigWidget::save()
{
if (d->dnOrderWidget) {
d->dnOrderWidget->save();
Settings settings;
settings.setAttributeOrder(d->dnOrderWidget->attributeOrder());
settings.save();
DN::setAttributeOrder(settings.attributeOrder());
}
TooltipPreferences prefs;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment