comparison main/main.cpp @ 165:33280c031d19

* Add a colour database, and Add New Colour function to the colour combo in property box. The colour property is only correctly handled in the waveform layer so far. * Add en_GB translation, to translate those annoying Color texts in the Qt colour picker dialog.
author Chris Cannam
date Wed, 11 Jul 2007 17:21:37 +0000
parents dfaf4f9330b5
children 4d762fe10919
comparison
equal deleted inserted replaced
164:75cafe7a9246 165:33280c031d19
29 #include <QTranslator> 29 #include <QTranslator>
30 #include <QLocale> 30 #include <QLocale>
31 #include <QSettings> 31 #include <QSettings>
32 #include <QIcon> 32 #include <QIcon>
33 #include <QSessionManager> 33 #include <QSessionManager>
34 #include <QDir>
34 35
35 #include <iostream> 36 #include <iostream>
36 #include <signal.h> 37 #include <signal.h>
37 38
38 /*! \mainpage Sonic Visualiser 39 /*! \mainpage Sonic Visualiser
234 QString language = QLocale::system().name(); 235 QString language = QLocale::system().name();
235 236
236 QTranslator qtTranslator; 237 QTranslator qtTranslator;
237 QString qtTrName = QString("qt_%1").arg(language); 238 QString qtTrName = QString("qt_%1").arg(language);
238 std::cerr << "Loading " << qtTrName.toStdString() << "..." << std::endl; 239 std::cerr << "Loading " << qtTrName.toStdString() << "..." << std::endl;
239 qtTranslator.load(qtTrName); 240 bool success = false;
241 if (!(success = qtTranslator.load(qtTrName))) {
242 QString qtDir = getenv("QTDIR");
243 if (qtDir != "") {
244 success = qtTranslator.load
245 (qtTrName, QDir(qtDir).filePath("translations"));
246 }
247 }
248 if (!success) {
249 std::cerr << "Failed to load Qt translation for locale" << std::endl;
250 }
240 application.installTranslator(&qtTranslator); 251 application.installTranslator(&qtTranslator);
241 252
242 QTranslator svTranslator; 253 QTranslator svTranslator;
243 QString svTrName = QString("sonic-visualiser_%1").arg(language); 254 QString svTrName = QString("sonic-visualiser_%1").arg(language);
244 std::cerr << "Loading " << svTrName.toStdString() << "..." << std::endl; 255 std::cerr << "Loading " << svTrName.toStdString() << "..." << std::endl;