Skip to content
Snippets Groups Projects
Commit 0c148dc3 authored by t.knopff's avatar t.knopff
Browse files

Rename ProjectLoadWarningDialog to ProjectLoadProblemDialog

parent 3b541411
No related branches found
No related tags found
1 merge request!371Reorg dirs: rename some files
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
// BornAgain: simulate and fit reflection and scattering // BornAgain: simulate and fit reflection and scattering
// //
//! @file GUI/Views/InfoWidgets/ProjectLoadWarningDialog.cpp //! @file GUI/Views/InfoWidgets/ProjectLoadProblemDialog.cpp
//! @brief Implements class ProjectLoadWarningDialog //! @brief Implements class ProjectLoadProblemDialog
//! //!
//! @homepage http://www.bornagainproject.org //! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING) //! @license GNU General Public License v3 or higher (see COPYING)
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// //
// ************************************************************************************************ // ************************************************************************************************
#include "GUI/Views/InfoWidgets/ProjectLoadWarningDialog.h" #include "GUI/Views/InfoWidgets/ProjectLoadProblemDialog.h"
#include "GUI/Views/CommonWidgets/DesignerHelper.h" #include "GUI/Views/CommonWidgets/DesignerHelper.h"
#include "GUI/utils/Helpers.h" #include "GUI/utils/Helpers.h"
#include <QBoxLayout> #include <QBoxLayout>
...@@ -25,7 +25,7 @@ namespace { ...@@ -25,7 +25,7 @@ namespace {
const int top_panel_height = 80; const int top_panel_height = 80;
} }
ProjectLoadWarningDialog::ProjectLoadWarningDialog(QWidget* parent, const QStringList& details, ProjectLoadProblemDialog::ProjectLoadProblemDialog(QWidget* parent, const QStringList& details,
const QString& documentVersion) const QString& documentVersion)
: QDialog(parent), m_projectDocumentVersion(documentVersion) : QDialog(parent), m_projectDocumentVersion(documentVersion)
{ {
...@@ -86,7 +86,7 @@ ProjectLoadWarningDialog::ProjectLoadWarningDialog(QWidget* parent, const QStrin ...@@ -86,7 +86,7 @@ ProjectLoadWarningDialog::ProjectLoadWarningDialog(QWidget* parent, const QStrin
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
} }
QWidget* ProjectLoadWarningDialog::createWarningWidget() QWidget* ProjectLoadProblemDialog::createWarningWidget()
{ {
auto warningLabel = new QLabel; auto warningLabel = new QLabel;
warningLabel->setPixmap(QPixmap(":/images/warning_64x64.png")); warningLabel->setPixmap(QPixmap(":/images/warning_64x64.png"));
...@@ -101,11 +101,11 @@ QWidget* ProjectLoadWarningDialog::createWarningWidget() ...@@ -101,11 +101,11 @@ QWidget* ProjectLoadWarningDialog::createWarningWidget()
return warningWidget; return warningWidget;
} }
QLayout* ProjectLoadWarningDialog::buttonLayout() QLayout* ProjectLoadProblemDialog::buttonLayout()
{ {
auto button = new QPushButton("Close", this); auto button = new QPushButton("Close", this);
button->setAutoDefault(false); button->setAutoDefault(false);
connect(button, &QPushButton::clicked, this, &ProjectLoadWarningDialog::close); connect(button, &QPushButton::clicked, this, &ProjectLoadProblemDialog::close);
auto result = new QHBoxLayout; auto result = new QHBoxLayout;
result->addStretch(3); result->addStretch(3);
...@@ -116,7 +116,7 @@ QLayout* ProjectLoadWarningDialog::buttonLayout() ...@@ -116,7 +116,7 @@ QLayout* ProjectLoadWarningDialog::buttonLayout()
} }
//! Returns explanations what went wrong. //! Returns explanations what went wrong.
QString ProjectLoadWarningDialog::explanationText() const QString ProjectLoadProblemDialog::explanationText() const
{ {
if (m_projectDocumentVersion != GUI::Helpers::getBornAgainVersionString()) { if (m_projectDocumentVersion != GUI::Helpers::getBornAgainVersionString()) {
return QString( return QString(
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
// BornAgain: simulate and fit reflection and scattering // BornAgain: simulate and fit reflection and scattering
// //
//! @file GUI/Views/InfoWidgets/ProjectLoadWarningDialog.h //! @file GUI/Views/InfoWidgets/ProjectLoadProblemDialog.h
//! @brief Defines class ProjectLoadWarningDialog //! @brief Defines class ProjectLoadProblemDialog
//! //!
//! @homepage http://www.bornagainproject.org //! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING) //! @license GNU General Public License v3 or higher (see COPYING)
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
// //
// ************************************************************************************************ // ************************************************************************************************
#ifndef BORNAGAIN_GUI_VIEWS_INFOWIDGETS_PROJECTLOADWARNINGDIALOG_H #ifndef BORNAGAIN_GUI_VIEWS_INFOWIDGETS_PROJECTLOADPROBLEMDIALOG_H
#define BORNAGAIN_GUI_VIEWS_INFOWIDGETS_PROJECTLOADWARNINGDIALOG_H #define BORNAGAIN_GUI_VIEWS_INFOWIDGETS_PROJECTLOADPROBLEMDIALOG_H
#include <QDialog> #include <QDialog>
#include <QString> #include <QString>
//! @class ProjectLoadWarningDialog //! @class ProjectLoadProblemDialog
//! @brief The dialog to inform user about encountered problems during the loading of old project //! @brief The dialog to inform user about encountered problems during the loading of old project
class ProjectLoadWarningDialog : public QDialog { class ProjectLoadProblemDialog : public QDialog {
public: public:
ProjectLoadWarningDialog(QWidget* parent, const QStringList& details, ProjectLoadProblemDialog(QWidget* parent, const QStringList& details,
const QString& documentVersion); const QString& documentVersion);
private: private:
...@@ -34,4 +34,4 @@ private: ...@@ -34,4 +34,4 @@ private:
QString m_projectDocumentVersion; QString m_projectDocumentVersion;
}; };
#endif // BORNAGAIN_GUI_VIEWS_INFOWIDGETS_PROJECTLOADWARNINGDIALOG_H #endif // BORNAGAIN_GUI_VIEWS_INFOWIDGETS_PROJECTLOADPROBLEMDIALOG_H
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "GUI/Models/ApplicationModels.h" #include "GUI/Models/ApplicationModels.h"
#include "GUI/Models/Error.h" #include "GUI/Models/Error.h"
#include "GUI/Views/CommonWidgets/GUIHelpers.h" #include "GUI/Views/CommonWidgets/GUIHelpers.h"
#include "GUI/Views/InfoWidgets/ProjectLoadWarningDialog.h" #include "GUI/Views/InfoWidgets/ProjectLoadProblemDialog.h"
#include "GUI/Views/Tools/mainwindow_constants.h" #include "GUI/Views/Tools/mainwindow_constants.h"
#include "GUI/mainwindow/ProjectUtils.h" #include "GUI/mainwindow/ProjectUtils.h"
#include "GUI/mainwindow/SaveService.h" #include "GUI/mainwindow/SaveService.h"
...@@ -341,7 +341,7 @@ void ProjectManager::openProject(QString fileName) ...@@ -341,7 +341,7 @@ void ProjectManager::openProject(QString fileName)
deleteCurrentProject(); deleteCurrentProject();
createNewProject(); createNewProject();
} else if (readResult == ProjectDocument::ReadResult::warning) { } else if (readResult == ProjectDocument::ReadResult::warning) {
riseProjectLoadWarningDialog(messageService); riseProjectLoadProblemDialog(messageService);
addToRecentProjects(); addToRecentProjects();
} }
if (m_project_document != nullptr) { if (m_project_document != nullptr) {
...@@ -472,14 +472,14 @@ void ProjectManager::riseProjectLoadFailedDialog(const MessageService& messageSe ...@@ -472,14 +472,14 @@ void ProjectManager::riseProjectLoadFailedDialog(const MessageService& messageSe
QMessageBox::warning(m_mainWindow, "Error while opening project file", message); QMessageBox::warning(m_mainWindow, "Error while opening project file", message);
} }
void ProjectManager::riseProjectLoadWarningDialog(const MessageService& messageService) void ProjectManager::riseProjectLoadProblemDialog(const MessageService& messageService)
{ {
ASSERT(m_project_document); ASSERT(m_project_document);
ProjectLoadWarningDialog* warningDialog = new ProjectLoadWarningDialog( ProjectLoadProblemDialog* problemDialog = new ProjectLoadProblemDialog(
m_mainWindow, messageService.warnings(true), m_project_document->documentVersion()); m_mainWindow, messageService.warnings(true), m_project_document->documentVersion());
warningDialog->show(); problemDialog->show();
warningDialog->raise(); problemDialog->raise();
} }
//! Rises dialog if the project should be restored from autosave. Returns true, if yes. //! Rises dialog if the project should be restored from autosave. Returns true, if yes.
......
...@@ -79,7 +79,7 @@ private: ...@@ -79,7 +79,7 @@ private:
QString untitledProjectName(); QString untitledProjectName();
void riseProjectLoadFailedDialog(const MessageService& messageService); void riseProjectLoadFailedDialog(const MessageService& messageService);
void riseProjectLoadWarningDialog(const MessageService& messageService); void riseProjectLoadProblemDialog(const MessageService& messageService);
bool restoreProjectDialog(const QString& projectFileName, const QString autosaveName); bool restoreProjectDialog(const QString& projectFileName, const QString autosaveName);
MainWindow* m_mainWindow; MainWindow* m_mainWindow;
......
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