mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Minor : use Diagram::showMe() method instead of emit several signal to do the same thing
This commit is contained in:
@@ -262,7 +262,7 @@ void ElementsPanel::slot_doubleClick(QTreeWidgetItem *qtwi, int) {
|
||||
emit(requestForProject(project));
|
||||
} else if (qtwi_type == QET::Diagram) {
|
||||
Diagram *diagram = valueForItem<Diagram *>(qtwi);
|
||||
emit(requestForDiagram(diagram));
|
||||
diagram->showMe();
|
||||
} else if (qtwi_type == QET::TitleBlockTemplate) {
|
||||
TitleBlockTemplateLocation tbt = valueForItem<TitleBlockTemplateLocation>(qtwi);
|
||||
emit(requestForTitleBlockTemplate(tbt));
|
||||
|
||||
@@ -52,7 +52,6 @@ class ElementsPanel : public GenericPanel {
|
||||
|
||||
signals:
|
||||
void requestForProject(QETProject *);
|
||||
void requestForDiagram(Diagram *);
|
||||
void requestForTitleBlockTemplate(const TitleBlockTemplateLocation &);
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -103,7 +103,6 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
|
||||
|
||||
connect(elements_panel, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(updateButtons()));
|
||||
connect(elements_panel, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(handleContextMenu(const QPoint &)));
|
||||
connect(elements_panel, SIGNAL(requestForDiagram(Diagram*)), this, SIGNAL(requestForDiagram(Diagram*)));
|
||||
connect(
|
||||
elements_panel,
|
||||
SIGNAL(requestForTitleBlockTemplate(const TitleBlockTemplateLocation &)),
|
||||
|
||||
@@ -61,7 +61,6 @@ class ElementsPanelWidget : public QWidget {
|
||||
inline ElementsPanel &elementsPanel() const;
|
||||
|
||||
signals:
|
||||
void requestForDiagram(Diagram *);
|
||||
void requestForProject(QETProject *);
|
||||
void requestForNewDiagram(QETProject *);
|
||||
void requestForProjectClosing(QETProject *);
|
||||
|
||||
@@ -163,8 +163,6 @@ void QETDiagramEditor::setUpElementsPanel()
|
||||
connect(pa, SIGNAL(requestForProjectClosing (QETProject *)), this, SLOT(closeProject(QETProject *)));
|
||||
connect(pa, SIGNAL(requestForProjectPropertiesEdition (QETProject *)), this, SLOT(editProjectProperties(QETProject *)));
|
||||
connect(pa, SIGNAL(requestForNewDiagram (QETProject *)), this, SLOT(addDiagramToProject(QETProject *)));
|
||||
|
||||
connect(pa, SIGNAL(requestForDiagram (Diagram *)), this, SLOT(activateDiagram(Diagram *)));
|
||||
connect(pa, SIGNAL(requestForDiagramPropertiesEdition (Diagram *)), this, SLOT(editDiagramProperties(Diagram *)));
|
||||
connect(pa, SIGNAL(requestForDiagramDeletion (Diagram *)), this, SLOT(removeDiagram(Diagram *)));
|
||||
connect(pa, SIGNAL(requestForDiagramMoveUp (Diagram *)), this, SLOT(moveDiagramUp(Diagram *)));
|
||||
@@ -1990,25 +1988,6 @@ void QETDiagramEditor::writeSettings()
|
||||
settings.setValue("diagrameditor/state", saveState());
|
||||
}
|
||||
|
||||
/**
|
||||
Active le schema passe en parametre
|
||||
@param diagram Schema a activer
|
||||
*/
|
||||
void QETDiagramEditor::activateDiagram(Diagram *diagram)
|
||||
{
|
||||
if (QETProject *project = diagram -> project()) {
|
||||
if (ProjectView *project_view = findProject(project)) {
|
||||
activateWidget(project_view);
|
||||
project_view -> showDiagram(diagram);
|
||||
}
|
||||
} else {
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO gerer ce cas")
|
||||
#endif
|
||||
/// @todo gerer ce cas
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Active le projet passe en parametre
|
||||
@param project Projet a activer
|
||||
|
||||
@@ -114,7 +114,6 @@ class QETDiagramEditor : public QETMainWindow
|
||||
void setTabbedMode();
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
void activateDiagram(Diagram *);
|
||||
void activateProject(QETProject *);
|
||||
void activateProject(ProjectView *);
|
||||
void activateWidget(QWidget *);
|
||||
|
||||
Reference in New Issue
Block a user