@@ -173,6 +173,10 MainWindow::MainWindow(QWidget *parent) | |||
|
173 | 173 | auto timeWidget = new TimeWidget{}; |
|
174 | 174 | mainToolBar->addWidget(timeWidget); |
|
175 | 175 | |
|
176 | // Controllers / controllers connections | |
|
177 | connect(&sqpApp->timeController(), SIGNAL(timeUpdated(SqpDateTime)), | |
|
178 | &sqpApp->variableController(), SLOT(onDateTimeOnSelection(SqpDateTime))); | |
|
179 | ||
|
176 | 180 | // Widgets / controllers connections |
|
177 | 181 | |
|
178 | 182 | // DataSource |
@@ -183,8 +187,10 MainWindow::MainWindow(QWidget *parent) | |||
|
183 | 187 | connect(timeWidget, SIGNAL(timeUpdated(SqpDateTime)), &sqpApp->timeController(), |
|
184 | 188 | SLOT(onTimeToUpdate(SqpDateTime))); |
|
185 | 189 | |
|
186 | connect(&sqpApp->timeController(), SIGNAL(timeUpdated(SqpDateTime)), | |
|
187 | &sqpApp->variableController(), SLOT(onDateTimeOnSelection(SqpDateTime))); | |
|
190 | // Visualization | |
|
191 | connect(&sqpApp->visualizationController(), | |
|
192 | SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), m_Ui->view, | |
|
193 | SLOT(onVariableAboutToBeDeleted(std::shared_ptr<Variable>))); | |
|
188 | 194 | |
|
189 | 195 | // Widgets / widgets connections |
|
190 | 196 |
@@ -34,6 +34,7 public: | |||
|
34 | 34 | * Deletes from the controller the variable passed in parameter. |
|
35 | 35 | * |
|
36 | 36 | * Delete a variable includes: |
|
37 | * - the deletion of the various references to the variable in SciQlop | |
|
37 | 38 | * - the deletion of the model variable |
|
38 | 39 | * - the deletion of the provider associated with the variable |
|
39 | 40 | * - removing the cache associated with the variable |
@@ -50,6 +51,8 public: | |||
|
50 | 51 | void deleteVariables(const QVector<std::shared_ptr<Variable> > &variables) noexcept; |
|
51 | 52 | |
|
52 | 53 | signals: |
|
54 | /// Signal emitted when a variable is about to be deleted from the controller | |
|
55 | void variableAboutToBeDeleted(std::shared_ptr<Variable> variable); | |
|
53 | 56 | /// Signal emitted when a variable has been created |
|
54 | 57 | void variableCreated(std::shared_ptr<Variable> variable); |
|
55 | 58 |
@@ -32,6 +32,10 public: | |||
|
32 | 32 | connect(m_VariableController.get(), SIGNAL(variableCreated(std::shared_ptr<Variable>)), |
|
33 | 33 | m_VisualizationController.get(), |
|
34 | 34 | SIGNAL(variableCreated(std::shared_ptr<Variable>))); |
|
35 | connect(m_VariableController.get(), | |
|
36 | SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), | |
|
37 | m_VisualizationController.get(), | |
|
38 | SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), Qt::DirectConnection); | |
|
35 | 39 | |
|
36 | 40 | m_DataSourceController->moveToThread(&m_DataSourceControllerThread); |
|
37 | 41 | m_VariableController->moveToThread(&m_VariableControllerThread); |
@@ -68,8 +68,8 void VariableInspectorWidget::onTableMenuRequested(const QPoint &pos) noexcept | |||
|
68 | 68 | // Adds menu-specific actions |
|
69 | 69 | if (!selectedVariables.isEmpty()) { |
|
70 | 70 | // 'Delete' action |
|
71 | auto deleteFun = []() { | |
|
72 | /// @todo ALX : call variable deletion | |
|
71 | auto deleteFun = [&selectedVariables]() { | |
|
72 | sqpApp->variableController().deleteVariables(selectedVariables); | |
|
73 | 73 | }; |
|
74 | 74 | |
|
75 | 75 | tableMenu.addSeparator(); |
General Comments 0
You need to be logged in to leave comments.
Login now