File indexing completed on 2025-01-05 05:18:57

0001 // SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0002 //
0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #include "KLLMConfigureWidget.h"
0006 #include "KLLMModelComboBox.h"
0007 #include <KLocalizedString>
0008 #include <QHBoxLayout>
0009 #include <QLabel>
0010 #include <QVBoxLayout>
0011 
0012 using namespace KLLMWidgets;
0013 KLLMConfigureWidget::KLLMConfigureWidget(QWidget *parent)
0014     : QWidget{parent}
0015     , mKLLMModelComboBox(new KLLMModelComboBox(this))
0016 {
0017     auto mainLayout = new QVBoxLayout(this);
0018     mainLayout->setObjectName(QStringLiteral("mainLayout"));
0019     mainLayout->setContentsMargins({});
0020 
0021     auto modelLayout = new QHBoxLayout;
0022     modelLayout->setObjectName(QStringLiteral("modelLayout"));
0023     mainLayout->addLayout(modelLayout);
0024 
0025     auto label = new QLabel(i18n("Models:"), this);
0026     label->setObjectName(QStringLiteral("label"));
0027     modelLayout->addWidget(label);
0028 
0029     mKLLMModelComboBox->setObjectName(QStringLiteral("mKLLMModelComboBox"));
0030     modelLayout->addWidget(mKLLMModelComboBox);
0031 }
0032 
0033 KLLMConfigureWidget::~KLLMConfigureWidget() = default;
0034 
0035 int KLLMConfigureWidget::currentModel() const
0036 {
0037     return mKLLMModelComboBox->currentIndex();
0038 }
0039 
0040 void KLLMConfigureWidget::setCurrentModel(int index)
0041 {
0042     mKLLMModelComboBox->setCurrentIndex(index);
0043 }
0044 
0045 #include "moc_KLLMConfigureWidget.cpp"