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 | updateListAll(); | 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 | void ConfigList::saveSettings(void) | 373 | void ConfigList::saveSettings(void) |
| 362 | { | 374 | { |
| 363 | if (!objectName().isEmpty()) { | 375 | if (!objectName().isEmpty()) { |
| @@ -901,9 +913,9 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e) · 537 unmodified lines | |||
| 901 | } | 913 | } |
| 902 | 914 | ||
| 903 | ConfigView*ConfigView::viewList; | 915 | ConfigView*ConfigView::viewList; |
| 904 | QAction *ConfigView::showNormalAction; | 916 | QAction *ConfigList::showNormalAction; |
| 905 | QAction *ConfigView::showAllAction; | 917 | QAction *ConfigList::showAllAction; |
| 906 | QAction *ConfigView::showPromptAction; | 918 | QAction *ConfigList::showPromptAction; |
| 907 | 919 | ||
| 908 | ConfigView::ConfigView(QWidget* parent, const char *name) | 920 | ConfigView::ConfigView(QWidget* parent, const char *name) |
| 909 | : Parent(parent) | 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 | void ConfigView::setShowName(bool b) | 949 | void ConfigView::setShowName(bool b) |
| 950 | { | 950 | { |
| 951 | if (list->showName != b) { | 951 | if (list->showName != b) { |
| @@ -1488,17 +1488,17 @@ ConfigMainWindow::ConfigMainWindow(void) · 536 unmodified lines | |||
| 1488 | 1488 | ||
| 1489 | QActionGroup *optGroup = new QActionGroup(this); | 1489 | QActionGroup *optGroup = new QActionGroup(this); |
| 1490 | optGroup->setExclusive(true); | 1490 | optGroup->setExclusive(true); |
| 1491 | connect(optGroup, SIGNAL(triggered(QAction*)), configView, | 1491 | connect(optGroup, SIGNAL(triggered(QAction*)), configList, |
| 1492 | SLOT(setOptionMode(QAction *))); | 1492 | SLOT(setOptionMode(QAction *))); |
| 1493 | connect(optGroup, SIGNAL(triggered(QAction *)), menuView, | 1493 | connect(optGroup, SIGNAL(triggered(QAction *)), menuList, |
| 1494 | SLOT(setOptionMode(QAction *))); | 1494 | SLOT(setOptionMode(QAction *))); |
| 1495 | 1495 | ||
| 1496 | configView->showNormalAction = new QAction("Show Normal Options", optGroup); | 1496 | ConfigList::showNormalAction = new QAction("Show Normal Options", optGroup); |
| 1497 | configView->showAllAction = new QAction("Show All Options", optGroup); | 1497 | ConfigList::showNormalAction->setCheckable(true); |
| 1498 | configView->showPromptAction = new QAction("Show Prompt Options", optGroup); | 1498 | ConfigList::showAllAction = new QAction("Show All Options", optGroup); |
| 1499 | configView->showNormalAction->setCheckable(true); | 1499 | ConfigList::showAllAction->setCheckable(true); |
| 1500 | configView->showAllAction->setCheckable(true); | 1500 | ConfigList::showPromptAction = new QAction("Show Prompt Options", optGroup); |
| 1501 | configView->showPromptAction->setCheckable(true); | 1501 | ConfigList::showPromptAction->setCheckable(true); |
| 1502 | 1502 | ||
| 1503 | QAction *showDebugAction = new QAction("Show Debug Info", this); | 1503 | QAction *showDebugAction = new QAction("Show Debug Info", this); |
| 1504 | showDebugAction->setCheckable(true); | 1504 | showDebugAction->setCheckable(true); |
| @@ -74,6 +74,8 @@ public slots: · 73 unmodified lines | |||
| 74 | void changeValue(ConfigItem* item); | 74 | void changeValue(ConfigItem* item); |
| 75 | void updateSelection(void); | 75 | void updateSelection(void); |
| 76 | void saveSettings(void); | 76 | void saveSettings(void); |
| 77 | void setOptionMode(QAction *action); | ||
| 78 | |||
| 77 | signals: | 79 | signals: |
| 78 | void menuChanged(struct menu *menu); | 80 | void menuChanged(struct menu *menu); |
| 79 | void menuSelected(struct menu *menu); | 81 | void menuSelected(struct menu *menu); |
| @@ -105,6 +107,8 @@ public: · 25 unmodified lines | |||
| 105 | QPalette disabledColorGroup; | 107 | QPalette disabledColorGroup; |
| 106 | QPalette inactivedColorGroup; | 108 | QPalette inactivedColorGroup; |
| 107 | QMenu* headerPopup; | 109 | QMenu* headerPopup; |
| 110 | |||
| 111 | static QAction *showNormalAction, *showAllAction, *showPromptAction; | ||
| 108 | }; | 112 | }; |
| 109 | 113 | ||
| 110 | class ConfigItem : public QTreeWidgetItem { | 114 | class ConfigItem : public QTreeWidgetItem { |
| @@ -196,7 +200,6 @@ public slots: · 85 unmodified lines | |||
| 196 | void setShowName(bool); | 200 | void setShowName(bool); |
| 197 | void setShowRange(bool); | 201 | void setShowRange(bool); |
| 198 | void setShowData(bool); | 202 | void setShowData(bool); |
| 199 | void setOptionMode(QAction *); | ||
| 200 | signals: | 203 | signals: |
| 201 | void showNameChanged(bool); | 204 | void showNameChanged(bool); |
| 202 | void showRangeChanged(bool); | 205 | void showRangeChanged(bool); |
| @@ -207,10 +210,6 @@ public: · 4 unmodified lines | |||
| 207 | 210 | ||
| 208 | static ConfigView* viewList; | 211 | static ConfigView* viewList; |
| 209 | ConfigView* nextView; | 212 | ConfigView* nextView; |
| 210 | |||
| 211 | static QAction *showNormalAction; | ||
| 212 | static QAction *showAllAction; | ||
| 213 | static QAction *showPromptAction; | ||
| 214 | }; | 213 | }; |
| 215 | 214 | ||
| 216 | class ConfigInfoView : public QTextBrowser { | 215 | class ConfigInfoView : public QTextBrowser { |