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
0134376e
Commit
0134376e
authored
Mar 05, 2012
by
Kurt Hindenburg
Browse files
-Wshadow fixes to parameter names and variable names
parent
4d63325c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/EditProfileDialog.cpp
View file @
0134376e
...
...
@@ -58,8 +58,8 @@
using
namespace
Konsole
;
EditProfileDialog
::
EditProfileDialog
(
QWidget
*
p
arent
)
:
KDialog
(
p
arent
)
EditProfileDialog
::
EditProfileDialog
(
QWidget
*
aP
arent
)
:
KDialog
(
aP
arent
)
,
_colorSchemeAnimationTimeLine
(
0
)
,
_delayedPreviewTimer
(
new
QTimer
(
this
))
{
...
...
@@ -362,13 +362,13 @@ void EditProfileDialog::insertRemoteTabTitleText(const QString& text)
{
_ui
->
remoteTabTitleEdit
->
insert
(
text
);
}
void
EditProfileDialog
::
saveGeometryOnExit
(
bool
sav
e
)
void
EditProfileDialog
::
saveGeometryOnExit
(
bool
valu
e
)
{
updateTempProfileProperty
(
Profile
::
SaveGeometryOnExit
,
sav
e
);
updateTempProfileProperty
(
Profile
::
SaveGeometryOnExit
,
valu
e
);
}
void
EditProfileDialog
::
showTerminalSizeHint
(
bool
show
)
void
EditProfileDialog
::
showTerminalSizeHint
(
bool
value
)
{
updateTempProfileProperty
(
Profile
::
ShowTerminalSizeHint
,
show
);
updateTempProfileProperty
(
Profile
::
ShowTerminalSizeHint
,
value
);
}
void
EditProfileDialog
::
tabTitleFormatChanged
(
const
QString
&
format
)
{
...
...
@@ -468,13 +468,13 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
// setup font preview
bool
antialias
=
profile
->
property
<
bool
>
(
Profile
::
AntiAliasFonts
);
QFont
f
ont
=
profile
->
font
();
f
ont
.
setStyleStrategy
(
antialias
?
QFont
::
PreferAntialias
:
QFont
::
NoAntialias
);
QFont
profileF
ont
=
profile
->
font
();
profileF
ont
.
setStyleStrategy
(
antialias
?
QFont
::
PreferAntialias
:
QFont
::
NoAntialias
);
_ui
->
fontPreviewLabel
->
installEventFilter
(
this
);
_ui
->
fontPreviewLabel
->
setFont
(
f
ont
);
setFontSliderRange
(
f
ont
);
setFontSliderValue
(
f
ont
);
_ui
->
fontPreviewLabel
->
setFont
(
profileF
ont
);
setFontSliderRange
(
profileF
ont
);
setFontSliderValue
(
profileF
ont
);
connect
(
_ui
->
fontSizeSlider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
setFontSize
(
int
)));
...
...
@@ -493,11 +493,11 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
}
void
EditProfileDialog
::
setAntialiasText
(
bool
enable
)
{
QFont
f
ont
=
_ui
->
fontPreviewLabel
->
font
();
f
ont
.
setStyleStrategy
(
enable
?
QFont
::
PreferAntialias
:
QFont
::
NoAntialias
);
QFont
profileF
ont
=
_ui
->
fontPreviewLabel
->
font
();
profileF
ont
.
setStyleStrategy
(
enable
?
QFont
::
PreferAntialias
:
QFont
::
NoAntialias
);
// update preview to reflect text smoothing state
fontSelected
(
f
ont
);
fontSelected
(
profileF
ont
);
updateTempProfileProperty
(
Profile
::
AntiAliasFonts
,
enable
);
}
void
EditProfileDialog
::
setBoldIntense
(
bool
enable
)
...
...
@@ -572,8 +572,8 @@ void EditProfileDialog::updateKeyBindingsList(bool selectCurrentTranslator)
QStandardItem
*
selectedItem
=
0
;
QList
<
QString
>
translatorNames
=
keyManager
->
allTranslators
();
foreach
(
const
QString
&
n
ame
,
translatorNames
)
{
const
KeyboardTranslator
*
translator
=
keyManager
->
findTranslator
(
n
ame
);
foreach
(
const
QString
&
translatorN
ame
,
translatorNames
)
{
const
KeyboardTranslator
*
translator
=
keyManager
->
findTranslator
(
translatorN
ame
);
QStandardItem
*
item
=
new
QStandardItem
(
translator
->
description
());
item
->
setData
(
QVariant
::
fromValue
(
translator
),
Qt
::
UserRole
+
1
);
...
...
@@ -592,22 +592,22 @@ void EditProfileDialog::updateKeyBindingsList(bool selectCurrentTranslator)
QItemSelectionModel
::
Select
);
}
}
bool
EditProfileDialog
::
eventFilter
(
QObject
*
watched
,
QEvent
*
e
vent
)
bool
EditProfileDialog
::
eventFilter
(
QObject
*
watched
,
QEvent
*
aE
vent
)
{
if
(
watched
==
_ui
->
colorSchemeList
&&
e
vent
->
type
()
==
QEvent
::
Leave
)
{
if
(
watched
==
_ui
->
colorSchemeList
&&
aE
vent
->
type
()
==
QEvent
::
Leave
)
{
if
(
_tempProfile
->
isPropertySet
(
Profile
::
ColorScheme
))
preview
(
Profile
::
ColorScheme
,
_tempProfile
->
colorScheme
());
else
unpreview
(
Profile
::
ColorScheme
);
}
if
(
watched
==
_ui
->
fontPreviewLabel
&&
e
vent
->
type
()
==
QEvent
::
FontChange
)
{
if
(
watched
==
_ui
->
fontPreviewLabel
&&
aE
vent
->
type
()
==
QEvent
::
FontChange
)
{
const
QFont
&
labelFont
=
_ui
->
fontPreviewLabel
->
font
();
qreal
s
ize
=
labelFont
.
pointSizeF
();
QString
fontSize
=
KGlobal
::
locale
()
->
formatNumber
(
s
ize
,
s
ize
==
floor
(
s
ize
)
?
0
:
1
);
qreal
fontS
ize
F
=
labelFont
.
pointSizeF
();
QString
fontSize
=
KGlobal
::
locale
()
->
formatNumber
(
fontS
ize
F
,
fontS
ize
F
==
floor
(
fontS
ize
F
)
?
0
:
1
);
_ui
->
fontPreviewLabel
->
setText
(
i18n
(
"%1, size %2"
,
labelFont
.
family
(),
fontSize
));
}
return
KDialog
::
eventFilter
(
watched
,
e
vent
);
return
KDialog
::
eventFilter
(
watched
,
aE
vent
);
}
void
EditProfileDialog
::
unpreviewAll
()
{
...
...
@@ -625,22 +625,22 @@ void EditProfileDialog::unpreviewAll()
if
(
!
map
.
isEmpty
())
SessionManager
::
instance
()
->
changeProfile
(
_profile
,
map
,
false
);
}
void
EditProfileDialog
::
unpreview
(
int
p
roperty
)
void
EditProfileDialog
::
unpreview
(
int
aP
roperty
)
{
_delayedPreviewProperties
.
remove
(
p
roperty
);
_delayedPreviewProperties
.
remove
(
aP
roperty
);
if
(
!
_previewedProperties
.
contains
(
p
roperty
))
if
(
!
_previewedProperties
.
contains
(
aP
roperty
))
return
;
QHash
<
Profile
::
Property
,
QVariant
>
map
;
map
.
insert
((
Profile
::
Property
)
p
roperty
,
_previewedProperties
[
p
roperty
]);
map
.
insert
((
Profile
::
Property
)
aP
roperty
,
_previewedProperties
[
aP
roperty
]);
SessionManager
::
instance
()
->
changeProfile
(
_profile
,
map
,
false
);
_previewedProperties
.
remove
(
p
roperty
);
_previewedProperties
.
remove
(
aP
roperty
);
}
void
EditProfileDialog
::
delayedPreview
(
int
p
roperty
,
const
QVariant
&
value
)
void
EditProfileDialog
::
delayedPreview
(
int
aP
roperty
,
const
QVariant
&
value
)
{
_delayedPreviewProperties
.
insert
(
p
roperty
,
value
);
_delayedPreviewProperties
.
insert
(
aP
roperty
,
value
);
_delayedPreviewTimer
->
stop
();
_delayedPreviewTimer
->
start
(
300
);
...
...
@@ -655,12 +655,12 @@ void EditProfileDialog::delayedPreviewActivate()
preview
(
iter
.
key
(),
iter
.
value
());
}
}
void
EditProfileDialog
::
preview
(
int
p
roperty
,
const
QVariant
&
value
)
void
EditProfileDialog
::
preview
(
int
aP
roperty
,
const
QVariant
&
value
)
{
QHash
<
Profile
::
Property
,
QVariant
>
map
;
map
.
insert
((
Profile
::
Property
)
p
roperty
,
value
);
map
.
insert
((
Profile
::
Property
)
aP
roperty
,
value
);
_delayedPreviewProperties
.
remove
(
p
roperty
);
_delayedPreviewProperties
.
remove
(
aP
roperty
);
const
Profile
::
Ptr
original
=
lookupProfile
();
...
...
@@ -670,11 +670,11 @@ void EditProfileDialog::preview(int property , const QVariant& value)
// TODO - Save the original values for each profile and use to unpreview properties
ProfileGroup
::
Ptr
group
=
original
->
asGroup
();
if
(
group
&&
group
->
profiles
().
count
()
>
1
&&
original
->
property
<
QVariant
>
((
Profile
::
Property
)
p
roperty
).
isNull
())
original
->
property
<
QVariant
>
((
Profile
::
Property
)
aP
roperty
).
isNull
())
return
;
if
(
!
_previewedProperties
.
contains
(
p
roperty
))
{
_previewedProperties
.
insert
(
p
roperty
,
original
->
property
<
QVariant
>
((
Profile
::
Property
)
p
roperty
));
if
(
!
_previewedProperties
.
contains
(
aP
roperty
))
{
_previewedProperties
.
insert
(
aP
roperty
,
original
->
property
<
QVariant
>
((
Profile
::
Property
)
aP
roperty
));
}
// temporary change to color scheme
...
...
@@ -805,9 +805,9 @@ void EditProfileDialog::createTempProfile()
_tempProfile
->
setHidden
(
true
);
}
void
EditProfileDialog
::
updateTempProfileProperty
(
Profile
::
Property
p
roperty
,
const
QVariant
&
value
)
void
EditProfileDialog
::
updateTempProfileProperty
(
Profile
::
Property
aP
roperty
,
const
QVariant
&
value
)
{
_tempProfile
->
setProperty
(
p
roperty
,
value
);
_tempProfile
->
setProperty
(
aP
roperty
,
value
);
updateButtonApply
();
}
...
...
@@ -819,18 +819,18 @@ void EditProfileDialog::updateButtonApply()
while
(
iter
.
hasNext
())
{
iter
.
next
();
Profile
::
Property
p
roperty
=
iter
.
key
();
Profile
::
Property
aP
roperty
=
iter
.
key
();
QVariant
value
=
iter
.
value
()
;
// for previewed property
if
(
_previewedProperties
.
contains
(
int
(
p
roperty
)))
{
if
(
value
!=
_previewedProperties
.
value
(
int
(
p
roperty
)))
{
if
(
_previewedProperties
.
contains
(
int
(
aP
roperty
)))
{
if
(
value
!=
_previewedProperties
.
value
(
int
(
aP
roperty
)))
{
userModified
=
true
;
break
;
}
}
// for not-previewed property
else
if
((
value
!=
_profile
->
property
<
QVariant
>
(
p
roperty
)))
{
else
if
((
value
!=
_profile
->
property
<
QVariant
>
(
aP
roperty
)))
{
userModified
=
true
;
break
;
}
...
...
@@ -1147,17 +1147,17 @@ void EditProfileDialog::toggleResizeWindow(bool enable)
{
updateTempProfileProperty
(
Profile
::
AllowProgramsToResizeWindow
,
enable
);
}
void
EditProfileDialog
::
fontSelected
(
const
QFont
&
f
ont
)
void
EditProfileDialog
::
fontSelected
(
const
QFont
&
aF
ont
)
{
QFont
previewFont
=
f
ont
;
QFont
previewFont
=
aF
ont
;
setFontSliderRange
(
f
ont
);
setFontSliderValue
(
f
ont
);
setFontSliderRange
(
aF
ont
);
setFontSliderValue
(
aF
ont
);
_ui
->
fontPreviewLabel
->
setFont
(
previewFont
);
preview
(
Profile
::
Font
,
f
ont
);
updateTempProfileProperty
(
Profile
::
Font
,
f
ont
);
preview
(
Profile
::
Font
,
aF
ont
);
updateTempProfileProperty
(
Profile
::
Font
,
aF
ont
);
}
void
EditProfileDialog
::
showFontDialog
()
...
...
@@ -1196,23 +1196,23 @@ void EditProfileDialog::setFontSize(int pointSize)
updateTempProfileProperty
(
Profile
::
Font
,
newFont
);
}
void
EditProfileDialog
::
setFontSliderRange
(
const
QFont
&
f
ont
)
void
EditProfileDialog
::
setFontSliderRange
(
const
QFont
&
aF
ont
)
{
QSlider
*
slider
=
_ui
->
fontSizeSlider
;
// Minimum on the slider is 4,
// Maximum is the greater of 2 times the current size and 14
slider
->
setRange
(
qMin
(
4
*
10
,
qRound
(
f
ont
.
pointSizeF
()
*
10
)),
qMax
(
14
*
10
,
2
*
qRound
(
f
ont
.
pointSize
()
*
10
)));
slider
->
setRange
(
qMin
(
4
*
10
,
qRound
(
aF
ont
.
pointSizeF
()
*
10
)),
qMax
(
14
*
10
,
2
*
qRound
(
aF
ont
.
pointSize
()
*
10
)));
}
void
EditProfileDialog
::
setFontSliderValue
(
const
QFont
&
f
ont
)
void
EditProfileDialog
::
setFontSliderValue
(
const
QFont
&
aF
ont
)
{
_ui
->
fontSizeSlider
->
setValue
(
qRound
(
f
ont
.
pointSize
()
*
10
));
_ui
->
fontSizeSlider
->
setValue
(
qRound
(
aF
ont
.
pointSize
()
*
10
));
}
ColorSchemeViewDelegate
::
ColorSchemeViewDelegate
(
QObject
*
p
arent
)
:
QAbstractItemDelegate
(
p
arent
)
ColorSchemeViewDelegate
::
ColorSchemeViewDelegate
(
QObject
*
aP
arent
)
:
QAbstractItemDelegate
(
aP
arent
)
{
}
...
...
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