From 60a4fefe952a574ef47e58d5157386c69e75b599 Mon Sep 17 00:00:00 2001 From: nemerle Date: Sun, 1 May 2016 18:45:22 +0200 Subject: [PATCH] Fix command queue stepping. Also add instanceDescription to Command class to allow for more verbose command information reporting --- src/Command.h | 1 + src/ui/CommandQueueView.cpp | 8 +++++++- src/ui/CommandQueueView.h | 3 +++ src/ui/CommandQueueView.ui | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Command.h b/src/Command.h index d04a921..280cca5 100644 --- a/src/Command.h +++ b/src/Command.h @@ -33,6 +33,7 @@ class Command public: Command(QString n,CommandLevel level) : m_command_name(n),m_level(level) {} QString name() const { return m_command_name;} + virtual QString instanceDescription() const { return m_command_name; } virtual bool execute(CommandContext *) { return false; } }; class CompoundCommand : public Command { diff --git a/src/ui/CommandQueueView.cpp b/src/ui/CommandQueueView.cpp index 1f195a9..1179e21 100644 --- a/src/ui/CommandQueueView.cpp +++ b/src/ui/CommandQueueView.cpp @@ -34,6 +34,12 @@ void CommandQueueView::onCommandListChanged() { ui->lstQueuedCommands->clear(); const CommandStream& cs(project.m_project_command_stream); for(const Command * cmd : cs.m_commands) { - ui->lstQueuedCommands->addItem(cmd->name()); + ui->lstQueuedCommands->addItem(cmd->instanceDescription()); } } + +void CommandQueueView::on_btnStep_clicked() +{ + Project &project(*Project::get()); + project.processCommands(1); +} diff --git a/src/ui/CommandQueueView.h b/src/ui/CommandQueueView.h index eb7cda8..d66645e 100644 --- a/src/ui/CommandQueueView.h +++ b/src/ui/CommandQueueView.h @@ -21,6 +21,9 @@ public slots: protected: void changeEvent(QEvent *e); +private slots: + void on_btnStep_clicked(); + private: Ui::CommandQueueView *ui; }; diff --git a/src/ui/CommandQueueView.ui b/src/ui/CommandQueueView.ui index 0a759c8..6665699 100644 --- a/src/ui/CommandQueueView.ui +++ b/src/ui/CommandQueueView.ui @@ -19,7 +19,7 @@ - + Step