Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Add-ons
Commits
0e22ee0d
Commit
0e22ee0d
authored
Jun 27, 2021
by
Laurent Montel
😁
Browse files
Add reset button
parent
cb233761
Pipeline
#67742
passed with stage
in 54 minutes and 24 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kmail/grammarplugins/languagetool/src/languagetoolconfigdialog.cpp
View file @
0e22ee0d
...
...
@@ -10,6 +10,7 @@
#include <KLocalizedString>
#include <KSharedConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
namespace
...
...
@@ -27,11 +28,12 @@ LanguageToolConfigDialog::LanguageToolConfigDialog(QWidget *parent)
mConfigWidget
->
setObjectName
(
QStringLiteral
(
"configwidget"
));
mainLayout
->
addWidget
(
mConfigWidget
);
auto
box
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
auto
box
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Reset
,
this
);
box
->
setObjectName
(
QStringLiteral
(
"box"
));
mainLayout
->
addWidget
(
box
);
connect
(
box
,
&
QDialogButtonBox
::
accepted
,
this
,
&
LanguageToolConfigDialog
::
accept
);
connect
(
box
,
&
QDialogButtonBox
::
rejected
,
this
,
&
LanguageToolConfigDialog
::
reject
);
connect
(
box
->
button
(
QDialogButtonBox
::
Reset
),
&
QPushButton
::
clicked
,
mConfigWidget
,
&
LanguageToolConfigWidget
::
resetValue
);
readConfig
();
}
...
...
kmail/grammarplugins/languagetool/src/languagetoolconfigwidget.cpp
View file @
0e22ee0d
...
...
@@ -75,6 +75,7 @@ LanguageToolConfigWidget::LanguageToolConfigWidget(QWidget *parent)
mLanguageToolUpdateCombobox
->
refreshListOfLanguages
();
loadSettings
();
updateWidgets
(
mUseLocalInstance
->
isChecked
());
connect
(
this
,
&
LanguageToolConfigWidget
::
resetValue
,
this
,
&
LanguageToolConfigWidget
::
slotResetValue
);
}
LanguageToolConfigWidget
::~
LanguageToolConfigWidget
()
...
...
@@ -82,6 +83,13 @@ LanguageToolConfigWidget::~LanguageToolConfigWidget()
saveSettings
();
}
void
LanguageToolConfigWidget
::
slotResetValue
()
{
mUseLocalInstance
->
setChecked
(
false
);
mInstancePath
->
setText
(
QStringLiteral
(
"https://api.languagetoolplus.com/v2"
));
updateWidgets
(
false
);
}
void
LanguageToolConfigWidget
::
updateWidgets
(
bool
enabled
)
{
mInstancePathLabel
->
setEnabled
(
enabled
);
...
...
kmail/grammarplugins/languagetool/src/languagetoolconfigwidget.h
View file @
0e22ee0d
...
...
@@ -22,9 +22,13 @@ public:
void
loadSettings
();
void
saveSettings
();
Q_SIGNALS:
void
resetValue
();
private:
Q_DISABLE_COPY
(
LanguageToolConfigWidget
)
void
updateWidgets
(
bool
enabled
);
void
slotResetValue
();
QCheckBox
*
mUseLocalInstance
=
nullptr
;
QLineEdit
*
mInstancePath
=
nullptr
;
QLabel
*
mInstancePathLabel
=
nullptr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment