Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1d99daa4 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Spellchecker Runner] Add button to open Spell Check KCM

In the runner's configuration you can only configure the trigger word, whereas language and other settings are in the KCM.
Just add a button to open said KCM

BUG: 398244
FIXED-IN: 5.14.0

Differential Revision: https://phabricator.kde.org/D15427
parent 69dffdd8
......@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "spellcheck_config.h"
#include <QGridLayout>
#include <QProcess>
#include <KConfigGroup>
#include <KPluginFactory>
......@@ -46,6 +47,9 @@ SpellCheckConfig::SpellCheckConfig(QWidget* parent, const QVariantList& args) :
connect(m_ui->m_requireTriggerWord, SIGNAL(stateChanged(int)), this, SLOT(toggleTriggerWord(int)));
connect(m_ui->m_triggerWord, SIGNAL(textChanged(QString)), this, SLOT(changed()));
m_ui->m_openKcmButton->setIcon(QIcon::fromTheme(QStringLiteral("tools-check-spelling")));
connect(m_ui->m_openKcmButton, &QPushButton::clicked, this, &SpellCheckConfig::openKcm);
load();
}
......@@ -62,6 +66,11 @@ void SpellCheckConfig::toggleTriggerWord(int state)
}
}
void SpellCheckConfig::openKcm()
{
QProcess::startDetached(QStringLiteral("kcmshell5"), {QStringLiteral("spellchecking")});
}
void SpellCheckConfig::load()
{
KCModule::load();
......
......@@ -43,6 +43,7 @@ class SpellCheckConfig : public KCModule
void defaults() override;
void toggleTriggerWord(int state);
void openKcm();
private:
SpellCheckConfigForm* m_ui;
......
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SpellCheckConfigUi</class>
<widget class="QWidget" name="SpellCheckConfigUi" >
<property name="geometry" >
<widget class="QWidget" name="SpellCheckConfigUi">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
......@@ -9,43 +10,67 @@
<height>315</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Spell Check Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3" >
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="m_requireTriggerWord" >
<property name="text" >
<widget class="QCheckBox" name="m_requireTriggerWord">
<property name="text">
<string>&amp;Require trigger word</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Trigger word:</string>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>m_triggerWord</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_triggerWord" />
<widget class="QLineEdit" name="m_triggerWord"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="m_openKcmButton">
<property name="text">
<string>Configure Dictionaries...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>193</height>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment