Commit f15c486b authored by Clément Stenac's avatar Clément Stenac

* Fix a number of encoding bugs

* add "make nice" in modules to call ./compile
parent f6ef9859
...@@ -222,6 +222,9 @@ endif ...@@ -222,6 +222,9 @@ endif
all: all-modules all: all-modules
nice:
\$(top_builddir)/compile
# Find out which modules were enabled and tell make to build them # Find out which modules were enabled and tell make to build them
all-modules: all-modules:
if USE_LIBTOOL if USE_LIBTOOL
......
...@@ -67,7 +67,7 @@ $(UIH): %.h: %.ui ...@@ -67,7 +67,7 @@ $(UIH): %.h: %.ui
$(install_sh) -d ui $(install_sh) -d ui
@echo "$(UIC) $< -> $@" @echo "$(UIC) $< -> $@"
rm -f $@ rm -f $@
echo "#define Q_(a,b) _(a)" > $@ echo "#define Q_(a,b) QString::fromUtf8(_(a))" > $@
$(UIC) -tr "Q_" $< >> $@ $(UIC) -tr "Q_" $< >> $@
......
...@@ -117,24 +117,24 @@ void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf ) ...@@ -117,24 +117,24 @@ void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
THEDP->menusUpdateMapper, SLOT(map()) ); \ THEDP->menusUpdateMapper, SLOT(map()) ); \
THEDP->menusUpdateMapper->setMapping( menu, f ); } THEDP->menusUpdateMapper->setMapping( menu, f ); }
BAR_ADD( FileMenu(), _("File") ); BAR_ADD( FileMenu(), qtr("File") );
BAR_ADD( ToolsMenu( p_intf ), _("Tools") ); BAR_ADD( ToolsMenu( p_intf ), qtr("Tools") );
BAR_DADD( VideoMenu( p_intf, NULL ), _("Video"), 1 ); BAR_DADD( VideoMenu( p_intf, NULL ), qtr("Video"), 1 );
BAR_DADD( AudioMenu( p_intf, NULL ), _("Audio"), 2 ); BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
BAR_DADD( NavigMenu( p_intf, NULL ), _("Navigation"), 3 ); BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
// BAR_ADD( HelpMenu(), _("Help" ) ); // BAR_ADD( HelpMenu(), qtr("Help" ) );
} }
QMenu *QVLCMenu::FileMenu() QMenu *QVLCMenu::FileMenu()
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
DP_SADD( _("Quick &Open File...") , "", "", simpleOpenDialog() ); DP_SADD( qtr("Quick &Open File...") , "", "", simpleOpenDialog() );
DP_SADD( _("&Advanced Open..." ), "", "", openDialog() ); DP_SADD( qtr("&Advanced Open..." ), "", "", openDialog() );
menu->addSeparator(); menu->addSeparator();
DP_SADD( _("Streaming..."), "", "", streamingDialog() ); DP_SADD( qtr("Streaming..."), "", "", streamingDialog() );
menu->addSeparator(); menu->addSeparator();
DP_SADD( _("&Quit") , "", "", quit() ); DP_SADD( qtr("&Quit") , "", "", quit() );
return menu; return menu;
} }
...@@ -144,16 +144,16 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, bool with_intf ) ...@@ -144,16 +144,16 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, bool with_intf )
if( with_intf ) if( with_intf )
{ {
QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); QMenu *intfmenu = InterfacesMenu( p_intf, NULL );
intfmenu->setTitle( _("Interfaces" ) ); intfmenu->setTitle( qtr("Interfaces" ) );
menu->addMenu( intfmenu ); menu->addMenu( intfmenu );
/** \todo ADD EXT GUI HERE */ /** \todo ADD EXT GUI HERE */
menu->addSeparator(); menu->addSeparator();
} }
DP_SADD( _("Messages" ), "", "", messagesDialog() ); DP_SADD( qtr("Messages" ), "", "", messagesDialog() );
DP_SADD( _("Information") , "", "", streaminfoDialog() ); DP_SADD( qtr("Information") , "", "", streaminfoDialog() );
DP_SADD( _("Bookmarks"), "", "", bookmarksDialog() ); DP_SADD( qtr("Bookmarks"), "", "", bookmarksDialog() );
menu->addSeparator(); menu->addSeparator();
DP_SADD( _("Preferences"), "", "", prefsDialog() ); DP_SADD( qtr("Preferences"), "", "", prefsDialog() );
return menu; return menu;
} }
...@@ -261,26 +261,26 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -261,26 +261,26 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
#define POPUP_STATIC_ENTRIES \ #define POPUP_STATIC_ENTRIES \
vlc_value_t val; \ vlc_value_t val; \
MIM_SADD( _("Stop"), "", "", stop() ); \ MIM_SADD( qtr("Stop"), "", "", stop() ); \
MIM_SADD( _("Previous"), "", "", prev() ); \ MIM_SADD( qtr("Previous"), "", "", prev() ); \
MIM_SADD( _("Next"), "", "", next() ); \ MIM_SADD( qtr("Next"), "", "", next() ); \
if( p_input ) \ if( p_input ) \
{ \ { \
var_Get( p_input, "state", &val ); \ var_Get( p_input, "state", &val ); \
if( val.i_int == PAUSE_S ) \ if( val.i_int == PAUSE_S ) \
MIM_SADD( _("Play"), "", "", togglePlayPause() ) \ MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
else \ else \
MIM_SADD( _("Pause"), "", "", togglePlayPause() ) \ MIM_SADD( qtr("Pause"), "", "", togglePlayPause() ) \
} \ } \
else if( THEPL->i_size && THEPL->i_enabled ) \ else if( THEPL->i_size && THEPL->i_enabled ) \
MIM_SADD( _("Play"), "", "", togglePlayPause() ) \ MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
\ \
QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); \ QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); \
intfmenu->setTitle( _("Interfaces" ) ); \ intfmenu->setTitle( qtr("Interfaces" ) ); \
menu->addMenu( intfmenu ); \ menu->addMenu( intfmenu ); \
\ \
QMenu *toolsmenu = ToolsMenu( p_intf, false ); \ QMenu *toolsmenu = ToolsMenu( p_intf, false ); \
toolsmenu->setTitle( _("Tools" ) ); \ toolsmenu->setTitle( qtr("Tools" ) ); \
menu->addMenu( toolsmenu ); \ menu->addMenu( toolsmenu ); \
void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf ) void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
...@@ -413,7 +413,7 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current, ...@@ -413,7 +413,7 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current,
vlc_bool_t b_section_empty = VLC_FALSE; vlc_bool_t b_section_empty = VLC_FALSE;
int i; int i;
#define APPEND_EMPTY { QAction *action = menu->addAction( _("Empty" ) ); \ #define APPEND_EMPTY { QAction *action = menu->addAction( qtr("Empty" ) ); \
action->setEnabled( false ); } action->setEnabled( false ); }
for( i = 0; i < (int)objects.size() ; i++ ) for( i = 0; i < (int)objects.size() ; i++ )
...@@ -541,7 +541,8 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var, ...@@ -541,7 +541,8 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
if( b_submenu ) if( b_submenu )
{ {
QMenu *submenu = new QMenu(); QMenu *submenu = new QMenu();
submenu->setTitle( text.psz_string ? text.psz_string : psz_var ); submenu->setTitle( QString::fromUtf8( text.psz_string ?
text.psz_string : psz_var ) );
if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0) if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0)
menu->addMenu( submenu ); menu->addMenu( submenu );
} }
...@@ -551,7 +552,8 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var, ...@@ -551,7 +552,8 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
return; return;
} }
#define TEXT_OR_VAR text.psz_string ? text.psz_string : psz_var #define TEXT_OR_VAR QString::fromUtf8 ( text.psz_string ? text.psz_string : \
psz_var )
switch( i_type & VLC_VAR_TYPE ) switch( i_type & VLC_VAR_TYPE )
{ {
...@@ -618,7 +620,8 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var, ...@@ -618,7 +620,8 @@ int QVLCMenu::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( CURTEXT ? CURTEXT : CURVAL.psz_string ); subsubmenu->setTitle( QString::fromUtf8( CURTEXT ? CURTEXT :
CURVAL.psz_string ) );
submenu->addMenu( subsubmenu ); submenu->addMenu( subsubmenu );
break; break;
...@@ -710,6 +713,8 @@ void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data ) ...@@ -710,6 +713,8 @@ void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data )
itemData->i_object_id ); itemData->i_object_id );
if( p_object == NULL ) return; if( p_object == NULL ) return;
fprintf( stderr, "Setting %s on %i\n", itemData->psz_var,
p_object->i_object_id );
var_Set( p_object, itemData->psz_var, itemData->val ); var_Set( p_object, itemData->psz_var, itemData->val );
vlc_object_release( p_object ); vlc_object_release( p_object );
} }
...@@ -50,6 +50,8 @@ struct intf_sys_t ...@@ -50,6 +50,8 @@ struct intf_sys_t
#define THEDP DialogsProvider::getInstance() #define THEDP DialogsProvider::getInstance()
#define THEMIM MainInputManager::getInstance( NULL ) #define THEMIM MainInputManager::getInstance( NULL )
#define qtr( i ) QString::fromUtf8( _(i) )
static int DialogEvent_Type = QEvent::User + 1; static int DialogEvent_Type = QEvent::User + 1;
class DialogEvent : public QEvent class DialogEvent : public QEvent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment