ConfigList::ConfigList(ConfigView* p, const char *name)
: Parent(p),
updateAll(false),
- showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),
+ showName(false), showRange(false), mode(singleMode), optMode(normalOpt),
rootEntry(0), headerPopup(0)
{
setObjectName(name);
configSettings->beginGroup(name);
showName = configSettings->value("/showName", false).toBool();
showRange = configSettings->value("/showRange", false).toBool();
- showData = configSettings->value("/showData", false).toBool();
optMode = (enum optionMode)configSettings->value("/optionMode", 0).toInt();
configSettings->endGroup();
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
void ConfigList::reinit(void)
{
- hideColumn(dataColIdx);
hideColumn(yesColIdx);
hideColumn(modColIdx);
hideColumn(noColIdx);
showColumn(modColIdx);
showColumn(yesColIdx);
}
- if (showData)
- showColumn(dataColIdx);
updateListAll();
}
configSettings->beginGroup(objectName());
configSettings->setValue("/showName", showName);
configSettings->setValue("/showRange", showRange);
- configSettings->setValue("/showData", showData);
configSettings->setValue("/optionMode", (int)optMode);
configSettings->endGroup();
}
action, SLOT(setChecked(bool)));
action->setChecked(showRange);
headerPopup->addAction(action);
-
- action = new QAction("Show Data", this);
- action->setCheckable(true);
- connect(action, SIGNAL(toggled(bool)),
- parent(), SLOT(setShowData(bool)));
- connect(parent(), SIGNAL(showDataChanged(bool)),
- action, SLOT(setChecked(bool)));
- action->setChecked(showData);
- headerPopup->addAction(action);
}
headerPopup->exec(e->globalPos());
}
}
-void ConfigView::setShowData(bool b)
-{
- if (list->showData != b) {
- list->showData = b;
- list->reinit();
- emit showDataChanged(b);
- }
-}
-
void ConfigList::setAllOpen(bool open)
{
QTreeWidgetItemIterator it(this);
QAction *showRangeAction = new QAction("Show Range", this);
showRangeAction->setCheckable(true);
connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
- QAction *showDataAction = new QAction("Show Data", this);
- showDataAction->setCheckable(true);
- connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
QActionGroup *optGroup = new QActionGroup(this);
optGroup->setExclusive(true);
menu = menuBar()->addMenu("&Option");
menu->addAction(showNameAction);
menu->addAction(showRangeAction);
- menu->addAction(showDataAction);
menu->addSeparator();
menu->addActions(optGroup->actions());
menu->addSeparator();