From e020106e82e7f7e1c45c124c0c7d55535699fb70 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Fri, 16 Mar 2012 17:35:37 +0100 Subject: [PATCH] Translation files are now embedded into the binary, also made the source groups a bit more sane. --- .../client/client_config_qt/CMakeLists.txt | 21 ++++++++++++------- .../general_settings_widget.cpp | 2 +- .../ryzom_configuration_en.ts | 0 .../ryzom_configuration_hu.ts | 0 .../translations/translations.qrc | 6 ++++++ 5 files changed, 21 insertions(+), 8 deletions(-) rename code/ryzom/tools/client/client_config_qt/{ => translations}/ryzom_configuration_en.ts (100%) rename code/ryzom/tools/client/client_config_qt/{ => translations}/ryzom_configuration_hu.ts (100%) create mode 100644 code/ryzom/tools/client/client_config_qt/translations/translations.qrc diff --git a/code/ryzom/tools/client/client_config_qt/CMakeLists.txt b/code/ryzom/tools/client/client_config_qt/CMakeLists.txt index 05877232f..c69bb6aed 100644 --- a/code/ryzom/tools/client/client_config_qt/CMakeLists.txt +++ b/code/ryzom/tools/client/client_config_qt/CMakeLists.txt @@ -1,17 +1,16 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QT_INCLUDES} ) + FILE( GLOB SRC *.cpp *.h ) SET( CLIENT_CONFIG_HDR client_config_dialog.h - config.h display_settings_advanced_widget.h display_settings_details_widget.h display_settings_widget.h general_settings_widget.h sound_settings_widget.h - system.h sys_info_d3d_widget.h sys_info_opengl_widget.h sys_info_widget.h @@ -30,21 +29,29 @@ SET( CLIENT_CONFIG_UIS sys_info_widget.ui ) -SET( CLIENT_CONFIG_RCS resources.qrc ) +SET( CLIENT_CONFIG_TRANS + translations/ryzom_configuration_en.ts + translations/ryzom_configuration_hu.ts +) + +CONFIGURE_FILE( translations/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY ) +SET( CLIENT_CONFIG_RCS resources.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc ) SET( QT_USE_QTGUI TRUE ) SET( QT_USE_QTOPENGL TRUE ) SET( QT_USE_QTCORE TRUE ) +QT4_ADD_TRANSLATION( CLIENT_CONFIG_QM ${CLIENT_CONFIG_TRANS} ) QT4_ADD_RESOURCES( CLIENT_CONFIG_RC_SRCS ${CLIENT_CONFIG_RCS} ) QT4_WRAP_CPP( CLIENT_CONFIG_MOC_SRC ${CLIENT_CONFIG_HDR} ) QT4_WRAP_UI( CLIENT_CONFIG_UI_HDRS ${CLIENT_CONFIG_UIS} ) -SOURCE_GROUP( "Resources" FILES ${CLIENT_CONFIG_UIS} ${CLIENT_CONFIG_RCS} ) +SOURCE_GROUP( "Resources" FILES ${CLIENT_CONFIG_RCS} ) +SOURCE_GROUP( "Forms" FILES ${CLIENT_CONFIG_UIS} ) SOURCE_GROUP( "Generated Files" FILES ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_MOC_SRC} ) -SOURCE_GROUP( "Sources" FILES ${SRC} ) +SOURCE_GROUP( "Translation Files" FILES ${CLIENT_CONFIG_TRANS} ) ADD_DEFINITIONS( ${QT_DEFINITIONS} ) -ADD_EXECUTABLE( ryzom_configuration_qt ${SRC} ${CLIENT_CONFIG_MOC_SRC} ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_RC_SRCS} ) +ADD_EXECUTABLE( ryzom_configuration_qt WIN32 MACOSX_BUNDLE ${SRC} ${CLIENT_CONFIG_MOC_SRC} ${CLIENT_CONFIG_UI_HDRS} ${CLIENT_CONFIG_RC_SRCS} ${CLIENT_CONFIG_TRANS} ) NL_DEFAULT_PROPS( ryzom_configuration_qt "Ryzom, Tools: Ryzom Configuration Qt" ) NL_ADD_RUNTIME_FLAGS( ryzom_configuration_qt ) NL_ADD_LIB_SUFFIX( ryzom_configuration_qt ) -TARGET_LINK_LIBRARIES( ryzom_configuration_qt nelmisc nel3d ${QT_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ) +TARGET_LINK_LIBRARIES( ryzom_configuration_qt nelmisc nel3d ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ) INSTALL( TARGETS ryzom_configuration_qt RUNTIME DESTINATION games COMPONENT client BUNDLE DESTINATION /Applications ) diff --git a/code/ryzom/tools/client/client_config_qt/general_settings_widget.cpp b/code/ryzom/tools/client/client_config_qt/general_settings_widget.cpp index 86b6dca63..75bba0297 100644 --- a/code/ryzom/tools/client/client_config_qt/general_settings_widget.cpp +++ b/code/ryzom/tools/client/client_config_qt/general_settings_widget.cpp @@ -90,7 +90,7 @@ void CGeneralSettingsWidget::onLanguageChanged() } currentTranslator = new QTranslator(); - if( currentTranslator->load( QString( "ryzom_configuration_%1" ).arg( languageCodes[ i ] ) ) ) + if( currentTranslator->load( QString( ":/translations/ryzom_configuration_%1" ).arg( languageCodes[ i ] ) ) ) qApp->installTranslator( currentTranslator ); emit changed(); diff --git a/code/ryzom/tools/client/client_config_qt/ryzom_configuration_en.ts b/code/ryzom/tools/client/client_config_qt/translations/ryzom_configuration_en.ts similarity index 100% rename from code/ryzom/tools/client/client_config_qt/ryzom_configuration_en.ts rename to code/ryzom/tools/client/client_config_qt/translations/ryzom_configuration_en.ts diff --git a/code/ryzom/tools/client/client_config_qt/ryzom_configuration_hu.ts b/code/ryzom/tools/client/client_config_qt/translations/ryzom_configuration_hu.ts similarity index 100% rename from code/ryzom/tools/client/client_config_qt/ryzom_configuration_hu.ts rename to code/ryzom/tools/client/client_config_qt/translations/ryzom_configuration_hu.ts diff --git a/code/ryzom/tools/client/client_config_qt/translations/translations.qrc b/code/ryzom/tools/client/client_config_qt/translations/translations.qrc new file mode 100644 index 000000000..07411f16d --- /dev/null +++ b/code/ryzom/tools/client/client_config_qt/translations/translations.qrc @@ -0,0 +1,6 @@ + + + ryzom_configuration_en.qm + ryzom_configuration_hu.qm + +