From f15c486bef6a06353326f24387a527e4b6b72088 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20Stenac?= Date: Tue, 18 Jul 2006 18:57:19 +0000 Subject: [PATCH] * Fix a number of encoding bugs * add "make nice" in modules to call ./compile --- bootstrap | 3 ++ modules/gui/qt4/Modules.am | 2 +- modules/gui/qt4/menus.cpp | 59 +++++++++++++++++++++----------------- modules/gui/qt4/qt4.hpp | 2 ++ 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/bootstrap b/bootstrap index 31ba13522b..f4e17d00c4 100755 --- a/bootstrap +++ b/bootstrap @@ -222,6 +222,9 @@ endif all: all-modules +nice: + \$(top_builddir)/compile + # Find out which modules were enabled and tell make to build them all-modules: if USE_LIBTOOL diff --git a/modules/gui/qt4/Modules.am b/modules/gui/qt4/Modules.am index 85ab2f3478..125c765bc4 100644 --- a/modules/gui/qt4/Modules.am +++ b/modules/gui/qt4/Modules.am @@ -67,7 +67,7 @@ $(UIH): %.h: %.ui $(install_sh) -d ui @echo "$(UIC) $< -> $@" rm -f $@ - echo "#define Q_(a,b) _(a)" > $@ + echo "#define Q_(a,b) QString::fromUtf8(_(a))" > $@ $(UIC) -tr "Q_" $< >> $@ diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp index d4902f2909..3cf4f599a1 100644 --- a/modules/gui/qt4/menus.cpp +++ b/modules/gui/qt4/menus.cpp @@ -117,24 +117,24 @@ void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf ) THEDP->menusUpdateMapper, SLOT(map()) ); \ THEDP->menusUpdateMapper->setMapping( menu, f ); } - BAR_ADD( FileMenu(), _("File") ); - BAR_ADD( ToolsMenu( p_intf ), _("Tools") ); - BAR_DADD( VideoMenu( p_intf, NULL ), _("Video"), 1 ); - BAR_DADD( AudioMenu( p_intf, NULL ), _("Audio"), 2 ); - BAR_DADD( NavigMenu( p_intf, NULL ), _("Navigation"), 3 ); + BAR_ADD( FileMenu(), qtr("File") ); + BAR_ADD( ToolsMenu( p_intf ), qtr("Tools") ); + BAR_DADD( VideoMenu( p_intf, NULL ), qtr("Video"), 1 ); + BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 ); + BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 ); - // BAR_ADD( HelpMenu(), _("Help" ) ); + // BAR_ADD( HelpMenu(), qtr("Help" ) ); } QMenu *QVLCMenu::FileMenu() { QMenu *menu = new QMenu(); - DP_SADD( _("Quick &Open File...") , "", "", simpleOpenDialog() ); - DP_SADD( _("&Advanced Open..." ), "", "", openDialog() ); + DP_SADD( qtr("Quick &Open File...") , "", "", simpleOpenDialog() ); + DP_SADD( qtr("&Advanced Open..." ), "", "", openDialog() ); menu->addSeparator(); - DP_SADD( _("Streaming..."), "", "", streamingDialog() ); + DP_SADD( qtr("Streaming..."), "", "", streamingDialog() ); menu->addSeparator(); - DP_SADD( _("&Quit") , "", "", quit() ); + DP_SADD( qtr("&Quit") , "", "", quit() ); return menu; } @@ -144,16 +144,16 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, bool with_intf ) if( with_intf ) { QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); - intfmenu->setTitle( _("Interfaces" ) ); + intfmenu->setTitle( qtr("Interfaces" ) ); menu->addMenu( intfmenu ); /** \todo ADD EXT GUI HERE */ menu->addSeparator(); } - DP_SADD( _("Messages" ), "", "", messagesDialog() ); - DP_SADD( _("Information") , "", "", streaminfoDialog() ); - DP_SADD( _("Bookmarks"), "", "", bookmarksDialog() ); + DP_SADD( qtr("Messages" ), "", "", messagesDialog() ); + DP_SADD( qtr("Information") , "", "", streaminfoDialog() ); + DP_SADD( qtr("Bookmarks"), "", "", bookmarksDialog() ); menu->addSeparator(); - DP_SADD( _("Preferences"), "", "", prefsDialog() ); + DP_SADD( qtr("Preferences"), "", "", prefsDialog() ); return menu; } @@ -261,26 +261,26 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current ) #define POPUP_STATIC_ENTRIES \ vlc_value_t val; \ - MIM_SADD( _("Stop"), "", "", stop() ); \ - MIM_SADD( _("Previous"), "", "", prev() ); \ - MIM_SADD( _("Next"), "", "", next() ); \ + MIM_SADD( qtr("Stop"), "", "", stop() ); \ + MIM_SADD( qtr("Previous"), "", "", prev() ); \ + MIM_SADD( qtr("Next"), "", "", next() ); \ if( p_input ) \ { \ var_Get( p_input, "state", &val ); \ if( val.i_int == PAUSE_S ) \ - MIM_SADD( _("Play"), "", "", togglePlayPause() ) \ + MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \ else \ - MIM_SADD( _("Pause"), "", "", togglePlayPause() ) \ + MIM_SADD( qtr("Pause"), "", "", togglePlayPause() ) \ } \ else if( THEPL->i_size && THEPL->i_enabled ) \ - MIM_SADD( _("Play"), "", "", togglePlayPause() ) \ + MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \ \ QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); \ - intfmenu->setTitle( _("Interfaces" ) ); \ + intfmenu->setTitle( qtr("Interfaces" ) ); \ menu->addMenu( intfmenu ); \ \ QMenu *toolsmenu = ToolsMenu( p_intf, false ); \ - toolsmenu->setTitle( _("Tools" ) ); \ + toolsmenu->setTitle( qtr("Tools" ) ); \ menu->addMenu( toolsmenu ); \ void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf ) @@ -413,7 +413,7 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current, vlc_bool_t b_section_empty = VLC_FALSE; int i; -#define APPEND_EMPTY { QAction *action = menu->addAction( _("Empty" ) ); \ +#define APPEND_EMPTY { QAction *action = menu->addAction( qtr("Empty" ) ); \ action->setEnabled( false ); } for( i = 0; i < (int)objects.size() ; i++ ) @@ -541,7 +541,8 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var, if( b_submenu ) { 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) menu->addMenu( submenu ); } @@ -551,7 +552,8 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var, 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 ) { @@ -618,7 +620,8 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var, { case VLC_VAR_VARIABLE: 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 ); break; @@ -710,6 +713,8 @@ void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data ) itemData->i_object_id ); 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 ); vlc_object_release( p_object ); } diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp index 6e406947c8..cb62bc9894 100644 --- a/modules/gui/qt4/qt4.hpp +++ b/modules/gui/qt4/qt4.hpp @@ -50,6 +50,8 @@ struct intf_sys_t #define THEDP DialogsProvider::getInstance() #define THEMIM MainInputManager::getInstance( NULL ) +#define qtr( i ) QString::fromUtf8( _(i) ) + static int DialogEvent_Type = QEvent::User + 1; class DialogEvent : public QEvent -- 2.39.2