##// END OF EJS Templates
Add skelleton of the gui
perrinel -
r56:244ada855935
parent child
Show More
@@ -1,102 +1,112
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 #include <QAction>
24 #include <QAction>
25 #include <QDate>
25 #include <QDate>
26 #include <QDateTime>
26 #include <QDateTime>
27 #include <QDir>
27 #include <QDir>
28 #include <QFileDialog>
28 #include <QFileDialog>
29 //#include <omp.h>
29 //#include <omp.h>
30 //#include <network/filedownloader.h>
30 //#include <network/filedownloader.h>
31 //#include <qlopdatabase.h>
31 //#include <qlopdatabase.h>
32 //#include <qlopsettings.h>
32 //#include <qlopsettings.h>
33 //#include <qlopgui.h>
33 //#include <qlopgui.h>
34 //#include <spacedata.h>
34 //#include <spacedata.h>
35 //#include "qlopcore.h"
35 //#include "qlopcore.h"
36 //#include "qlopcodecmanager.h"
36 //#include "qlopcodecmanager.h"
37 //#include "cdfcodec.h"
37 //#include "cdfcodec.h"
38 //#include "amdatxtcodec.h"
38 //#include "amdatxtcodec.h"
39 //#include <qlopplotmanager.h>
39 //#include <qlopplotmanager.h>
40
40 #include <QAction>
41 #include <QToolBar>
42 #include <memory.h>
41 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::MainWindow)
43 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::MainWindow)
42 {
44 {
43 m_Ui->setupUi(this);
45 m_Ui->setupUi(this);
46
47 QToolBar *actionToolbar = new QToolBar(this);
48 actionToolbar->setOrientation(Qt::Vertical);
49 actionToolbar->addAction("ACTION");
50 actionToolbar->addAction("ACTION 2");
51 actionToolbar->addAction("ACTION 3");
52 m_Ui->leftInspectorSidePane->layout()->addWidget(actionToolbar);
53
44 /* QLopGUI::registerMenuBar(menuBar());
54 /* QLopGUI::registerMenuBar(menuBar());
45 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
55 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
46 this->m_progressWidget = new QWidget();
56 this->m_progressWidget = new QWidget();
47 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
57 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
48 this->m_progressWidget->setLayout(this->m_progressLayout);
58 this->m_progressWidget->setLayout(this->m_progressLayout);
49 this->m_progressWidget->setWindowModality(Qt::WindowModal);
59 this->m_progressWidget->setWindowModality(Qt::WindowModal);
50 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
60 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
51 for(int i=0;i<OMP_THREADS;i++)
61 for(int i=0;i<OMP_THREADS;i++)
52 {
62 {
53 this->m_progress.append(new QProgressBar(this->m_progressWidget));
63 this->m_progress.append(new QProgressBar(this->m_progressWidget));
54 this->m_progress.last()->setMinimum(0);
64 this->m_progress.last()->setMinimum(0);
55 this->m_progress.last()->setMaximum(100);
65 this->m_progress.last()->setMaximum(100);
56 this->m_progressLayout->addWidget(this->m_progress.last());
66 this->m_progressLayout->addWidget(this->m_progress.last());
57 this->m_progressWidget->hide();
67 this->m_progressWidget->hide();
58 this->m_progressThreadIds[i] = -1;
68 this->m_progressThreadIds[i] = -1;
59 }
69 }
60 this->m_progressWidget->setWindowTitle("Loading File");
70 this->m_progressWidget->setWindowTitle("Loading File");
61 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
71 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
62 << QLopCore::self()
72 << QLopCore::self()
63 << QLopPlotManager::self()
73 << QLopPlotManager::self()
64 << QLopCodecManager::self()
74 << QLopCodecManager::self()
65 << FileDownloader::self()
75 << FileDownloader::self()
66 << QLopDataBase::self()
76 << QLopDataBase::self()
67 << SpaceData::self();
77 << SpaceData::self();
68
78
69 CDFCodec::registerToManager();
79 CDFCodec::registerToManager();
70 AMDATXTCodec::registerToManager();
80 AMDATXTCodec::registerToManager();
71
81
72
82
73 for(int i=0;i<ServicesToLoad.count();i++)
83 for(int i=0;i<ServicesToLoad.count();i++)
74 {
84 {
75 qDebug()<<ServicesToLoad.at(i)->serviceName();
85 qDebug()<<ServicesToLoad.at(i)->serviceName();
76 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
86 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
77 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
87 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
78 if(wdgt)
88 if(wdgt)
79 {
89 {
80 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
90 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
81 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
91 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
82 }
92 }
83 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
93 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
84 }*/
94 }*/
85 }
95 }
86
96
87 MainWindow::~MainWindow()
97 MainWindow::~MainWindow()
88 {
98 {
89 }
99 }
90
100
91
101
92 void MainWindow::changeEvent(QEvent *e)
102 void MainWindow::changeEvent(QEvent *e)
93 {
103 {
94 QMainWindow::changeEvent(e);
104 QMainWindow::changeEvent(e);
95 switch (e->type()) {
105 switch (e->type()) {
96 case QEvent::LanguageChange:
106 case QEvent::LanguageChange:
97 m_Ui->retranslateUi(this);
107 m_Ui->retranslateUi(this);
98 break;
108 break;
99 default:
109 default:
100 break;
110 break;
101 }
111 }
102 }
112 }
@@ -1,56 +1,90
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
2 <ui version="4.0">
3 <class>MainWindow</class>
3 <class>MainWindow</class>
4 <widget class="QMainWindow" name="MainWindow">
4 <widget class="QMainWindow" name="MainWindow">
5 <property name="geometry">
5 <property name="geometry">
6 <rect>
6 <rect>
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>800</width>
9 <width>800</width>
10 <height>600</height>
10 <height>600</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="windowTitle">
13 <property name="windowTitle">
14 <string>QLop</string>
14 <string>QLop</string>
15 </property>
15 </property>
16 <property name="dockNestingEnabled">
16 <property name="dockNestingEnabled">
17 <bool>true</bool>
17 <bool>true</bool>
18 </property>
18 </property>
19 <widget class="QWidget" name="centralWidget">
19 <widget class="QWidget" name="centralWidget">
20 <property name="enabled">
20 <property name="enabled">
21 <bool>true</bool>
21 <bool>true</bool>
22 </property>
22 </property>
23 <property name="sizePolicy">
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
24 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
25 <horstretch>0</horstretch>
25 <horstretch>0</horstretch>
26 <verstretch>0</verstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
27 </sizepolicy>
28 </property>
28 </property>
29 <property name="maximumSize">
29 <property name="maximumSize">
30 <size>
30 <size>
31 <width>16777215</width>
31 <width>16777215</width>
32 <height>16777215</height>
32 <height>16777215</height>
33 </size>
33 </size>
34 </property>
34 </property>
35 <layout class="QHBoxLayout" name="horizontalLayout">
36 <item>
37 <widget class="QWidget" name="leftInspectorWidget" native="true">
38 <layout class="QHBoxLayout" name="horizontalLayout_2">
39 <item>
40 <widget class="QWidget" name="widget" native="true">
41 <layout class="QVBoxLayout" name="verticalLayout">
42 <item>
43 <widget class="QWidget" name="dateSourceWidget" native="true"/>
44 </item>
45 <item>
46 <widget class="QWidget" name="dateTimeWidget" native="true"/>
47 </item>
48 <item>
49 <widget class="QWidget" name="variableInspectorWidget" native="true"/>
50 </item>
51 </layout>
52 </widget>
53 </item>
54 <item>
55 <widget class="QWidget" name="leftInspectorSidePane" native="true">
56 <layout class="QVBoxLayout" name="verticalLayout_2"/>
57 </widget>
58 </item>
59 </layout>
60 </widget>
61 </item>
62 <item>
63 <widget class="QWidget" name="viewWidget" native="true"/>
64 </item>
65 <item>
66 <widget class="QWidget" name="rightInspectorWidget" native="true"/>
67 </item>
68 </layout>
35 </widget>
69 </widget>
36 <widget class="QMenuBar" name="menuBar">
70 <widget class="QMenuBar" name="menuBar">
37 <property name="geometry">
71 <property name="geometry">
38 <rect>
72 <rect>
39 <x>0</x>
73 <x>0</x>
40 <y>0</y>
74 <y>0</y>
41 <width>800</width>
75 <width>800</width>
42 <height>45</height>
76 <height>26</height>
43 </rect>
77 </rect>
44 </property>
78 </property>
45 </widget>
79 </widget>
46 <widget class="QStatusBar" name="statusBar"/>
80 <widget class="QStatusBar" name="statusBar"/>
47 <action name="actionIndex_Viewer">
81 <action name="actionIndex_Viewer">
48 <property name="text">
82 <property name="text">
49 <string>Index Viewer</string>
83 <string>Index Viewer</string>
50 </property>
84 </property>
51 </action>
85 </action>
52 </widget>
86 </widget>
53 <layoutdefault spacing="6" margin="11"/>
87 <layoutdefault spacing="6" margin="11"/>
54 <resources/>
88 <resources/>
55 <connections/>
89 <connections/>
56 </ui>
90 </ui>
General Comments 8
Under Review
author

Auto status change to "Under Review"

Approved
author

Status change > Approved

Under Review
author

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

Changed commits:
  * 1 added
  * 0 removed

Changed files:
  * M core/CMakeLists.txt
Approved
author

Status change > Approved

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