| 24 | static const char version[] = "0.1"; |
| 25 | |
| 26 | class State : public QObject |
| 27 | { |
| 28 | Q_OBJECT |
| 29 | public: |
| 30 | explicit State(QDialogButtonBox* buttonBox, CustomBuildSystemConfigWidget* cfgWidget, KConfig* config) |
| 31 | : buttonBox(buttonBox) |
| 32 | , configWidget(cfgWidget) |
| 33 | , cfg(config) |
| 34 | { |
| 35 | connect(buttonBox, &QDialogButtonBox::clicked, this, &State::buttonClicked); |
| 36 | connect(configWidget, &CustomBuildSystemConfigWidget::changed, this, &State::configChanged); |
| 37 | } |
| 38 | public Q_SLOTS: |
| 39 | void buttonClicked(QAbstractButton* button) |
| 40 | { |
| 41 | if (button == buttonBox->button(QDialogButtonBox::Apply)) { |
| 42 | apply(); |
| 43 | } else if (button == buttonBox->button(QDialogButtonBox::Ok)) { |
| 44 | ok(); |
| 45 | } else if (button == buttonBox->button(QDialogButtonBox::Cancel)) { |
| 46 | qApp->quit(); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | void apply() { |
| 51 | configWidget->saveTo(cfg); |