# HG changeset patch # User Chris Cannam # Date 1213267631 0 # Node ID 6a96bff0bd59e020151f22d48f0caa5dd1b05459 # Parent 4caa28a0a8a233658dbc11f9c11ef3db64c69bd8 * Update translations, and add change counter to name of bundle command diff -r 4caa28a0a8a2 -r 6a96bff0bd59 base/Command.cpp --- a/base/Command.cpp Thu Jun 12 09:03:00 2008 +0000 +++ b/base/Command.cpp Thu Jun 12 10:47:11 2008 +0000 @@ -14,6 +14,7 @@ */ #include "Command.h" +#include MacroCommand::MacroCommand(QString name) : m_name(name) @@ -81,3 +82,19 @@ m_name = name; } +BundleCommand::BundleCommand(QString name) : + MacroCommand(name) +{ +} + +BundleCommand::~BundleCommand() +{ +} + +QString +BundleCommand::getName() const +{ + if (m_commands.size() == 1) return m_name; + return tr("%1 (%n change(s))", "", m_commands.size()).arg(m_name); +} + diff -r 4caa28a0a8a2 -r 6a96bff0bd59 base/Command.h --- a/base/Command.h Thu Jun 12 09:03:00 2008 +0000 +++ b/base/Command.h Thu Jun 12 10:47:11 2008 +0000 @@ -16,6 +16,7 @@ #ifndef _COMMAND_H_ #define _COMMAND_H_ +#include #include #include @@ -50,5 +51,21 @@ std::vector m_commands; }; +/** + * BundleCommand is a MacroCommand whose name includes a note of how + * many commands it contains. It is a QObject with Q_OBJECT macro so + * that it can do plural-sensitive translations. + */ +class BundleCommand : public QObject, public MacroCommand +{ + Q_OBJECT + +public: + BundleCommand(QString name); + virtual ~BundleCommand(); + + virtual QString getName() const; +}; + #endif diff -r 4caa28a0a8a2 -r 6a96bff0bd59 data/model/ImageModel.h --- a/data/model/ImageModel.h Thu Jun 12 09:03:00 2008 +0000 +++ b/data/model/ImageModel.h Thu Jun 12 10:47:11 2008 +0000 @@ -20,6 +20,8 @@ #include "base/XmlExportable.h" #include "base/RealTime.h" +#include + /** * Image point type for use in a SparseModel. This represents an * image, identified by filename, at a given time. The filename can @@ -84,6 +86,8 @@ class ImageModel : public SparseModel { + Q_OBJECT + public: ImageModel(size_t sampleRate, size_t resolution, bool notifyOnAdd = true) : SparseModel(sampleRate, resolution, notifyOnAdd) diff -r 4caa28a0a8a2 -r 6a96bff0bd59 data/model/Labeller.h --- a/data/model/Labeller.h Thu Jun 12 09:03:00 2008 +0000 +++ b/data/model/Labeller.h Thu Jun 12 10:47:11 2008 +0000 @@ -28,6 +28,8 @@ class Labeller : public QObject { + Q_OBJECT + public: enum ValueType { ValueNone, diff -r 4caa28a0a8a2 -r 6a96bff0bd59 data/model/NoteModel.h --- a/data/model/NoteModel.h Thu Jun 12 09:03:00 2008 +0000 +++ b/data/model/NoteModel.h Thu Jun 12 10:47:11 2008 +0000 @@ -88,6 +88,8 @@ class NoteModel : public SparseValueModel { + Q_OBJECT + public: NoteModel(size_t sampleRate, size_t resolution, bool notifyOnAdd = true) : diff -r 4caa28a0a8a2 -r 6a96bff0bd59 data/model/SparseOneDimensionalModel.h --- a/data/model/SparseOneDimensionalModel.h Thu Jun 12 09:03:00 2008 +0000 +++ b/data/model/SparseOneDimensionalModel.h Thu Jun 12 10:47:11 2008 +0000 @@ -70,6 +70,8 @@ class SparseOneDimensionalModel : public SparseModel { + Q_OBJECT + public: SparseOneDimensionalModel(size_t sampleRate, size_t resolution, bool notifyOnAdd = true) : diff -r 4caa28a0a8a2 -r 6a96bff0bd59 data/model/SparseTimeValueModel.h --- a/data/model/SparseTimeValueModel.h Thu Jun 12 09:03:00 2008 +0000 +++ b/data/model/SparseTimeValueModel.h Thu Jun 12 10:47:11 2008 +0000 @@ -77,6 +77,8 @@ class SparseTimeValueModel : public SparseValueModel { + Q_OBJECT + public: SparseTimeValueModel(size_t sampleRate, size_t resolution, bool notifyOnAdd = true) : @@ -143,8 +145,6 @@ virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) const { - std::cerr << "SparseTimeValueModel::setData: row = " << row << ", column = " << column << ", role = " << role << std::endl; - if (role != Qt::EditRole) return false; PointListIterator i = getPointListIteratorForRow(row); if (i == m_points.end()) { @@ -159,9 +159,7 @@ switch (column) { case 0: break; case 1: break; - case 2: point.value = value.toDouble(); - std::cerr << "setting value of point at " << point.frame << " to " << point.value << std::endl; - break; + case 2: point.value = value.toDouble(); break; case 3: point.label = value.toString(); break; } diff -r 4caa28a0a8a2 -r 6a96bff0bd59 data/model/TextModel.h --- a/data/model/TextModel.h Thu Jun 12 09:03:00 2008 +0000 +++ b/data/model/TextModel.h Thu Jun 12 10:47:11 2008 +0000 @@ -20,6 +20,8 @@ #include "base/XmlExportable.h" #include "base/RealTime.h" +#include + /** * Text point type for use in a SparseModel. This represents a piece * of text at a given time and y-value in the [0,1) range (indicative @@ -80,6 +82,8 @@ class TextModel : public SparseModel { + Q_OBJECT + public: TextModel(size_t sampleRate, size_t resolution, bool notifyOnAdd = true) : SparseModel(sampleRate, resolution, notifyOnAdd)