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
Utilities
Konsole
Commits
13bcea61
Commit
13bcea61
authored
Jul 02, 2020
by
Tomaz Canabrava
Browse files
Clean EditProfileDialog out of Qt4 connection Style
parent
4f726439
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/EditProfileDialog.cpp
View file @
13bcea61
...
...
@@ -1504,22 +1504,6 @@ void EditProfileDialog::resetKeyBindings()
}
}
void
EditProfileDialog
::
setupCheckBoxes
(
const
QVector
<
BooleanOption
>&
options
,
const
Profile
::
Ptr
&
profile
)
{
for
(
const
auto
&
option
:
options
)
{
option
.
button
->
setChecked
(
profile
->
property
<
bool
>
(
option
.
property
));
connect
(
option
.
button
,
SIGNAL
(
toggled
(
bool
)),
this
,
option
.
slot
);
}
}
void
EditProfileDialog
::
setupRadio
(
const
QVector
<
RadioOption
>&
possibilities
,
int
actual
)
{
for
(
const
auto
&
possibility
:
possibilities
)
{
possibility
.
button
->
setChecked
(
possibility
.
value
==
actual
);
connect
(
possibility
.
button
,
SIGNAL
(
clicked
()),
this
,
possibility
.
slot
);
}
}
void
EditProfileDialog
::
setupButtonGroup
(
const
ButtonGroupOptions
&
options
,
const
Profile
::
Ptr
&
profile
)
{
auto
currentValue
=
profile
->
property
<
int
>
(
options
.
profileProperty
);
...
...
@@ -1642,10 +1626,10 @@ void EditProfileDialog::setupMousePage(const Profile::Ptr &profile)
// setup middle click paste mode
const
auto
middleClickPasteMode
=
profile
->
property
<
int
>
(
Profile
::
MiddleClickPasteMode
);
const
auto
pasteModes
=
QVector
<
RadioOption
>
{
{
_mouseUi
->
pasteFromX11SelectionButton
,
Enum
::
PasteFromX11Selection
,
SLOT
(
pasteFromX11Selection
())},
{
_mouseUi
->
pasteFromClipboardButton
,
Enum
::
PasteFromClipboard
,
SLOT
(
pasteFromClipboard
())}
}
;
setupRadio
(
pasteModes
,
middleClickPasteMode
);
_mouseUi
->
pasteFromX11SelectionButton
->
setChecked
(
Enum
::
PasteFromX11Selection
==
middleClickPasteMode
);
connect
(
_mouseUi
->
pasteFromX11SelectionButton
,
&
QPushButton
::
clicked
,
this
,
&
EditProfileDialog
::
pasteFromX11Selection
);
_mouseUi
->
pasteFromClipboardButton
->
setChecked
(
Enum
::
PasteFromClipboard
==
middleClickPasteMode
)
;
connect
(
_mouseUi
->
pasteFromClipboardButton
,
&
QPushButton
::
clicked
,
this
,
&
EditProfileDialog
::
pasteFromClipboard
);
// interaction options
_mouseUi
->
wordCharacterEdit
->
setText
(
profile
->
wordCharacters
());
...
...
src/EditProfileDialog.h
View file @
13bcea61
...
...
@@ -286,19 +286,6 @@ private:
static
QString
groupProfileNames
(
const
ProfileGroup
::
Ptr
&
group
,
int
maxLength
=
-
1
);
struct
RadioOption
{
QAbstractButton
*
button
;
int
value
;
const
char
*
slot
;
};
void
setupRadio
(
const
QVector
<
RadioOption
>&
possibilities
,
int
actual
);
struct
BooleanOption
{
QAbstractButton
*
button
;
Profile
::
Property
property
;
const
char
*
slot
;
};
void
setupCheckBoxes
(
const
QVector
<
BooleanOption
>&
options
,
const
Profile
::
Ptr
&
profile
);
struct
ButtonGroupOption
{
QAbstractButton
*
button
;
int
value
;
...
...
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