# HG changeset patch
# User Chris Cannam
# Date 1184174497 0
# Node ID 33280c031d190e7b4fd7fd7cea1646ccbc5c4c42
# Parent 75cafe7a9246f0504ad6f5a29821c51e2dc0bead
* 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.
diff -r 75cafe7a9246 -r 33280c031d19 i18n/sonic-visualiser_en_GB.qm
Binary file i18n/sonic-visualiser_en_GB.qm has changed
diff -r 75cafe7a9246 -r 33280c031d19 i18n/sonic-visualiser_en_GB.ts
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/i18n/sonic-visualiser_en_GB.ts Wed Jul 11 17:21:37 2007 +0000
@@ -0,0 +1,29 @@
+
+
+ QColorDialog
+
+
+ Colour
+
+
+
+ &Basic colours
+
+
+
+ &Custom colours
+
+
+
+ &Define Custom Colours >>
+
+
+
+ &Add to Custom Colours
+
+
+
+ Select colour
+
+
+
diff -r 75cafe7a9246 -r 33280c031d19 main/MainWindow.cpp
--- a/main/MainWindow.cpp Thu Jul 05 15:36:37 2007 +0000
+++ b/main/MainWindow.cpp Wed Jul 11 17:21:37 2007 +0000
@@ -60,6 +60,8 @@
#include "base/CommandHistory.h"
#include "base/Profiler.h"
#include "base/Clipboard.h"
+#include "base/UnitDatabase.h"
+#include "base/ColourDatabase.h"
#include "osc/OSCQueue.h"
// For version information
@@ -138,9 +140,18 @@
{
setWindowTitle(tr("Sonic Visualiser"));
- UnitDatabase::getInstance()->registerUnit("Hz");
- UnitDatabase::getInstance()->registerUnit("dB");
- UnitDatabase::getInstance()->registerUnit("s");
+ UnitDatabase *udb = UnitDatabase::getInstance();
+ udb->registerUnit("Hz");
+ udb->registerUnit("dB");
+ udb->registerUnit("s");
+
+ ColourDatabase *cdb = ColourDatabase::getInstance();
+ cdb->addColour(Qt::black, tr("Black"));
+ cdb->addColour(Qt::darkRed, tr("Red"));
+ cdb->addColour(Qt::darkBlue, tr("Blue"));
+ cdb->addColour(Qt::darkGreen, tr("Green"));
+ cdb->addColour(QColor(200, 50, 255), tr("Purple"));
+ cdb->addColour(QColor(255, 150, 50), tr("Orange"));
connect(CommandHistory::getInstance(), SIGNAL(commandExecuted()),
this, SLOT(documentModified()));
@@ -2757,7 +2768,7 @@
QMessageBox::warning
(this, tr("Couldn't open audio device"),
tr("Could not open an audio device for playback.\nAudio playback will not be available during this session.\n"),
- QMessageBox::Ok, 0);
+ QMessageBox::Ok);
}
connect(m_fader, SIGNAL(valueChanged(float)),
m_playTarget, SLOT(setOutputGain(float)));
@@ -3230,9 +3241,8 @@
QMessageBox::warning(this,
tr("Session modified"),
tr("The current session has been modified.\nDo you want to save it?"),
- QMessageBox::Yes,
- QMessageBox::No,
- QMessageBox::Cancel);
+ QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
+ QMessageBox::Yes);
if (button == QMessageBox::Yes) {
saveSession();
@@ -4364,7 +4374,7 @@
tr("Failed to generate layer"),
tr("Failed to generate a derived layer.\n\nThe layer transform \"%1\" failed.\n\nThis probably means that a plugin failed to initialise, perhaps because it\nrejected the processing block size that was requested.")
.arg(transformName),
- QMessageBox::Ok, 0);
+ QMessageBox::Ok);
}
void
@@ -4375,7 +4385,7 @@
tr("Failed to regenerate layer"),
tr("Failed to regenerate derived layer \"%1\".\n\nThe layer transform \"%2\" failed to run.\n\nThis probably means the layer used a plugin that is not currently available.")
.arg(layerName).arg(transformName),
- QMessageBox::Ok, 0);
+ QMessageBox::Ok);
}
void
diff -r 75cafe7a9246 -r 33280c031d19 main/main.cpp
--- a/main/main.cpp Thu Jul 05 15:36:37 2007 +0000
+++ b/main/main.cpp Wed Jul 11 17:21:37 2007 +0000
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include
#include
@@ -236,7 +237,17 @@
QTranslator qtTranslator;
QString qtTrName = QString("qt_%1").arg(language);
std::cerr << "Loading " << qtTrName.toStdString() << "..." << std::endl;
- qtTranslator.load(qtTrName);
+ bool success = false;
+ if (!(success = qtTranslator.load(qtTrName))) {
+ QString qtDir = getenv("QTDIR");
+ if (qtDir != "") {
+ success = qtTranslator.load
+ (qtTrName, QDir(qtDir).filePath("translations"));
+ }
+ }
+ if (!success) {
+ std::cerr << "Failed to load Qt translation for locale" << std::endl;
+ }
application.installTranslator(&qtTranslator);
QTranslator svTranslator;
diff -r 75cafe7a9246 -r 33280c031d19 sonic-visualiser.qrc
--- a/sonic-visualiser.qrc Thu Jul 05 15:36:37 2007 +0000
+++ b/sonic-visualiser.qrc Wed Jul 11 17:21:37 2007 +0000
@@ -83,6 +83,7 @@
samples/strike.wav
samples/tap.wav
i18n/sonic-visualiser_ru.qm
+ i18n/sonic-visualiser_en_GB.qm
i18n/tips_en.xml