File indexing completed on 2024-05-12 05:03:31

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "systemmessagescombobox.h"
0008 #include "model/systemmessagesmodel.h"
0009 
0010 SystemMessagesComboBox::SystemMessagesComboBox(QWidget *parent)
0011     : QComboBox(parent)
0012     , mSystemMessagesModel(new SystemMessagesModel(this))
0013 {
0014     setModel(mSystemMessagesModel);
0015     connect(mSystemMessagesModel, &SystemMessagesModel::dataChanged, this, &SystemMessagesComboBox::settingsChanged);
0016 }
0017 
0018 SystemMessagesComboBox::~SystemMessagesComboBox() = default;
0019 
0020 void SystemMessagesComboBox::setMessagesSystem(const QStringList &lst)
0021 {
0022     mSystemMessagesModel->setMessagesSystem(lst);
0023 }
0024 
0025 QStringList SystemMessagesComboBox::systemMessagesSelected() const
0026 {
0027     return mSystemMessagesModel->systemMessagesSelected();
0028 }
0029 
0030 #include "moc_systemmessagescombobox.cpp"