mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Add RemoveTerminalStripCommand class
This commit is contained in:
@@ -26,7 +26,9 @@
|
||||
* @param strip
|
||||
* @param parent
|
||||
*/
|
||||
AddTerminalStripCommand::AddTerminalStripCommand(TerminalStrip *strip, QETProject *project, QUndoCommand *parent) :
|
||||
AddTerminalStripCommand::AddTerminalStripCommand(TerminalStrip *strip,
|
||||
QETProject *project,
|
||||
QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_strip(strip),
|
||||
m_project(project)
|
||||
@@ -48,3 +50,30 @@ void AddTerminalStripCommand::redo() {
|
||||
m_project->addTerminalStrip(m_strip);
|
||||
}
|
||||
}
|
||||
|
||||
RemoveTerminalStripCommand::RemoveTerminalStripCommand(TerminalStrip *strip,
|
||||
QETProject *project,
|
||||
QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_strip(strip),
|
||||
m_project(project)
|
||||
{
|
||||
setText(QObject::tr("Supprimer un groupe de bornes"));
|
||||
}
|
||||
|
||||
RemoveTerminalStripCommand::~RemoveTerminalStripCommand()
|
||||
{}
|
||||
|
||||
void RemoveTerminalStripCommand::undo()
|
||||
{
|
||||
if (m_project && m_strip) {
|
||||
m_project->addTerminalStrip(m_strip);
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveTerminalStripCommand::redo()
|
||||
{
|
||||
if (m_project && m_strip) {
|
||||
m_project->removeTerminalStrip(m_strip);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user