#include <iomanip>
#include <sstream>
#include <algorithm>
+#include <math.h>
using namespace Ui;
{
for (int row = 0 ; row < lyxObjectsLW->count() ; ++row) {
// skip colors that are taken from system palette
- bool const hide = syscolorsCB->isChecked()
+ bool const disable = syscolorsCB->isChecked()
&& guiApp->colorCache().isSystem(lcolors_[row]);
- lyxObjectsLW->item(row)->setHidden(hide);
- }
+ QListWidgetItem * const item = lyxObjectsLW->item(row);
+ Qt::ItemFlags const flags = item->flags();
+ if (disable)
+ item->setFlags(flags & ~Qt::ItemIsEnabled);
+ else
+ item->setFlags(flags | Qt::ItemIsEnabled);
+ }
}
void PrefColors::changeLyxObjectsSelection()
converterED->setValidator(new NoNewLineValidator(converterED));
converterFlagED->setValidator(new NoNewLineValidator(converterFlagED));
- maxAgeLE->setValidator(new QDoubleValidator(maxAgeLE));
+ maxAgeLE->setValidator(new QDoubleValidator(0, HUGE_VAL, 6, maxAgeLE));
//converterDefGB->setFocusProxy(convertersLW);
}
bool GuiPreferences::initialiseParams(string const &)
{
rc_ = lyxrc;
- formats_ = lyx::formats;
+ formats_ = theFormats();
converters_ = theConverters();
converters_.update(formats_);
movers_ = theMovers();
Author(from_utf8(rc_.user_name), from_utf8(rc_.user_email));
theBufferList().recordCurrentAuthor(author);
- lyx::formats = formats_;
+ theFormats() = formats_;
theConverters() = converters_;
- theConverters().update(lyx::formats);
+ theConverters().update(formats_);
theConverters().buildGraph();
theBufferList().invalidateConverterCache();