Skip to content
Snippets Groups Projects
Commit 46f63268 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

done with dependence on MainWindow class

parent 631402ee
No related branches found
No related tags found
1 merge request!427Reduce include dependences in GUI; break cyclic dependence between View and Model
......@@ -18,7 +18,6 @@
#include "GUI/Model/Instrument/InstrumentModel.h"
#include "GUI/Model/Instrument/LinkInstrumentManager.h"
#include "GUI/Model/Project/ProjectDocument.h"
#include "GUI/View/Main/MainWindow.h"
#include <QComboBox>
#include <QLabel>
#include <QVBoxLayout>
......
......@@ -25,7 +25,6 @@
#include "GUI/View/Import/ImportDataUtils.h"
#include "GUI/View/Import/RealDataPropertiesWidget.h"
#include "GUI/View/Import/RealDataTreeModel.h"
#include "GUI/View/Main/MainWindow.h"
#include "GUI/View/Main/ProjectManager.h"
#include "GUI/View/Tool/MessageBox.h"
#include <QFileDialog>
......
......@@ -19,7 +19,6 @@
#include "GUI/Model/State/SessionData.h"
#include "GUI/View/Instrument/InstrumentLibraryEditor.h"
#include "GUI/View/Instrument/InstrumentListModel.h"
#include "GUI/View/Main/MainWindow.h"
#include <QAction>
#include <QListView>
#include <QMessageBox>
......@@ -210,7 +209,7 @@ void InstrumentListView::onStoreInLibrary()
QModelIndex idx = m_listView->selectionModel()->selectedIndexes().front();
InstrumentItem* instrument = m_model->instrumentForIndex(idx);
InstrumentLibraryEditor dlg(baWin);
InstrumentLibraryEditor dlg(parentWidget());
dlg.setGisasEnabled(m_document->functionalities().testFlag(ProjectDocument::Gisas));
dlg.setOffSpecEnabled(m_document->functionalities().testFlag(ProjectDocument::OffSpecular));
dlg.setSpecularEnabled(m_document->functionalities().testFlag(ProjectDocument::Specular));
......@@ -221,12 +220,12 @@ void InstrumentListView::onStoreInLibrary()
void InstrumentListView::onLoadFromLibrary()
{
if (gSessionData->instrumentLibrary.isEmpty()) {
QMessageBox::information(baWin, "Select from library",
QMessageBox::information(parentWidget(), "Select from library",
"The library does not contain instruments so far.");
return;
}
InstrumentLibraryEditor dlg(baWin);
InstrumentLibraryEditor dlg(parentWidget());
dlg.setGisasEnabled(m_document->functionalities().testFlag(ProjectDocument::Gisas));
dlg.setOffSpecEnabled(m_document->functionalities().testFlag(ProjectDocument::OffSpecular));
dlg.setSpecularEnabled(m_document->functionalities().testFlag(ProjectDocument::Specular));
......
......@@ -19,7 +19,6 @@
#include "GUI/View/Intensity/ColorMap.h"
#include "GUI/View/Intensity/ColorMapCanvas.h"
#include "GUI/View/Intensity/SavePlotAssistant.h"
#include "GUI/View/Main/MainWindow.h"
#include "GUI/View/Main/ProjectManager.h"
#include "GUI/View/Tool/MessageBox.h"
#include <QAction>
......@@ -119,7 +118,8 @@ void IntensityDataCanvas::rotateData()
const QString title("Rotate data");
const QString message("Rotation will break the link between the data and the instrument. "
"Detector masks or projections, if they exist, will be removed.");
if (!GUI::View::Helpers::question(baWin, title, message, "Do you wish to rotate the data?",
if (!GUI::View::Helpers::question(parentWidget(),
title, message, "Do you wish to rotate the data?",
"Yes, please rotate", "No, cancel data rotation"))
return;
}
......
......@@ -20,7 +20,6 @@
#include "GUI/Model/IO/DataLoaders1D.h"
#include "GUI/Model/Instrument/InstrumentItems.h"
#include "GUI/View/Loaders/DataLoaderUtil.h"
#include "GUI/View/Main/MainWindow.h"
#include "ui_SpecularDataImportWidget.h"
#include <QAction>
#include <QBoxLayout>
......@@ -199,7 +198,7 @@ void SpecularDataImportWidget::onFormatSelectionChanged()
QSignalBlocker b(m_ui->formatSelectionComboBox);
m_ui->formatSelectionComboBox->setCurrentText(m_loader->name());
QMessageBox::information(MainWindow::instance(), "Information",
QMessageBox::information(parentWidget(), "Information",
"Changing the loader is not possible because the original file "
"contents are not available any more.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment