Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2d37a070
Commit
2d37a070
authored
Sep 28, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: correctly save the keys, indepententy from the locale
parent
5e3714e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+7
-7
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.cpp
+2
-2
modules/gui/qt4/util/customwidgets.hpp
modules/gui/qt4/util/customwidgets.hpp
+1
-1
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
2d37a070
...
...
@@ -1228,11 +1228,11 @@ void KeySelectorControl::finish()
treeItem
->
setData
(
ACTION_COL
,
Qt
::
UserRole
,
QVariant
(
qfu
(
p_config_item
->
psz_name
)
)
);
QString
keys
=
qfu
(
p_config_item
->
value
.
psz
);
QString
keys
=
qfu
(
p_config_item
->
value
.
psz
?
_
(
p_config_item
->
value
.
psz
)
:
""
);
treeItem
->
setText
(
HOTKEY_COL
,
keys
);
treeItem
->
setToolTip
(
HOTKEY_COL
,
qtr
(
"Double click to change.
\n
Delete key to remove."
)
);
treeItem
->
setToolTip
(
GLOBAL_HOTKEY_COL
,
qtr
(
"Double click to change.
\n
Delete key to remove."
)
);
treeItem
->
setData
(
HOTKEY_COL
,
Qt
::
UserRole
,
QVariant
(
keys
)
);
treeItem
->
setData
(
HOTKEY_COL
,
Qt
::
UserRole
,
QVariant
(
p_config_item
->
value
.
psz
)
);
table
->
addTopLevelItem
(
treeItem
);
continue
;
}
...
...
@@ -1313,7 +1313,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem, int column )
if
(
d
->
result
()
==
QDialog
::
Accepted
)
{
QString
newKey
=
VLCKeyToString
(
d
->
keyValue
);
QString
newKey
=
VLCKeyToString
(
d
->
keyValue
,
false
);
/* In case of conflict, reset other keys*/
if
(
d
->
conflicts
)
...
...
@@ -1331,7 +1331,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem, int column )
}
}
keyItem
->
setText
(
column
,
newKey
);
keyItem
->
setText
(
column
,
VLCKeyToString
(
d
->
keyValue
,
true
)
);
keyItem
->
setData
(
column
,
Qt
::
UserRole
,
newKey
);
}
else
if
(
d
->
result
()
==
2
)
...
...
@@ -1448,7 +1448,7 @@ void KeyInputDialog::setExistingkeysSet( const QSet<QString> *keyset )
void
KeyInputDialog
::
checkForConflicts
(
int
i_vlckey
,
const
QString
&
sequence
)
{
QList
<
QTreeWidgetItem
*>
conflictList
=
table
->
findItems
(
VLCKeyToString
(
i_vlckey
),
Qt
::
MatchExactly
,
table
->
findItems
(
VLCKeyToString
(
i_vlckey
,
true
),
Qt
::
MatchExactly
,
b_global
?
2
:
1
);
if
(
conflictList
.
count
()
&&
...
...
@@ -1491,7 +1491,7 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
int
i_vlck
=
qtEventToVLCKey
(
e
);
QKeySequence
sequence
(
e
->
key
()
|
e
->
modifiers
()
);
selected
->
setText
(
qtr
(
"Key or combination: "
)
+
QString
(
"<b>%1</b>"
).
arg
(
VLCKeyToString
(
i_vlck
)
)
);
+
QString
(
"<b>%1</b>"
).
arg
(
VLCKeyToString
(
i_vlck
,
true
)
)
);
checkForConflicts
(
i_vlck
,
sequence
.
toString
()
);
keyValue
=
i_vlck
;
}
...
...
@@ -1499,7 +1499,7 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
void
KeyInputDialog
::
wheelEvent
(
QWheelEvent
*
e
)
{
int
i_vlck
=
qtWheelEventToVLCKey
(
e
);
selected
->
setText
(
qtr
(
"Key: "
)
+
VLCKeyToString
(
i_vlck
)
);
selected
->
setText
(
qtr
(
"Key: "
)
+
VLCKeyToString
(
i_vlck
,
true
)
);
checkForConflicts
(
i_vlck
,
QString
()
);
keyValue
=
i_vlck
;
}
...
...
modules/gui/qt4/util/customwidgets.cpp
View file @
2d37a070
...
...
@@ -306,9 +306,9 @@ int qtWheelEventToVLCKey( QWheelEvent *e )
return
i_vlck
;
}
QString
VLCKeyToString
(
unsigned
val
)
QString
VLCKeyToString
(
unsigned
val
,
bool
locale
)
{
char
*
base
=
vlc_keycode2str
(
val
,
tru
e
);
char
*
base
=
vlc_keycode2str
(
val
,
local
e
);
if
(
base
==
NULL
)
return
qtr
(
"Unset"
);
...
...
modules/gui/qt4/util/customwidgets.hpp
View file @
2d37a070
...
...
@@ -177,6 +177,6 @@ class QInputEvent;
int
qtKeyModifiersToVLC
(
QInputEvent
*
e
);
int
qtEventToVLCKey
(
QKeyEvent
*
e
);
int
qtWheelEventToVLCKey
(
QWheelEvent
*
e
);
QString
VLCKeyToString
(
unsigned
val
);
QString
VLCKeyToString
(
unsigned
val
,
bool
);
#endif
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