diff --git a/GUI/View/Import/RealDataPropertiesWidget.cpp b/GUI/View/Import/RealDataPropertiesWidget.cpp index a808662ce9d17fa485213046e25ad4831714f369..5d6d7d6030f9813097bda3d0e7dd6f56d44883ca 100644 --- a/GUI/View/Import/RealDataPropertiesWidget.cpp +++ b/GUI/View/Import/RealDataPropertiesWidget.cpp @@ -18,6 +18,7 @@ #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> @@ -98,7 +99,7 @@ void RealDataPropertiesWidget::onInstrumentComboIndexChanged(int /*index*/) return; if (m_document->linkInstrumentManager()->canLinkDataToInstrument( - m_currentDataItem, newSelectedInstrumentId, this)) { + m_currentDataItem, newSelectedInstrumentId, baWin)) { m_currentDataItem->setInstrumentId(newSelectedInstrumentId); InstrumentItem* newSelectedInstrument = m_document->instrumentModel()->findInstrumentById(newSelectedInstrumentId); diff --git a/GUI/View/Import/SpecularDataImportWidget.cpp b/GUI/View/Import/SpecularDataImportWidget.cpp index 2831db0a0f9d45e03c50837422666d0fb6426825..a1965fc14417d0af7a60235094d50e223b3f5076 100644 --- a/GUI/View/Import/SpecularDataImportWidget.cpp +++ b/GUI/View/Import/SpecularDataImportWidget.cpp @@ -20,6 +20,7 @@ #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> @@ -198,7 +199,7 @@ void SpecularDataImportWidget::onFormatSelectionChanged() QSignalBlocker b(m_ui->formatSelectionComboBox); m_ui->formatSelectionComboBox->setCurrentText(m_loader->name()); - QMessageBox::information(parentWidget(), "Information", + QMessageBox::information(baWin, "Information", "Changing the loader is not possible because the original file " "contents are not available any more."); diff --git a/GUI/View/Instrument/InstrumentListView.cpp b/GUI/View/Instrument/InstrumentListView.cpp index f9fb2b4bd29308da58587889a197c4a3d05c62d2..d7c7f64a084d60de594cd9bb9dc6afc307305760 100644 --- a/GUI/View/Instrument/InstrumentListView.cpp +++ b/GUI/View/Instrument/InstrumentListView.cpp @@ -19,6 +19,7 @@ #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> @@ -209,7 +210,7 @@ void InstrumentListView::onStoreInLibrary() QModelIndex idx = m_listView->selectionModel()->selectedIndexes().front(); InstrumentItem* instrument = m_model->instrumentForIndex(idx); - InstrumentLibraryEditor dlg(parentWidget()); + InstrumentLibraryEditor dlg(baWin); dlg.setGisasEnabled(m_document->functionalities().testFlag(ProjectDocument::Gisas)); dlg.setOffSpecEnabled(m_document->functionalities().testFlag(ProjectDocument::OffSpecular)); dlg.setSpecularEnabled(m_document->functionalities().testFlag(ProjectDocument::Specular)); @@ -220,12 +221,12 @@ void InstrumentListView::onStoreInLibrary() void InstrumentListView::onLoadFromLibrary() { if (gSessionData->instrumentLibrary.isEmpty()) { - QMessageBox::information(parentWidget(), "Select from library", + QMessageBox::information(baWin, "Select from library", "The library does not contain instruments so far."); return; } - InstrumentLibraryEditor dlg(parentWidget()); + InstrumentLibraryEditor dlg(baWin); dlg.setGisasEnabled(m_document->functionalities().testFlag(ProjectDocument::Gisas)); dlg.setOffSpecEnabled(m_document->functionalities().testFlag(ProjectDocument::OffSpecular)); dlg.setSpecularEnabled(m_document->functionalities().testFlag(ProjectDocument::Specular)); diff --git a/GUI/View/Intensity/IntensityDataCanvas.cpp b/GUI/View/Intensity/IntensityDataCanvas.cpp index bcb0feda2baacaafd609c32d2739ae8a8f1f8d7f..ed4db46203ede78b12696cada646c7506786b9b8 100644 --- a/GUI/View/Intensity/IntensityDataCanvas.cpp +++ b/GUI/View/Intensity/IntensityDataCanvas.cpp @@ -17,10 +17,11 @@ #include "GUI/Model/Data/RealDataItem.h" #include "GUI/Model/State/SessionData.h" #include "GUI/Util/ComboProperty.h" +#include "GUI/View/Info/MessageBox.h" #include "GUI/View/Intensity/ColorMap.h" #include "GUI/View/Intensity/ColorMapCanvas.h" #include "GUI/View/Intensity/SavePlotAssistant.h" -#include "GUI/View/Info/MessageBox.h" +#include "GUI/View/Main/MainWindow.h" #include <QAction> #include <QMouseEvent> #include <QSettings> @@ -117,9 +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(parentWidget(), title, message, - "Do you wish to rotate the data?", "Yes, please rotate", - "No, cancel data rotation")) + if (!GUI::View::Helpers::question(baWin, title, message, "Do you wish to rotate the data?", + "Yes, please rotate", "No, cancel data rotation")) return; } diff --git a/GUI/View/PropertyEditor/CustomEditors.cpp b/GUI/View/PropertyEditor/CustomEditors.cpp index 3d22fbdaaaf9f55fb717ef3c880b227a557c6544..b2f800e742ddc875a23d273c5f3104250171b13c 100644 --- a/GUI/View/PropertyEditor/CustomEditors.cpp +++ b/GUI/View/PropertyEditor/CustomEditors.cpp @@ -19,6 +19,7 @@ #include "GUI/Model/State/SessionData.h" #include "GUI/Util/ComboProperty.h" #include "GUI/View/Common/ScientificSpinBox.h" +#include "GUI/View/Main/MainWindow.h" #include "GUI/View/MaterialEditor/MaterialEditorDialog.h" #include "GUI/View/PropertyEditor/CustomEventFilters.h" #include <QApplication> @@ -100,7 +101,7 @@ void MaterialSelectionEditor::buttonClicked() installEventFilter(m_focusFilter); const QString materialIdentifier = m_data.toString(); const QString newMaterialIdentifier = MaterialEditorDialog::chooseMaterial( - parentWidget(), gSessionData->projectDocument, materialIdentifier); + baWin, gSessionData->projectDocument, materialIdentifier); removeEventFilter(m_focusFilter); diff --git a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp index bc0cdd947a6edbe0077f8dc6bd1774090cb01bc0..d650a4c136115826c23b604891bda57f4f67c567 100644 --- a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp +++ b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp @@ -22,12 +22,13 @@ #include "GUI/Model/State/SessionData.h" #include "GUI/Model/Types/DoubleDescriptor.h" #include "GUI/Model/Types/VectorDescriptor.h" -#include "GUI/View/Tool/LayoutUtils.h" #include "GUI/View/Edit/DoubleLineEdit.h" #include "GUI/View/Edit/DoubleSpinBox.h" +#include "GUI/View/Main/MainWindow.h" #include "GUI/View/MaterialEditor/MaterialEditorDialog.h" #include "GUI/View/SampleDesigner/LayerEditorUtils.h" #include "GUI/View/SampleDesigner/SampleEditorController.h" +#include "GUI/View/Tool/LayoutUtils.h" #include <QGridLayout> #include <QLabel> @@ -65,7 +66,7 @@ void MaterialInplaceForm::updateValues() void MaterialInplaceForm::selectMaterial() { const QString newMaterialIdentifier = MaterialEditorDialog::chooseMaterial( - parentWidget(), gSessionData->projectDocument, m_item->materialIdentifier()); + baWin, gSessionData->projectDocument, m_item->materialIdentifier()); if (!newMaterialIdentifier.isEmpty() && newMaterialIdentifier != m_item->materialIdentifier()) { GUI::Util::Layout::clearLayout(m_layout, true); diff --git a/GUI/View/SampleDesigner/SampleToolBar.cpp b/GUI/View/SampleDesigner/SampleToolBar.cpp index 44d531f6fc7a8aa68aceb4552ff94634440936f9..04847356d69306a88d74871f1001eba3f7a5ece2 100644 --- a/GUI/View/SampleDesigner/SampleToolBar.cpp +++ b/GUI/View/SampleDesigner/SampleToolBar.cpp @@ -14,6 +14,7 @@ #include "GUI/View/SampleDesigner/SampleToolBar.h" #include "GUI/Model/State/SessionData.h" +#include "GUI/View/Main/MainWindow.h" #include "GUI/View/MaterialEditor/MaterialEditorDialog.h" #include "GUI/View/SampleDesigner/DesignerView.h" #include "GUI/View/SampleDesigner/SampleView.h" @@ -141,5 +142,5 @@ void SampleToolBar::onScaleComboChanged(const QString& scale_string) void SampleToolBar::onMaterialEditorCall() { - MaterialEditorDialog::editMaterials(parentWidget(), gSessionData->projectDocument); + MaterialEditorDialog::editMaterials(baWin, gSessionData->projectDocument); } diff --git a/GUI/View/Toplevel/SimulationView.cpp b/GUI/View/Toplevel/SimulationView.cpp index 5af06ed2497f8b788cecab5205bedff784585374..8c5ce4f3e3ae6d1a57378277d3ce783fe43eee66 100644 --- a/GUI/View/Toplevel/SimulationView.cpp +++ b/GUI/View/Toplevel/SimulationView.cpp @@ -25,6 +25,7 @@ #include "GUI/Model/Session/ModelUtils.h" #include "GUI/Model/Session/SimulationOptionsItem.h" #include "GUI/Model/State/SessionData.h" +#include "GUI/View/Main/MainWindow.h" #include "GUI/View/Main/ProjectManager.h" #include "GUI/View/Script/PythonScriptWidget.h" #include "GUI/View/Tool/GroupBoxCollapser.h" @@ -164,7 +165,7 @@ void SimulationView::exportPythonScript() "Can't export to Python with current settings\n\n" + msg); return; } - PythonScriptWidget* pythonWidget = new PythonScriptWidget(parentWidget()); + PythonScriptWidget* pythonWidget = new PythonScriptWidget(baWin); pythonWidget->show(); pythonWidget->raise(); pythonWidget->generatePythonScript(selectedSample(), selectedInstrument(), optionsItem(),