|
@@
-1,236
+1,248
|
|
1
|
/*------------------------------------------------------------------------------
|
|
1
|
/*------------------------------------------------------------------------------
|
|
2
|
-- This file is a part of the SciQLop Software
|
|
2
|
-- This file is a part of the SciQLop Software
|
|
3
|
-- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
|
|
3
|
-- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
|
|
4
|
--
|
|
4
|
--
|
|
5
|
-- This program is free software; you can redistribute it and/or modify
|
|
5
|
-- This program is free software; you can redistribute it and/or modify
|
|
6
|
-- it under the terms of the GNU General Public License as published by
|
|
6
|
-- it under the terms of the GNU General Public License as published by
|
|
7
|
-- the Free Software Foundation; either version 2 of the License, or
|
|
7
|
-- the Free Software Foundation; either version 2 of the License, or
|
|
8
|
-- (at your option) any later version.
|
|
8
|
-- (at your option) any later version.
|
|
9
|
--
|
|
9
|
--
|
|
10
|
-- This program is distributed in the hope that it will be useful,
|
|
10
|
-- This program is distributed in the hope that it will be useful,
|
|
11
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-- GNU General Public License for more details.
|
|
13
|
-- GNU General Public License for more details.
|
|
14
|
--
|
|
14
|
--
|
|
15
|
-- You should have received a copy of the GNU General Public License
|
|
15
|
-- You should have received a copy of the GNU General Public License
|
|
16
|
-- along with this program; if not, write to the Free Software
|
|
16
|
-- along with this program; if not, write to the Free Software
|
|
17
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
17
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
18
|
-------------------------------------------------------------------------------*/
|
|
18
|
-------------------------------------------------------------------------------*/
|
|
19
|
/*-- Author : Alexis Jeandet
|
|
19
|
/*-- Author : Alexis Jeandet
|
|
20
|
-- Mail : alexis.jeandet@member.fsf.org
|
|
20
|
-- Mail : alexis.jeandet@member.fsf.org
|
|
21
|
----------------------------------------------------------------------------*/
|
|
21
|
----------------------------------------------------------------------------*/
|
|
22
|
#include "MainWindow.h"
|
|
22
|
#include "MainWindow.h"
|
|
23
|
#include "ui_MainWindow.h"
|
|
23
|
#include "ui_MainWindow.h"
|
|
24
|
|
|
24
|
|
|
25
|
#include <DataSource/DataSourceController.h>
|
|
25
|
#include <DataSource/DataSourceController.h>
|
|
26
|
#include <DataSource/DataSourceWidget.h>
|
|
26
|
#include <DataSource/DataSourceWidget.h>
|
|
27
|
#include <Settings/SqpSettingsDialog.h>
|
|
27
|
#include <Settings/SqpSettingsDialog.h>
|
|
|
|
|
28
|
#include <Settings/SqpSettingsGeneralWidget.h>
|
|
28
|
#include <SidePane/SqpSidePane.h>
|
|
29
|
#include <SidePane/SqpSidePane.h>
|
|
29
|
#include <SqpApplication.h>
|
|
30
|
#include <SqpApplication.h>
|
|
30
|
#include <Time/TimeController.h>
|
|
31
|
#include <Time/TimeController.h>
|
|
31
|
#include <TimeWidget/TimeWidget.h>
|
|
32
|
#include <TimeWidget/TimeWidget.h>
|
|
32
|
#include <Variable/Variable.h>
|
|
33
|
#include <Variable/Variable.h>
|
|
33
|
#include <Variable/VariableController.h>
|
|
34
|
#include <Variable/VariableController.h>
|
|
34
|
#include <Visualization/VisualizationController.h>
|
|
35
|
#include <Visualization/VisualizationController.h>
|
|
35
|
|
|
36
|
|
|
36
|
#include <QAction>
|
|
37
|
#include <QAction>
|
|
37
|
#include <QDate>
|
|
38
|
#include <QDate>
|
|
38
|
#include <QDateTime>
|
|
39
|
#include <QDateTime>
|
|
39
|
#include <QDir>
|
|
40
|
#include <QDir>
|
|
40
|
#include <QFileDialog>
|
|
41
|
#include <QFileDialog>
|
|
41
|
#include <QToolBar>
|
|
42
|
#include <QToolBar>
|
|
42
|
#include <QToolButton>
|
|
43
|
#include <QToolButton>
|
|
43
|
#include <memory.h>
|
|
44
|
#include <memory.h>
|
|
44
|
|
|
45
|
|
|
45
|
#include "iostream"
|
|
46
|
#include "iostream"
|
|
46
|
|
|
47
|
|
|
47
|
Q_LOGGING_CATEGORY(LOG_MainWindow, "MainWindow")
|
|
48
|
Q_LOGGING_CATEGORY(LOG_MainWindow, "MainWindow")
|
|
48
|
|
|
49
|
|
|
49
|
namespace {
|
|
50
|
namespace {
|
|
50
|
const auto LEFTMAININSPECTORWIDGETSPLITTERINDEX = 0;
|
|
51
|
const auto LEFTMAININSPECTORWIDGETSPLITTERINDEX = 0;
|
|
51
|
const auto LEFTINSPECTORSIDEPANESPLITTERINDEX = 1;
|
|
52
|
const auto LEFTINSPECTORSIDEPANESPLITTERINDEX = 1;
|
|
52
|
const auto VIEWPLITTERINDEX = 2;
|
|
53
|
const auto VIEWPLITTERINDEX = 2;
|
|
53
|
const auto RIGHTINSPECTORSIDEPANESPLITTERINDEX = 3;
|
|
54
|
const auto RIGHTINSPECTORSIDEPANESPLITTERINDEX = 3;
|
|
54
|
const auto RIGHTMAININSPECTORWIDGETSPLITTERINDEX = 4;
|
|
55
|
const auto RIGHTMAININSPECTORWIDGETSPLITTERINDEX = 4;
|
|
55
|
}
|
|
56
|
}
|
|
56
|
|
|
57
|
|
|
57
|
class MainWindow::MainWindowPrivate {
|
|
58
|
class MainWindow::MainWindowPrivate {
|
|
58
|
public:
|
|
59
|
public:
|
|
59
|
explicit MainWindowPrivate(MainWindow *mainWindow)
|
|
60
|
explicit MainWindowPrivate(MainWindow *mainWindow)
|
|
60
|
: m_LastOpenLeftInspectorSize{},
|
|
61
|
: m_LastOpenLeftInspectorSize{},
|
|
61
|
m_LastOpenRightInspectorSize{},
|
|
62
|
m_LastOpenRightInspectorSize{},
|
|
|
|
|
63
|
m_GeneralSettingsWidget{new SqpSettingsGeneralWidget{mainWindow}},
|
|
62
|
m_SettingsDialog{new SqpSettingsDialog{mainWindow}}
|
|
64
|
m_SettingsDialog{new SqpSettingsDialog{mainWindow}}
|
|
63
|
{
|
|
65
|
{
|
|
64
|
}
|
|
66
|
}
|
|
65
|
|
|
67
|
|
|
66
|
QSize m_LastOpenLeftInspectorSize;
|
|
68
|
QSize m_LastOpenLeftInspectorSize;
|
|
67
|
QSize m_LastOpenRightInspectorSize;
|
|
69
|
QSize m_LastOpenRightInspectorSize;
|
|
|
|
|
70
|
/// General settings widget. MainWindow has the ownership
|
|
|
|
|
71
|
SqpSettingsGeneralWidget *m_GeneralSettingsWidget;
|
|
68
|
/// Settings dialog. MainWindow has the ownership
|
|
72
|
/// Settings dialog. MainWindow has the ownership
|
|
69
|
SqpSettingsDialog *m_SettingsDialog;
|
|
73
|
SqpSettingsDialog *m_SettingsDialog;
|
|
70
|
};
|
|
74
|
};
|
|
71
|
|
|
75
|
|
|
72
|
MainWindow::MainWindow(QWidget *parent)
|
|
76
|
MainWindow::MainWindow(QWidget *parent)
|
|
73
|
: QMainWindow{parent},
|
|
77
|
: QMainWindow{parent},
|
|
74
|
m_Ui{new Ui::MainWindow},
|
|
78
|
m_Ui{new Ui::MainWindow},
|
|
75
|
impl{spimpl::make_unique_impl<MainWindowPrivate>(this)}
|
|
79
|
impl{spimpl::make_unique_impl<MainWindowPrivate>(this)}
|
|
76
|
{
|
|
80
|
{
|
|
77
|
m_Ui->setupUi(this);
|
|
81
|
m_Ui->setupUi(this);
|
|
78
|
|
|
82
|
|
|
79
|
m_Ui->splitter->setCollapsible(LEFTINSPECTORSIDEPANESPLITTERINDEX, false);
|
|
83
|
m_Ui->splitter->setCollapsible(LEFTINSPECTORSIDEPANESPLITTERINDEX, false);
|
|
80
|
m_Ui->splitter->setCollapsible(RIGHTINSPECTORSIDEPANESPLITTERINDEX, false);
|
|
84
|
m_Ui->splitter->setCollapsible(RIGHTINSPECTORSIDEPANESPLITTERINDEX, false);
|
|
81
|
|
|
85
|
|
|
82
|
|
|
86
|
|
|
83
|
auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
|
|
87
|
auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
|
|
84
|
auto openLeftInspectorAction = new QAction{QIcon{
|
|
88
|
auto openLeftInspectorAction = new QAction{QIcon{
|
|
85
|
":/icones/previous.png",
|
|
89
|
":/icones/previous.png",
|
|
86
|
},
|
|
90
|
},
|
|
87
|
tr("Show/hide the left inspector"), this};
|
|
91
|
tr("Show/hide the left inspector"), this};
|
|
88
|
|
|
92
|
|
|
89
|
|
|
93
|
|
|
90
|
auto spacerLeftTop = new QWidget{};
|
|
94
|
auto spacerLeftTop = new QWidget{};
|
|
91
|
spacerLeftTop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
95
|
spacerLeftTop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
92
|
|
|
96
|
|
|
93
|
auto spacerLeftBottom = new QWidget{};
|
|
97
|
auto spacerLeftBottom = new QWidget{};
|
|
94
|
spacerLeftBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
98
|
spacerLeftBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
95
|
|
|
99
|
|
|
96
|
leftSidePane->addWidget(spacerLeftTop);
|
|
100
|
leftSidePane->addWidget(spacerLeftTop);
|
|
97
|
leftSidePane->addAction(openLeftInspectorAction);
|
|
101
|
leftSidePane->addAction(openLeftInspectorAction);
|
|
98
|
leftSidePane->addWidget(spacerLeftBottom);
|
|
102
|
leftSidePane->addWidget(spacerLeftBottom);
|
|
99
|
|
|
103
|
|
|
100
|
|
|
104
|
|
|
101
|
auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
|
|
105
|
auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
|
|
102
|
auto openRightInspectorAction = new QAction{QIcon{
|
|
106
|
auto openRightInspectorAction = new QAction{QIcon{
|
|
103
|
":/icones/next.png",
|
|
107
|
":/icones/next.png",
|
|
104
|
},
|
|
108
|
},
|
|
105
|
tr("Show/hide the right inspector"), this};
|
|
109
|
tr("Show/hide the right inspector"), this};
|
|
106
|
|
|
110
|
|
|
107
|
auto spacerRightTop = new QWidget{};
|
|
111
|
auto spacerRightTop = new QWidget{};
|
|
108
|
spacerRightTop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
112
|
spacerRightTop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
109
|
|
|
113
|
|
|
110
|
auto spacerRightBottom = new QWidget{};
|
|
114
|
auto spacerRightBottom = new QWidget{};
|
|
111
|
spacerRightBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
115
|
spacerRightBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
112
|
|
|
116
|
|
|
113
|
rightSidePane->addWidget(spacerRightTop);
|
|
117
|
rightSidePane->addWidget(spacerRightTop);
|
|
114
|
rightSidePane->addAction(openRightInspectorAction);
|
|
118
|
rightSidePane->addAction(openRightInspectorAction);
|
|
115
|
rightSidePane->addWidget(spacerRightBottom);
|
|
119
|
rightSidePane->addWidget(spacerRightBottom);
|
|
116
|
|
|
120
|
|
|
117
|
openLeftInspectorAction->setCheckable(true);
|
|
121
|
openLeftInspectorAction->setCheckable(true);
|
|
118
|
openRightInspectorAction->setCheckable(true);
|
|
122
|
openRightInspectorAction->setCheckable(true);
|
|
119
|
|
|
123
|
|
|
120
|
auto openInspector = [this](bool checked, bool right, auto action) {
|
|
124
|
auto openInspector = [this](bool checked, bool right, auto action) {
|
|
121
|
|
|
125
|
|
|
122
|
action->setIcon(QIcon{(checked xor right) ? ":/icones/next.png" : ":/icones/previous.png"});
|
|
126
|
action->setIcon(QIcon{(checked xor right) ? ":/icones/next.png" : ":/icones/previous.png"});
|
|
123
|
|
|
127
|
|
|
124
|
auto &lastInspectorSize
|
|
128
|
auto &lastInspectorSize
|
|
125
|
= right ? impl->m_LastOpenRightInspectorSize : impl->m_LastOpenLeftInspectorSize;
|
|
129
|
= right ? impl->m_LastOpenRightInspectorSize : impl->m_LastOpenLeftInspectorSize;
|
|
126
|
|
|
130
|
|
|
127
|
auto nextInspectorSize = right ? m_Ui->rightMainInspectorWidget->size()
|
|
131
|
auto nextInspectorSize = right ? m_Ui->rightMainInspectorWidget->size()
|
|
128
|
: m_Ui->leftMainInspectorWidget->size();
|
|
132
|
: m_Ui->leftMainInspectorWidget->size();
|
|
129
|
|
|
133
|
|
|
130
|
// Update of the last opened geometry
|
|
134
|
// Update of the last opened geometry
|
|
131
|
if (checked) {
|
|
135
|
if (checked) {
|
|
132
|
lastInspectorSize = nextInspectorSize;
|
|
136
|
lastInspectorSize = nextInspectorSize;
|
|
133
|
}
|
|
137
|
}
|
|
134
|
|
|
138
|
|
|
135
|
auto startSize = lastInspectorSize;
|
|
139
|
auto startSize = lastInspectorSize;
|
|
136
|
auto endSize = startSize;
|
|
140
|
auto endSize = startSize;
|
|
137
|
endSize.setWidth(0);
|
|
141
|
endSize.setWidth(0);
|
|
138
|
|
|
142
|
|
|
139
|
auto splitterInspectorIndex
|
|
143
|
auto splitterInspectorIndex
|
|
140
|
= right ? RIGHTMAININSPECTORWIDGETSPLITTERINDEX : LEFTMAININSPECTORWIDGETSPLITTERINDEX;
|
|
144
|
= right ? RIGHTMAININSPECTORWIDGETSPLITTERINDEX : LEFTMAININSPECTORWIDGETSPLITTERINDEX;
|
|
141
|
|
|
145
|
|
|
142
|
auto currentSizes = m_Ui->splitter->sizes();
|
|
146
|
auto currentSizes = m_Ui->splitter->sizes();
|
|
143
|
if (checked) {
|
|
147
|
if (checked) {
|
|
144
|
// adjust sizes individually here, e.g.
|
|
148
|
// adjust sizes individually here, e.g.
|
|
145
|
currentSizes[splitterInspectorIndex] -= lastInspectorSize.width();
|
|
149
|
currentSizes[splitterInspectorIndex] -= lastInspectorSize.width();
|
|
146
|
currentSizes[VIEWPLITTERINDEX] += lastInspectorSize.width();
|
|
150
|
currentSizes[VIEWPLITTERINDEX] += lastInspectorSize.width();
|
|
147
|
m_Ui->splitter->setSizes(currentSizes);
|
|
151
|
m_Ui->splitter->setSizes(currentSizes);
|
|
148
|
}
|
|
152
|
}
|
|
149
|
else {
|
|
153
|
else {
|
|
150
|
// adjust sizes individually here, e.g.
|
|
154
|
// adjust sizes individually here, e.g.
|
|
151
|
currentSizes[splitterInspectorIndex] += lastInspectorSize.width();
|
|
155
|
currentSizes[splitterInspectorIndex] += lastInspectorSize.width();
|
|
152
|
currentSizes[VIEWPLITTERINDEX] -= lastInspectorSize.width();
|
|
156
|
currentSizes[VIEWPLITTERINDEX] -= lastInspectorSize.width();
|
|
153
|
m_Ui->splitter->setSizes(currentSizes);
|
|
157
|
m_Ui->splitter->setSizes(currentSizes);
|
|
154
|
}
|
|
158
|
}
|
|
155
|
|
|
159
|
|
|
156
|
};
|
|
160
|
};
|
|
157
|
|
|
161
|
|
|
158
|
|
|
162
|
|
|
159
|
connect(openLeftInspectorAction, &QAction::triggered,
|
|
163
|
connect(openLeftInspectorAction, &QAction::triggered,
|
|
160
|
[openInspector, openLeftInspectorAction](bool checked) {
|
|
164
|
[openInspector, openLeftInspectorAction](bool checked) {
|
|
161
|
openInspector(checked, false, openLeftInspectorAction);
|
|
165
|
openInspector(checked, false, openLeftInspectorAction);
|
|
162
|
});
|
|
166
|
});
|
|
163
|
connect(openRightInspectorAction, &QAction::triggered,
|
|
167
|
connect(openRightInspectorAction, &QAction::triggered,
|
|
164
|
[openInspector, openRightInspectorAction](bool checked) {
|
|
168
|
[openInspector, openRightInspectorAction](bool checked) {
|
|
165
|
openInspector(checked, true, openRightInspectorAction);
|
|
169
|
openInspector(checked, true, openRightInspectorAction);
|
|
166
|
});
|
|
170
|
});
|
|
167
|
|
|
171
|
|
|
168
|
// //// //
|
|
172
|
// //// //
|
|
169
|
// Menu //
|
|
173
|
// Menu //
|
|
170
|
// //// //
|
|
174
|
// //// //
|
|
171
|
this->menuBar()->addAction(tr("File"));
|
|
175
|
this->menuBar()->addAction(tr("File"));
|
|
172
|
auto toolsMenu = this->menuBar()->addMenu(tr("Tools"));
|
|
176
|
auto toolsMenu = this->menuBar()->addMenu(tr("Tools"));
|
|
173
|
toolsMenu->addAction(tr("Settings..."), [this]() {
|
|
177
|
toolsMenu->addAction(tr("Settings..."), [this]() {
|
|
174
|
impl->m_SettingsDialog->exec();
|
|
178
|
impl->m_SettingsDialog->exec();
|
|
175
|
});
|
|
179
|
});
|
|
176
|
|
|
180
|
|
|
177
|
auto mainToolBar = this->addToolBar(QStringLiteral("MainToolBar"));
|
|
181
|
auto mainToolBar = this->addToolBar(QStringLiteral("MainToolBar"));
|
|
178
|
|
|
182
|
|
|
179
|
auto timeWidget = new TimeWidget{};
|
|
183
|
auto timeWidget = new TimeWidget{};
|
|
180
|
mainToolBar->addWidget(timeWidget);
|
|
184
|
mainToolBar->addWidget(timeWidget);
|
|
181
|
|
|
185
|
|
|
|
|
|
186
|
// //////// //
|
|
|
|
|
187
|
// Settings //
|
|
|
|
|
188
|
// //////// //
|
|
|
|
|
189
|
|
|
|
|
|
190
|
// Registers "general settings" widget to the settings dialog
|
|
|
|
|
191
|
impl->m_SettingsDialog->registerWidget(QStringLiteral("General"),
|
|
|
|
|
192
|
impl->m_GeneralSettingsWidget);
|
|
|
|
|
193
|
|
|
182
|
// /////////// //
|
|
194
|
// /////////// //
|
|
183
|
// Connections //
|
|
195
|
// Connections //
|
|
184
|
// /////////// //
|
|
196
|
// /////////// //
|
|
185
|
|
|
197
|
|
|
186
|
// Controllers / controllers connections
|
|
198
|
// Controllers / controllers connections
|
|
187
|
connect(&sqpApp->timeController(), SIGNAL(timeUpdated(SqpDateTime)),
|
|
199
|
connect(&sqpApp->timeController(), SIGNAL(timeUpdated(SqpDateTime)),
|
|
188
|
&sqpApp->variableController(), SLOT(onDateTimeOnSelection(SqpDateTime)));
|
|
200
|
&sqpApp->variableController(), SLOT(onDateTimeOnSelection(SqpDateTime)));
|
|
189
|
|
|
201
|
|
|
190
|
// Widgets / controllers connections
|
|
202
|
// Widgets / controllers connections
|
|
191
|
|
|
203
|
|
|
192
|
// DataSource
|
|
204
|
// DataSource
|
|
193
|
connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
|
|
205
|
connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
|
|
194
|
m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *)));
|
|
206
|
m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *)));
|
|
195
|
|
|
207
|
|
|
196
|
// Time
|
|
208
|
// Time
|
|
197
|
connect(timeWidget, SIGNAL(timeUpdated(SqpDateTime)), &sqpApp->timeController(),
|
|
209
|
connect(timeWidget, SIGNAL(timeUpdated(SqpDateTime)), &sqpApp->timeController(),
|
|
198
|
SLOT(onTimeToUpdate(SqpDateTime)));
|
|
210
|
SLOT(onTimeToUpdate(SqpDateTime)));
|
|
199
|
|
|
211
|
|
|
200
|
// Visualization
|
|
212
|
// Visualization
|
|
201
|
connect(&sqpApp->visualizationController(),
|
|
213
|
connect(&sqpApp->visualizationController(),
|
|
202
|
SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), m_Ui->view,
|
|
214
|
SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), m_Ui->view,
|
|
203
|
SLOT(onVariableAboutToBeDeleted(std::shared_ptr<Variable>)));
|
|
215
|
SLOT(onVariableAboutToBeDeleted(std::shared_ptr<Variable>)));
|
|
204
|
|
|
216
|
|
|
205
|
connect(&sqpApp->visualizationController(),
|
|
217
|
connect(&sqpApp->visualizationController(),
|
|
206
|
SIGNAL(rangeChanged(std::shared_ptr<Variable>, const SqpDateTime &)), m_Ui->view,
|
|
218
|
SIGNAL(rangeChanged(std::shared_ptr<Variable>, const SqpDateTime &)), m_Ui->view,
|
|
207
|
SLOT(onRangeChanged(std::shared_ptr<Variable>, const SqpDateTime &)));
|
|
219
|
SLOT(onRangeChanged(std::shared_ptr<Variable>, const SqpDateTime &)));
|
|
208
|
|
|
220
|
|
|
209
|
// Widgets / widgets connections
|
|
221
|
// Widgets / widgets connections
|
|
210
|
|
|
222
|
|
|
211
|
// For the following connections, we use DirectConnection to allow each widget that can
|
|
223
|
// For the following connections, we use DirectConnection to allow each widget that can
|
|
212
|
// potentially attach a menu to the variable's menu to do so before this menu is displayed.
|
|
224
|
// potentially attach a menu to the variable's menu to do so before this menu is displayed.
|
|
213
|
// The order of connections is also important, since it determines the order in which each
|
|
225
|
// The order of connections is also important, since it determines the order in which each
|
|
214
|
// widget will attach its menu
|
|
226
|
// widget will attach its menu
|
|
215
|
connect(
|
|
227
|
connect(
|
|
216
|
m_Ui->variableInspectorWidget,
|
|
228
|
m_Ui->variableInspectorWidget,
|
|
217
|
SIGNAL(tableMenuAboutToBeDisplayed(QMenu *, const QVector<std::shared_ptr<Variable> > &)),
|
|
229
|
SIGNAL(tableMenuAboutToBeDisplayed(QMenu *, const QVector<std::shared_ptr<Variable> > &)),
|
|
218
|
m_Ui->view, SLOT(attachVariableMenu(QMenu *, const QVector<std::shared_ptr<Variable> > &)),
|
|
230
|
m_Ui->view, SLOT(attachVariableMenu(QMenu *, const QVector<std::shared_ptr<Variable> > &)),
|
|
219
|
Qt::DirectConnection);
|
|
231
|
Qt::DirectConnection);
|
|
220
|
}
|
|
232
|
}
|
|
221
|
|
|
233
|
|
|
222
|
MainWindow::~MainWindow()
|
|
234
|
MainWindow::~MainWindow()
|
|
223
|
{
|
|
235
|
{
|
|
224
|
}
|
|
236
|
}
|
|
225
|
|
|
237
|
|
|
226
|
void MainWindow::changeEvent(QEvent *e)
|
|
238
|
void MainWindow::changeEvent(QEvent *e)
|
|
227
|
{
|
|
239
|
{
|
|
228
|
QMainWindow::changeEvent(e);
|
|
240
|
QMainWindow::changeEvent(e);
|
|
229
|
switch (e->type()) {
|
|
241
|
switch (e->type()) {
|
|
230
|
case QEvent::LanguageChange:
|
|
242
|
case QEvent::LanguageChange:
|
|
231
|
m_Ui->retranslateUi(this);
|
|
243
|
m_Ui->retranslateUi(this);
|
|
232
|
break;
|
|
244
|
break;
|
|
233
|
default:
|
|
245
|
default:
|
|
234
|
break;
|
|
246
|
break;
|
|
235
|
}
|
|
247
|
}
|
|
236
|
}
|
|
248
|
}
|