diff options
Diffstat (limited to 'tools/qtconfig')
-rw-r--r-- | tools/qtconfig/main.cpp | 14 | ||||
-rw-r--r-- | tools/qtconfig/mainwindow.cpp | 28 | ||||
-rw-r--r-- | tools/qtconfig/paletteeditoradvanced.cpp | 1 | ||||
-rw-r--r-- | tools/qtconfig/qtconfig.pro | 5 | ||||
-rw-r--r-- | tools/qtconfig/translations/translations.pro | 15 |
5 files changed, 35 insertions, 28 deletions
diff --git a/tools/qtconfig/main.cpp b/tools/qtconfig/main.cpp index 24d044f..928cf01 100644 --- a/tools/qtconfig/main.cpp +++ b/tools/qtconfig/main.cpp @@ -42,6 +42,9 @@ #include "ui_previewwidgetbase.h" #include "mainwindow.h" #include <QApplication> +#include <QLibraryInfo> +#include <QLocale> +#include <QTranslator> QT_USE_NAMESPACE @@ -50,6 +53,17 @@ int main(int argc, char **argv) Q_INIT_RESOURCE(qtconfig); QApplication app(argc, argv); + + QTranslator translator; + QTranslator qtTranslator; + QString sysLocale = QLocale::system().name(); + QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (translator.load(QLatin1String("qtconfig_") + sysLocale, resourceDir) + && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir)) { + app.installTranslator(&translator); + app.installTranslator(&qtTranslator); + } + MainWindow mw; mw.show(); return app.exec(); diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 604b1f4..4fe2868 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -68,6 +68,8 @@ #ifndef QT_NO_GSTREAMER #include <gst/gst.h> +#endif +#ifdef HAVE_PHONON #include <phonon/phononnamespace.h> #endif @@ -79,7 +81,7 @@ QT_BEGIN_NAMESPACE // external use ignore them // extern bool Q_CORE_EXPORT qt_resolve_symlinks; -static const char *appearance_text = +static const char *appearance_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Appearance</font></b></p>" "<hr>" "<p>Use this tab to customize the appearance of your Qt applications.</p>" @@ -93,9 +95,9 @@ static const char *appearance_text = "To customize colors further, press the Tune Palette button to open " "the advanced palette editor." "<p>The Preview Window shows what the selected Style and colors look " -"like."; +"like."); -static const char *font_text = +static const char *font_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Fonts</font></b></p>" "<hr>" "<p>Use this tab to select the default font for your Qt applications. " @@ -112,9 +114,9 @@ static const char *font_text = "Korean characters that are not found in the Lucida font will be taken " "from the Mincho font. Because the font substitutions are " "lists, you can also select multiple families, such as Song Ti (for " -"use with Chinese text)."; +"use with Chinese text)."); -static const char *interface_text = +static const char *interface_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Interface</font></b></p>" "<hr>" "<p>Use this tab to customize the feel of your Qt applications.</p>" @@ -129,10 +131,10 @@ static const char *interface_text = "at 0 will disable the Global Strut feature</p>" "<p>XIM (Extended Input Methods) are used for entering characters in " "languages that have large character sets, for example, Chinese and " -"Japanese."; +"Japanese."); // ### What does the 'Enhanced support for languages written R2L do? -static const char *printer_text = +static const char *printer_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Printer</font></b></p>" "<hr>" "<p>Use this tab to configure the way Qt generates output for the printer." @@ -143,14 +145,14 @@ static const char *printer_text = "size will be bigger." "<p>When using font embedding you can select additional directories where " "Qt should search for embeddable font files. By default, the X " -"server font path is used."; +"server font path is used."); -static const char *phonon_text = +static const char *phonon_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Phonon</font></b></p>" "<hr>" "<p>Use this tab to configure the Phonon GStreamer multimedia backend. " "<p>It is reccommended to leave all settings on \"Auto\" to let " -"Phonon determine your settings automatically."; +"Phonon determine your settings automatically."); static QColorGroup::ColorRole centralFromItem( int item ) { @@ -387,8 +389,10 @@ MainWindow::MainWindow() audiosinkCombo->addItem(tr("aRts"), QLatin1String("artssink")); audiosinkCombo->setItemData(audiosinkCombo->findText(tr("aRts")), tr("Experimental aRts support for GStreamer."), Qt::ToolTipRole); -#ifndef QT_NO_GSTREAMER +#ifdef HAVE_PHONON phononVersionLabel->setText(QLatin1String(Phonon::phononVersion())); +#endif +#ifndef QT_NO_GSTREAMER if (gst_init_check(0, 0, 0)) { gchar *versionString = gst_version_string(); gstversionLabel->setText(QLatin1String(versionString)); @@ -428,7 +432,7 @@ MainWindow::MainWindow() #endif #ifndef QT_NO_OPENGL videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL")); - videomodeCombo->setItemData(videomodeCombo->findText(tr("OpenGL")), tr("Use OpenGL if avaiable"), Qt::ToolTipRole); + videomodeCombo->setItemData(videomodeCombo->findText(tr("OpenGL")), tr("Use OpenGL if available"), Qt::ToolTipRole); #endif videomodeCombo->addItem(tr("Software"), QLatin1String("Software")); videomodeCombo->setItemData(videomodeCombo->findText(tr("Software")), tr("Use simple software rendering"), Qt::ToolTipRole); diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index 2728557..f59584e 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -182,6 +182,7 @@ QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item ) } QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item ) + { switch( item ) { case 0: diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro index 8ab3f03..d1fd320 100644 --- a/tools/qtconfig/qtconfig.pro +++ b/tools/qtconfig/qtconfig.pro @@ -9,7 +9,10 @@ QT += qt3support contains(QT_CONFIG, gstreamer):LIBS += $$QT_LIBS_GSTREAMER -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 contains(QT_CONFIG, gstreamer):QMAKE_CXXFLAGS += $$QT_CFLAGS_GSTREAMER -contains(QT_CONFIG, gstreamer):QT += phonon +contains(QT_CONFIG, phonon) { + QT += phonon + DEFINES += HAVE_PHONON +} SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp \ mainwindowbase.cpp paletteeditoradvancedbase.cpp previewwidgetbase.cpp HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h \ diff --git a/tools/qtconfig/translations/translations.pro b/tools/qtconfig/translations/translations.pro deleted file mode 100644 index bf8a1da..0000000 --- a/tools/qtconfig/translations/translations.pro +++ /dev/null @@ -1,15 +0,0 @@ -# Include those manually as they do not contain any directory specification - -SOURCES += ../colorbutton.cpp ../main.cpp ../previewframe.cpp ../previewwidget.cpp ../mainwindow.cpp ../paletteeditoradvanced.cpp \ - ../mainwindowbase.cpp ../paletteeditoradvancedbase.cpp ../previewwidgetbase.cpp -HEADERS += ../colorbutton.h ../previewframe.h ../previewwidget.h ../mainwindow.h ../paletteeditoradvanced.h \ - ../mainwindowbase.h ../paletteeditoradvancedbase.h ../previewwidgetbase.h - -FORMS = ../mainwindowbase.ui ../paletteeditoradvancedbase.ui ../previewwidgetbase.ui - -TR_DIR = $$PWD/../../../translations -TRANSLATIONS = \ - $$TR_DIR/qtconfig_pl.ts \ - $$TR_DIR/qtconfig_ru.ts \ - $$TR_DIR/qtconfig_zh_CN.ts \ - $$TR_DIR/qtconfig_zh_TW.ts |