diff --git a/sqpapp/src/main.cpp b/sqpapp/src/main.cpp new file mode 100644 index 0000000..6f07a2e --- /dev/null +++ b/sqpapp/src/main.cpp @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the QLop Software +-- Copyright (C) 2015, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ +#include "mainwindow.h" +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + QApplication::setOrganizationName("LPP"); + QApplication::setOrganizationDomain("lpp.fr"); + QApplication::setApplicationName("SciQLop"); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/sqpapp/src/mainwindow.cpp b/sqpapp/src/mainwindow.cpp new file mode 100644 index 0000000..123396f --- /dev/null +++ b/sqpapp/src/mainwindow.cpp @@ -0,0 +1,104 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the QLop Software +-- Copyright (C) 2015, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include +#include +#include +#include +#include +#include +//#include +//#include +//#include +//#include +//#include +//#include "qlopcore.h" +//#include "qlopcodecmanager.h" +//#include "cdfcodec.h" +//#include "amdatxtcodec.h" +//#include + + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) +{ + ui->setupUi(this); + /* QLopGUI::registerMenuBar(menuBar()); + this->setWindowIcon(QIcon(":/sciqlopLOGO.svg")); + this->m_progressWidget = new QWidget(); + this->m_progressLayout = new QVBoxLayout(this->m_progressWidget); + this->m_progressWidget->setLayout(this->m_progressLayout); + this->m_progressWidget->setWindowModality(Qt::WindowModal); + m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int)); + for(int i=0;im_progress.append(new QProgressBar(this->m_progressWidget)); + this->m_progress.last()->setMinimum(0); + this->m_progress.last()->setMaximum(100); + this->m_progressLayout->addWidget(this->m_progress.last()); + this->m_progressWidget->hide(); + this->m_progressThreadIds[i] = -1; + } + this->m_progressWidget->setWindowTitle("Loading File"); + const QListServicesToLoad=QList() + << QLopCore::self() + << QLopPlotManager::self() + << QLopCodecManager::self() + << FileDownloader::self() + << QLopDataBase::self() + << SpaceData::self(); + + CDFCodec::registerToManager(); + AMDATXTCodec::registerToManager(); + + + for(int i=0;iserviceName(); + ServicesToLoad.at(i)->initialize(); //must be called before getGUI + QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI(); + if(wdgt) + { + wdgt->setAllowedAreas(Qt::AllDockWidgetAreas); + this->addDockWidget(Qt::TopDockWidgetArea,wdgt); + } + PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i)); + }*/ +} + +MainWindow::~MainWindow() +{ + delete ui; +} + + +void MainWindow::changeEvent(QEvent *e) +{ + QMainWindow::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} diff --git a/sqpapp/src/mainwindow.h b/sqpapp/src/mainwindow.h new file mode 100644 index 0000000..a349a21 --- /dev/null +++ b/sqpapp/src/mainwindow.h @@ -0,0 +1,60 @@ +/*------------------------------------------------------------------------------ +-- This file is a part of the QLop Software +-- Copyright (C) 2015, Plasma Physics Laboratory - CNRS +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-------------------------------------------------------------------------------*/ +/*-- Author : Alexis Jeandet +-- Mail : alexis.jeandet@member.fsf.org +----------------------------------------------------------------------------*/ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +//#include "../Core/qlopservice.h" +//#include "../Core/qlopgui.h" + + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow { + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); +public slots: + +protected: + void changeEvent(QEvent *e); + +private: + Ui::MainWindow *ui; + QList m_progress; + int *m_progressThreadIds; + QWidget *m_progressWidget; + QVBoxLayout *m_progressLayout; + // QList m_qlopServices; +}; + +#endif // MAINWINDOW_H diff --git a/sqpapp/src/mainwindow.ui b/sqpapp/src/mainwindow.ui new file mode 100644 index 0000000..581352a --- /dev/null +++ b/sqpapp/src/mainwindow.ui @@ -0,0 +1,56 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + QLop + + + true + + + + true + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + + + 0 + 0 + 800 + 45 + + + + + + + Index Viewer + + + + + + +