KTextAddons

voskenginedialog.cpp
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "voskenginedialog.h"
8#include "voskenginelanguagewidget.h"
9#include <KConfigGroup>
10#include <KLocalizedString>
11#include <KSharedConfig>
12#include <KWindowConfig>
13#include <QDialogButtonBox>
14#include <QVBoxLayout>
15#include <QWindow>
16
17namespace
18{
19static const char myConfigGroupName[] = "VoskEngineDialog";
20}
21
22VoskEngineDialog::VoskEngineDialog(QWidget *parent)
23 : QDialog(parent)
24 , mVoskEngineWidget(new VoskEngineLanguageWidget(this))
25{
26 setWindowTitle(i18nc("@title:window", "Vosk Plugin Settings"));
27 auto mainLayout = new QVBoxLayout(this);
28 mainLayout->setObjectName(QStringLiteral("mainLayout"));
29
30 mVoskEngineWidget->setObjectName(QStringLiteral("mVoskEngineWidget"));
31 mainLayout->addWidget(mVoskEngineWidget);
32
34 buttonBox->setObjectName(QStringLiteral("buttonBox"));
35 mainLayout->addWidget(buttonBox);
38 readConfig();
39}
40
41VoskEngineDialog::~VoskEngineDialog()
42{
43 writeConfig();
44}
45
46void VoskEngineDialog::writeConfig()
47{
50}
51
52void VoskEngineDialog::readConfig()
53{
54 create(); // ensure a window is created
55 windowHandle()->resize(QSize(500, 300));
58 resize(windowHandle()->size()); // workaround for QTBUG-40584
59}
60
61#include "moc_voskenginedialog.cpp"
static KSharedConfig::Ptr openStateConfig(const QString &fileName=QString())
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KCONFIGGUI_EXPORT void saveWindowSize(const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal)
KCONFIGGUI_EXPORT void restoreWindowSize(QWindow *window, const KConfigGroup &config)
virtual void accept()
virtual void reject()
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void create(WId window, bool initializeWindow, bool destroyOldWindow)
void resize(const QSize &)
QWindow * windowHandle() const const
void resize(const QSize &newSize)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.