mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Add new action DiagramMoveDownx10, DiagramMoveUpx10
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3551 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -72,6 +72,8 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
|
|||||||
prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer ce sch\351ma"), this);
|
prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer ce sch\351ma"), this);
|
||||||
prj_move_diagram_up = new QAction(QET::Icons::GoUp, tr("Remonter ce sch\351ma"), this);
|
prj_move_diagram_up = new QAction(QET::Icons::GoUp, tr("Remonter ce sch\351ma"), this);
|
||||||
prj_move_diagram_down = new QAction(QET::Icons::GoDown, tr("Abaisser ce sch\351ma"), this);
|
prj_move_diagram_down = new QAction(QET::Icons::GoDown, tr("Abaisser ce sch\351ma"), this);
|
||||||
|
prj_move_diagram_upx10 = new QAction(QET::Icons::GoUp, tr("Remonter ce sch\351ma x10"), this);
|
||||||
|
prj_move_diagram_downx10 = new QAction(QET::Icons::GoDown, tr("Abaisser ce sch\351ma x10"), this);
|
||||||
tbt_add = new QAction(QET::Icons::TitleBlock, tr("Nouveau mod\350le"), this);
|
tbt_add = new QAction(QET::Icons::TitleBlock, tr("Nouveau mod\350le"), this);
|
||||||
tbt_edit = new QAction(QET::Icons::TitleBlock, tr("\311diter ce mod\350le"), this);
|
tbt_edit = new QAction(QET::Icons::TitleBlock, tr("\311diter ce mod\350le"), this);
|
||||||
tbt_remove = new QAction(QET::Icons::TitleBlock, tr("Supprimer ce mod\350le"), this);
|
tbt_remove = new QAction(QET::Icons::TitleBlock, tr("Supprimer ce mod\350le"), this);
|
||||||
@@ -118,6 +120,8 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
|
|||||||
connect(prj_del_diagram, SIGNAL(triggered()), this, SLOT(deleteDiagram()));
|
connect(prj_del_diagram, SIGNAL(triggered()), this, SLOT(deleteDiagram()));
|
||||||
connect(prj_move_diagram_up, SIGNAL(triggered()), this, SLOT(moveDiagramUp()));
|
connect(prj_move_diagram_up, SIGNAL(triggered()), this, SLOT(moveDiagramUp()));
|
||||||
connect(prj_move_diagram_down, SIGNAL(triggered()), this, SLOT(moveDiagramDown()));
|
connect(prj_move_diagram_down, SIGNAL(triggered()), this, SLOT(moveDiagramDown()));
|
||||||
|
connect(prj_move_diagram_upx10, SIGNAL(triggered()), this, SLOT(moveDiagramUpx10()));
|
||||||
|
connect(prj_move_diagram_downx10, SIGNAL(triggered()), this, SLOT(moveDiagramDownx10()));
|
||||||
connect(tbt_add, SIGNAL(triggered()), this, SLOT(addTitleBlockTemplate()));
|
connect(tbt_add, SIGNAL(triggered()), this, SLOT(addTitleBlockTemplate()));
|
||||||
connect(tbt_edit, SIGNAL(triggered()), this, SLOT(editTitleBlockTemplate()));
|
connect(tbt_edit, SIGNAL(triggered()), this, SLOT(editTitleBlockTemplate()));
|
||||||
connect(tbt_remove, SIGNAL(triggered()), this, SLOT(removeTitleBlockTemplate()));
|
connect(tbt_remove, SIGNAL(triggered()), this, SLOT(removeTitleBlockTemplate()));
|
||||||
@@ -311,6 +315,25 @@ void ElementsPanelWidget::moveDiagramDown() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Emet le signal requestForDiagramMoveUpx10 avec le schema selectionne
|
||||||
|
*/
|
||||||
|
void ElementsPanelWidget::moveDiagramUpx10() {
|
||||||
|
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||||
|
emit(requestForDiagramMoveUpx10(selected_diagram));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Emet le signal requestForDiagramMoveDownx10 avec le schema selectionne
|
||||||
|
*/
|
||||||
|
void ElementsPanelWidget::moveDiagramDownx10() {
|
||||||
|
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
|
||||||
|
emit(requestForDiagramMoveDownx10(selected_diagram));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Opens a template editor to create a new title block template.
|
Opens a template editor to create a new title block template.
|
||||||
*/
|
*/
|
||||||
@@ -431,6 +454,8 @@ void ElementsPanelWidget::updateButtons() {
|
|||||||
prj_del_diagram -> setEnabled(is_writable);
|
prj_del_diagram -> setEnabled(is_writable);
|
||||||
prj_move_diagram_up -> setEnabled(is_writable && diagram_position > 0);
|
prj_move_diagram_up -> setEnabled(is_writable && diagram_position > 0);
|
||||||
prj_move_diagram_down -> setEnabled(is_writable && diagram_position < project_diagrams_count - 1);
|
prj_move_diagram_down -> setEnabled(is_writable && diagram_position < project_diagrams_count - 1);
|
||||||
|
prj_move_diagram_upx10 -> setEnabled(is_writable && diagram_position > 10);
|
||||||
|
prj_move_diagram_downx10 -> setEnabled(is_writable && diagram_position < project_diagrams_count - 10);
|
||||||
setElementsActionEnabled(false);
|
setElementsActionEnabled(false);
|
||||||
} else if (current_type == QET::TitleBlockTemplatesCollection) {
|
} else if (current_type == QET::TitleBlockTemplatesCollection) {
|
||||||
TitleBlockTemplateLocation location = elements_panel -> templateLocationForItem(current_item);
|
TitleBlockTemplateLocation location = elements_panel -> templateLocationForItem(current_item);
|
||||||
@@ -533,8 +558,10 @@ void ElementsPanelWidget::handleContextMenu(const QPoint &pos) {
|
|||||||
case QET::Diagram:
|
case QET::Diagram:
|
||||||
context_menu -> addAction(prj_prop_diagram);
|
context_menu -> addAction(prj_prop_diagram);
|
||||||
context_menu -> addAction(prj_del_diagram);
|
context_menu -> addAction(prj_del_diagram);
|
||||||
|
context_menu -> addAction(prj_move_diagram_upx10);
|
||||||
context_menu -> addAction(prj_move_diagram_up);
|
context_menu -> addAction(prj_move_diagram_up);
|
||||||
context_menu -> addAction(prj_move_diagram_down);
|
context_menu -> addAction(prj_move_diagram_down);
|
||||||
|
context_menu -> addAction(prj_move_diagram_downx10);
|
||||||
break;
|
break;
|
||||||
case QET::TitleBlockTemplatesCollection:
|
case QET::TitleBlockTemplatesCollection:
|
||||||
context_menu -> addAction(tbt_add);
|
context_menu -> addAction(tbt_add);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class ElementsPanelWidget : public QWidget {
|
|||||||
QAction *new_category, *edit_category, *delete_category;
|
QAction *new_category, *edit_category, *delete_category;
|
||||||
QAction *delete_collection;
|
QAction *delete_collection;
|
||||||
QAction *new_element, *edit_element, *delete_element, *open_element;
|
QAction *new_element, *edit_element, *delete_element, *open_element;
|
||||||
QAction *prj_activate, *prj_close, *prj_edit_prop, *prj_prop_diagram, *prj_add_diagram, *prj_del_diagram, *prj_move_diagram_up, *prj_move_diagram_down;
|
QAction *prj_activate, *prj_close, *prj_edit_prop, *prj_prop_diagram, *prj_add_diagram, *prj_del_diagram, *prj_move_diagram_up, *prj_move_diagram_down, *prj_move_diagram_upx10, *prj_move_diagram_downx10;
|
||||||
QAction *tbt_add, *tbt_edit, *tbt_remove;
|
QAction *tbt_add, *tbt_edit, *tbt_remove;
|
||||||
QAction *copy_elements_, *move_elements_, *cancel_elements_;
|
QAction *copy_elements_, *move_elements_, *cancel_elements_;
|
||||||
QMenu *context_menu;
|
QMenu *context_menu;
|
||||||
@@ -67,6 +67,8 @@ class ElementsPanelWidget : public QWidget {
|
|||||||
void requestForDiagramDeletion(Diagram *);
|
void requestForDiagramDeletion(Diagram *);
|
||||||
void requestForDiagramMoveUp(Diagram *);
|
void requestForDiagramMoveUp(Diagram *);
|
||||||
void requestForDiagramMoveDown(Diagram *);
|
void requestForDiagramMoveDown(Diagram *);
|
||||||
|
void requestForDiagramMoveUpx10(Diagram *);
|
||||||
|
void requestForDiagramMoveDownx10(Diagram *);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clearFilterTextField();
|
void clearFilterTextField();
|
||||||
@@ -81,6 +83,8 @@ class ElementsPanelWidget : public QWidget {
|
|||||||
void deleteDiagram();
|
void deleteDiagram();
|
||||||
void moveDiagramUp();
|
void moveDiagramUp();
|
||||||
void moveDiagramDown();
|
void moveDiagramDown();
|
||||||
|
void moveDiagramUpx10();
|
||||||
|
void moveDiagramDownx10();
|
||||||
void addTitleBlockTemplate();
|
void addTitleBlockTemplate();
|
||||||
void editTitleBlockTemplate();
|
void editTitleBlockTemplate();
|
||||||
void removeTitleBlockTemplate();
|
void removeTitleBlockTemplate();
|
||||||
|
|||||||
@@ -501,6 +501,48 @@ void ProjectView::moveDiagramDown(Diagram *diagram) {
|
|||||||
moveDiagramDown(findDiagram(diagram));
|
moveDiagramDown(findDiagram(diagram));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deplace le schema diagram_view vers le haut / la gauche x10
|
||||||
|
*/
|
||||||
|
void ProjectView::moveDiagramUpx10(DiagramView *diagram_view) {
|
||||||
|
if (!diagram_view) return;
|
||||||
|
|
||||||
|
int diagram_view_position = diagram_ids_.key(diagram_view);
|
||||||
|
if (!diagram_view_position) {
|
||||||
|
// le schema est le premier du projet
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tabs_ -> moveTab(diagram_view_position, diagram_view_position - 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deplace le schema diagram vers le haut / la gauche x10
|
||||||
|
*/
|
||||||
|
void ProjectView::moveDiagramUpx10(Diagram *diagram) {
|
||||||
|
moveDiagramUpx10(findDiagram(diagram));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deplace le schema diagram_view vers le bas / la droite x10
|
||||||
|
*/
|
||||||
|
void ProjectView::moveDiagramDownx10(DiagramView *diagram_view) {
|
||||||
|
if (!diagram_view) return;
|
||||||
|
|
||||||
|
int diagram_view_position = diagram_ids_.key(diagram_view);
|
||||||
|
if (diagram_view_position + 1 == diagram_ids_.count()) {
|
||||||
|
// le schema est le dernier du projet
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tabs_ -> moveTab(diagram_view_position, diagram_view_position + 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deplace le schema diagram vers le bas / la droite x10
|
||||||
|
*/
|
||||||
|
void ProjectView::moveDiagramDownx10(Diagram *diagram) {
|
||||||
|
moveDiagramDownx10(findDiagram(diagram));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Ce slot demarre un dialogue permettant a l'utilisateur de parametrer et de
|
Ce slot demarre un dialogue permettant a l'utilisateur de parametrer et de
|
||||||
lancer l'impression de toute ou partie du projet.
|
lancer l'impression de toute ou partie du projet.
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ class ProjectView : public QWidget {
|
|||||||
void moveDiagramUp(Diagram *);
|
void moveDiagramUp(Diagram *);
|
||||||
void moveDiagramDown(DiagramView *);
|
void moveDiagramDown(DiagramView *);
|
||||||
void moveDiagramDown(Diagram *);
|
void moveDiagramDown(Diagram *);
|
||||||
|
void moveDiagramUpx10(DiagramView *);
|
||||||
|
void moveDiagramUpx10(Diagram *);
|
||||||
|
void moveDiagramDownx10(DiagramView *);
|
||||||
|
void moveDiagramDownx10(Diagram *);
|
||||||
void printProject();
|
void printProject();
|
||||||
void exportProject();
|
void exportProject();
|
||||||
QETResult save();
|
QETResult save();
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ void QETDiagramEditor::setUpElementsPanel() {
|
|||||||
connect(pa, SIGNAL(requestForDiagramDeletion (Diagram *)), this, SLOT(removeDiagram(Diagram *)));
|
connect(pa, SIGNAL(requestForDiagramDeletion (Diagram *)), this, SLOT(removeDiagram(Diagram *)));
|
||||||
connect(pa, SIGNAL(requestForDiagramMoveUp (Diagram *)), this, SLOT(moveDiagramUp(Diagram *)));
|
connect(pa, SIGNAL(requestForDiagramMoveUp (Diagram *)), this, SLOT(moveDiagramUp(Diagram *)));
|
||||||
connect(pa, SIGNAL(requestForDiagramMoveDown (Diagram *)), this, SLOT(moveDiagramDown(Diagram *)));
|
connect(pa, SIGNAL(requestForDiagramMoveDown (Diagram *)), this, SLOT(moveDiagramDown(Diagram *)));
|
||||||
|
connect(pa, SIGNAL(requestForDiagramMoveUpx10 (Diagram *)), this, SLOT(moveDiagramUpx10(Diagram *)));
|
||||||
|
connect(pa, SIGNAL(requestForDiagramMoveDownx10 (Diagram *)), this, SLOT(moveDiagramDownx10(Diagram *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1813,6 +1815,46 @@ void QETDiagramEditor::moveDiagramDown(Diagram *diagram) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Change l'ordre des schemas d'un projet, en decalant le schema vers le haut /
|
||||||
|
la gauche x10
|
||||||
|
@param diagram Schema a decaler vers le haut / la gauche x10
|
||||||
|
*/
|
||||||
|
void QETDiagramEditor::moveDiagramUpx10(Diagram *diagram) {
|
||||||
|
if (!diagram) return;
|
||||||
|
|
||||||
|
// recupere le projet contenant le schema
|
||||||
|
if (QETProject *diagram_project = diagram -> project()) {
|
||||||
|
if (diagram_project -> isReadOnly()) return;
|
||||||
|
|
||||||
|
// recupere la vue sur ce projet
|
||||||
|
if (ProjectView *project_view = findProject(diagram_project)) {
|
||||||
|
project_view -> moveDiagramUpx10(diagram);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Change l'ordre des schemas d'un projet, en decalant le schema vers le bas /
|
||||||
|
la droite x10
|
||||||
|
@param diagram Schema a decaler vers le bas / la droite x10
|
||||||
|
*/
|
||||||
|
void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram) {
|
||||||
|
if (!diagram) return;
|
||||||
|
|
||||||
|
// recupere le projet contenant le schema
|
||||||
|
if (QETProject *diagram_project = diagram -> project()) {
|
||||||
|
if (diagram_project -> isReadOnly()) return;
|
||||||
|
|
||||||
|
// recupere la vue sur ce projet
|
||||||
|
if (ProjectView *project_view = findProject(diagram_project)) {
|
||||||
|
project_view -> moveDiagramDownx10(diagram);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Nettoie le projet courant
|
Nettoie le projet courant
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ class QETDiagramEditor : public QETMainWindow {
|
|||||||
void removeDiagramFromProject();
|
void removeDiagramFromProject();
|
||||||
void moveDiagramUp(Diagram *);
|
void moveDiagramUp(Diagram *);
|
||||||
void moveDiagramDown(Diagram *);
|
void moveDiagramDown(Diagram *);
|
||||||
|
void moveDiagramUpx10(Diagram *);
|
||||||
|
void moveDiagramDownx10(Diagram *);
|
||||||
void cleanCurrentProject();
|
void cleanCurrentProject();
|
||||||
void nomenclatureProject();
|
void nomenclatureProject();
|
||||||
void diagramWasAdded(DiagramView *);
|
void diagramWasAdded(DiagramView *);
|
||||||
|
|||||||
Reference in New Issue
Block a user