Changeset View
Changeset View
Standalone View
Standalone View
krusader/Konfigurator/konfiguratoritems.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 95 | KonfiguratorCheckBox::KonfiguratorCheckBox(QString configGroup, QString name, bool defaultValue, const QString& text, | |||
---|---|---|---|---|---|
96 | QWidget *parent, bool restart, int page) : QCheckBox(text, parent), | 96 | QWidget *parent, bool restart, int page) : QCheckBox(text, parent), | ||
97 | defaultValue(defaultValue) | 97 | defaultValue(defaultValue) | ||
98 | { | 98 | { | ||
99 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | 99 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | ||
100 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorCheckBox::slotApply); | 100 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorCheckBox::slotApply); | ||
101 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorCheckBox::slotSetDefaults); | 101 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorCheckBox::slotSetDefaults); | ||
102 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorCheckBox::loadInitialValue); | 102 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorCheckBox::loadInitialValue); | ||
103 | 103 | | |||
104 | connect(this, &KonfiguratorCheckBox::stateChanged, ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | 104 | connect(this, &KonfiguratorCheckBox::stateChanged, | ||
105 | ext, static_cast<void (KonfiguratorExtension::*)()>(&KonfiguratorExtension::setChanged)); | ||||
105 | loadInitialValue(); | 106 | loadInitialValue(); | ||
106 | } | 107 | } | ||
107 | 108 | | |||
108 | KonfiguratorCheckBox::~KonfiguratorCheckBox() | 109 | KonfiguratorCheckBox::~KonfiguratorCheckBox() | ||
109 | { | 110 | { | ||
110 | delete ext; | 111 | delete ext; | ||
111 | } | 112 | } | ||
112 | 113 | | |||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 160 | KonfiguratorSpinBox::KonfiguratorSpinBox(QString configGroup, QString configName, int defaultValue, | |||
161 | int page) | 162 | int page) | ||
162 | : QSpinBox(parent), defaultValue(defaultValue) | 163 | : QSpinBox(parent), defaultValue(defaultValue) | ||
163 | { | 164 | { | ||
164 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(configName), restartNeeded, page); | 165 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(configName), restartNeeded, page); | ||
165 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorSpinBox::slotApply); | 166 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorSpinBox::slotApply); | ||
166 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorSpinBox::slotSetDefaults); | 167 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorSpinBox::slotSetDefaults); | ||
167 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorSpinBox::loadInitialValue); | 168 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorSpinBox::loadInitialValue); | ||
168 | 169 | | |||
169 | connect(this, QOverload<int>::of(&KonfiguratorSpinBox::valueChanged), ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | 170 | connect(this, static_cast<void (KonfiguratorSpinBox::*)(int)>(&KonfiguratorSpinBox::valueChanged), | ||
171 | ext, static_cast<void (KonfiguratorExtension::*)()>(&KonfiguratorExtension::setChanged)); | ||||
170 | 172 | | |||
171 | setMinimum(min); | 173 | setMinimum(min); | ||
172 | setMaximum(max); | 174 | setMaximum(max); | ||
173 | 175 | | |||
174 | loadInitialValue(); | 176 | loadInitialValue(); | ||
175 | } | 177 | } | ||
176 | 178 | | |||
177 | KonfiguratorSpinBox::~KonfiguratorSpinBox() | 179 | KonfiguratorSpinBox::~KonfiguratorSpinBox() | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
245 | } | 247 | } | ||
246 | 248 | | |||
247 | void KonfiguratorRadioButtons::addRadioButton(QRadioButton *radioWidget, const QString& name, const QString& value) | 249 | void KonfiguratorRadioButtons::addRadioButton(QRadioButton *radioWidget, const QString& name, const QString& value) | ||
248 | { | 250 | { | ||
249 | radioButtons.append(radioWidget); | 251 | radioButtons.append(radioWidget); | ||
250 | radioNames.push_back(name); | 252 | radioNames.push_back(name); | ||
251 | radioValues.push_back(value); | 253 | radioValues.push_back(value); | ||
252 | 254 | | |||
253 | connect(radioWidget, &QRadioButton::toggled, ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | 255 | connect(radioWidget, &QRadioButton::toggled, | ||
256 | ext, static_cast<void (KonfiguratorExtension::*)()>(&KonfiguratorExtension::setChanged)); | ||||
254 | } | 257 | } | ||
255 | 258 | | |||
256 | QRadioButton * KonfiguratorRadioButtons::find(int index) | 259 | QRadioButton * KonfiguratorRadioButtons::find(int index) | ||
257 | { | 260 | { | ||
258 | if (index < 0 || index >= radioButtons.count()) | 261 | if (index < 0 || index >= radioButtons.count()) | ||
259 | return nullptr; | 262 | return nullptr; | ||
260 | 263 | | |||
261 | return radioButtons.at(index); | 264 | return radioButtons.at(index); | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 338 | KonfiguratorEditBox::KonfiguratorEditBox(QString configGroup, QString name, QString defaultValue, | |||
336 | QWidget *parent, bool restart, int page) : QLineEdit(parent), | 339 | QWidget *parent, bool restart, int page) : QLineEdit(parent), | ||
337 | defaultValue(std::move(defaultValue)) | 340 | defaultValue(std::move(defaultValue)) | ||
338 | { | 341 | { | ||
339 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | 342 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | ||
340 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorEditBox::slotApply); | 343 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorEditBox::slotApply); | ||
341 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorEditBox::slotSetDefaults); | 344 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorEditBox::slotSetDefaults); | ||
342 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorEditBox::loadInitialValue); | 345 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorEditBox::loadInitialValue); | ||
343 | 346 | | |||
344 | connect(this, &KonfiguratorEditBox::textChanged, ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | 347 | connect(this, &KonfiguratorEditBox::textChanged, | ||
348 | ext, static_cast<void (KonfiguratorExtension::*)()>(&KonfiguratorExtension::setChanged)); | ||||
345 | 349 | | |||
346 | loadInitialValue(); | 350 | loadInitialValue(); | ||
347 | } | 351 | } | ||
348 | 352 | | |||
349 | KonfiguratorEditBox::~KonfiguratorEditBox() | 353 | KonfiguratorEditBox::~KonfiguratorEditBox() | ||
350 | { | 354 | { | ||
351 | delete ext; | 355 | delete ext; | ||
352 | } | 356 | } | ||
Show All 25 Lines | 380 | KonfiguratorURLRequester::KonfiguratorURLRequester(QString configGroup, QString name, | |||
378 | bool restart, int page, bool expansion) | 382 | bool restart, int page, bool expansion) | ||
379 | : KUrlRequester(parent), defaultValue(std::move(defaultValue)), expansion(expansion) | 383 | : KUrlRequester(parent), defaultValue(std::move(defaultValue)), expansion(expansion) | ||
380 | { | 384 | { | ||
381 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | 385 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | ||
382 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorURLRequester::slotApply); | 386 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorURLRequester::slotApply); | ||
383 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorURLRequester::slotSetDefaults); | 387 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorURLRequester::slotSetDefaults); | ||
384 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorURLRequester::loadInitialValue); | 388 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorURLRequester::loadInitialValue); | ||
385 | 389 | | |||
386 | connect(this, &KonfiguratorURLRequester::textChanged, ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | 390 | connect(this, &KonfiguratorURLRequester::textChanged, | ||
391 | ext, static_cast<void (KonfiguratorExtension::*)()>(&KonfiguratorExtension::setChanged)); | ||||
387 | 392 | | |||
388 | loadInitialValue(); | 393 | loadInitialValue(); | ||
389 | } | 394 | } | ||
390 | 395 | | |||
391 | KonfiguratorURLRequester::~KonfiguratorURLRequester() | 396 | KonfiguratorURLRequester::~KonfiguratorURLRequester() | ||
392 | { | 397 | { | ||
393 | delete ext; | 398 | delete ext; | ||
394 | } | 399 | } | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 495 | { | |||
496 | } | 501 | } | ||
497 | 502 | | |||
498 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | 503 | ext = new KonfiguratorExtension(this, std::move(configGroup), std::move(name), restart, page); | ||
499 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorComboBox::slotApply); | 504 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorComboBox::slotApply); | ||
500 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorComboBox::slotSetDefaults); | 505 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorComboBox::slotSetDefaults); | ||
501 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorComboBox::loadInitialValue); | 506 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorComboBox::loadInitialValue); | ||
502 | 507 | | |||
503 | //connect(this, &KonfiguratorComboBox::highlighted, ext, &KonfiguratorExtension::setChanged); /* Removed because of startup combo failure */ | 508 | //connect(this, &KonfiguratorComboBox::highlighted, ext, &KonfiguratorExtension::setChanged); /* Removed because of startup combo failure */ | ||
504 | connect(this, QOverload<int>::of(&KonfiguratorComboBox::activated), ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | 509 | connect(this, static_cast<void (KonfiguratorComboBox::*)(int)>(&KonfiguratorComboBox::activated), | ||
505 | connect(this, &KonfiguratorComboBox::currentTextChanged, ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | 510 | ext, static_cast<void (KonfiguratorExtension::*)()>(&KonfiguratorExtension::setChanged)); | ||
511 | connect(this, &KonfiguratorComboBox::currentTextChanged, | ||||
512 | ext, static_cast<void (KonfiguratorExtension::*)()>(&KonfiguratorExtension::setChanged)); | ||||
506 | 513 | | |||
507 | setEditable(editable); | 514 | setEditable(editable); | ||
508 | loadInitialValue(); | 515 | loadInitialValue(); | ||
509 | } | 516 | } | ||
510 | 517 | | |||
511 | KonfiguratorComboBox::~KonfiguratorComboBox() | 518 | KonfiguratorComboBox::~KonfiguratorComboBox() | ||
512 | { | 519 | { | ||
513 | delete []list; | 520 | delete []list; | ||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 574 | { | |||
592 | addColor(i18n("Dark Magenta"), Qt::darkMagenta); | 599 | addColor(i18n("Dark Magenta"), Qt::darkMagenta); | ||
593 | addColor(i18n("Dark Yellow"), Qt::darkYellow); | 600 | addColor(i18n("Dark Yellow"), Qt::darkYellow); | ||
594 | addColor(i18n("White"), Qt::white); | 601 | addColor(i18n("White"), Qt::white); | ||
595 | addColor(i18n("Light Gray"), Qt::lightGray); | 602 | addColor(i18n("Light Gray"), Qt::lightGray); | ||
596 | addColor(i18n("Gray"), Qt::gray); | 603 | addColor(i18n("Gray"), Qt::gray); | ||
597 | addColor(i18n("Dark Gray"), Qt::darkGray); | 604 | addColor(i18n("Dark Gray"), Qt::darkGray); | ||
598 | addColor(i18n("Black"), Qt::black); | 605 | addColor(i18n("Black"), Qt::black); | ||
599 | 606 | | |||
600 | connect(this, QOverload<int>::of(&KonfiguratorColorChooser::activated), this, &KonfiguratorColorChooser::slotCurrentChanged); | 607 | connect(this, static_cast<void (KonfiguratorColorChooser::*)(int)>(&KonfiguratorColorChooser::activated), | ||
608 | this, &KonfiguratorColorChooser::slotCurrentChanged); | ||||
601 | 609 | | |||
602 | loadInitialValue(); | 610 | loadInitialValue(); | ||
603 | } | 611 | } | ||
604 | 612 | | |||
605 | KonfiguratorColorChooser::~KonfiguratorColorChooser() | 613 | KonfiguratorColorChooser::~KonfiguratorColorChooser() | ||
606 | { | 614 | { | ||
607 | delete ext; | 615 | delete ext; | ||
608 | } | 616 | } | ||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |