| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2019 KDE Developers |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #include "kateconfigpage.h" |
| 8 | |
| 9 | #include <KFontRequester> |
| 10 | #include <KUrlRequester> |
| 11 | |
| 12 | #include <QAbstractButton> |
| 13 | #include <QAbstractSlider> |
| 14 | #include <QComboBox> |
| 15 | #include <QGroupBox> |
| 16 | #include <QLineEdit> |
| 17 | #include <QSpinBox> |
| 18 | |
| 19 | KateConfigPage::KateConfigPage(QWidget *parent, const char *) |
| 20 | : KTextEditor::ConfigPage(parent) |
| 21 | { |
| 22 | connect(sender: this, signal: &KateConfigPage::changed, context: this, slot: &KateConfigPage::somethingHasChanged); |
| 23 | } |
| 24 | |
| 25 | KateConfigPage::~KateConfigPage() |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | void KateConfigPage::observeChanges(KateConfigPage *page) const |
| 30 | { |
| 31 | connect(sender: page, signal: &KateConfigPage::changed, context: this, slot: &KateConfigPage::slotChanged); |
| 32 | } |
| 33 | |
| 34 | void KateConfigPage::observeChanges(KUrlRequester *requester) const |
| 35 | { |
| 36 | connect(sender: requester, signal: &KUrlRequester::textChanged, context: this, slot: &KateConfigPage::slotChanged); |
| 37 | } |
| 38 | |
| 39 | void KateConfigPage::observeChanges(QAbstractButton *button) const |
| 40 | { |
| 41 | connect(sender: button, signal: &QAbstractButton::toggled, context: this, slot: &KateConfigPage::slotChanged); |
| 42 | } |
| 43 | |
| 44 | void KateConfigPage::observeChanges(QAbstractSlider *slider) const |
| 45 | { |
| 46 | connect(sender: slider, signal: &QAbstractSlider::valueChanged, context: this, slot: &KateConfigPage::slotChanged); |
| 47 | } |
| 48 | |
| 49 | void KateConfigPage::observeChanges(QSpinBox *spinBox) const |
| 50 | { |
| 51 | connect(sender: spinBox, signal: &QSpinBox::textChanged, context: this, slot: &KateConfigPage::slotChanged); |
| 52 | } |
| 53 | |
| 54 | void KateConfigPage::observeChanges(QDoubleSpinBox *spinBox) const |
| 55 | { |
| 56 | connect(sender: spinBox, signal: &QDoubleSpinBox::textChanged, context: this, slot: &KateConfigPage::slotChanged); |
| 57 | } |
| 58 | |
| 59 | void KateConfigPage::observeChanges(QComboBox *comboBox) const |
| 60 | { |
| 61 | connect(sender: comboBox, signal: &QComboBox::currentIndexChanged, context: this, slot: &KateConfigPage::slotChanged); |
| 62 | } |
| 63 | |
| 64 | void KateConfigPage::observeChanges(QGroupBox *groupBox) const |
| 65 | { |
| 66 | connect(sender: groupBox, signal: &QGroupBox::toggled, context: this, slot: &KateConfigPage::slotChanged); |
| 67 | } |
| 68 | |
| 69 | void KateConfigPage::observeChanges(QLineEdit *lineEdit) const |
| 70 | { |
| 71 | connect(sender: lineEdit, signal: &QLineEdit::textChanged, context: this, slot: &KateConfigPage::slotChanged); |
| 72 | } |
| 73 | |
| 74 | void KateConfigPage::observeChanges(KFontRequester *chooser) const |
| 75 | { |
| 76 | connect(sender: chooser, signal: &KFontRequester::fontSelected, context: this, slot: &KateConfigPage::slotChanged); |
| 77 | } |
| 78 | |
| 79 | void KateConfigPage::slotChanged() |
| 80 | { |
| 81 | Q_EMIT changed(); |
| 82 | } |
| 83 | |
| 84 | void KateConfigPage::somethingHasChanged() |
| 85 | { |
| 86 | m_changed = true; |
| 87 | } |
| 88 | |