Skip to content
Snippets Groups Projects
Commit 23f83cde authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

ID: change case

parent 25091c7c
No related branches found
No related tags found
1 merge request!1342GUI: move shared enums to 'GUI/Support/Data/ID.h'
Pipeline #89090 passed
...@@ -56,7 +56,7 @@ ProjectDocument::ProjectDocument() ...@@ -56,7 +56,7 @@ ProjectDocument::ProjectDocument()
, m_singleSampleMode(false) , m_singleSampleMode(false)
, m_functionalities(All) , m_functionalities(All)
, m_instrumentEditController(&m_instrumentModel) , m_instrumentEditController(&m_instrumentModel)
, m_lastViewActive(GUI::ID::ViewId::INSTRUMENT) , m_lastViewActive(GUI::ID::ViewId::Instrument)
{ {
connect(&m_instrumentEditController, &InstrumentsEditController::instrumentAddedOrRemoved, this, connect(&m_instrumentEditController, &InstrumentsEditController::instrumentAddedOrRemoved, this,
&ProjectDocument::onModelChanged, Qt::UniqueConnection); &ProjectDocument::onModelChanged, Qt::UniqueConnection);
......
...@@ -24,7 +24,7 @@ enum ProjectionType { Horizontal, Vertical, Invalid }; ...@@ -24,7 +24,7 @@ enum ProjectionType { Horizontal, Vertical, Invalid };
enum class Distributions { All, Symmetric }; enum class Distributions { All, Symmetric };
//! Enumerates views of the main window //! Enumerates views of the main window
enum ViewId { PROJECTS, INSTRUMENT, SAMPLE, IMPORT, SIMULATION, JOB }; enum ViewId { Projects, Instrument, Sample, Import, Simulation, Job };
} // namespace GUI::ID } // namespace GUI::ID
......
...@@ -65,7 +65,7 @@ void JobView::onFocusRequest(JobItem* jobItem) ...@@ -65,7 +65,7 @@ void JobView::onFocusRequest(JobItem* jobItem)
setActivityAndPresentationForNewJob(jobItem); setActivityAndPresentationForNewJob(jobItem);
} }
emit focusRequest(GUI::ID::JOB); emit focusRequest(GUI::ID::Job);
} }
//! Sets docks visibility in accordance with required activity. //! Sets docks visibility in accordance with required activity.
......
...@@ -94,8 +94,8 @@ MainWindow::MainWindow() ...@@ -94,8 +94,8 @@ MainWindow::MainWindow()
connect(m_projectManager, &ProjectManager::aboutToCloseDocument, this, connect(m_projectManager, &ProjectManager::aboutToCloseDocument, this,
&MainWindow::onAboutToCloseDocument); &MainWindow::onAboutToCloseDocument);
ASSERT(m_viewSelectionButtons->button(GUI::ID::ViewId::PROJECTS) != nullptr); ASSERT(m_viewSelectionButtons->button(GUI::ID::ViewId::Projects) != nullptr);
m_viewSelectionButtons->button(GUI::ID::ViewId::PROJECTS)->setChecked(true); m_viewSelectionButtons->button(GUI::ID::ViewId::Projects)->setChecked(true);
updateTitle(); updateTitle();
if (appSettings) if (appSettings)
...@@ -128,7 +128,7 @@ void MainWindow::setCurrentView(int viewId) ...@@ -128,7 +128,7 @@ void MainWindow::setCurrentView(int viewId)
void MainWindow::raiseView(int viewId) void MainWindow::raiseView(int viewId)
{ {
if (gProjectDocument.has_value() && viewId != GUI::ID::ViewId::PROJECTS) if (gProjectDocument.has_value() && viewId != GUI::ID::ViewId::Projects)
gProjectDocument.value()->setViewId(viewId); gProjectDocument.value()->setViewId(viewId);
if (m_viewsStack->currentIndex() != viewId) { if (m_viewsStack->currentIndex() != viewId) {
m_viewsStack->setCurrentIndex(viewId); m_viewsStack->setCurrentIndex(viewId);
...@@ -210,25 +210,25 @@ void MainWindow::initProgressBar() ...@@ -210,25 +210,25 @@ void MainWindow::initProgressBar()
void MainWindow::initButtons() void MainWindow::initButtons()
{ {
addButton(GUI::ID::ViewId::PROJECTS, QIcon(":/images/main_welcomeview.svg"), "Projects", addButton(GUI::ID::ViewId::Projects, QIcon(":/images/main_welcomeview.svg"), "Projects",
"Switch to Projects View"); "Switch to Projects View");
addButton(GUI::ID::ViewId::INSTRUMENT, QIcon(":/images/main_instrumentview.svg"), "Instrument", addButton(GUI::ID::ViewId::Instrument, QIcon(":/images/main_instrumentview.svg"), "Instrument",
"Define the beam and the detector"); "Define the beam and the detector");
addButton(GUI::ID::ViewId::SAMPLE, QIcon(":/images/main_sampleview.svg"), "Sample", addButton(GUI::ID::ViewId::Sample, QIcon(":/images/main_sampleview.svg"), "Sample",
"Build the sample"); "Build the sample");
addButton(GUI::ID::ViewId::IMPORT, QIcon(":/images/main_importview.svg"), "Data", addButton(GUI::ID::ViewId::Import, QIcon(":/images/main_importview.svg"), "Data",
"Import intensity data to fit"); "Import intensity data to fit");
addButton(GUI::ID::ViewId::SIMULATION, QIcon(":/images/main_simulationview.svg"), "Simulation", addButton(GUI::ID::ViewId::Simulation, QIcon(":/images/main_simulationview.svg"), "Simulation",
"Run simulation"); "Run simulation");
addButton(GUI::ID::ViewId::JOB, QIcon(":/images/main_jobview.svg"), "Jobs", addButton(GUI::ID::ViewId::Job, QIcon(":/images/main_jobview.svg"), "Jobs",
"Switch to see job results, tune parameters real time,\nfit the data"); "Switch to see job results, tune parameters real time,\nfit the data");
for (auto* button : m_viewSelectionButtons->buttons()) { for (auto* button : m_viewSelectionButtons->buttons()) {
if (button == m_viewSelectionButtons->button(GUI::ID::ViewId::PROJECTS)) if (button == m_viewSelectionButtons->button(GUI::ID::ViewId::Projects))
continue; continue;
button->setEnabled(false); button->setEnabled(false);
} }
...@@ -237,7 +237,7 @@ void MainWindow::initButtons() ...@@ -237,7 +237,7 @@ void MainWindow::initButtons()
void MainWindow::initViews() void MainWindow::initViews()
{ {
m_projectsView = new ProjectsView(this); m_projectsView = new ProjectsView(this);
resetView(GUI::ID::ViewId::PROJECTS, m_projectsView); resetView(GUI::ID::ViewId::Projects, m_projectsView);
if (gProjectDocument.has_value()) { if (gProjectDocument.has_value()) {
auto* doc = gProjectDocument.value(); auto* doc = gProjectDocument.value();
...@@ -247,15 +247,15 @@ void MainWindow::initViews() ...@@ -247,15 +247,15 @@ void MainWindow::initViews()
m_simulationView = new SimulationView(this, doc); m_simulationView = new SimulationView(this, doc);
m_jobView = new JobView(this, doc); m_jobView = new JobView(this, doc);
resetView(GUI::ID::ViewId::INSTRUMENT, m_instrumentView); resetView(GUI::ID::ViewId::Instrument, m_instrumentView);
resetView(GUI::ID::ViewId::SAMPLE, m_sampleView); resetView(GUI::ID::ViewId::Sample, m_sampleView);
resetView(GUI::ID::ViewId::IMPORT, m_importDataView); resetView(GUI::ID::ViewId::Import, m_importDataView);
resetView(GUI::ID::ViewId::SIMULATION, m_simulationView); resetView(GUI::ID::ViewId::Simulation, m_simulationView);
resetView(GUI::ID::ViewId::JOB, m_jobView); resetView(GUI::ID::ViewId::Job, m_jobView);
connect(m_jobView, &JobView::focusRequest, this, &MainWindow::onFocusRequest); connect(m_jobView, &JobView::focusRequest, this, &MainWindow::onFocusRequest);
...@@ -264,7 +264,7 @@ void MainWindow::initViews() ...@@ -264,7 +264,7 @@ void MainWindow::initViews()
if (gProjectDocument.has_value()) if (gProjectDocument.has_value())
setCurrentView(gProjectDocument.value()->viewId()); setCurrentView(gProjectDocument.value()->viewId());
else else
raiseView(GUI::ID::ViewId::PROJECTS); raiseView(GUI::ID::ViewId::Projects);
} }
} }
...@@ -363,7 +363,7 @@ void MainWindow::onDocumentOpenedOrClosed(bool open) ...@@ -363,7 +363,7 @@ void MainWindow::onDocumentOpenedOrClosed(bool open)
fillerBtn->setEnabled(true); fillerBtn->setEnabled(true);
setCurrentView(gProjectDocument.value()->viewId()); setCurrentView(gProjectDocument.value()->viewId());
} else } else
setCurrentView(GUI::ID::ViewId::INSTRUMENT); setCurrentView(GUI::ID::ViewId::Instrument);
} }
} }
...@@ -374,7 +374,7 @@ void MainWindow::onDocumentModified() ...@@ -374,7 +374,7 @@ void MainWindow::onDocumentModified()
void MainWindow::onAboutToCloseDocument() void MainWindow::onAboutToCloseDocument()
{ {
setCurrentView(GUI::ID::ViewId::PROJECTS); setCurrentView(GUI::ID::ViewId::Projects);
updateViewSelectionButtonsGeometry(); updateViewSelectionButtonsGeometry();
......
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