# HG changeset patch # User Chris Cannam # Date 1235493883 0 # Node ID 133b378d8efef4e11d96c3506453c52ca457c77b # Parent 73a58a4dfebdd782f90cc45bf46d26a6bb1e59f3 * more activity updates diff -r 73a58a4dfebd -r 133b378d8efe view/ViewManager.cpp --- a/view/ViewManager.cpp Tue Feb 24 14:01:42 2009 +0000 +++ b/view/ViewManager.cpp Tue Feb 24 16:44:43 2009 +0000 @@ -19,6 +19,7 @@ #include "data/model/Model.h" #include "widgets/CommandHistory.h" #include "View.h" +#include "Overview.h" #include #include @@ -508,9 +509,11 @@ if (v) emit viewCentreFrameChanged(v, f); } - emit activity(tr("Scroll view to %1") - .arg(RealTime::frame2RealTime - (f, m_mainModelSampleRate).toText().c_str())); + if (!dynamic_cast(v) || (mode != PlaybackIgnore)) { + emit activity(tr("Scroll to %1") + .arg(RealTime::frame2RealTime + (f, m_mainModelSampleRate).toText().c_str())); + } if (mode == PlaybackIgnore) { return; @@ -566,7 +569,10 @@ #endif emit viewZoomLevelChanged(v, z, locked); - emit activity(tr("Zoom to %n sample(s) per pixel", "", z)); + + if (!dynamic_cast(v)) { + emit activity(tr("Zoom to %n sample(s) per pixel", "", z)); + } } void diff -r 73a58a4dfebd -r 133b378d8efe widgets/ActivityLog.cpp --- a/widgets/ActivityLog.cpp Tue Feb 24 14:01:42 2009 +0000 +++ b/widgets/ActivityLog.cpp Tue Feb 24 16:44:43 2009 +0000 @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -40,11 +41,16 @@ { name = name.replace("&", ""); std::cerr << "ActivityLog::activityHappened(" << name.toStdString() << ")" << std::endl; -// int row = m_model->rowCount(); - int row = 0; + if (name == m_prevName) { + std::cerr << "(ignoring duplicate)" << std::endl; + return; + } + m_prevName = name; + int row = m_model->rowCount(); + name = tr("%1: %2").arg(QTime::currentTime().toString()).arg(name); m_model->insertRows(row, 1); - m_model->setData(m_model->index(row, 0), name); + QModelIndex ix = m_model->index(row, 0); + m_model->setData(ix, name); + if (m_listView->isVisible()) m_listView->scrollTo(ix); } - - diff -r 73a58a4dfebd -r 133b378d8efe widgets/ActivityLog.h --- a/widgets/ActivityLog.h Tue Feb 24 14:01:42 2009 +0000 +++ b/widgets/ActivityLog.h Tue Feb 24 16:44:43 2009 +0000 @@ -36,6 +36,7 @@ private: QListView *m_listView; QStringListModel *m_model; + QString m_prevName; }; #endif diff -r 73a58a4dfebd -r 133b378d8efe widgets/CommandHistory.cpp --- a/widgets/CommandHistory.cpp Tue Feb 24 14:01:42 2009 +0000 +++ b/widgets/CommandHistory.cpp Tue Feb 24 16:44:43 2009 +0000 @@ -35,7 +35,9 @@ #include -//#define DEBUG_COMMAND_HISTORY 1 +#include + +#define DEBUG_COMMAND_HISTORY 1 CommandHistory *CommandHistory::m_instance = 0; @@ -141,7 +143,7 @@ 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; + std::cerr << "CommandHistory::addCommand: " << command->getName().toLocal8Bit().data() << " of type " << typeid(*command).name() << " at " << command << ": execute = " << execute << ", bundle = " << bundle << " (m_currentCompound = " << m_currentCompound << ", m_currentBundle = " << m_currentBundle << ")" << std::endl; #endif if (m_currentCompound) {