Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
87a0f42e
Commit
87a0f42e
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
pointerize member, fwd decl
parent
1b30d69d
No related branches found
No related tags found
1 merge request
!2263
make full use of gDoc being global
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Instrument/InstrumentListing.cpp
+8
-6
8 additions, 6 deletions
GUI/View/Instrument/InstrumentListing.cpp
GUI/View/Instrument/InstrumentListing.h
+2
-2
2 additions, 2 deletions
GUI/View/Instrument/InstrumentListing.h
with
10 additions
and
8 deletions
GUI/View/Instrument/InstrumentListing.cpp
+
8
−
6
View file @
87a0f42e
...
...
@@ -13,6 +13,7 @@
// ************************************************************************************************
#include
"GUI/View/Instrument/InstrumentListing.h"
#include
"GUI/Model/Device/InstrumentLibrary.h"
#include
"GUI/Model/Project/ProjectDocument.h"
#include
"GUI/View/Instrument/InstrumentLibraryEditor.h"
#include
"GUI/View/Instrument/InstrumentListModel.h"
...
...
@@ -22,11 +23,12 @@
#include
<QVBoxLayout>
InstrumentListing
::
InstrumentListing
()
:
m_model
(
new
InstrumentListModel
(
this
,
gDoc
->
multiNotifier
()))
:
m_instrumentLibrary
(
std
::
make_unique
<
InstrumentLibrary
>
())
,
m_model
(
new
InstrumentListModel
(
this
,
gDoc
->
multiNotifier
()))
,
m_separatorAction1
(
new
QAction
(
this
))
,
m_separatorAction2
(
new
QAction
(
this
))
{
m_instrumentLibrary
.
load
();
m_instrumentLibrary
->
load
();
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Expanding
);
setViewMode
(
QListView
::
IconMode
);
...
...
@@ -104,7 +106,7 @@ InstrumentListing::InstrumentListing()
InstrumentListing
::~
InstrumentListing
()
{
m_instrumentLibrary
.
saveIfModified
();
m_instrumentLibrary
->
saveIfModified
();
}
QSize
InstrumentListing
::
sizeHint
()
const
...
...
@@ -199,19 +201,19 @@ void InstrumentListing::onStoreInLibrary()
QModelIndex
idx
=
selectionModel
()
->
selectedIndexes
().
front
();
InstrumentItem
*
instrument
=
m_model
->
instrumentItemForIndex
(
idx
);
InstrumentLibraryEditor
dlg
(
GUI
::
Global
::
mainWindow
,
&
m_instrumentLibrary
);
InstrumentLibraryEditor
dlg
(
GUI
::
Global
::
mainWindow
,
m_instrumentLibrary
.
get
()
);
dlg
.
execAdd
(
*
instrument
);
}
void
InstrumentListing
::
onLoadFromLibrary
()
{
if
(
m_instrumentLibrary
.
isEmpty
())
{
if
(
m_instrumentLibrary
->
isEmpty
())
{
QMessageBox
::
information
(
GUI
::
Global
::
mainWindow
,
"Select from library"
,
"The library does not contain instruments so far."
);
return
;
}
InstrumentLibraryEditor
dlg
(
GUI
::
Global
::
mainWindow
,
&
m_instrumentLibrary
);
InstrumentLibraryEditor
dlg
(
GUI
::
Global
::
mainWindow
,
m_instrumentLibrary
.
get
()
);
auto
*
instrumentToCopy
=
dlg
.
execChoose
();
if
(
instrumentToCopy
==
nullptr
)
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Instrument/InstrumentListing.h
+
2
−
2
View file @
87a0f42e
...
...
@@ -15,10 +15,10 @@
#ifndef BORNAGAIN_GUI_VIEW_INSTRUMENT_INSTRUMENTLISTING_H
#define BORNAGAIN_GUI_VIEW_INSTRUMENT_INSTRUMENTLISTING_H
#include
"GUI/Model/Device/InstrumentLibrary.h"
#include
<QListView>
class
InstrumentItem
;
class
InstrumentLibrary
;
class
InstrumentListModel
;
//! Instrument selector on the left side of InstrumentView.
...
...
@@ -58,7 +58,7 @@ private:
void
restoreSelection
();
private:
InstrumentLibrary
m_instrumentLibrary
;
std
::
unique_ptr
<
InstrumentLibrary
>
m_instrumentLibrary
;
InstrumentListModel
*
m_model
;
QAction
*
m_newGisasAction
;
QAction
*
m_newOffspecAction
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment