Fix command queue stepping.

Also add instanceDescription to Command class to allow for more verbose command information reporting
This commit is contained in:
nemerle 2016-05-01 18:45:22 +02:00
parent 0391f67109
commit 60a4fefe95
4 changed files with 12 additions and 2 deletions

View File

@ -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 {

View File

@ -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);
}

View File

@ -21,6 +21,9 @@ public slots:
protected:
void changeEvent(QEvent *e);
private slots:
void on_btnStep_clicked();
private:
Ui::CommandQueueView *ui;
};

View File

@ -19,7 +19,7 @@
<widget class="QListWidget" name="lstQueuedCommands"/>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="btnStep">
<property name="text">
<string>Step</string>
</property>