mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-13 10:04:13 +02:00
Add "Insert folio above/below" to the elements panel's folio menu
"Add folio" always appends to the end of the project, ignoring whatever folio is currently selected in the left panel -- even though the panel already tracks the selected diagram's position for its existing move up/down/top actions, and QETProject::addNewDiagram(pos) already accepts an arbitrary insertion index, pushed as an undoable AddDiagramCommand (QetGraphicsTableFactory::create() already relies on this exact mechanism to insert a folio right after a specific one). Add two new context-menu actions that compute the target position from the selected diagram's folioIndex() and pass it straight through the existing machinery -- no changes needed to QETProject or AddDiagramCommand. New requestForNewDiagramAt/addDiagramToProjectAt signal/slot pair added alongside the existing requestForNewDiagram/addDiagramToProject rather than changing it, so the plain "Add folio" action's append-at-end behavior is untouched.
This commit is contained in:
@@ -137,6 +137,7 @@ class QETDiagramEditor : public QETMainWindow
|
||||
void editDiagramProperties(DiagramView *);
|
||||
void editDiagramProperties(Diagram *);
|
||||
void addDiagramToProject(QETProject *);
|
||||
void addDiagramToProjectAt(QETProject *, int);
|
||||
void removeDiagram(Diagram *);
|
||||
void removeDiagrams(const QList<Diagram *> &diagrams);
|
||||
void removeDiagramFromProject();
|
||||
|
||||
Reference in New Issue
Block a user