Changeset View
Changeset View
Standalone View
Standalone View
src/configdialog/dialogs/ExcludedLabelsDialog.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 40 | { | |||
---|---|---|---|---|---|
44 | setLayout(mainLayout); | 44 | setLayout(mainLayout); | ||
45 | mainLayout->addWidget(mainWidget); | 45 | mainLayout->addWidget(mainWidget); | ||
46 | setupUi(mainWidget); | 46 | setupUi(mainWidget); | ||
47 | 47 | | |||
48 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | 48 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | ||
49 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | 49 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | ||
50 | okButton->setDefault(true); | 50 | okButton->setDefault(true); | ||
51 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | 51 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | ||
52 | connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); | 52 | connect(buttonBox, &QDialogButtonBox::accepted, this, &ExcludedLabelsDialog::accept); | ||
53 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); | 53 | connect(buttonBox, &QDialogButtonBox::rejected, this, &ExcludedLabelsDialog::reject); | ||
54 | setWindowTitle( i18n( "Excluded Labels" ) ); | 54 | setWindowTitle( i18n( "Excluded Labels" ) ); | ||
55 | mainLayout->addWidget(buttonBox); | 55 | mainLayout->addWidget(buttonBox); | ||
56 | 56 | | |||
57 | addLabels( config->excludedLabels(), true ); | 57 | addLabels( config->excludedLabels(), true ); | ||
58 | Collections::QueryMaker *qm = CollectionManager::instance()->queryMaker(); | 58 | Collections::QueryMaker *qm = CollectionManager::instance()->queryMaker(); | ||
59 | qm->setQueryType( Collections::QueryMaker::Label ); | 59 | qm->setQueryType( Collections::QueryMaker::Label ); | ||
60 | qm->setAutoDelete( true ); | 60 | qm->setAutoDelete( true ); | ||
61 | connect( qm, SIGNAL(newResultReady(Meta::LabelList)), | 61 | connect( qm, &Collections::QueryMaker::newLabelsReady, | ||
62 | SLOT(slowNewResultReady(Meta::LabelList)) ); | 62 | this, &ExcludedLabelsDialog::slowNewResultReady ); | ||
63 | qm->run(); | 63 | qm->run(); | ||
64 | 64 | | |||
65 | connect( addButton, SIGNAL(clicked(bool)), SLOT(slotAddExcludedLabel()) ); | 65 | connect( addButton, &QAbstractButton::clicked, this, &ExcludedLabelsDialog::slotAddExcludedLabel ); | ||
66 | connect( addLabelLine, SIGNAL(returnPressed(QString)), SLOT(slotAddExcludedLabel()) ); | 66 | connect( addLabelLine, &KLineEdit::returnPressed, this, &ExcludedLabelsDialog::slotAddExcludedLabel ); | ||
67 | connect(okButton, SIGNAL(clicked()), SLOT(slotSaveToConfig()) ); | 67 | connect( okButton, &QAbstractButton::clicked, this, &ExcludedLabelsDialog::slotSaveToConfig ); | ||
68 | } | 68 | } | ||
69 | 69 | | |||
70 | void | 70 | void | ||
71 | ExcludedLabelsDialog::slowNewResultReady( const Meta::LabelList &labels ) | 71 | ExcludedLabelsDialog::slowNewResultReady( const Meta::LabelList &labels ) | ||
72 | { | 72 | { | ||
73 | foreach( const Meta::LabelPtr &label, labels ) | 73 | foreach( const Meta::LabelPtr &label, labels ) | ||
74 | addLabel( label->name() ); | 74 | addLabel( label->name() ); | ||
75 | } | 75 | } | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |