ConfigView::setOptionMode() only gets access to the 'list' member. Move it to the more relevant ConfigList class.
Unified · Split
| @@ -358,6 +358,18 @@ void ConfigList::reinit(void) · 357 unmodified lines | ||
| 358 | 358 | updateListAll(); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | +void ConfigList::setOptionMode(QAction *action) | |
| 362 | +{ | |
| 363 | + if (action == showNormalAction) | |
| 364 | + optMode = normalOpt; | |
| 365 | + else if (action == showAllAction) | |
| 366 | + optMode = allOpt; | |
| 367 | + else | |
| 368 | + optMode = promptOpt; | |
| 369 | + | |
| 370 | + updateListAll(); | |
| 371 | +} | |
| 372 | + | |
| 361 | 373 | void ConfigList::saveSettings(void) |
| 362 | 374 | { |
| 363 | 375 | if (!objectName().isEmpty()) { |
| @@ -901,9 +913,9 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) · 537 unmodified lines | ||
| 901 | 913 | } |
| 902 | 914 | |
| 903 | 915 | ConfigView*ConfigView::viewList; |
| 904 | −QAction *ConfigView::showNormalAction; | |
| 905 | −QAction *ConfigView::showAllAction; | |
| 906 | −QAction *ConfigView::showPromptAction; | |
| 916 | +QAction *ConfigList::showNormalAction; | |
| 917 | +QAction *ConfigList::showAllAction; | |
| 918 | +QAction *ConfigList::showPromptAction; | |
| 907 | 919 | |
| 908 | 920 | ConfigView::ConfigView(QWidget* parent, const char *name) |
| 909 | 921 | : Parent(parent) |
| @@ -934,18 +946,6 @@ ConfigView::~ConfigView(void) · 24 unmodified lines | ||
| 934 | 946 | } |
| 935 | 947 | } |
| 936 | 948 | |
| 937 | −void ConfigView::setOptionMode(QAction *act) | |
| 938 | −{ | |
| 939 | − if (act == showNormalAction) | |
| 940 | − list->optMode = normalOpt; | |
| 941 | − else if (act == showAllAction) | |
| 942 | − list->optMode = allOpt; | |
| 943 | − else | |
| 944 | − list->optMode = promptOpt; | |
| 945 | − | |
| 946 | − list->updateListAll(); | |
| 947 | −} | |
| 948 | − | |
| 949 | 949 | void ConfigView::setShowName(bool b) |
| 950 | 950 | { |
| 951 | 951 | if (list->showName != b) { |
| @@ -1488,17 +1488,17 @@ ConfigMainWindow::ConfigMainWindow(void) · 536 unmodified lines | ||
| 1488 | 1488 | |
| 1489 | 1489 | QActionGroup *optGroup = new QActionGroup(this); |
| 1490 | 1490 | optGroup->setExclusive(true); |
| 1491 | − connect(optGroup, SIGNAL(triggered(QAction*)), configView, | |
| 1491 | + connect(optGroup, SIGNAL(triggered(QAction*)), configList, | |
| 1492 | 1492 | SLOT(setOptionMode(QAction *))); |
| 1493 | − connect(optGroup, SIGNAL(triggered(QAction *)), menuView, | |
| 1493 | + connect(optGroup, SIGNAL(triggered(QAction *)), menuList, | |
| 1494 | 1494 | SLOT(setOptionMode(QAction *))); |
| 1495 | 1495 | |
| 1496 | − configView->showNormalAction = new QAction("Show Normal Options", optGroup); | |
| 1497 | − configView->showAllAction = new QAction("Show All Options", optGroup); | |
| 1498 | − configView->showPromptAction = new QAction("Show Prompt Options", optGroup); | |
| 1499 | − configView->showNormalAction->setCheckable(true); | |
| 1500 | − configView->showAllAction->setCheckable(true); | |
| 1501 | − configView->showPromptAction->setCheckable(true); | |
| 1496 | + ConfigList::showNormalAction = new QAction("Show Normal Options", optGroup); | |
| 1497 | + ConfigList::showNormalAction->setCheckable(true); | |
| 1498 | + ConfigList::showAllAction = new QAction("Show All Options", optGroup); | |
| 1499 | + ConfigList::showAllAction->setCheckable(true); | |
| 1500 | + ConfigList::showPromptAction = new QAction("Show Prompt Options", optGroup); | |
| 1501 | + ConfigList::showPromptAction->setCheckable(true); | |
| 1502 | 1502 | |
| 1503 | 1503 | QAction *showDebugAction = new QAction("Show Debug Info", this); |
| 1504 | 1504 | showDebugAction->setCheckable(true); |
| @@ -74,6 +74,8 @@ public slots: · 73 unmodified lines | ||
| 74 | 74 | void changeValue(ConfigItem* item); |
| 75 | 75 | void updateSelection(void); |
| 76 | 76 | void saveSettings(void); |
| 77 | + void setOptionMode(QAction *action); | |
| 78 | + | |
| 77 | 79 | signals: |
| 78 | 80 | void menuChanged(struct menu *menu); |
| 79 | 81 | void menuSelected(struct menu *menu); |
| @@ -105,6 +107,8 @@ public: · 25 unmodified lines | ||
| 105 | 107 | QPalette disabledColorGroup; |
| 106 | 108 | QPalette inactivedColorGroup; |
| 107 | 109 | QMenu* headerPopup; |
| 110 | + | |
| 111 | + static QAction *showNormalAction, *showAllAction, *showPromptAction; | |
| 108 | 112 | }; |
| 109 | 113 | |
| 110 | 114 | class ConfigItem : public QTreeWidgetItem { |
| @@ -196,7 +200,6 @@ public slots: · 85 unmodified lines | ||
| 196 | 200 | void setShowName(bool); |
| 197 | 201 | void setShowRange(bool); |
| 198 | 202 | void setShowData(bool); |
| 199 | − void setOptionMode(QAction *); | |
| 200 | 203 | signals: |
| 201 | 204 | void showNameChanged(bool); |
| 202 | 205 | void showRangeChanged(bool); |
| @@ -207,10 +210,6 @@ public: · 4 unmodified lines | ||
| 207 | 210 | |
| 208 | 211 | static ConfigView* viewList; |
| 209 | 212 | ConfigView* nextView; |
| 210 | − | |
| 211 | − static QAction *showNormalAction; | |
| 212 | − static QAction *showAllAction; | |
| 213 | − static QAction *showPromptAction; | |
| 214 | 213 | }; |
| 215 | 214 | |
| 216 | 215 | class ConfigInfoView : public QTextBrowser { |