Changeset View
Changeset View
Standalone View
Standalone View
krusader/Konfigurator/konfiguratoritems.cpp
Show First 20 Lines • Show All 415 Lines • ▼ Show 20 Line(s) | |||||
416 | 416 | | |||
417 | KonfiguratorFontChooser::KonfiguratorFontChooser(QString configGroup, QString name, QFont defaultValue, | 417 | KonfiguratorFontChooser::KonfiguratorFontChooser(QString configGroup, QString name, QFont defaultValue, | ||
418 | QWidget *parent, bool restart, int page) : QWidget(parent), | 418 | QWidget *parent, bool restart, int page) : QWidget(parent), | ||
419 | defaultValue(defaultValue) | 419 | defaultValue(defaultValue) | ||
420 | { | 420 | { | ||
421 | QHBoxLayout *layout = new QHBoxLayout(this); | 421 | QHBoxLayout *layout = new QHBoxLayout(this); | ||
422 | 422 | | |||
423 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | 423 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | ||
424 | connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); | 424 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorFontChooser::slotApply); | ||
425 | connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); | 425 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorFontChooser::slotSetDefaults); | ||
426 | connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); | 426 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorFontChooser::loadInitialValue); | ||
427 | 427 | | |||
428 | pLabel = new QLabel(this); | 428 | pLabel = new QLabel(this); | ||
429 | pLabel->setMinimumWidth(150); | 429 | pLabel->setMinimumWidth(150); | ||
430 | layout->addWidget(pLabel); | 430 | layout->addWidget(pLabel); | ||
431 | 431 | | |||
432 | pToolButton = new QToolButton(this); | 432 | pToolButton = new QToolButton(this); | ||
433 | 433 | | |||
434 | connect(pToolButton, SIGNAL(clicked()), this, SLOT(slotBrowseFont())); | 434 | connect(pToolButton, &QToolButton::clicked, this, &KonfiguratorFontChooser::slotBrowseFont); | ||
435 | 435 | | |||
436 | pToolButton->setIcon(Icon("document-open")); | 436 | pToolButton->setIcon(Icon("document-open")); | ||
437 | layout->addWidget(pToolButton); | 437 | layout->addWidget(pToolButton); | ||
438 | 438 | | |||
439 | loadInitialValue(); | 439 | loadInitialValue(); | ||
440 | } | 440 | } | ||
441 | 441 | | |||
442 | KonfiguratorFontChooser::~KonfiguratorFontChooser() | 442 | KonfiguratorFontChooser::~KonfiguratorFontChooser() | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 489 | { | |||
490 | list = new KONFIGURATOR_NAME_VALUE_PAIR[ listInLen ]; | 490 | list = new KONFIGURATOR_NAME_VALUE_PAIR[ listInLen ]; | ||
491 | 491 | | |||
492 | for (int i = 0; i != listLen; i++) { | 492 | for (int i = 0; i != listLen; i++) { | ||
493 | list[i] = listIn[i]; | 493 | list[i] = listIn[i]; | ||
494 | addItem(list[i].text); | 494 | addItem(list[i].text); | ||
495 | } | 495 | } | ||
496 | 496 | | |||
497 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | 497 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | ||
498 | connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); | 498 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorComboBox::slotApply); | ||
499 | connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); | 499 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorComboBox::slotSetDefaults); | ||
500 | connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); | 500 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorComboBox::loadInitialValue); | ||
501 | 501 | | |||
502 | // connect( this, SIGNAL(highlighted(int)), ext, SLOT(setChanged()) ); /* Removed because of startup combo failure */ | 502 | //connect(this, &KonfiguratorComboBox::highlighted, ext, &KonfiguratorExtension::setChanged); /* Removed because of startup combo failure */ | ||
503 | connect(this, SIGNAL(activated(int)), ext, SLOT(setChanged())); | 503 | connect(this, QOverload<int>::of(&KonfiguratorComboBox::activated), ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | ||
504 | connect(this, SIGNAL(currentTextChanged(QString)), ext, SLOT(setChanged())); | 504 | connect(this, &KonfiguratorComboBox::currentTextChanged, ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); | ||
505 | 505 | | |||
506 | setEditable(editable); | 506 | setEditable(editable); | ||
507 | loadInitialValue(); | 507 | loadInitialValue(); | ||
508 | } | 508 | } | ||
509 | 509 | | |||
510 | KonfiguratorComboBox::~KonfiguratorComboBox() | 510 | KonfiguratorComboBox::~KonfiguratorComboBox() | ||
511 | { | 511 | { | ||
512 | delete []list; | 512 | delete []list; | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
561 | KonfiguratorColorChooser::KonfiguratorColorChooser(QString configGroup, QString name, | 561 | KonfiguratorColorChooser::KonfiguratorColorChooser(QString configGroup, QString name, | ||
562 | QColor defaultValue, QWidget *parent, | 562 | QColor defaultValue, QWidget *parent, | ||
563 | bool restart, ADDITIONAL_COLOR *addColPtr, | 563 | bool restart, ADDITIONAL_COLOR *addColPtr, | ||
564 | int addColNum, int page) | 564 | int addColNum, int page) | ||
565 | : QComboBox(parent), defaultValue(defaultValue), disableColorChooser(true) | 565 | : QComboBox(parent), defaultValue(defaultValue), disableColorChooser(true) | ||
566 | { | 566 | { | ||
567 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | 567 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | ||
568 | 568 | | |||
569 | connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); | 569 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorColorChooser::slotApply); | ||
570 | connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); | 570 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorColorChooser::slotSetDefaults); | ||
571 | connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); | 571 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorColorChooser::loadInitialValue); | ||
572 | 572 | | |||
573 | addColor(i18n("Custom color"), QColor(255, 255, 255)); | 573 | addColor(i18n("Custom color"), QColor(255, 255, 255)); | ||
574 | addColor(i18nc("Default color", "Default"), defaultValue); | 574 | addColor(i18nc("Default color", "Default"), defaultValue); | ||
575 | 575 | | |||
576 | for (int i = 0; i != addColNum; i++) { | 576 | for (int i = 0; i != addColNum; i++) { | ||
577 | additionalColors.push_back(addColPtr[i]); | 577 | additionalColors.push_back(addColPtr[i]); | ||
578 | addColor(addColPtr[i].name, addColPtr[i].color); | 578 | addColor(addColPtr[i].name, addColPtr[i].color); | ||
579 | } | 579 | } | ||
Show All 11 Lines | |||||
591 | addColor(i18n("Dark Magenta"), Qt::darkMagenta); | 591 | addColor(i18n("Dark Magenta"), Qt::darkMagenta); | ||
592 | addColor(i18n("Dark Yellow"), Qt::darkYellow); | 592 | addColor(i18n("Dark Yellow"), Qt::darkYellow); | ||
593 | addColor(i18n("White"), Qt::white); | 593 | addColor(i18n("White"), Qt::white); | ||
594 | addColor(i18n("Light Gray"), Qt::lightGray); | 594 | addColor(i18n("Light Gray"), Qt::lightGray); | ||
595 | addColor(i18n("Gray"), Qt::gray); | 595 | addColor(i18n("Gray"), Qt::gray); | ||
596 | addColor(i18n("Dark Gray"), Qt::darkGray); | 596 | addColor(i18n("Dark Gray"), Qt::darkGray); | ||
597 | addColor(i18n("Black"), Qt::black); | 597 | addColor(i18n("Black"), Qt::black); | ||
598 | 598 | | |||
599 | connect(this, SIGNAL(activated(int)), this, SLOT(slotCurrentChanged(int))); | 599 | connect(this, QOverload<int>::of(&KonfiguratorColorChooser::activated), this, &KonfiguratorColorChooser::slotCurrentChanged); | ||
600 | 600 | | |||
601 | loadInitialValue(); | 601 | loadInitialValue(); | ||
602 | } | 602 | } | ||
603 | 603 | | |||
604 | KonfiguratorColorChooser::~KonfiguratorColorChooser() | 604 | KonfiguratorColorChooser::~KonfiguratorColorChooser() | ||
605 | { | 605 | { | ||
606 | delete ext; | 606 | delete ext; | ||
607 | } | 607 | } | ||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Line(s) | |||||
763 | // KonfiguratorListBox class | 763 | // KonfiguratorListBox class | ||
764 | /////////////////////////////// | 764 | /////////////////////////////// | ||
765 | 765 | | |||
766 | KonfiguratorListBox::KonfiguratorListBox(QString configGroup, QString name, QStringList defaultValue, | 766 | KonfiguratorListBox::KonfiguratorListBox(QString configGroup, QString name, QStringList defaultValue, | ||
767 | QWidget *parent, bool restart, int page) : KrListWidget(parent), | 767 | QWidget *parent, bool restart, int page) : KrListWidget(parent), | ||
768 | defaultValue(defaultValue) | 768 | defaultValue(defaultValue) | ||
769 | { | 769 | { | ||
770 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | 770 | ext = new KonfiguratorExtension(this, configGroup, name, restart, page); | ||
771 | connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); | 771 | connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorListBox::slotApply); | ||
772 | connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); | 772 | connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorListBox::slotSetDefaults); | ||
773 | connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); | 773 | connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorListBox::loadInitialValue); | ||
774 | 774 | | |||
775 | loadInitialValue(); | 775 | loadInitialValue(); | ||
776 | } | 776 | } | ||
777 | 777 | | |||
778 | KonfiguratorListBox::~KonfiguratorListBox() | 778 | KonfiguratorListBox::~KonfiguratorListBox() | ||
779 | { | 779 | { | ||
780 | delete ext; | 780 | delete ext; | ||
781 | } | 781 | } | ||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |