##// END OF EJS Templates
@@ -1,128 +1,128
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SciQLop Software
3 3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 2 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@member.fsf.org
21 21 ----------------------------------------------------------------------------*/
22 22 #include "MainWindow.h"
23 23 #include "ui_MainWindow.h"
24 24
25 25 #include <DataSource/DataSourceController.h>
26 26 #include <DataSource/DataSourceWidget.h>
27 27 #include <SqpApplication.h>
28 28
29 29 #include <QAction>
30 30 #include <QDate>
31 31 #include <QDateTime>
32 32 #include <QDir>
33 33 #include <QFileDialog>
34 34 //#include <omp.h>
35 35 //#include <network/filedownloader.h>
36 36 //#include <qlopdatabase.h>
37 37 //#include <qlopsettings.h>
38 38 //#include <qlopgui.h>
39 39 //#include <spacedata.h>
40 40 //#include "qlopcore.h"
41 41 //#include "qlopcodecmanager.h"
42 42 //#include "cdfcodec.h"
43 43 //#include "amdatxtcodec.h"
44 44 //#include <qlopplotmanager.h>
45 45 #include <QAction>
46 46 #include <QToolBar>
47 47 #include <memory.h>
48 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::MainWindow)
48 MainWindow::MainWindow(QWidget *parent) : QMainWindow{parent}, m_Ui{new Ui::MainWindow}
49 49 {
50 50 m_Ui->setupUi(this);
51 51
52 52 auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
53 53 leftSidePane->addAction("ACTION L1");
54 54 leftSidePane->addAction("ACTION L2");
55 55 leftSidePane->addAction("ACTION L3");
56 56
57 57 auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
58 58 rightSidePane->addAction("ACTION R1");
59 59 rightSidePane->addAction("ACTION R2");
60 60 rightSidePane->addAction("ACTION R3");
61 61
62 62 this->menuBar()->addAction("File");
63 63 auto mainToolBar = this->addToolBar("MainToolBar");
64 64 mainToolBar->addAction("A1");
65 65
66 66 // Widgets / controllers connections
67 67 connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
68 68 m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *)));
69 69
70 70 /* QLopGUI::registerMenuBar(menuBar());
71 71 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
72 72 this->m_progressWidget = new QWidget();
73 73 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
74 74 this->m_progressWidget->setLayout(this->m_progressLayout);
75 75 this->m_progressWidget->setWindowModality(Qt::WindowModal);
76 76 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
77 77 for(int i=0;i<OMP_THREADS;i++)
78 78 {
79 79 this->m_progress.append(new QProgressBar(this->m_progressWidget));
80 80 this->m_progress.last()->setMinimum(0);
81 81 this->m_progress.last()->setMaximum(100);
82 82 this->m_progressLayout->addWidget(this->m_progress.last());
83 83 this->m_progressWidget->hide();
84 84 this->m_progressThreadIds[i] = -1;
85 85 }
86 86 this->m_progressWidget->setWindowTitle("Loading File");
87 87 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
88 88 << QLopCore::self()
89 89 << QLopPlotManager::self()
90 90 << QLopCodecManager::self()
91 91 << FileDownloader::self()
92 92 << QLopDataBase::self()
93 93 << SpaceData::self();
94 94
95 95 CDFCodec::registerToManager();
96 96 AMDATXTCodec::registerToManager();
97 97
98 98
99 99 for(int i=0;i<ServicesToLoad.count();i++)
100 100 {
101 101 qDebug()<<ServicesToLoad.at(i)->serviceName();
102 102 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
103 103 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
104 104 if(wdgt)
105 105 {
106 106 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
107 107 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
108 108 }
109 109 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
110 110 }*/
111 111 }
112 112
113 113 MainWindow::~MainWindow()
114 114 {
115 115 }
116 116
117 117
118 118 void MainWindow::changeEvent(QEvent *e)
119 119 {
120 120 QMainWindow::changeEvent(e);
121 121 switch (e->type()) {
122 122 case QEvent::LanguageChange:
123 123 m_Ui->retranslateUi(this);
124 124 break;
125 125 default:
126 126 break;
127 127 }
128 128 }
@@ -1,47 +1,47
1 1 #include "sidepane/SqpSidePane.h"
2 2 #include "ui_SqpSidePane.h"
3 3
4 4 #include <QAction>
5 5 #include <QLayout>
6 6 #include <QToolBar>
7 7
8 8 namespace {
9 9 static const QString SQPSIDEPANESTYLESHEET
10 10 = "QToolBar {"
11 11 " background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,"
12 12 " stop: 0.0 #5a5a5a,"
13 13 " stop: 1.0 #414141);"
14 14 " border: none;"
15 15 " border-left: 1px solid #424242;"
16 16 "border-right: 1px solid #393939;"
17 17 " }"
18 18
19 19 " QToolButton {"
20 20 "background: none;"
21 21 "border: none;"
22 22 " }";
23 23 }
24 24
25 SqpSidePane::SqpSidePane(QWidget *parent) : QWidget(parent), ui(new Ui::SqpSidePane)
25 SqpSidePane::SqpSidePane(QWidget *parent) : QWidget{parent}, ui{new Ui::SqpSidePane}
26 26 {
27 27 QVBoxLayout *sidePaneLayout = new QVBoxLayout(this);
28 28 sidePaneLayout->setContentsMargins(0, 0, 0, 0);
29 29 this->setLayout(sidePaneLayout);
30 30
31 31 ui->setupUi(this);
32 32 m_SidePaneToolbar = new QToolBar(this);
33 33 m_SidePaneToolbar->setOrientation(Qt::Vertical);
34 34 sidePaneLayout->addWidget(m_SidePaneToolbar);
35 35
36 36 m_SidePaneToolbar->setStyleSheet(SQPSIDEPANESTYLESHEET);
37 37 }
38 38
39 39 SqpSidePane::~SqpSidePane()
40 40 {
41 41 delete ui;
42 42 }
43 43
44 44 QToolBar *SqpSidePane::sidePane()
45 45 {
46 46 return m_SidePaneToolbar;
47 47 }
@@ -1,13 +1,13
1 1 #include "visualization/VisualizationTabWidget.h"
2 2 #include "ui_VisualizationTabWidget.h"
3 3
4 4 VisualizationTabWidget::VisualizationTabWidget(QWidget *parent)
5 : QWidget(parent), ui(new Ui::VisualizationTabWidget)
5 : QWidget{parent}, ui{new Ui::VisualizationTabWidget}
6 6 {
7 7 ui->setupUi(this);
8 8 }
9 9
10 10 VisualizationTabWidget::~VisualizationTabWidget()
11 11 {
12 12 delete ui;
13 13 }
@@ -1,43 +1,43
1 1 #include "visualization/VisualizationWidget.h"
2 2 #include "ui_VisualizationWidget.h"
3 3 #include "visualization/VisualizationTabWidget.h"
4 4
5 5 #include <QDebug>
6 6 #include <QToolButton>
7 7
8 8 #include "iostream"
9 9
10 10 Q_LOGGING_CATEGORY(LOG_VisualizationWidget, "VisualizationWidget")
11 11
12 12 VisualizationWidget::VisualizationWidget(QWidget *parent)
13 : QWidget(parent), ui(new Ui::VisualizationWidget)
13 : QWidget{parent}, ui{new Ui::VisualizationWidget}
14 14 {
15 15 ui->setupUi(this);
16 16
17 auto *addTabViewButton = new QToolButton(ui->tabWidget);
18 addTabViewButton->setText("Add View");
17 auto addTabViewButton = new QToolButton{ui->tabWidget};
18 addTabViewButton->setText(tr("Add View"));
19 19 addTabViewButton->setCursor(Qt::ArrowCursor);
20 20 addTabViewButton->setAutoRaise(true);
21 21 ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner);
22 22
23 23 auto addTabView = [&](bool checked) {
24 24 auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget),
25 25 QString("View %1").arg(ui->tabWidget->count() + 1));
26 26 qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index);
27 27 };
28 28
29 29 auto removeTabView = [&](int index) {
30 30 ui->tabWidget->removeTab(index);
31 31 qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
32 32 };
33 33
34 34 ui->tabWidget->setTabsClosable(true);
35 35
36 36 connect(addTabViewButton, &QToolButton::clicked, addTabView);
37 37 connect(ui->tabWidget, &QTabWidget::tabCloseRequested, removeTabView);
38 38 }
39 39
40 40 VisualizationWidget::~VisualizationWidget()
41 41 {
42 42 delete ui;
43 43 }
@@ -1,13 +1,13
1 1 #include "visualization/VisualizationZoneWidget.h"
2 2 #include "ui_VisualizationZoneWidget.h"
3 3
4 4 VisualizationZoneWidget::VisualizationZoneWidget(QWidget *parent)
5 : QWidget(parent), ui(new Ui::VisualizationZoneWidget)
5 : QWidget{parent}, ui{new Ui::VisualizationZoneWidget}
6 6 {
7 7 ui->setupUi(this);
8 8 }
9 9
10 10 VisualizationZoneWidget::~VisualizationZoneWidget()
11 11 {
12 12 delete ui;
13 13 }
General Comments 3
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 6 added
  * 3 removed

Changed files:
  * A gui/src/Visualization/VisualizationWidget.cpp
  * A gui/include/SidePane/SqpSidePane.h
  * A gui/include/Visualization/VisualizationGraphWidget.h
  * A gui/include/Visualization/VisualizationTabWidget.h
  * A gui/include/Visualization/VisualizationWidget.h
  * A gui/include/Visualization/VisualizationZoneWidget.h
  * A gui/include/Visualization/qcustomplot.h
  * A gui/src/SidePane/SqpSidePane.cpp
  * A gui/src/Visualization/VisualizationGraphWidget.cpp
  * A gui/src/Visualization/VisualizationTabWidget.cpp
  * A gui/src/Visualization/VisualizationZoneWidget.cpp
  * A gui/src/Visualization/qcustomplot.cpp
  * M gui/include/DataSource/DataSourceWidget.h
  * M gui/src/DataSource/DataSourceTreeWidgetItem.cpp
  * M gui/src/DataSource/DataSourceWidget.cpp
  * M app/src/Main.cpp
  * M app/src/MainWindow.cpp
  * M app/ui/MainWindow.ui
  * M core/include/DataSource/DataSourceController.h
  * M core/src/DataSource/DataSourceController.cpp
  * M core/tests/DataSource/TestDataSourceController.cpp
  * M gui/ui/visualization/VisualizationWidget.ui
  * M gui/vera-exclusions/exclusions.txt
  * M gui/src/visualization/VisualizationWidget.cpp
  * R cmake/sciqlop_package_qt.cmake
  * R core/include/Plugin/PluginManager.h
  * R core/include/Visualization/VisualizationController.h
  * R core/src/Plugin/PluginManager.cpp
  * R core/src/Visualization/VisualizationController.cpp
  * R gui/include/sidepane/SqpSidePane.h
  * R gui/include/visualization/VisualizationGraphWidget.h
  * R gui/include/visualization/VisualizationTabWidget.h
  * R gui/include/visualization/VisualizationWidget.h
  * R gui/include/visualization/VisualizationZoneWidget.h
  * R gui/include/visualization/qcustomplot.h
  * R gui/src/sidepane/SqpSidePane.cpp
  * R gui/src/visualization/VisualizationGraphWidget.cpp
  * R gui/src/visualization/VisualizationTabWidget.cpp
  * R gui/src/visualization/VisualizationZoneWidget.cpp
  * R gui/src/visualization/qcustomplot.cpp
  * R gui/ui/sidepane/SqpSidePane.ui
  * R gui/ui/visualization/VisualizationGraphWidget.ui
  * R gui/ui/visualization/VisualizationTabWidget.ui
  * R gui/ui/visualization/VisualizationZoneWidget.ui
  * R plugin/CMakeLists.txt
  * R plugin/cmake/Findsciqlop-plugin.cmake
  * R plugin/include/Plugin/IPlugin.h
  * R app/CMakeLists.txt
  * R app/include/MainWindow.h
  * R app/vera-exclusions/exclusions.txt
  * R cmake/sciqlop_applications.cmake
  * R core/CMakeLists.txt
  * R core/include/Common/spimpl.h
  * R gui/CMakeLists.txt
  * R gui/include/SqpApplication.h
  * R gui/src/SqpApplication.cpp
  * R app/src/mainwindow.ui
Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now