[vlc-commits] Qt: don't make 1 way only vars/commands radio items
Francois Cartegnie
git at videolan.org
Sat Feb 12 22:12:59 CET 2011
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Feb 12 21:29:46 2011 +0100| [d858c4451810076be9939918f4539162320a8053] | committer: Francois Cartegnie
Qt: don't make 1 way only vars/commands radio items
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d858c4451810076be9939918f4539162320a8053
---
modules/gui/qt4/menus.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 209ad74..83cea3d 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -1379,6 +1379,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
#define CURVAL val_list.p_list->p_values[i]
#define CURTEXT text_list.p_list->p_values[i].psz_string
+#define RADIO_OR_COMMAND ( i_type & VLC_VAR_ISCOMMAND ) ? ITEM_NORMAL : ITEM_RADIO
for( i = 0; i < val_list.p_list->i_count; i++ )
{
@@ -1398,7 +1399,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
var_Get( p_object, psz_var, &val );
another_val.psz_string = strdup( CURVAL.psz_string );
menutext = qfu( CURTEXT ? CURTEXT : another_val.psz_string );
- CreateAndConnect( submenu, psz_var, menutext, "", ITEM_RADIO,
+ CreateAndConnect( submenu, psz_var, menutext, "", RADIO_OR_COMMAND,
p_object, another_val, i_type,
val.psz_string && !strcmp( val.psz_string, CURVAL.psz_string ) );
@@ -1409,7 +1410,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
var_Get( p_object, psz_var, &val );
if( CURTEXT ) menutext = qfu( CURTEXT );
else menutext.sprintf( "%"PRId64, CURVAL.i_int );
- CreateAndConnect( submenu, psz_var, menutext, "", ITEM_RADIO,
+ CreateAndConnect( submenu, psz_var, menutext, "", RADIO_OR_COMMAND,
p_object, CURVAL, i_type,
( CURVAL.i_int == val.i_int )
&& CheckTitle( p_object, psz_var ) );
@@ -1419,7 +1420,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
var_Get( p_object, psz_var, &val );
if( CURTEXT ) menutext = qfu( CURTEXT );
else menutext.sprintf( "%.2f", CURVAL.f_float );
- CreateAndConnect( submenu, psz_var, menutext, "", ITEM_RADIO,
+ CreateAndConnect( submenu, psz_var, menutext, "", RADIO_OR_COMMAND,
p_object, CURVAL, i_type,
CURVAL.f_float == val.f_float );
break;
@@ -1433,6 +1434,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
/* clean up everything */
var_FreeList( &val_list, &text_list );
+#undef RADIO_OR_COMMAND
#undef CURVAL
#undef CURTEXT
return submenu->isEmpty() ? VLC_EGENERIC : VLC_SUCCESS;
More information about the vlc-commits
mailing list