Add undo command for add/remove a terminal strip

This commit is contained in:
joshua
2021-04-05 19:47:51 +02:00
parent 63429ab087
commit 573c0c236a
5 changed files with 127 additions and 2 deletions

View File

@@ -1845,6 +1845,36 @@ TerminalStrip *QETProject::newTerminalStrip(QString installation, QString locati
return ts;
}
/**
* @brief QETProject::addTerminalStrip
* Add \p strip to the terminal strip list of the project.
* The project of \p strip must this project
* @param strip
* @return true if successfully added
*/
bool QETProject::addTerminalStrip(TerminalStrip *strip)
{
if (strip->parent() != this)
return false;
if (!m_terminal_strip_vector.contains(strip))
return true;
m_terminal_strip_vector.append(strip);
return true;
}
/**
* @brief QETProject::removeTerminalStrip
* Remove \p strip from the terminal strip list of this project.
* Strip is removed from the list but not deleted.
* @param strip
* @return true if successfully removed.
*/
bool QETProject::removeTerminalStrip(TerminalStrip *strip) {
return m_terminal_strip_vector.removeOne(strip);
}
/**
Cette methode sert a reperer un projet vide, c-a-d un projet identique a ce
que l'on obtient en faisant Fichier > Nouveau.