| 171 | } |
| 172 | |
| 173 | void ConfigDialog::onPageChanged() |
| 174 | { |
| 175 | QObject* from = sender(); |
| 176 | if (from && from != currentPage()->widget()) { |
| 177 | qCWarning(SHELL) << "Settings in config page" << from << "changed, while" << currentPage()->widget() << "is currently selected. This case is not implemented yet."; |
| 178 | return; |
| 179 | // TODO: add a QHash<ConfigPage*, bool> as a member to make sure the apply button is always correct |
| 180 | |
| 181 | // TODO: when pressing okay show confirm dialog if other pages have changed or just silently apply every page? "Items on other pages have changed, do you wish to review those changes? + list with changed pages." |
| 182 | } |
| 183 | if (!m_currentlyApplyingChanges) { |
| 184 | // e.g. PluginPreferences emits changed() from its apply method, better fix this here than having to |
| 185 | // ensure that no plugin emits changed() from apply() |
| 186 | // together with KPageDialog emitting currentPageChanged("Plugins", nullptr) this could cause a crash |
| 187 | // when we dereference before |
| 188 | m_currentPageHasChanges = true; |
| 189 | button(QDialogButtonBox::Apply)->setEnabled(true); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | |
| 194 | void ConfigDialog::applyChanges(ConfigPage* page) |
nothing calls this directly
no test coverage detected