/*------------------------------------------------------------------------------ -- 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 "qcustomplot.h" #include #include #include #include #include #include #include #include const QListServicesToLoad=QList() <OMP_THREADS = OMP_THREADS; ui->setupUi(this); this->setWindowIcon(QIcon(":img/QLop.svg")); // QLopPlots::getPlot()->setXaxisTickLabelType(QCPAxis::ltDateTime); // QLopPlots::getPlot()->setXaxisDateTimeFormat("hh:mm:ss.zzz"); this->progressWidget = new QWidget(); this->progressLayout = new QVBoxLayout(this->progressWidget); this->progressWidget->setLayout(this->progressLayout); this->progressWidget->setWindowModality(Qt::WindowModal); progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int)); for(int i=0;iprogress.append(new QProgressBar(this->progressWidget)); this->progress.last()->setMinimum(0); this->progress.last()->setMaximum(100); this->progressLayout->addWidget(this->progress.last()); this->progressWidget->hide(); this->progressThreadIds[i] = -1; } this->progressWidget->setWindowTitle("Loading File"); for(int i=0;iserviceName(); QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI(); 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; } //QString MainWindow::getFilePath(const QString &name) //{ //// for(int i=0;ifolderViews.count();i++) //// { //// if(folderViews.at(i)->isDraging(name)) //// return folderViews.at(i)->currentFolder(); //// } // return ""; //} void MainWindow::updateProgress(int threadId, int percentProgress) { bool updated=false; for(int i=0;iprogress.count()) { this->progress.at(i)->setValue(percentProgress); updated=true; } } } if(Q_UNLIKELY(updated==false)) { for(int i=0;ifolderViews.count();i++) // { // this->folderViews.at(i)->refreshFolder(); // } } void MainWindow::showThemisIndexViewer() { } void MainWindow::changeEvent(QEvent *e) { QMainWindow::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: ui->retranslateUi(this); break; default: break; } }