Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c06aeca0
Commit
c06aeca0
authored
Apr 25, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: Menus: escape shortcuts in dynamic entries (fix #7123)
parent
a5d592c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.cpp
+7
-6
modules/gui/qt4/qt4.hpp
modules/gui/qt4/qt4.hpp
+1
-0
No files found.
modules/gui/qt4/menus.cpp
View file @
c06aeca0
...
@@ -1239,7 +1239,7 @@ static bool IsMenuEmpty( const char *psz_var,
...
@@ -1239,7 +1239,7 @@ static bool IsMenuEmpty( const char *psz_var,
return
i_result
;
return
i_result
;
}
}
#define TEXT_OR_VAR qfu ( text.psz_string ? text.psz_string : psz_var )
#define TEXT_OR_VAR qfu
e
( text.psz_string ? text.psz_string : psz_var )
void
VLCMenuBar
::
UpdateItem
(
intf_thread_t
*
p_intf
,
QMenu
*
menu
,
void
VLCMenuBar
::
UpdateItem
(
intf_thread_t
*
p_intf
,
QMenu
*
menu
,
const
char
*
psz_var
,
vlc_object_t
*
p_object
,
bool
b_submenu
)
const
char
*
psz_var
,
vlc_object_t
*
p_object
,
bool
b_submenu
)
...
@@ -1423,14 +1423,14 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
...
@@ -1423,14 +1423,14 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
{
{
case
VLC_VAR_VARIABLE
:
case
VLC_VAR_VARIABLE
:
CreateChoicesMenu
(
subsubmenu
,
CURVAL
.
psz_string
,
p_object
,
false
);
CreateChoicesMenu
(
subsubmenu
,
CURVAL
.
psz_string
,
p_object
,
false
);
subsubmenu
->
setTitle
(
qfu
(
CURTEXT
?
CURTEXT
:
CURVAL
.
psz_string
)
);
subsubmenu
->
setTitle
(
qfu
e
(
CURTEXT
?
CURTEXT
:
CURVAL
.
psz_string
)
);
submenu
->
addMenu
(
subsubmenu
);
submenu
->
addMenu
(
subsubmenu
);
break
;
break
;
case
VLC_VAR_STRING
:
case
VLC_VAR_STRING
:
var_Get
(
p_object
,
psz_var
,
&
val
);
var_Get
(
p_object
,
psz_var
,
&
val
);
another_val
.
psz_string
=
strdup
(
CURVAL
.
psz_string
);
another_val
.
psz_string
=
strdup
(
CURVAL
.
psz_string
);
menutext
=
qfu
(
CURTEXT
?
CURTEXT
:
another_val
.
psz_string
);
menutext
=
qfu
e
(
CURTEXT
?
CURTEXT
:
another_val
.
psz_string
);
CreateAndConnect
(
submenu
,
psz_var
,
menutext
,
""
,
RADIO_OR_COMMAND
,
CreateAndConnect
(
submenu
,
psz_var
,
menutext
,
""
,
RADIO_OR_COMMAND
,
p_object
,
another_val
,
i_type
,
p_object
,
another_val
,
i_type
,
val
.
psz_string
&&
!
strcmp
(
val
.
psz_string
,
CURVAL
.
psz_string
)
);
val
.
psz_string
&&
!
strcmp
(
val
.
psz_string
,
CURVAL
.
psz_string
)
);
...
@@ -1440,7 +1440,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
...
@@ -1440,7 +1440,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
case
VLC_VAR_INTEGER
:
case
VLC_VAR_INTEGER
:
var_Get
(
p_object
,
psz_var
,
&
val
);
var_Get
(
p_object
,
psz_var
,
&
val
);
if
(
CURTEXT
)
menutext
=
qfu
(
CURTEXT
);
if
(
CURTEXT
)
menutext
=
qfu
e
(
CURTEXT
);
else
menutext
=
QString
::
number
(
CURVAL
.
i_int
);
else
menutext
=
QString
::
number
(
CURVAL
.
i_int
);
CreateAndConnect
(
submenu
,
psz_var
,
menutext
,
""
,
RADIO_OR_COMMAND
,
CreateAndConnect
(
submenu
,
psz_var
,
menutext
,
""
,
RADIO_OR_COMMAND
,
p_object
,
CURVAL
,
i_type
,
p_object
,
CURVAL
,
i_type
,
...
@@ -1450,7 +1450,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
...
@@ -1450,7 +1450,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
case
VLC_VAR_FLOAT
:
case
VLC_VAR_FLOAT
:
var_Get
(
p_object
,
psz_var
,
&
val
);
var_Get
(
p_object
,
psz_var
,
&
val
);
if
(
CURTEXT
)
menutext
=
qfu
(
CURTEXT
);
if
(
CURTEXT
)
menutext
=
qfu
e
(
CURTEXT
);
else
menutext
.
sprintf
(
"%.2f"
,
CURVAL
.
f_float
);
else
menutext
.
sprintf
(
"%.2f"
,
CURVAL
.
f_float
);
CreateAndConnect
(
submenu
,
psz_var
,
menutext
,
""
,
RADIO_OR_COMMAND
,
CreateAndConnect
(
submenu
,
psz_var
,
menutext
,
""
,
RADIO_OR_COMMAND
,
p_object
,
CURVAL
,
i_type
,
p_object
,
CURVAL
,
i_type
,
...
@@ -1469,6 +1469,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
...
@@ -1469,6 +1469,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
#undef RADIO_OR_COMMAND
#undef RADIO_OR_COMMAND
#undef CURVAL
#undef CURVAL
#undef CURTEXT
#undef CURTEXT
return
submenu
->
isEmpty
()
?
VLC_EGENERIC
:
VLC_SUCCESS
;
return
submenu
->
isEmpty
()
?
VLC_EGENERIC
:
VLC_SUCCESS
;
}
}
...
@@ -1555,7 +1556,7 @@ void VLCMenuBar::updateAudioDevice( intf_thread_t * p_intf, audio_output_t *p_ao
...
@@ -1555,7 +1556,7 @@ void VLCMenuBar::updateAudioDevice( intf_thread_t * p_intf, audio_output_t *p_ao
for
(
int
i
=
0
;
i
<
i_result
;
i
++
)
for
(
int
i
=
0
;
i
<
i_result
;
i
++
)
{
{
action
=
new
QAction
(
qfu
(
names
[
i
]
),
NULL
);
action
=
new
QAction
(
qfu
e
(
names
[
i
]
),
NULL
);
action
->
setData
(
ids
[
i
]
);
action
->
setData
(
ids
[
i
]
);
action
->
setCheckable
(
true
);
action
->
setCheckable
(
true
);
if
(
selected
&&
!
strcmp
(
ids
[
i
],
selected
)
)
if
(
selected
&&
!
strcmp
(
ids
[
i
],
selected
)
)
...
...
modules/gui/qt4/qt4.hpp
View file @
c06aeca0
...
@@ -92,6 +92,7 @@ struct intf_sys_t
...
@@ -92,6 +92,7 @@ struct intf_sys_t
#define THEAM ActionsManager::getInstance( p_intf )
#define THEAM ActionsManager::getInstance( p_intf )
#define qfu( i ) QString::fromUtf8( i )
#define qfu( i ) QString::fromUtf8( i )
#define qfue( i ) QString::fromUtf8( i ).replace( "&", "&&" )
/* for actions/buttons */
#define qtr( i ) QString::fromUtf8( vlc_gettext(i) )
#define qtr( i ) QString::fromUtf8( vlc_gettext(i) )
#define qtu( i ) ((i).toUtf8().constData())
#define qtu( i ) ((i).toUtf8().constData())
...
...
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