# HG changeset patch # User Chris Cannam # Date 1213267631 0 # Node ID 2c59b0cd176b455eeafe1015532393269de0deef # Parent 2669267fb7eac687870a81e5b6937ecf74e07c4c * Update translations, and add change counter to name of bundle command diff -r 2669267fb7ea -r 2c59b0cd176b layer/SingleColourLayer.h --- a/layer/SingleColourLayer.h Thu Jun 12 09:03:00 2008 +0000 +++ b/layer/SingleColourLayer.h Thu Jun 12 10:47:11 2008 +0000 @@ -23,6 +23,8 @@ class SingleColourLayer : public Layer { + Q_OBJECT + public: virtual void setBaseColour(int); virtual int getBaseColour() const; diff -r 2669267fb7ea -r 2c59b0cd176b widgets/CommandHistory.cpp --- a/widgets/CommandHistory.cpp Thu Jun 12 09:03:00 2008 +0000 +++ b/widgets/CommandHistory.cpp Thu Jun 12 10:47:11 2008 +0000 @@ -35,7 +35,7 @@ #include -//#define DEBUG_COMMAND_HISTORY 1 +#define DEBUG_COMMAND_HISTORY 1 CommandHistory *CommandHistory::m_instance = 0; @@ -139,6 +139,10 @@ { if (!command) return; +#ifdef DEBUG_COMMAND_HISTORY + std::cerr << "CommandHistory::addCommand: " << command->getName().toLocal8Bit().data() << " at " << command << ": execute = " << execute << ", bundle = " << bundle << " (m_currentCompound = " << m_currentCompound << ", m_currentBundle = " << m_currentBundle << ")" << std::endl; +#endif + if (m_currentCompound) { addToCompound(command, execute); return; @@ -152,7 +156,6 @@ } #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::addCommand: " << command->getName().toLocal8Bit().data() << " at " << command << std::endl; if (!m_redoStack.empty()) { std::cerr << "CommandHistory::clearing redo stack" << std::endl; } @@ -205,7 +208,7 @@ // need to addCommand before setting m_currentBundle, as addCommand // with bundle false will reset m_currentBundle to 0 - MacroCommand *mc = new MacroCommand(command->getName()); + MacroCommand *mc = new BundleCommand(command->getName()); addCommand(mc, false); m_currentBundle = mc; m_currentBundleName = command->getName(); diff -r 2669267fb7ea -r 2c59b0cd176b widgets/MIDIFileImportDialog.h --- a/widgets/MIDIFileImportDialog.h Thu Jun 12 09:03:00 2008 +0000 +++ b/widgets/MIDIFileImportDialog.h Thu Jun 12 10:47:11 2008 +0000 @@ -22,6 +22,8 @@ class MIDIFileImportDialog : public QObject, public MIDIFileImportPreferenceAcquirer { + Q_OBJECT + public: MIDIFileImportDialog(QWidget *parent = 0); diff -r 2669267fb7ea -r 2c59b0cd176b widgets/ModelDataTableDialog.cpp --- a/widgets/ModelDataTableDialog.cpp Thu Jun 12 09:03:00 2008 +0000 +++ b/widgets/ModelDataTableDialog.cpp Thu Jun 12 10:47:11 2008 +0000 @@ -70,6 +70,8 @@ this, SLOT(viewClicked(const QModelIndex &))); connect(m_tableView, SIGNAL(pressed(const QModelIndex &)), this, SLOT(viewPressed(const QModelIndex &))); + connect(m_table, SIGNAL(executeCommand(Command *)), + this, SLOT(executeCommand(Command *))); QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Close); connect(bb, SIGNAL(rejected()), this, SLOT(close())); @@ -118,6 +120,7 @@ void ModelDataTableDialog::executeCommand(Command *command) { - CommandHistory::getInstance()->addCommand(command, true, true); + std::cerr << "ModelDataTableDialog::executeCommand(" << command << ")" << std::endl; + CommandHistory::getInstance()->addCommand(command, false, true); } diff -r 2669267fb7ea -r 2c59b0cd176b widgets/PropertyStack.cpp --- a/widgets/PropertyStack.cpp Thu Jun 12 09:03:00 2008 +0000 +++ b/widgets/PropertyStack.cpp Thu Jun 12 10:47:11 2008 +0000 @@ -203,8 +203,8 @@ class ShowLayerCommand : public QObject, public Command { public: - ShowLayerCommand(View *view, Layer *layer, bool show) : - m_view(view), m_layer(layer), m_show(show) { } + ShowLayerCommand(View *view, Layer *layer, bool show, QString name) : + m_view(view), m_layer(layer), m_show(show), m_name(name) { } void execute() { m_layer->showLayer(m_view, m_show); } @@ -212,12 +212,13 @@ m_layer->showLayer(m_view, !m_show); } QString getName() const { - return tr("Change Layer Visibility"); + return m_name; } protected: View *m_view; Layer *m_layer; bool m_show; + QString m_name; }; void @@ -230,7 +231,8 @@ Layer *layer = dynamic_cast(m_boxes[i]->getContainer()); if (layer) { CommandHistory::getInstance()->addCommand - (new ShowLayerCommand(m_client, layer, show)); + (new ShowLayerCommand(m_client, layer, show, + tr("Change Layer Visibility"))); return; } }