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
Marco Bubke
flatpak-qt-creator
Commits
22773fc8
Commit
22773fc8
authored
Mar 04, 2010
by
Daniel Molkentin
Browse files
Shortcutsettings/FakeVim: Indicate modified shortcuts/regexps.
Fixes: QTCREATORBUG-559
parent
c642d929
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/dialogs/shortcutsettings.cpp
View file @
22773fc8
...
...
@@ -180,6 +180,21 @@ void ShortcutSettings::keyChanged()
if
(
current
&&
current
->
data
(
0
,
Qt
::
UserRole
).
isValid
())
{
ShortcutItem
*
scitem
=
qVariantValue
<
ShortcutItem
*>
(
current
->
data
(
0
,
Qt
::
UserRole
));
scitem
->
m_key
=
QKeySequence
(
m_key
[
0
],
m_key
[
1
],
m_key
[
2
],
m_key
[
3
]);
if
(
scitem
->
m_cmd
->
defaultKeySequence
()
!=
scitem
->
m_key
)
{
QFont
f
=
current
->
font
(
0
);
f
.
setItalic
(
true
);
current
->
setFont
(
0
,
f
);
current
->
setFont
(
1
,
f
);
f
.
setBold
(
true
);
current
->
setFont
(
2
,
f
);
}
else
{
QFont
f
=
current
->
font
(
0
);
f
.
setItalic
(
false
);
f
.
setBold
(
false
);
current
->
setFont
(
0
,
f
);
current
->
setFont
(
1
,
f
);
current
->
setFont
(
2
,
f
);
}
current
->
setText
(
2
,
scitem
->
m_key
);
}
}
...
...
@@ -333,6 +348,16 @@ void ShortcutSettings::initialize()
}
item
->
setText
(
2
,
s
->
m_key
);
if
(
s
->
m_cmd
->
defaultKeySequence
()
!=
s
->
m_key
)
{
QFont
f
=
item
->
font
(
0
);
f
.
setItalic
(
true
);
item
->
setFont
(
0
,
f
);
item
->
setFont
(
1
,
f
);
f
.
setBold
(
true
);
item
->
setFont
(
2
,
f
);
}
item
->
setData
(
0
,
Qt
::
UserRole
,
qVariantFromValue
(
s
));
}
}
...
...
src/plugins/fakevim/fakevimplugin.cpp
View file @
22773fc8
...
...
@@ -390,6 +390,16 @@ void FakeVimExCommandsPage::initialize()
item
->
setText
(
2
,
ci
->
m_regex
);
item
->
setData
(
0
,
Qt
::
UserRole
,
qVariantFromValue
(
ci
));
if
(
ci
->
m_regex
!=
s_defaultExCommandMap
[
name
].
pattern
())
{
QFont
f
=
item
->
font
(
0
);
f
.
setItalic
(
true
);
item
->
setFont
(
0
,
f
);
item
->
setFont
(
1
,
f
);
f
.
setBold
(
true
);
item
->
setFont
(
2
,
f
);
}
}
commandChanged
(
0
);
...
...
@@ -402,6 +412,7 @@ void FakeVimExCommandsPage::commandChanged(QTreeWidgetItem *current)
m_ui
.
seqGrp
->
setEnabled
(
false
);
return
;
}
m_ui
.
seqGrp
->
setEnabled
(
true
);
CommandItem
*
citem
=
qVariantValue
<
CommandItem
*>
(
current
->
data
(
0
,
Qt
::
UserRole
));
m_ui
.
regexEdit
->
setText
(
citem
->
m_regex
);
...
...
@@ -417,14 +428,36 @@ void FakeVimExCommandsPage::filterChanged(const QString &f)
void
FakeVimExCommandsPage
::
regexChanged
()
{
UniqueIDManager
*
uidm
=
UniqueIDManager
::
instance
();
QTreeWidgetItem
*
current
=
m_ui
.
commandList
->
currentItem
();
if
(
current
&&
current
->
data
(
0
,
Qt
::
UserRole
).
isValid
())
{
CommandItem
*
citem
=
qVariantValue
<
CommandItem
*>
(
current
->
data
(
0
,
Qt
::
UserRole
));
if
(
!
current
)
return
;
UniqueIDManager
*
uidm
=
UniqueIDManager
::
instance
();
CommandItem
*
citem
=
qVariantValue
<
CommandItem
*>
(
current
->
data
(
0
,
Qt
::
UserRole
));
const
QString
name
=
uidm
->
stringForUniqueIdentifier
(
citem
->
m_cmd
->
id
());
if
(
current
->
data
(
0
,
Qt
::
UserRole
).
isValid
())
{
citem
->
m_regex
=
m_ui
.
regexEdit
->
text
();
current
->
setText
(
2
,
citem
->
m_regex
);
s_exCommandMap
[
uidm
->
stringForUniqueIdentifier
(
citem
->
m_cmd
->
id
())
]
=
QRegExp
(
citem
->
m_regex
);
s_exCommandMap
[
name
]
=
QRegExp
(
citem
->
m_regex
);
}
if
(
citem
->
m_regex
!=
s_defaultExCommandMap
[
name
].
pattern
())
{
QFont
f
=
current
->
font
(
0
);
f
.
setItalic
(
true
);
current
->
setFont
(
0
,
f
);
current
->
setFont
(
1
,
f
);
f
.
setBold
(
true
);
current
->
setFont
(
2
,
f
);
}
else
{
QFont
f
=
current
->
font
(
0
);
f
.
setItalic
(
false
);
f
.
setBold
(
false
);
current
->
setFont
(
0
,
f
);
current
->
setFont
(
1
,
f
);
current
->
setFont
(
2
,
f
);
}
}
void
FakeVimExCommandsPage
::
setRegex
(
const
QString
&
regex
)
...
...
Write
Preview
Supports
Markdown
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