Compare commits

...

2 Commits

Author SHA1 Message Date
joshua a121fbe530 Add undo / redo command
The undo/redo command of diagram editor is
shared to the terminal strip editor.
2025-07-01 23:37:16 +02:00
joshua a2ae8255ac Minor fix
During the development, we saved some terminal strip with "phantom"
terminal (terminal added to the strip and after the terminal was removed
from the project but keep in the terminal strip data) and this mistake
was saved in the xml. When we open this project the phantom terminal
don't appear in the layout but the empty physical terminal is still here
in the terminal strip data because the position of the terminals in the
strip is wrong (sometime bigger than the size of the strip, sometime
with a gap, sometime don't start at 0). This commit fix this mistake
when we open a project.
2025-07-01 22:46:18 +02:00
4 changed files with 13 additions and 4 deletions
+4 -2
View File
@@ -1037,8 +1037,10 @@ bool TerminalStrip::fromXml(QDomElement &xml_element)
}
}
auto raw_ptr = new PhysicalTerminal(this, real_t_vector);
m_physical_terminals.append(raw_ptr->sharedRef());
if (!real_t_vector.isEmpty()) {
auto raw_ptr = new PhysicalTerminal(this, real_t_vector);
m_physical_terminals.append(raw_ptr->sharedRef());
}
}
}
@@ -55,6 +55,11 @@ TerminalStripEditorWindow::TerminalStripEditorWindow(QETProject *project, QWidge
m_project(project)
{
ui->setupUi(this);
if (auto diagram_editor = QETApp::diagramEditor(project)) {
ui->m_tool_bar->addSeparator();
ui->m_tool_bar->addAction(diagram_editor->undo);
ui->m_tool_bar->addAction(diagram_editor->redo);
}
ui->m_remove_terminal->setDisabled(true);
addTreeDockWidget();
@@ -33,12 +33,12 @@
<x>0</x>
<y>0</y>
<width>1364</width>
<height>21</height>
<height>23</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="toolBar">
<widget class="QToolBar" name="m_tool_bar">
<property name="windowTitle">
<string>toolBar</string>
</property>
+2
View File
@@ -54,6 +54,8 @@ class KAutoSaveFile;
class QETDiagramEditor : public QETMainWindow
{
Q_OBJECT
friend class TerminalStripEditorWindow;
public:
QETDiagramEditor(