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
Accessibility
KMouth
Commits
19aeff21
Commit
19aeff21
authored
Aug 31, 2021
by
Laurent Montel
😁
Browse files
Fix options dialog
parent
c65b637f
Changes
1
Hide whitespace changes
Inline
Side-by-side
optionsdialog.cpp
View file @
19aeff21
...
...
@@ -121,21 +121,9 @@ OptionsDialog::OptionsDialog(QWidget *parent)
:
KPageDialog
(
parent
)
{
setWindowTitle
(
i18n
(
"Configuration"
));
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Help
|
QDialogButtonBox
::
Apply
);
QWidget
*
mainWidget
=
new
QWidget
(
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
mainLayout
->
addWidget
(
mainWidget
);
QPushButton
*
okButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
okButton
->
setDefault
(
true
);
okButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
QDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
QDialog
::
reject
);
//PORTING SCRIPT: WARNING mainLayout->addWidget(buttonBox) must be last item in layout. Please move it.
mainLayout
->
addWidget
(
buttonBox
);
setFaceType
(
KPageDialog
::
List
);
//setHelp(QLatin1String("config-dialog"));
setStandardButtons
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Help
|
QDialogButtonBox
::
Apply
);
//addGridPage (1, Qt::Horizontal, i18n("General Options"), QString(), iconGeneral);
...
...
@@ -158,12 +146,9 @@ OptionsDialog::OptionsDialog(QWidget *parent)
pageCompletion
->
setHeader
(
i18n
(
"Word Completion"
));
pageCompletion
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"keyboard"
)));
addPage
(
pageCompletion
);
buttonBox
->
button
(
QDialogButtonBox
::
Cancel
)
->
setDefault
(
true
);
connect
(
okButton
,
&
QAbstractButton
::
clicked
,
this
,
&
OptionsDialog
::
slotOk
);
connect
(
buttonBox
->
button
(
QDialogButtonBox
::
Cancel
),
&
QAbstractButton
::
clicked
,
this
,
&
OptionsDialog
::
slotCancel
);
connect
(
buttonBox
->
button
(
QDialogButtonBox
::
Apply
),
&
QAbstractButton
::
clicked
,
this
,
&
OptionsDialog
::
slotApply
);
connect
(
button
(
QDialogButtonBox
::
Ok
),
&
QAbstractButton
::
clicked
,
this
,
&
OptionsDialog
::
slotOk
);
connect
(
button
(
QDialogButtonBox
::
Cancel
),
&
QAbstractButton
::
clicked
,
this
,
&
OptionsDialog
::
slotCancel
);
connect
(
button
(
QDialogButtonBox
::
Apply
),
&
QAbstractButton
::
clicked
,
this
,
&
OptionsDialog
::
slotApply
);
}
OptionsDialog
::~
OptionsDialog
()
...
...
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