Fix command queue stepping.
Also add instanceDescription to Command class to allow for more verbose command information reporting
This commit is contained in:
parent
0391f67109
commit
60a4fefe95
@ -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 {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -21,6 +21,9 @@ public slots:
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private slots:
|
||||
void on_btnStep_clicked();
|
||||
|
||||
private:
|
||||
Ui::CommandQueueView *ui;
|
||||
};
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user