action = new QAction("Show Name", this);
action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)),
- parent(), SLOT(setShowName(bool)));
- connect(parent(), SIGNAL(showNameChanged(bool)),
+ SLOT(setShowName(bool)));
+ connect(this, SIGNAL(showNameChanged(bool)),
action, SLOT(setChecked(bool)));
action->setChecked(showName);
headerPopup->addAction(action);
action = new QAction("Show Range", this);
action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)),
- parent(), SLOT(setShowRange(bool)));
- connect(parent(), SIGNAL(showRangeChanged(bool)),
+ SLOT(setShowRange(bool)));
+ connect(this, SIGNAL(showRangeChanged(bool)),
action, SLOT(setChecked(bool)));
action->setChecked(showRange);
headerPopup->addAction(action);
e->accept();
}
+void ConfigList::setShowName(bool on)
+{
+ if (showName == on)
+ return;
+
+ showName = on;
+ reinit();
+ emit showNameChanged(on);
+}
+
+void ConfigList::setShowRange(bool on)
+{
+ if (showRange == on)
+ return;
+
+ showRange = on;
+ reinit();
+ emit showRangeChanged(on);
+}
+
QList<ConfigList *> ConfigList::allLists;
QAction *ConfigList::showNormalAction;
QAction *ConfigList::showAllAction;
verticalLayout->addWidget(list);
}
-void ConfigView::setShowName(bool b)
-{
- if (list->showName != b) {
- list->showName = b;
- list->reinit();
- emit showNameChanged(b);
- }
-}
-
-void ConfigView::setShowRange(bool b)
-{
- if (list->showRange != b) {
- list->showRange = b;
- list->reinit();
- emit showRangeChanged(b);
- }
-}
-
void ConfigList::setAllOpen(bool open)
{
QTreeWidgetItemIterator it(this);
QAction *showNameAction = new QAction("Show Name", this);
showNameAction->setCheckable(true);
- connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
- showNameAction->setChecked(configView->showName());
+ connect(showNameAction, SIGNAL(toggled(bool)), configList, SLOT(setShowName(bool)));
+ showNameAction->setChecked(configList->showName);
+
QAction *showRangeAction = new QAction("Show Range", this);
showRangeAction->setCheckable(true);
- connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
+ connect(showRangeAction, SIGNAL(toggled(bool)), configList, SLOT(setShowRange(bool)));
QActionGroup *optGroup = new QActionGroup(this);
optGroup->setExclusive(true);
void updateSelection(void);
void saveSettings(void);
void setOptionMode(QAction *action);
+ void setShowName(bool on);
+ void setShowRange(bool on);
signals:
void menuChanged(struct menu *menu);
void itemSelected(struct menu *menu);
void parentSelected(void);
void gotFocus(struct menu *);
+ void showNameChanged(bool on);
+ void showRangeChanged(bool on);
public:
void updateListAll(void)
public:
ConfigView(QWidget* parent, const char *name = 0);
- bool showName(void) const { return list->showName; }
- bool showRange(void) const { return list->showRange; }
-public slots:
- void setShowName(bool);
- void setShowRange(bool);
-signals:
- void showNameChanged(bool);
- void showRangeChanged(bool);
public:
ConfigList* list;
};